Graphics, Figures & Tableslongtable | Legend on subsequent Pages

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

longtable | Legend on subsequent Pages

Post by marie2011 »

Dear forum members,

I have the following longtable and I need to write the name of the legend in the subsequent pages. How can I do it? In addition, a line above "continuación" should appear as well.

Code: Select all

\documentclass[
12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
%  bibtotocnumbered,% <= obsolete
  bib=totoc,        % <= recommended
toc=listof,
toc=bibliography,
numbers=noenddot
]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{longtable}

\begin{document}
\begin{center}
\begin{longtable}{lp{13cm}}
\caption{Preguntas}
\label{tab:preguntas}\\
\hline
\textbf{Num.} & \textbf{Pregunta} \\
\hline \hline
\endfirsthead

\hline
\textbf{Num.} & \textbf{Pregunta} \\

\hline \hline
\endhead

 \multicolumn{2}{l}{continuación} \hline
\endfoot
\endlastfoot

5.& ¿Qué dudas o temores tenías antes de comenzar?\\

\end{longtable}
\end{center}
\end{document}
Many, many thanks for your help.


Regards,
Marie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

longtable | Legend on subsequent Pages

Post by sommerfee »

marie2011 wrote:I have the following longtable and I need to write the name of the legend in the subsequent pages.
Use \caption in your longtable header, which is marked with \endhead. (If you use \caption[]{...some...text...} this will suppress additional LOT entries.)
In addition, a line above "continuación" should appear as well.
Where is the problem in adding a \hline here?

BTW: I can't compile your sample document without errors:

Code: Select all

! Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \penalty \@M \futurelet \@let@token \LT@@h...
l.34  \multicolumn{2}{l}{continuación} \hline
Post Reply