21

I know that it is possible to change the size of the font of the section titles in a document using \usepackage{sectsty} and the command \sectionfont; for example, to set the section titles' font to 14pt, I would use

\sectionfont{\fontsize{14}{15}\selectfont}

But what does the second number (15) stand for? Nothing seems to change when I modify this value.

  • 2
    The 15 is the \baselineskip in points. The real distance is computed by the product of \baselineskip and \baselinestretch – user31729 Aug 3 '16 at 21:03
  • 3
    generally it's better to use one of the defined sizes such as \large (and then if necessary define \large to be \fontsize{14}{15}\selectfont that way you get consistend fonts across the document structures. Note that this is \fontsize syntax, unrelated to \sectionfont – David Carlisle Aug 3 '16 at 21:07
18

The two arguments for \fontsize{<size>}{<bskip>} sets respectively the font size and the baseline skip. After setting, you have to \selectfont for the parameters to become active, making them available in \f@size and \f@baselineskip.

Some considerations:

  • Not all font sizes are available, so your choice for <size> should be made to avoid font substitution, or choose a package that provides support for your font choice (like lmodern).

  • The choice of font size and baseline skip is usually paired to avoid descenders/ascenders from sticking into the line below/above it. As such, it is advised to use the predefined or default font switches. Another motivation for using these is that they vary depending on the default document font size selected. That is, \large (say) has a different font size under 10pt, 11pt and 12pt document class option.

Some examples highlighting the effect of the second argument:

\documentclass{article}

\usepackage{lmodern}
\usepackage[nopar]{lipsum}
\usepackage[margin=1in]{geometry}

\begin{document}

% https://tex.stackexchange.com/q/24599/5764
{\tiny tiny\par}% 5pt font / 6pt baseline skip
{\scriptsize scriptsize\par}% 7pt font / 8pt baseline skip
{\footnotesize footnotesize\par}% 8pt font / 9.5pt baseline skip
{\small small\par}% 9pt font / 11pt baseline skip
{\normalsize normalsize\par}% 10pt font / 12pt baseline skip
{\large large\par}% 12pt font / 14pt baseline skip
{\Large Large\par}% 14pt font / 18pt baseline skip
{\LARGE LARGE\par}% 17pt font / 22pt baseline skip
{\huge huge\par}% 20pt font / 25pt baseline skip
{\Huge Huge\par}% 25pt font / 30pt baseline skip

\clearpage

{\fontsize{15}{15}\selectfont \lipsum[2]\par}

{\fontsize{15}{18}\selectfont \lipsum[2]\par}

{\fontsize{15}{20}\selectfont \lipsum[2]\par}

\end{document}

The default font switches provide a good balance between font size and baseline skip to make the font readable:

enter image description here

Too small a baseline skip value makes the text look bunched together:

enter image description here

Related: What font size modifiers are available in LaTeX?

|improve this answer|||||

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.