1

i have longtables which span about 2-4 pages, with captions at the end of the tables. Therefore in the listoftables the numeration is the last page for each longtable, but I'd like it to be the first one.

I was not able to find a solution to this problem. Any ideas?

Thanks!

Here a minimal example. The table has two pages, is placed on page 2 and 3, and the listoftabels shows numbering 3, which i want it to be 2:

\documentclass[fontsize=11pt,paper=a4]{scrreprt}
\usepackage{longtable, ltxtable, booktabs}
\usepackage{filecontents}
\usepackage[ngerman]{babel}

\begin{document}
\listoftables
\newpage
\begin{filecontents}{\jobname-ltxtable.tex}
\begin{longtable}{|p{2cm}|p{2cm}|}
\hline 
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ 
\caption{Title}
\label{tbl_trends_overview}
\end{longtable}
\end{filecontents}
\LTXtable{\textwidth}{\jobname-ltxtable.tex}
\end{document}
2
  • please can you add a minimal example? – touhami Sep 25 '16 at 19:42
  • Sure, sorry i didn't do it right away. Now i added an example. – user2974776 Sep 25 '16 at 20:13
0

Here is a solution. new command \mtcaption{Title} after begin and \caption[]{Title} at the end.

\documentclass[fontsize=11pt,paper=a4]{scrreprt}
\usepackage{longtable, ltxtable, booktabs}
\usepackage{filecontents}
\usepackage[ngerman]{babel}
\newcommand{\mtcaption}[1]{%
\addcontentsline{lot}{table}{\protect\numberline{\thetable}{#1}}}
\begin{document}
\listoftables
\newpage
\begin{filecontents}{\jobname-ltxtable.tex}
\begin{longtable}{|p{2cm}|p{2cm}|}
\noalign{\mtcaption{Title}\label{tbl}}
\hline 
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\
A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ A&B \\ 
\caption[]{Title}
\end{longtable}
\end{filecontents}
\LTXtable{\textwidth}{\jobname-ltxtable.tex}
\end{document}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.