How to change font size of longtable-lines without changing font size of caption?
Since you are using a KOMA-Script document class you can simply use \setkomafont
or \addtokomafont
to set the size of the caption(s):
\documentclass[captions=tableheading]{scrbook}
\usepackage{longtable, booktabs}
\setkomafont{caption}{\normalsize}
\begin{document}
\begingroup
\footnotesize
\begin{longtable}{ccc}
\caption{This is the caption of the table which shall be normal size!}\\
\toprule
aaaaaaa & bbbbbb & ccccccccc\\
\midrule
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
\bottomrule
\end{longtable}
\endgroup
\end{document}
For other document classes one can include the caption
package. Simply including is sufficient since \normalsize
is the default caption size here (at least since version 3.1):
\documentclass{book}
\usepackage{longtable, booktabs}
\usepackage[tableposition=t]{caption}
\begin{document}
\begingroup
\footnotesize
\begin{longtable}{ccc}
\caption{This is the caption of the table which shall be normal size!}\\
\toprule
aaaaaaa & bbbbbb & ccccccccc\\
\midrule
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
\bottomrule
\end{longtable}
\endgroup
\end{document}
If someone is not using a KOMA-Script document class, but don't want to use the caption
package either, one can give the ltcaption
package a try which is part of the caption
package bundle but patches the captioning stuff for longtables only:
\documentclass{book}
\usepackage{longtable, booktabs}
\usepackage{ltcaption}
% The ltcaption package supports \CaptionLabelFont & \CaptionTextFont
% introduced by the NTG document classes
\renewcommand\CaptionLabelFont{\normalsize}
\renewcommand\CaptionTextFont{\normalsize}
\begin{document}
\begingroup
\footnotesize
\begin{longtable}{ccc}
\caption{This is the caption of the table which shall be normal size!}\\
\toprule
aaaaaaa & bbbbbb & ccccccccc\\
\midrule
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
\bottomrule
\end{longtable}
\endgroup
\end{document}
You can modify the definition of \LT@makecaption
in such a way that it uses \normalsize
; since you are using scrbook
one has to use its definition. I'll define a new environment that will make things easier.
\documentclass{scrbook}
\usepackage{longtable, booktabs,etoolbox}
\makeatletter
\newenvironment{longtable*}[1]
{%
\renewcommand{\LT@makecaption}[3]{%
\noalign{%
\if@captionabove
\vskip\belowcaptionskip
\else
\vskip\abovecaptionskip
\fi
}%
\LT@mcol\LT@cols c{%
\hbox to\z@{\normalsize\hss\parbox[t]\linewidth{%
\@@makecaption{##1}{##2}{##3}%
\endgraf
\if@captionabove
\vskip\abovecaptionskip
\else
\vskip\belowcaptionskip
\fi
}%
\hss
}%
}%
}%
#1\begin{longtable}}
{\end{longtable}}
\makeatother
\begin{document}
\hrule
\begin{longtable*}{\footnotesize}{ccc}
\caption{This is the caption of the table which shall be normal size!}\\
\toprule
aaaaaaa & bbbbbb & ccccccccc\\
\midrule
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
\bottomrule
\end{longtable*}
\begin{longtable}{ccc}
\caption{This is the caption of the table which shall be normal size!}\\
\toprule
aaaaaaa & bbbbbb & ccccccccc\\
\midrule
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
a & b & c\\
\bottomrule
\end{longtable}
\end{document}
The syntax of the longtable*
environment is simple: it takes as argument the desired size of the table's body; the usual argument to longtable
follows. I've left the two examples to show the difference.
You can do global change by keeping the following three lines in the preamble:
\usepackage[font=normalsize]{caption} %% make caption in normal size
\usepackage{etoolbox}
\AtBeginEnvironment{longtabu}{\footnotesize}{}{} %% change all longtabu content to foot note size
as answered by Harish Kumar here in this question