New answers tagged

1

Maybe this is what you want? I used ltablex, which brings the functionalities of longtable to tabularx: \documentclass[12pt]{article} \usepackage{amssymb} \usepackage{amsfonts} \usepackage[capposition=top]{floatrow} \usepackage{amsmath} \usepackage[nohead]{geometry} \usepackage[singlespacing]{setspace} \usepackage[bottom]{footmisc} \usepackage{graphicx} \...


2

You can change the goal height of the tabular before the problematic line. This will force an earlier page break: \documentclass[a4paper,12pt]{book} \usepackage{helvet} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais]{babel} \usepackage{supertabular} \usepackage{lipsum} \begin{document} \newcounter{MyCounter} \lipsum[1] ...


2

This is just a matter of placing the \endhead. This is easily found in the documentation for longtable, under section 3. In this example I have used some looping just to simulate a long table, as you did not include a Minimal Working Example. Also, I've used the booktabs, which gives a much nicer look to tables. Output Image taken for page two, but ...


1

\endhead was the solution, the problem is resolved.


1

This issue is related to this issue, where they link to a bug report. The suggested workaround is to add \usepackage{glossaries-extra}. The complete code is then: \documentclass{scrbook} \usepackage{glossaries} \usepackage{glossaries-extra} \makenoidxglossaries \newglossaryentry{lorem}{name={lorem},description={ipsum}} \newglossaryentry{dolor}{name={dolor}...


2

Actually, ltablex doesn't work exactly like tabularx: the calculated size of the X columns is a maximum width for this column, its actual width depending on its actual content. If you don't want it, us the \keepXColumns directive. However, I would rather load siunitx and use the the S column type, to get a correct alignment of numerical values on the ...


8

Longtable increases the table counter, with the intention that you use \caption within the environment, and then you have used \captionof{table} outside the environment. Either change \end{longtable}\captionof{table}{...} to \caption{...}\end{longtable} or, for special circumstances where you really need no caption in the table, you could use \end{...


2

You have the wrong number of &: you should have written x cm & & x cm & & x cm \\ In other words: you're not always in the column you believe you're in.


5

\begin{longtable}{p{2cm}lp{2cm}lp{2cm}l} means that you have 6 colums, 3 of them with specified width. Hence it is expected that the second column (l as left) has only width needed to enclose your test word.


2

There are missing & characters to use the correct columns here -- 6 columns are defined, but only 3 & are used. Either remove the inner l column specifiers or use additional & characters. The additional l columns aren't necessary, in my point of view -- the table will get too wide and LaTeX complains about overfull boxes. \documentclass{...


3

Here's a quickly hacked-up solution. As noted by @DavidCarlisle, the \widesplit command from this answer is probably a better solution. \documentclass[draft,runnngheads]{book} \usepackage{mptab} \begin{document} \mptab{\the\columnsep}{\textwidth}{ {$a_1$, $a_2$, $a_3$, $b_1$, $b_2$, $c_1$, $c_2$, $c_3$, $d_1$, $d_2$, $i_1$, $i_2$, $e_1$,...


0

This will add the page number to the right of every landscape page in the entire document. \documentclass{book} \usepackage{everypage} \usepackage{longtable} \usepackage{rotating} \usepackage{lscape} \AddEverypageHook{\ifdim\textwidth=\textheight \raisebox{\dimexpr 1in-0.5\paperheight}[0pt][0pt]% {\rlap{\hspace*{\dimexpr \paperwidth-1in-1cm}% place ...


6

You don't need to guess .95\linewidth, you can indent the table by the list's indentation and make it exactly \linewidth wide: \documentclass{article} \usepackage{longtable,array,lipsum} \begin{document} \begin{enumerate} \item first \item \mbox{}\\[-3\baselineskip] {\LTleft=\dimexpr\labelwidth+\labelsep \begin{longtable}{|m{.2\dimexpr\linewidth-4\...


2

Another kludge ;) \documentclass{article} \usepackage{longtable,array,lipsum} \setlength\LTleft{50pt} \begin{document} \begin{enumerate} \vskip2in \item first \vskip.2in \item ~ \vskip-.27in \begin{longtable}[]{|m{.1\linewidth}|m{.85\linewidth}|}\hline a & \lipsum[1] \\\hline & c \\\hline \end{longtable} \item third \end{enumerate} \end{...


4

Here you are. I replace long table with ltablex, which brings the functionalities of longtable to tabularx: \documentclass{article} \usepackage{longtable,array,lipsum} \usepackage{enumitem} \usepackage{ltablex} \renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}} \begin{document} \begin{enumerate} \item first ...


6

this is a kludge. depending on what else is on the page, the alignment of the first line of the table might not be very good. \documentclass{article} \usepackage{longtable,array,lipsum} \begin{document} \begin{enumerate} \item first \item \leavevmode \vspace{-1.75\baselineskip} \begin{longtable}[l]{m{.05\linewidth}|m{.1\linewidth}|m{.8\linewidth}|}% \...


1

You can use the environ package to collect the body and then write it. Be aware that the body is written in one long line. \documentclass[]{article} \usepackage{polyglossia} \usepackage{ltxtable,longtable,colortbl,environ,etoolbox} \newwrite\mytabularwrite \NewEnviron{tbl} {% \immediate\openout\mytabularwrite=\jobname-ltxtable.tex \immediate\write\...


1

I am unable to compile your code, but by I brief look I suspect that changing \newcolumntype{C}[1]{>{\centering}p{#1}} with \newcolumntype{C}[1]{>{\centering}m{#1}} will solve your problems


3

tcolorbox normally issues \pagebreak (among other things) when starting; this is ignored in tabular, but not in longtable. \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{color} \usepackage{listings} \usepackage{tcolorbox} \tcbuselibrary{many,listings} \usepackage{longtable} \definecolor{bg}{RGB}{240,240,240} \begin{document} \begin{...


4

Using \internallinenumbers seems to work. Update: Comment asked to change the spacing inside the new env. To use \internallinenumbers it needs a new env. One can use minipage or parbox and may be others, and it will work. To adjust the margins, here is the updated example using \vspace{5pt} but there are other ways to adjust margins and spacings one can use....



Top 50 recent answers are included