1

I have a very large table of results. It spans over two pages using the longtable package. To reduce the size of the table I have set the font size to \tiny. However, as a longtable doesn't exist within a float, it makes the table ID (eg "Table 1") before the table caption tiny also.

Below is a working example of my code:

\tiny
    \begin{longtable}{llllll}
    \caption{\normalsize{This is the caption.}}\\
\hline
column 1 & column 2 & column 3 & column 4 & column 5 \\ \hline
blah & blah & blah & blah & blah \\ \hline
\end{longtable}

How do I produce a longtable with tiny text in the cells but normal sizing for the table ID/number?

1
  • welcome to tex.se! what is table ID? is this caption? caption font is determined with caption set up and should be independent from fonts used in table. for clarifying question please provide small but complete document beginning with \documentclas... and ending with \endbdocument}.
    – Zarko
    Aug 28, 2018 at 22:10

1 Answer 1

3

Typesetting of the \caption under longtable is defined within \LT@makecaption and doesn't follow the same protocols of the regular placement of \captions within floats, since a longtable doesn't float.

You can patch \LT@makecaption to use \normalsize for setting the caption (using etoolbox):

enter image description here

\documentclass{article}

\usepackage{longtable,etoolbox}

\makeatletter
\patchcmd{\LT@makecaption}% <cmd>
  {\sbox}% <search>
  {\normalsize\sbox}% <replace>
  {}{}% <success><failure>
\makeatother

\begin{document}

\tiny
\begin{longtable}{ *{6}{l} }
  \caption{This is the caption.} \\
  \hline
  column 1 & column 2 & column 3 & column 4 & column 5 \\
  \hline
  blah & blah & blah & blah & blah \\
  \hline
\end{longtable}

\end{document}

The other - more preferred - option is to use caption:

\usepackage{caption}
\captionsetup{font=normalsize}
1
  • 1
    ...and if the documentclass used is incompatible to the caption package, there is a 3rd option: \usepackage{ltcaption}\renewcommand\CaptionLabelFont{\normalsize}\renewcommand\CaptionTextFont{\normalsize}. (This works only if the caption package is not loaded.)
    – user2574
    Aug 29, 2018 at 7:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .