I need help understanding what is happening in the below example. I am trying to set the font size to 23pts. But it is only changing the size of the font within the \textbf{}. The text that fills the #2 parameter ends up being very small. See the picture for the example.

\includegraphics[width=\textwidth, height=1.25cm]{./images/green_checkmark}
\textcolor{TitleColor}{\textbf{#1} #2} \\

Using \Large

However if I comment out \Large and uncomment \fontsize:

\textcolor{TitleColor}{\textbf{#1} #2} \\

I get:

enter image description here

Basically, all I want is to be able to set the font size to be something between \LARGE and \huge.

Also, I tried the below without success:

 \textcolor{TitleColor}{\textbf{#1} \fontsize{23}{28}#2} \

There are several commands for changing font attributes; there are the lower level ones


that are used by higher level commands. Each of these commands changes one attribute (the last one requires two arguments, font size and baselineskip); however they just instruct LaTeX to change the current value of the attribute, without actually selecting it: it would be inefficient for LaTeX to compute a new current font four times with, say


so the real way to operate is choosing the various attributes and select the font with \selectfont. For instance, the "middle level" command


is equivalent to


A \fontXYZ command just changes the attribute, but the change remains suspended until \selectfont acts. The same is for \fontsize.

The higher level commands such as \bfseries do essentially something like


while \textbf{text} does

{\bfseries text}

and this explains the problem you get: it's the implicit \bfseries that does \selectfont, but as soon as the closing brace is scanned, the font goes back to the previously selected one.

In conclusion,


will do. Remember either to load the fix-cm package or use a fully scalable font.

  • Thank you for the explanation in addition to the answer! – ajon Jul 8 '13 at 21:01

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.