Graphics, Figures & Tables ⇒ problems with the legend of a long table
problems with the legend of a long table
Many thanks for the prompt answer.
I can compile the table now. I have two further questions:
1. Is it possible to have "continuación" not in the middle, but on the right side. This is the way my other tables look like.
2. Is it possible to delete the line above the legend which appears in the table on the next page? Attached you will find a picture so that you can see what I mean.
Many thanks in advance.
Best regards,
Marie
- Attachments
-
- line.png (4.92 KiB) Viewed 5372 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
problems with the legend of a long table
Code: Select all
...
\endfirsthead
\toprule% <= this needs to be removed
\multicolumn{2}{c}
{\parbox{\LTcapwidth}{\tablename\ \thetable{}: Respuestas a la pregunta 10 del
cuestionario final de evaluación: incluir pregunta/ incluir pregunta / incluir
pregunta}} \\
\toprule
\textbf{Participante} & \textbf{Respuesta} \\
\midrule
\endhead
...
As for the continuation remark: change the
\hfil
in my code to \hfill
.Here's the adapted example using your original settings:
Code: Select all
\documentclass{scrbook}
\usepackage{longtable}
\newcommand\exampleentry{%
1 & Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch --
immer noch und mit Leidenschaft. \\}
\begin{document}
\begin{longtable}{lp{.7\linewidth}}
\caption{Respuestas a la pregunta 10 del cuestionario final de
evaluación: incluir pregunta / incluir pregunta / incluir pregunta} \label{tab:longtable} \\
\hline
\textbf{Participante} & \textbf{Respuesta} \\
\hline
\endfirsthead
\multicolumn{2}{c}%
{\parbox{\LTcapwidth}{\tablename\ \thetable{}: Respuestas a la pregunta 10 del cuestionario final de
evaluación: incluir pregunta/ incluir pregunta / incluir pregunta }} \\
\hline
\textbf{Participante} & \textbf{Respuesta} \\
\hline
\endhead
\hline
& \hfill \emph{continuación} \\ \hline
\endfoot
\hline \hline
\endlastfoot
% fill the table with stuff:
\exampleentry
\exampleentry
\exampleentry
\exampleentry
\exampleentry
\exampleentry
\exampleentry
\end{longtable}
\end{document}
problems with the legend of a long table
Many thanks for your prompt answer. Everything works fine now and a new question arose:
Is it possible to expand the legend of "change.png" so that it looks like the legend in "right.png"?
Thanks for your hint (bookmarks). The problem I have is that I have many tables in my work and I would have to make changes in all of them. I have to submit it quite soon, but perhaps I can manage to change things.
Many thanks in advance.
Best regards,
Marie
- Attachments
-
- change.png (21.69 KiB) Viewed 5360 times
-
- right.png (16 KiB) Viewed 5360 times
problems with the legend of a long table
Anyway, you should not just blindly (?) copy and paste my code but only change the parts in your original document that need to be changed. Basically that are the column specifications and the various
\multicolumn
s. Just compare your code with mine to see where the differences are and exchange them. Maybe don't change everything at once but gradually and compile in between so you can see what each code part does.Regards
problems with the legend of a long table
you are right. I just copied your code and did not compare it with mine. I compared it with mine this time and unfortunately I am still having problems. I am adding my current code:
Code: Select all
\documentclass[12pt%
%,draft%
,twoside%
,BCOR10mm%
,bibtotocnumbered,
,toc=listof,
numbers=noenddot
]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{color}
%\usepackage[round]{natbib}
\usepackage{natbib}
\usepackage{etex}
\usepackage{booktabs}
\usepackage{url}
\usepackage{paralist}
\usepackage{mystyle}
\usepackage{acronym}
\usepackage{graphicx}
\usepackage{appendix}
\usepackage{longtable}
\usepackage{color}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{pgfplots}
\usepackage{tabu}
\usepackage{lscape}
\usepackage{textcomp}
\usepackage{pdflscape}
\usepackage{geometry}
\usepackage{soul}
%\usepackage{legend}
\usepackage{tablefootnote}
\usepackage{afterpage}
\usepackage{ltxtable}
\captionsetup[table]{labelsep=quad}
\captionsetup[figure]{labelsep=quad}
%\toc=listof
\addto\captionsspanish{%
%\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listtablename}{Índice de Tablas}
\renewcommand{\figurename}{Figura}
\renewcommand{\tablename}{Tabla}
\renewcommand{\bibname}{Referencias bibliográficas}
\renewcommand{\appendixname}{Apéndices}
\renewcommand{\appendixtocname}{Apéndices}
\renewcommand{\appendixpagename}{Apéndices}}
%\listofgraficos
%\DeclareCaptionType{grafico}[Gr\'afico][\'Indice de Gr\'aficos]
\raggedbottom
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\begin{document}
\begin{longtable}{lp{.7\linewidth}}
\caption{Respuestas a la pregunta 10 del cuestionario final de
evaluación: incluir respuesta a la pregunta 10 / incluir respuesta } \label{tab:respuestas-preg-10-espanoles} \\
\toprule
\textbf{Participante} & \textbf{Respuesta} \\
\midrule
\endfirsthead
\multicolumn{2}{r}
{\parbox{\LTcapwidth}{\tablename\ \thetable{}: Respuestas a la pregunta 10 del cuestionario final de
evaluación: incluir respuesta a la pregunta 10 / incluir respuesta }} \\
\toprule
\textbf{Participante} & \textbf{Respuesta} \\
\midrule
\endhead
\midrule
&\hfill\emph{continuación} \\
\bottomrule
\endfoot
\bottomrule
\endlastfoot
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
\end{longtable}
\end{document}
%%% emacs stuff %%%
%%% Local Variables:
%%% TeX-PDF-mode: t
%%% mode: auto-fill
%%% ispell-local-dictionary: "castellano8"
%%% eval: (set-input-method "spanish-prefix")
%%% TeX-master: t
%%% End:
After compiling the document I have two questions/problems again:
1. Table legend: Is it possible to finish the first line after the colon?
2. I am still struggling with the legend in the second page of the table.
As usual, many thanks in advance.
Regards,
Marie
- Attachments
-
- second problem/question
- finish-line-after-colon-2.png (23.62 KiB) Viewed 5360 times
-
- first problem/question
- finish-line-after-colon.png (23.62 KiB) Viewed 5360 times
-
- Posts: 133
- Joined: Sat Feb 25, 2012 6:12 pm
problems with the legend of a long table
\\
after the colon, I can't help you with the second problem, I think your screenshot is wrong though, if I compile it the header gets only as wide as the right column, and I'm guessing that's your problem too. 
-
- Posts: 133
- Joined: Sat Feb 25, 2012 6:12 pm
problems with the legend of a long table
\caption
[ ] command instead of the \multicolumn
which does not create a listoftables entry while still printing the table number. The \multicolumn
version is identical to the standard caption in the plain latex classes, while the \caption
[ ] is updated when using the KOMA script classes.Code: Select all
\documentclass[12pt%
%,draft%
,twoside%
,BCOR10mm%
,bibtotocnumbered,
,toc=listof,
numbers=noenddot
]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{color}
%\usepackage[round]{natbib}
\usepackage{natbib}
\usepackage{etex}
\usepackage{booktabs}
\usepackage{url}
\usepackage{paralist}
\usepackage{mystyle}
\usepackage{acronym}
\usepackage{graphicx}
\usepackage{appendix}
\usepackage{longtable}
\usepackage{color}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{pgfplots}
\usepackage{tabu}
\usepackage{lscape}
\usepackage{textcomp}
\usepackage{pdflscape}
\usepackage{geometry}
\usepackage{soul}
%\usepackage{legend}
\usepackage{tablefootnote}
\usepackage{afterpage}
\usepackage{ltxtable}
\captionsetup[table]{labelsep=quad}
\captionsetup[figure]{labelsep=quad}
%\toc=listof
\addto\captionsspanish{%
%\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listtablename}{Índice de Tablas}
\renewcommand{\figurename}{Figura}
\renewcommand{\tablename}{Tabla}
\renewcommand{\bibname}{Referencias bibliográficas}
\renewcommand{\appendixname}{Apéndices}
\renewcommand{\appendixtocname}{Apéndices}
\renewcommand{\appendixpagename}{Apéndices}}
%\listofgraficos
%\DeclareCaptionType{grafico}[Gr\'afico][\'Indice de Gr\'aficos]
\raggedbottom
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\begin{document}
\begin{longtable}{lp{.7\linewidth}}
\caption{Respuestas a la pregunta 10 del cuestionario final de
evaluación:\\ incluir respuesta a la pregunta 10 / incluir respuesta } \label{tab:respuestas-preg-10-espanoles} \\
\toprule
\textbf{Participante} & \textbf{Respuesta} \\
\midrule
\endfirsthead
\caption[]{Respuestas a la pregunta 10 del cuestionario final de
evaluación:\\ incluir respuesta a la pregunta 10 / incluir respuesta } \\
\toprule
\textbf{Participante} & \textbf{Respuesta} \\
\midrule
\endhead
\midrule
&\hfill\emph{continuación} \\
\bottomrule
\endfoot
\bottomrule
\endlastfoot
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
1&Einst war Großbritannien die vorherrschende Weltmacht. Im Kampf mit
Portugal, Spanien, Frankreich und den Niederlanden eroberte das
British Empire Gebiete, die zu Hochzeiten fast ein Viertel der Erde
bedeckten. Heute erinnern nur noch 14 kleine Außenposten an die
koloniale Vergangenheit. Der Fotograf Jon Tonks hat sie besucht: Oft
Tausende Meilen vom Festland entfernt, sind die Insulaner britisch –
immer noch und mit Leidenschaft.\\
\end{longtable}
\end{document}
%%% emacs stuff %%%
%%% Local Variables:
%%% TeX-PDF-mode: t
%%% mode: auto-fill
%%% ispell-local-dictionary: "castellano8"
%%% eval: (set-input-method "spanish-prefix")
%%% TeX-master: t
%%% End:
problems with the legend of a long table
Many thanks for your answers and help. Everything works fine now

Best regards,
Marie