I am creating the document for my thesis, which is made up of three chapters.
In one of them I have longtables
. When writing that chapter as an article
, I found a solution to get the table to have a title and a caption (both within the caption
). Here is part of my code (the table is longer, so the use of longtable
is justified):
\documentclass[a4paper]{article}
\usepackage{longtable,array}
\usepackage[justification=centering]{caption}
\usepackage{cellspace}
\usepackage{booktabs}
\usepackage{varwidth}
\usepackage[a4paper,margin=25mm]{geometry}
\usepackage{multirow}
\usepackage{multicol}
\setlength{\parskip}{\baselineskip}
\setlength{\tabcolsep}{4pt}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}
\newenvironment{outdent}
{\begin{list}{}{\leftmargin-0cm\rightmargin\leftmargin}\centering\item\relax}
{\end{list}\ignorespacesafterend}
\begin{document}
\begin{footnotesize}
\begin{longtable}{m{3cm}m{3cm}@{}m{3cm}@{}m{3cm}@{}m{2.1cm}@{}}
\caption{Binary ESG Variables \newline \smallskip \newline \footnotesize This table shows the means of the binary ESG variables for the full period (2002-2017) and for two subperiods (2002-2007 and 2008-2017), the growth rate from one subperiod to the other and the overall mean for all of them in the last row.}
\label{descbin}\\
\toprule
Variable & Mean (2002-2017) & Mean (2002-2007) & Mean (2008-2017) & Mean Growth \\
\hline
\midrule[\heavyrulewidth] % make this rule as thick as \toprule
\endfirsthead
\toprule
\multicolumn{5}{l}{\small\sl continued from previous page}\\ \hline
Variable & Mean (2002-2017) & Mean (2002-2007) & Mean (2008-2017) & Mean Growth \\
\hline
\midrule[\heavyrulewidth] % make this rule as thick as \toprule
\endhead
\bottomrule
\multicolumn{5}{r}{\small\sl continued on next page} \\ \hline
\endfoot
\bottomrule
\endlastfoot
\hline \multicolumn{5}{|c|}{Panel A: Environmental variables} \\
\hline CO2EmT & 0.38992 & 0.27250 & 0.46037 & 68.95\% \\
CO2DirEm & 0.28134 & 0.15358 & 0.35800 & 133.11\% \\
CO2IndEm & 0.25803 & 0.10909 & 0.34739 & 218.44\% \\
FlaNG & 0.00729 & 0.00616 & 0.00796 & 29.28\% \\
OzDepSub & 0.03486 & 0.02730 & 0.03939 & 44.32\% \\
NOxEm & 0.14152 & 0.12901 & 0.14902 & 15.51\% \\
SOxEm & 0.13392 & 0.11698 & 0.14409 & 23.18\% \\
VOCEm & 0.07476 & 0.06650 & 0.07972 & 19.88\% \\
WasTot & 0.25446 & 0.18339 & 0.29710 & 62.00\% \\
NhazWas & 0.12237 & 0.07164 & 0.15280 & 113.30\% \\
WasRecT & 0.19662 & 0.12476 & 0.23973 & 92.15\% \\
HazWas & 0.13412 & 0.09565 & 0.15720 & 64.34\% \\
WatDis & 0.07482 & 0.05188 & 0.08858 & 70.72\% \\
WatPolEm & 0.06320 & 0.04405 & 0.07470 & 69.57\% \\
ISOEMSCP & 0.11375 & 0.05814 & 0.14711 & 153.02\% \\
EnvExp & 0.16774 & 0.10902 & 0.20297 & 86.18\% \\
EnvProv & 0.08972 & 0.04083 & 0.11906 & 191.61\% \\
CO2S3 & 0.13229 & 0.02050 & 0.19937 & 872.33\% \\
CoffCre & 0.02412 & 0.00274 & 0.03694 & 1246.67\% \\
ENVRDExp & 0.04883 & 0.04708 & 0.04987 & 5.92\% \\
EnUTot & 0.30960 & 0.18363 & 0.38519 & 109.76\% \\
IndEnU & 0.01168 & 0.01225 & 0.01134 & -7.42\% \\
WWTot & 0.30248 & 0.23085 & 0.34545 & 49.65\% \\
FWWTot & 0.16238 & 0.06121 & 0.22309 & 264.49\% \\
WatRec & 0.05536 & 0.02169 & 0.07556 & 248.41\% \\ \hline
\end{longtable}
\end{footnotesize}
\end{document}
The problem arrives, when I try to compile this type of tables in a report
document, because I have to generate a list of tables and in the list.
\documentclass[11 pt,twoside]{report}
\usepackage{longtable,array}
\usepackage[justification=centering]{caption}
\usepackage{cellspace}
\usepackage{booktabs}
\usepackage{varwidth}
\usepackage[a4paper,margin=25mm]{geometry}
\usepackage{multirow}
\usepackage{multicol}
\setlength{\parskip}{\baselineskip}
\setlength{\tabcolsep}{4pt}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}
\newenvironment{outdent}
{\begin{list}{}{\leftmargin-0cm\rightmargin\leftmargin}\centering\item\relax}
{\end{list}\ignorespacesafterend}
\begin{document}
\listoftables
\begin{footnotesize}
\begin{longtable}{m{3cm}m{3cm}@{}m{3cm}@{}m{3cm}@{}m{2.1cm}@{}}
\caption{Binary ESG Variables \newline \smallskip \newline \footnotesize This table shows the means of the binary ESG variables for the full period (2002-2017) and for two subperiods (2002-2007 and 2008-2017), the growth rate from one subperiod to the other and the overall mean for all of them in the last row.}
\label{descbin}\\
\toprule
Variable & Mean (2002-2017) & Mean (2002-2007) & Mean (2008-2017) & Mean Growth \\
\hline
\midrule[\heavyrulewidth] % make this rule as thick as \toprule
\endfirsthead
\toprule
\multicolumn{5}{l}{\small\sl continued from previous page}\\ \hline
Variable & Mean (2002-2017) & Mean (2002-2007) & Mean (2008-2017) & Mean Growth \\
\hline
\midrule[\heavyrulewidth] % make this rule as thick as \toprule
\endhead
\bottomrule
\multicolumn{5}{r}{\small\sl continued on next page} \\ \hline
\endfoot
\bottomrule
\endlastfoot
\hline \multicolumn{5}{|c|}{Panel A: Environmental variables} \\
\hline CO2EmT & 0.38992 & 0.27250 & 0.46037 & 68.95\% \\
CO2DirEm & 0.28134 & 0.15358 & 0.35800 & 133.11\% \\
CO2IndEm & 0.25803 & 0.10909 & 0.34739 & 218.44\% \\
FlaNG & 0.00729 & 0.00616 & 0.00796 & 29.28\% \\
OzDepSub & 0.03486 & 0.02730 & 0.03939 & 44.32\% \\
NOxEm & 0.14152 & 0.12901 & 0.14902 & 15.51\% \\
SOxEm & 0.13392 & 0.11698 & 0.14409 & 23.18\% \\
VOCEm & 0.07476 & 0.06650 & 0.07972 & 19.88\% \\
WasTot & 0.25446 & 0.18339 & 0.29710 & 62.00\% \\
NhazWas & 0.12237 & 0.07164 & 0.15280 & 113.30\% \\
WasRecT & 0.19662 & 0.12476 & 0.23973 & 92.15\% \\
HazWas & 0.13412 & 0.09565 & 0.15720 & 64.34\% \\
WatDis & 0.07482 & 0.05188 & 0.08858 & 70.72\% \\
WatPolEm & 0.06320 & 0.04405 & 0.07470 & 69.57\% \\
ISOEMSCP & 0.11375 & 0.05814 & 0.14711 & 153.02\% \\
EnvExp & 0.16774 & 0.10902 & 0.20297 & 86.18\% \\
EnvProv & 0.08972 & 0.04083 & 0.11906 & 191.61\% \\
CO2S3 & 0.13229 & 0.02050 & 0.19937 & 872.33\% \\
CoffCre & 0.02412 & 0.00274 & 0.03694 & 1246.67\% \\
ENVRDExp & 0.04883 & 0.04708 & 0.04987 & 5.92\% \\
EnUTot & 0.30960 & 0.18363 & 0.38519 & 109.76\% \\
IndEnU & 0.01168 & 0.01225 & 0.01134 & -7.42\% \\
WWTot & 0.30248 & 0.23085 & 0.34545 & 49.65\% \\
FWWTot & 0.16238 & 0.06121 & 0.22309 & 264.49\% \\
WatRec & 0.05536 & 0.02169 & 0.07556 & 248.41\% \\ \hline
\end{longtable}
\end{footnotesize}
\end{document}
The following appears:
1.2 Binary ESG Variables This table shows the means of the binary ESG variables for the full period (2002-2017) and for two subperiods (2002-2007 and 2008-2017), the growth rate from one subperiod to the other and the overall mean for all of them in the last row. . . . . . . . . . . 14
How can I get the table to have a title and caption, but that only the title appears?
\caption[<short caption for the list of tables>]{<long caption that is printed with the table>}
l
type columns?