1

I let captions of my tables be defined by scrreport. I skipped caption or caption2 package because those did not let me adjust the distance between caption and table. I´m pleased with the results. However, when using \longtable, captions are smaller and set in the same size as the rest of the table.

I tried several solutions including How to change font size of longtable-lines without changing font size of caption? and https://tex.stackexchange.com/a/308135/193730. The first did not work and the second uses \usepackage[font=normalsize]{caption}, which I want to avoid as explained above.

Anyone knows how to solve this?

Thank you

My MWE: (unfortunately produces one minor error)


\documentclass[a4paper,
                DIV=10,
                BCOR=5mm,
                headsepline,
                fontsize=11pt,captions=tableheading]
                {scrreprt}

\usepackage[onehalfspacing]{setspace}

\pagestyle{headings}

%
\makeatletter
\let\origps@plain\ps@plain
\newcommand\MakePlainPagestyleEmpty{\let\ps@plain\ps@empty}
\newcommand\MakePlainPagestylePlain{\let\ps@plain\origps@plain}
\makeatother


% Für das Handling von deutscher Sprache
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[]{url}
\usepackage[babel]{csquotes} %Anführungszeichen
\usepackage{textcomp}
\usepackage{dcolumn}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{amsmath}
% Für schönere Listen
\usepackage[]{mdwlist}

% Für griechisches Alphabet
\usepackage{pxfonts}

%Hurenkinder/Schusterjungen/allein stehende Überschriften
\clubpenalty = 10000 
\widowpenalty = 10000 
\displaywidowpenalty = 10000

% Zum Referenzieren, --> Buch S. 72-74
\usepackage[english]{varioref}
\usepackage[english]{hyperref}
\usepackage[english,noabbrev]{cleveref}



%Fortlaufende Nummerierung der Fußnote
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}


%Schrift
\usepackage{lmodern}
\usepackage{lettrine}
\addtokomafont{disposition}{\rmfamily}
\let\oldpercent=\%
\renewcommand{\%}{\ifmmode\oldpercent\else\,\oldpercent\fi}
% CM-Modern Sans-Serif Command
%\renewcommand{\familydefault}{\sfdefault} 
\usepackage{changepage}

%Grafik
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{float}
\usepackage[export]{adjustbox}
\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother
\usepackage[export]{adjustbox} %Horizontale Anordnung von Grafiken innerhalb des Befehls \includegraphics

%table
\renewcommand{\caplabelfont}{\bfseries} 
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{afterpage}
\usepackage[table,xcdraw,dvipsnames]{xcolor}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage{tabu}
\usepackage{tabularx}
\usepackage{multirow,bigdelim}
\usepackage{array}
\usepackage{arydshln}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage{pdflscape}
\usepackage{lscape}
\usepackage{colortbl}
\definecolor{light-gray}{gray}{0.92}
\definecolor{light-red}{RGB}{255,174,174}
\definecolor{light-green}{cmyk}{0.4,0,0.4,0}
\usepackage{siunitx}
%\usepackage[format=hang,margin=10pt,font=small,labelfont=bf]{caption}
\usepackage{makecell}

\begin{document}
\pagestyle{myheadings}
\markright{Appendix}
\pagebreak
\renewcommand{\thetable}{A.\arabic{table}}
\begin{scriptsize}
\renewcommand{\theadalign}{cc}
\begin{longtable}[c]{crrcrrc}
\caption{Agglomeration Schedule, Average Linkage Within Groups}
\label{tab:1} \\
% Definition des Tabellenkopfes auf der ersten Seite
\toprule
 \textbf{Stage} & \multicolumn{2}{c}{\textbf{Cluster Combined}} & \textbf{Coefficients} & \multicolumn{2}{c}{\textbf{\thead{Stage Cluster \\ First Appears}}} & \textbf{Next Stage}\\
 \cmidrule(lr){2-3}\cmidrule(lr){5-6}
    ~ & \textbf{Cluster} 1 & \textbf{Cluster 2} & ~ & \textbf{Cluster} 1 & \textbf{Cluster 2} & ~\\
    \midrule\\
\endfirsthead % Erster Kopf zu Ende
% Definition des Tabellenkopfes auf den folgenden Seiten
\caption*{Continuation of \vref{tab:1}}\\
\toprule
 \textbf{Stage} & \multicolumn{2}{c}{\textbf{Cluster Combined}} & \textbf{Coefficients} & \multicolumn{2}{c}{\textbf{\thead{Stage Cluster \\ First Appears}}} & \textbf{Next Stage}\\
 \cmidrule(lr){2-3}\cmidrule(lr){5-6}
    ~ & \textbf{Cluster} 1 & \textbf{Cluster 2} & ~ & \textbf{Cluster} 1 & \textbf{Cluster 2} & ~\\
    \midrule
\endhead % Zweiter Kopf ist zu Ende
\endfoot
\bottomrule
\endlastfoot
% Ab hier kommt der Inhalt der Tabelle
1 & 2840 &  2842 &  1 & 0 & 0 & 3\\
2 & 2839 &  2841 &  1 & 0 & 0 & 4\\
3 & 1 & 2840 &  1 & 0 & 1 & 11\\
\end{longtable}
\end{scriptsize}

\begin{landscape}
    \centering
