Tag Info

Hot answers tagged

14

Your example is far from minimal, but anyway seems like \midrule looks ahead and sees ( so you need \midrule\relax Just as you do to protect cells that start with [ from \\ looking ahead.


7

Here is how I would typeset the table: \documentclass[12pt]{article} \usepackage[tableposition = top]{caption} \usepackage{longtable, booktabs} \usepackage{siunitx} \setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in} \setlength{\topmargin}{-.5in} \setlength{\headsep}{0in} \setlength{\textwidth}{6.5in} \setlength{\textheight}{8.5in} ...


5

You can retrieve the column sizes from the aux file where longtable stores them: You will need to delete the .aux initially to avoid picking up bad lengths from earlier attempts. \documentclass[a4paper,10pt]{article} \usepackage{array,tabularx,longtable,tabu} \usepackage{lipsum} \begin{document} \makeatletter \ifx\LT@i\@undefined \def\mcspec#1{} \else ...


5

ll*{3}{>{\RaggedRight\arraybackslash\hspace{0pt}}X} is ll two columns of single line left aligned entries, then *{3}{>{\RaggedRight\arraybackslash\hspace{0pt}}X} three copies of >{\RaggedRight\arraybackslash\hspace{0pt}}X each of these is basically an X column which is p{...} for an automatically calculated width. The tokens in the ...


4

If you fix the with of the columns, then the width of the second column can be calculated, just subtracting the total width of the other columns, taking account the \tabcolsep padding on either side of each cell. \documentclass[10pt]{report} \usepackage{booktabs} \usepackage{longtable} \usepackage{pdflscape} \usepackage{geometry} \geometry{ a4paper, ...


4

you put the t on the wrong place (longtable doesn't take t anyway it takes l c r) You want it on the tabular in the third column so that entry is top aligned with the first two columns. I also added @{} so you do not get double cell padding from the outer and inner table. \documentclass{minimal} \usepackage{longtable} \usepackage{booktabs} ...


3

A bit long for a comment: Your example is much too long and contains too many questions. Regarding the posting you linked to I don't understand why all the \expandafter are used. I would simply use \newcolumntype: \documentclass{article} \usepackage{array} \newcolumntype\specA{l} \newcolumntype\specB{l} \newcolumntype\mytablespec{\specA|\specB} ...


3

You can hide the nasty details in macros. Note that your definitions of \commandatablecolumndesignaa and \ commandatablecolumndesignab are wrong: you can't leave an unfinished { in the body of a definition and that you are forgetting the argument to the M columns. \documentclass[ fontsize=11pt, % Document font size paper=a4, % Document paper type ...


3

The problem is that microtype lets hyphens and dashes protrude in the margins. Let's look at a couple of examples: \documentclass{article} \usepackage{microtype,longtable} \begin{document} \setlength{\tabcolsep}{0pt} % no intercolumn space to show the problem \begin{longtable}{l|p{3cm}} xxx &- abc - abc\\ \end{longtable} \centering % longtable ...


3

You can't break a line inside \left...\right, so write \right.\newline\left., where the dot means "invisible delimiter". By the way, breaking at 3/4 gives a better-looking result. Personal opinion: I prefer operators be tied to the right operand, so instead of having + signs at the end of line, I'd rather like to place them at the beginning, correctly ...


3

Using \\ (double backslash) at the end of each row, and inserting & (column separators) fixes the issue you're encountering. Incidentally, as @egreg has noted in a comment, you shouldn't be using -; at the very least, consider using en-dashes (created by typing --). \documentclass[a4paper,12pt]{report} \usepackage[swedish, italian]{babel} ...


3

The following shows different values of \baselinestretch applying to text and longtables within the same page: \documentclass{article} \usepackage{longtable} \def\a{One two three four five six. } \def\b{\a\a\par Red green blue. \a\a\a\par Yellow black \a\a\a\a} \begin{document} 111! \b \renewcommand\baselinestretch{2.5}\selectfont 222! \b ...


3

9 times out of 10 it's better to set this sort of thing as a list than as a table, which allows a lot more flexibility, and allows page breaking within items, a basic start might be: \documentclass{article} \usepackage{longtable} \renewcommand{\labelitemi}{$\diamond$} \newcommand\foo[3]{\item[{% \parbox[t]{\linewidth}{% \hrule \vspace{2pt}% ...


3

I think it's easier to concatenate externally, either on the commandline or here usimg pdflatex --shell-escape to allow latex to call out to the paste command: I modified the 2nd csv file not to be a copy of the 1st, to check the correct data is being used. \documentclass[]{article} \usepackage{longtable} \usepackage{csvsimple} ...


3

Here is a possibility to do so. This table fits exactly on a page of an 11pt-book. If you need to do a page break, please read the documentation of the longtable package. You can reduce some more white space when having a look on Bernard's comment below. A makecell would reduce the width of the first column. \documentclass[11pt]{book} ...


2

Both \afterpage and longtable act during the phase in which TeX ships out a page, so they are very likely to enter in conflict with each other. Using \afterpage for the purpose of changing footer after the first page is not recommendable. \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyfoot[L]{footer for all pages} ...


2

multipage table packages include at least longtable, supertabular, tabu, xtab, cals. They all have good and bad points. I do not understand your comment that it is not "direct" to output long tables. Most latex functionality is provided in class or package files that have to be referenced from the document. table environment and sectioning commands like ...


2

tabu uses some code derived partly from tabularx that sets the table multiple times to determine the column widths so you need to disable \autocite during the trials. tabu has a hook for that: \documentclass{article} \usepackage[backend=bibtex,style=authoryear-icomp]{biblatex} \usepackage{longtable, tabu} \tabuDisableCommands{\def\autocite{}} ...


2

Not sure what microtype is doing there but you can hide it with a box and a zero space: \documentclass[a4paper,12pt,]{report} \usepackage[swedish, italian]{babel} \usepackage[utf8]{inputenc} \usepackage{pslatex} \usepackage{booktabs} \usepackage{graphicx} \usepackage[round]{natbib} \usepackage{microtype} \usepackage{longtable} \usepackage[top=2cm, ...


2

A variant, using the nccmath package (for its mediumsized fractions) and the ltablex package, that allows for page breaking within tabularx environments. I use an aligned environment for the long math formula, and replace the \left … \right pairs with \Biggl … \Biggr. The makecell package allows to give some vertical spacing around the formula: ...


2

David Carlisle already answered to your first questions. So I will try to help you to resolve in other problems. Your MWE has some errors like \caption is after \begin{tabularx} ..., it hasn't \end{document}. And the most notable, to me it is not clear if you like to have longtabe (spread over more page) or just simple table in float environment. I assume ...


2

You can use the itemize environment, with the wide and nosep options of the enumitem package. I give two variants, to take into account dash protrusion: \documentclass[a4paper,12pt,]{report} \usepackage[italian]{babel}%swedish, \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{booktabs} \usepackage{graphicx} \usepackage[round]{natbib} ...


2

\documentclass{article} %---------------------------------------------------------------% \usepackage{tabularx,multicol,multirow} \usepackage[dvipsnames,table]{xcolor} % \usepackage[labelsep=colon, labelfont={bf,sf}, textfont={sf}]{caption}% added for caption customization ...


2

You do have a macro processor to hand.... \documentclass{article} \usepackage{booktabs} \usepackage{longtable} \begin{document} \newcommand\foo{% \toprule & foo \\ \midrule} \begin{longtable}{ll} \caption{My favourite caption}\label{tbl:table}\\ \foo \endfirsthead \caption{Continued...}\\ \foo \endhead bar ...


2

Alright had a go at it. You mixed up the \caption-command. Below is one way of doing things. Also, you'll observe I just put one longtable-environment there as it demonstrates the problem/solution. I also stripped the code of all the options (actually only the majority, not all) which do not relate to the task at hand. So this is what an MWE is for, hope it ...


2

probably you should be able to use the caption package hooks, but since you are patching \@caption may as well patch the LT version too: \documentclass[a4paper,12pt]{scrreprt} \usepackage[greek, english]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{booktabs} \usepackage{tabularx} \usepackage[labelfont=bf, font=small ]{caption} ...


2

You have a longtable without a caption, but the longtable increases the counter table anyway. This is the reason why a following table or longtable environment with a caption has the wrong number. Use \begin{longtable}{..}%% Which has _no_ caption %% No caption here ... \end{longtable} \addtocounter{table}{-1}%%%%% decrease the counter \begin{table}%% Or ...


1

I'm not sure the multi-page table packages are helping here, you can simply force the column widths and break by hand: \documentclass[11pt]{article} \usepackage[left=0.25in,right=0.25in,top=0.25in,bottom=0.25in]{geometry} \geometry{letterpaper} \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} \usepackage{colortbl} \newenvironment{zz} ...


1

Well after struggling all damn day with this table, and thanks to the kind responses and explanations of David Carlisle and the Zarco trick, I have the table just as I wanted. What I did was the following: \documentclass[11pt]{book} \usepackage[utf8]{inputenc} \usepackage[spanish,mexico]{babel} \usepackage[T1]{fontenc} \usepackage{ragged2e} ...


1

Heiko will probably post something using the proper interfaces but you can force the value of \currentlabelname and test that value and only conditionally make a bookmark: \documentclass{article} \usepackage{caption} \usepackage{hyperref} \usepackage{bookmark} \usepackage{longtable} \captionsetup{singlelinecheck=off} \makeatletter ...



Only top voted, non community-wiki answers of a minimum length are eligible