New answers tagged

1

If you want the bold column titles to appear in the first head too, you have to write them there as well, if that is what you meant by 'destroy'. And for setting the captions above tables neatly with some extra space, KOMA offers the option captions=tableheading. Is this the style you are after? \documentclass[ngerman,12pt,listof=entryprefix,listof=totoc,...


1

I propose this, which uses the xltabular environment, which combines the functionalities of longtable and tabularx. Also, depending on the real contents of your table, you might consider having a landscape table. \documentclass[11pt, letterpaper]{article} \usepackage[margin=0.75in]{geometry} \usepackage{caption} \usepackage{longtable} \usepackage{xltabular} \...


1

You had specified the table to be wider than the page, so I reduced the column widths. It would look better with shorter top headings, but you need subject knowledge to pick better headings so I left them as they are. \documentclass{article} \usepackage{longtable,array} \title{A longtable example} \begin{document} \setlength\extrarowheight{2pt} \begin{...


0

Here are two versions using either dcolumn or siunitx: \documentclass[12pt,a4paper,twoside]{article} \usepackage{geometry} \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm } \usepackage{longtable} \usepackage{booktabs} \usepackage{siunitx} \usepackage[flushleft, online]{threeparttablex} \usepackage{dcolumn} \begin{document} \begin{...


0

The issue for the overly wide first column is the use of {\tablename\ \thetable\ -- \textit{Continued from previous page}} \\ which places the whole text inside of the first column. Either use a \multicolumn as in \multicolumn{7}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\ or a \caption command as in \caption{ -- \textit{...


1

As mentioned in the comments, you could use xltabular to combine the features of longtable and tabularx. In the following MWE, I also included a second version of the table with slightly different column widths. With this layout you can wuite significantly reduce the amount of empty and "wasted" white space and also fit the whole table onto a ...


1

As of today this is still an issue and @Zarko 's answer cannot be solved through a pandoc filter because it is a writer issue. The script below is a (crude) solution to fix the table colors that can be integrated into a pipeline: #!/usr/bin/env python """ fix-table-color-bleed.py: take a file as argument or input from stdin, remove @{} from ...


1

The simple solution, you can add \newpage in the row that you want to move in the next page. You can get the last line on previous page move in next page. \documentclass[a4paper,oneside,11pt]{book} \usepackage[hmargin={3cm,2cm},vmargin={2cm,2cm}]{geometry} \usepackage{longtable} \usepackage{multirow} \usepackage{lipsum} \usepackage{titlesec} \usepackage{...


3

Something more like this (which does not use tabularx/xltabular at all) and has far fewer \multicolumn % article class does not have these options %\documentclass[paper=a4,fontsize=18pt]{article} \documentclass{article} \usepackage{geometry} \geometry{ % verbose, portrait, % page orientation (landscape or portrait) a4paper, % ...


0

You have to add a \pagebreak from time to time. \documentclass{article} \usepackage{longtable,lipsum} \begin{document} \begin{longtable}{|l|c|c|c|c|c|} \hline \multicolumn{6}{|p{10cm}|}{1. \lipsum[1-4] } \\ \hline \pagebreak \hline \multicolumn{6}{|p{10cm}|}{5. \lipsum[5-8] } \\ \hline \end{longtable} \end{document} With longtable you ...


0

A small variation of @Bur answer. Main diference are: csv file is reorganized: instead of semicolons are used comas instead of decimal comas are used decimal points. by this changes his solution start to work for me, before that I got errors {\csvcoli & \csvcolii & \csvcoliii & \csvcoliv & \csvcolv & \csvcolvi & \csvcolvii} are ...


2

If you want both a breakable table that span a given, xltabular is a way. \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{csvsimple} \usepackage{booktabs} % nice format of tables \usepackage{xltabular} % mix between longtable and tabularx \usepackage{siunitx} % to format units \begin{filecontents}{23....


1

Like this? With employing of the package caption: \documentclass[oneside,12pt,a4paper]{book} \usepackage{array, longtable} \usepackage{siunitx} % new \usepackage[skip=1ex, % new labelsep=quad, % new ]{caption} % new \usepackage{lipsum} % for dummy text filler \begin{document} \chapter{...


1

Hm, fit to one page? Yeah, if you will reduce font size to almost unreadable size and increase text block. I would rather have normal font, define text block accordingly and have table on two pages. By using longtable, displaystyle in the first column and define text block with geometry package: \documentclass{article} \usepackage[showframe, ...


1

To have any chance at all to fit the table on the page, you've got to allow line breaks in the formulas for F_{12}, F_{13}, and especially F_{13}. In the solution below, this is done with the help of the aligned environment of the amsmath package. I would also replace \frac expressions with inline-style fractional terms, e.g., replace \frac{1}{500} with 1/...


2

Question is not entirely clear, so some suggestion may miss the your problem. I suggest to use: landscape oriented pages for table (since it is quite wide with using normal font size) xltabular table (similar as @leandriis in his answer), for all columns except the first and last use C columns derived from X columns remove all \makcell{...} commands from ...


2

I am still not sure if I understood your question correctly, but I guess the following is at least somewhat close to the output you're looking for: \documentclass{article} \usepackage{graphicx} \usepackage{xltabular} \usepackage{geometry} \usepackage{booktabs} \usepackage{makecell} \renewcommand{\theadfont}{\footnotesize\bfseries} \usepackage{pdflscape} \...


3

Assuming a standard page size and margins no wider than 2.5cm, the table should fit on a page as long as you allow line-breaking in the cells. In the following, this is done by employing a tabularx column. I would also recommend getting rid of all vertical bars (they're not needed; in fact, they're a distraction) and replacing most instances of \midrule with ...


2

I would avoid tabu if possible. Instead you could use a tabularx (or xltabular if you need page breaks in between rows) it looks as if one could avoid your complicate construct of nested tables by adding line breaks. This will also allow automatic line breaks if you have columns of fixed with, e.g. p or X the table already spans the whole available text ...


1

Very similar to @egreg answer (+1). Small differences are: removed are also all multirow cells removed are all \itshape commands. Instead of it their use is modified column specifications: \begin{longtable}{@{} c >{\itshape}l >{\itshape}l l @{}} Considering aforementioned, the MWE, which ...


3

The most likely cause of longtable not breaking across pages is to have it inside a table environment, which is an error. Here's a version of the table that gets rid of all \multicolumn and \multirow instructions. The trick is to create subtables for the species' names. If you prefer vertical centering of the serial number, genus name and accession string, ...


1

\multirow{1}{*}{1} &Row One &Row One One\\ \cline{2-3}


0

Thanks @Bernard for the input. Here is how it would look like. The only thing is that it is not "page-breaking automatically", but it gets the job done! \documentclass{article} \usepackage{tabularx} \usepackage{xltabular} \usepackage{siunitx} \usepackage{textcomp} \usepackage{longtable} \usepackage{array} \usepackage{enumitem} \newcommand\Tstrut{\...


3

You can reduce the height of the header by adding negative vertical space. I added new column types for better control of the width of the columns, if needed. The rules in the booktabs package also vertically expand cells for a cleaner appearance. % !TeX TS-program = pdflatex \documentclass[a4paper,12pt,oneside,openany]{book} \usepackage[a4paper, inner=...


3

\documentclass[a4paper,12pt,oneside,openany]{book} \usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry} \usepackage{setspace,amsmath,times,array,caption,lipsum,longtable} \hyphenpenalty=10000 \sloppy \usepackage[utf8]{inputenc} \usepackage{makecell} \begin{document} { \setcellgapes{4pt}\makegapedcells% \begin{longtable}{p{0.5\...


1

With the help of supertabular you can achieve a page-breaking table that also works inside of a twocolumn page: \documentclass[a4paper,12pt,oneside,openany]{book} \usepackage{supertabular} \usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry} \usepackage{lipsum} % just for dummy text. Do not use in actual document. \begin{document} \...


1

My suggestion would be to not use longtable, as it seems to destroy the marks, even if you get them out of the \parbox. So I would just set each entry separately in a one-row tabular. The headers on each page can be added with \afterpage. Also I would recommend not using horizontal and vertical lines. I think this would give a cleaner layout. But to stay ...


4

Vertical space around your table depends from content of the next page. Why you use longtable? With small changes of table code as table is inserted in center environment, so it not float so the use of the \FloatBarrier superfluous using tabular instead of longtable using captionof{figure}{...} instead \caption{...} employing copyrightbox package for ...


0

Mostly off-topic, but anyway ... I would write your table on the following way: \documentclass[10pt,ngerman,english]{article} \usepackage{geometry} \usepackage{siunitx} \usepackage{booktabs, longtable, multirow, tabularx, threeparttable} \usepackage{caption} \captionsetup[table]{skip=1ex, labelsep=newline, textfont=...


2

The following whould serve as a point to start from. I moved the caption to the beginning of the table. If you want the column headers to repeat on the second and following pages of your table, take a look at the difference od \enfirstthead and \endhead. As already mentioned in the comments, the load order of packages matters, when you want to combine ...


Top 50 recent answers are included