2

In relation to the size of fonts I used to regard something like \Huge as a switch, \Huge{<some text>} as restricted to <some text>. Apparently not so. It turns out that proper grouping requires {\Huge ...}. I just wondered what the distinction there then is between switches \Huge <some text> and \Huge {<some text>}, if any.

\documentclass{article}
% RN. 03 Dec 2018
\begin{document}
  \Huge{Huge}

  Huge persists

  \tiny{tiny}

  tiny persists

  \normalsize

  normalsize

  {\Huge{Huge}}

  Huge properly grouped

  {\Huge Huge}

  Huge properly grouped, again
\end{document}
2
  • 3
    \Huge ... is equivalent to \Huge {...} (except in some corner cases, but these are not related to the presence of \Huge). Commented Dec 3, 2018 at 3:44
  • 1
    Note that the effect of "switches" (like \Huge is one) persist until the local group they appear in is closed. This is the reason why your {\Huge ...} example works as expected, the \Huge{...} example, on the other hand, doesn't. In the latter case, the effect persists until the \endgroup used internally by \end{document} occurs.
    – siracusa
    Commented Dec 3, 2018 at 3:56

1 Answer 1

3

We generally refer to a switch as a macro that does not take an argument (either directly or indirectly) to which something is applied. It may take an argument it doesn't apply anything to that argument. That is, the macro changes some setting that affects everything after it within the group. Here are some examples:

enter image description here

\documentclass{article}

\usepackage[margin=0.5in]{geometry}
\usepackage{xcolor}

\begin{document}

\begingroup
This is normal text followed by
\large
large text, followed by
\Large
Large text, followed by
\LARGE
LARGE text.
\endgroup

This is normal text again.

This is normal {text \color{red}set in red} and \textcolor{blue}{blue}.

Also see \textbf{bold} {and \bfseries bold} text.

\end{document}

Note how \textbf{<stuff>} has a scope over <stuff> only, while {\bfseries ...} will be applied to everything after it within the group. Similarly, \color{<colour>} is applied to everything until the group end, while \textcolor{<colour>}{<stuff>} is only applied to <stuff>.

Some switches have argument-delimited application, like \textbf to \bfseries, \textit to \itshape, \textsf to \sffamily, \textcolor{<colour>} to \color{<colour>}, etc.

You must log in to answer this question.

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