9

I am using longtable package to make my large table span two pages. However I have set the font size with \fontsize to my table to be quite small. The only problem is that when the table is finished, the text below it are also the small size.

\fontsize{9}{11}\selectfont
\centering
\begin{longtable}{| p{.20\textwidth} | p{.80\textwidth} |} 
\hline
foo & bar \\ \hline 
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
foo & bar \\ \hline
\caption{Your caption here}
\label{tab:myfirstlongtable}
\end{longtable}

(The above code was for test purposes as I was working from a tutorial)

10

\fontsize is defined as:

\fontsize{size}{skip}

The two arguments to \fontsize are the actual font size in size and the size of the baseline-skip in skip. The baseline-skip should be set to roughly 1.2x the font size. Reference

The declaration

\fontsize{9}{11}\selectfont

affects all following text until the end of the current group, the fact that there is a longtable there isn't that relevant. You can use \normalsize to reset it or use { and } to limit the scope. It really is better to use \small or other named sizes to get consistent sizing rather than setting each table to individually set point sizes. The scoping rules would apply to \small as well.

  • Hi, may you explain what 9 and 11 each represents? Thanks! – James H Jul 24 '18 at 22:50
  • 1
    @JamesH 9pt font with 11pt between lines of text – David Carlisle Jul 24 '18 at 23:51
8

Enclose the longtable within \begin{small} and \end{small}, this will ensure the text to be of small size. Worked well for me. Or start the longtable with \small, ending it with \normalsize where the table ends.

  • 1
    \small is not an environment. don't use it on such a way. – Zarko Aug 1 '18 at 11:53

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.