# Tag Info

## New answers tagged longtable

1

You need p{5cm} the same as in tabular to specify a cell that works like \parbox. 6cm and the default inter-column space made a table wider than the page, so I reduced both. Also don't put longtable in a center environment. If you edit a longtable (including changing c to p) it can take a few runs for all parts of the table to line up, which may account for ...

0

You can put your headline and description inside a separate tabular inside the same row of longtable. You can even make a macro for it like: \newcommand{\benchmark}[2]{% \begin{tabular}{@{}p{\linewidth}@{}} #1 \\ \midrule #2 \end{tabular}% } The full code: \documentclass{article} \usepackage{longtable,booktabs} \usepackage[textheight=3cm]{geometry} ...

3

(I realize your question appears to be about getting equal widths between the columns of a longtable. However, since the intercolumn whitespace is given by 2\tabcolsep, the intercolumn widths are already equal. I therefore interpret your question as being about getting the column widths to be equal.) In the present case, since you're already loading the ...

0

So far I sticked to framed description solution. The labels in description are given from former table heading. Description environment breaks nicely across pages and framed environment generates sensible rules. I also added hrules between items of description as described here. The final solution looks like this:

4

If only one column needs to break that can be on the main vertical list with the other columns treated as parboxes hung to the side: \documentclass {article} \usepackage [utf8] {inputenc} \usepackage [latin] {babel} \usepackage{lipsum} \newenvironment{foo}[3] {\list{}{\leftmargin6cm\rightmargin3cm \itemindent0cm \labelsep0pt \labelwidth0cm}% ...

5

As clarified in comments the problem is unrelated to floating environments. \documentclass{article} \usepackage{longtable} \begin{document} \paragraph{zz} \begin{longtable}{| c | c | c | c |} \hline 1 & 5 & 6 & 7 \\ \hline 1 & 5 & 6 & 7 \\ \hline 1 & 5 & 6 & 7 \\ \hline % and so on, many rows ...

2

For Unicode characters the routine to be used is more complex. This seems to work, at least for the characters you need. Please, don't use utf8x. \documentclass[6pt]{extarticle} %%%%%%%%%%%%%%%%%%%%%% % Package Inclusions % %%%%%%%%%%%%%%%%%%%%%% \usepackage{longtable, tabu} \usepackage{xparse} % used for \ExplSyntaxOn %used to print Spanish characters ...

4

The longtable environment is not capable of breaking a table inside a cell, and I doubt it will ever be. The true problem is that your table is semantically not a table, it is a list of lists. Therefore I would use one of the list environments: \documentclass{article} \begin{document} \begin{description} \item[Case 1.] 1, 286, 484, 507, 790, 920. ...

1

Thanks for posting the code of your longtable environment. It would appear that the main problem is that whereas you intend to have three columns (each allowing text to wrap), you're currently specifying a total of six columns, alternating l and p types. In addition to specifying just three columns (and removing the hard line breaks), I'd like to suggest ...

0

There are p columns, which limit the width and allow line breaks: \documentclass{article} \usepackage{longtable} \usepackage{lipsum} \begin{document} \begin{longtable}{lp{70mm}} First row: & \lipsum[1] \\ Second row: & \lipsum[2] \\ \end{longtable} \end{document}

0

My own solution is very similar to Gjallar's, but adds outside borders to the table, similar to Microsoft Word tables. \documentclass{report} \usepackage{parcolumns} \usepackage{mdframed} \newenvironment{mytable}[1] ...

1

The documentation (338 kb) says (p. 4, beginning of chapter 3) that one shall replace the \\ by \endhead resp. \endfirsthead. % arara: pdflatex \documentclass{scrartcl} \usepackage{longtable} \begin{document} \section{My awesome section} \vspace{175mm} With some really awesome Text ;) \begin{longtable}{|c|c|c|} \caption{The first table header}\\ ...

5

It's a known problem: with \NewDocumentEnvironment{foo}, the macro \endfoo, that's internally used by LaTeX when \end{foo} is processed is “protected” and, because of this, LaTeX can't see that the alignment is to be ended until it has already started a new row. The situation is mostly similar to having \multicolumn not as the first item in a cell. What ...

2

Here is a solution that consists in fixing experimentally the width of the caption. The default for \LTcaptionwidth is 4in, I use captionsetup inside the table, just before \caption. I also suppressed vertical lines, as it is bad typographical practice, and used booktabs. Here is the code: \documentclass[landscape]{article} \usepackage[utf8]{inputenc} ...

3

It's best (in any alignment) not to have columns that are always spanned. \documentclass[10pt]{report} \usepackage{longtable} \usepackage{tabu} \usepackage[letterpaper, top=0.5in, right=0.75in, bottom=0.5in, left=0.75in]{geometry} \begin{document} \begin{longtabu}{ X[4,l] X[2,r] X[1,c] X[2,r] X[1,c] } \textbf{Description} & ...

Top 50 recent answers are included