\begin{table}[p]
\begin{tiny}
\renewcommand{\arraystretch}{1.3}
\newcommand{\STAB}[1]{\begin{tabular}{@{}c@{}}#1\end{tabular}}
\caption{Results of multinomial logistic regression analysis, estimating the effects of a complete model on cluster membership in odds ratios}
\label{tab:2}
\begin{threeparttable}
\begin{tabular}{llD{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}D{.}{.}{4}}
\toprule
& \multicolumn{1}{r}{\textit{cluster...}} & \multicolumn{1}{c}{Cluster 2} & \multicolumn{1}{c}{Cluster 3} & \multicolumn{1}{c}{Cluster 4} & \multicolumn{1}{c}{Cluster 5} & \multicolumn{1}{c}{Cluster 6} & \multicolumn{1}{c}{Cluster 7} & \multicolumn{1}{c}{Cluster 8} & \multicolumn{1}{c}{Cluster 3} & \multicolumn{1}{c}{Cluster 4} & \multicolumn{1}{c}{Cluster 5} & \multicolumn{1}{c}{Cluster 6} \\
& \multicolumn{1}{r}{\textit{compared to...}} & \multicolumn{7}{c}{\textbf{Voters (1)}} & \multicolumn{4}{c}{\textbf{(Hyperactives 2)}}\\
 \cmidrule(lr){1-9} \cmidrule(lr){10-13}
\multirow{10}{*}{\STAB{\rotatebox[origin=c]{90}{\textbf{GIM}}}} & Selective-outcome & 1.018      & 1.192      & .900      & 1.126      & .839      & .917      & .917      & 1.171      & .884      & 1.106      & .824  \\
    & Selective-process & .902      & 1.217      & 1.113      & .986      & .976      & 2.572 ^{\ast\ast}    & 2.572 ^{\ast\ast}    & 1.350      & 1.234      & 1.093      & 1.082  \\
    & Collective-political & 1.109      & 1.145      & .903      & .953      & .979      & 1.228      & 1.228      & 1.033      & .815      & .860      & .883  \\
    & Normative & .933      & .788      & .987      & .965      & 1.086      & 1.112      & 1.112      & .845      & 1.058      & 1.035      & 1.164  \\
    & Altruistic & 1.223 ^{\ast}    & 1.045      & 1.149 ^{\ast}    & .971      & 1.016      & 1.389 ^{\ast}    & 1.389 ^{\ast}    & .855      & .939      & .793 ^{\ast}    & .830  \\
    & Ideological & .581 ^{\ast\ast\ast}    & 1.083      & 1.137      & .910      & 1.130      & .767      & .767      & 1.864 ^{\ast\ast}    & 1.956 ^{\ast\ast\ast}    & 1.566 ^{\ast\ast}    & 1.945 ^{\ast\ast\ast}\\
    & Expressive & 1.914 ^{\ast\ast\ast}    & 1.115      & 1.030      & 1.356 ^{\ast}    & .940      & 1.302      & 1.302      & .583 ^{\ast}    & .538 ^{\ast\ast\ast}    & .709      & .491 ^{\ast\ast\ast}\\
    & Opp. Costs (n) & .868      & 1.094      & .913      & .980      & .919      & 1.166      & 1.166      & 1.261      & 1.052      & 1.130      & 1.060  \\
    & Disutility (n) & 1.223 ^{\ast}    & .960      & 1.119      & 1.031      & 1.134      & 1.519 ^{\ast\ast}    & 1.519 ^{\ast\ast}    & .785      & .915      & .843      & .927  \\
    & Financial (n) & 1.227      & 1.174      & .999      & .960      & 1.162      & 1.004      & 1.004      & .956      & .814      & .782      & .947  \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item bla
\end{tablenotes}
\end{threeparttable}
\end{tiny}
\end{table}
\end{landscape}
\end{document}`
  • Adjusting the distance between caption and table is just \captionsetup{skip=whatever you please}! – Bernard Aug 1 at 11:55
  • 2
    You should sort and shorten your preamble. I doubt that you actually use all these packages. Also load hyperref later and better don't use tabu. – Ulrike Fischer Aug 1 at 12:02
  • 1
    It seems you forgot the M and W parts in MWE. Please make your example code as short as possible while still producing the behavior you are asking about, as well as not produce any errors that are not part of your question. – schtandard Aug 1 at 12:14
  • Thank you very much @Bernard. Funny how easy things are sometimes. – Pullp Aug 1 at 13:14
  • It happens to all of us to skim through documentations ;o) – Bernard Aug 1 at 13:17
2

With the KOMA-Script class you can use

\addtokomafont{caption}{\normalsize}

MWE:

\documentclass[captions=tableheading]{scrreprt}
\usepackage[onehalfspacing]{setspace}

\usepackage{array}
\usepackage{booktabs}
\usepackage{longtable}

\addtokomafont{caption}{\normalsize}
\addtokomafont{captionlabel}{\bfseries}

\usepackage{blindtext}
\begin{document}
\blindtext

\begingroup\par\scriptsize
\begin{longtable}{ll}
  \caption{A caption}\\
  \toprule
  \textbf{Column 1}&\textbf{Column 2}\\
  \midrule
  \endfirsthead
  Text&Text\\
  \bottomrule
\end{longtable}
\par\endgroup

\blindtext

\begingroup\par\tiny
\begin{longtable}{ll}
  \caption{A caption}\\
  \toprule
  \textbf{Column 1}&\textbf{Column 2}\\
  \midrule
  \endfirsthead
  Text&Text\\
  \bottomrule
\end{longtable}
\par\endgroup

\blindtext[2]
\end{document}

Result:

enter image description here

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.