48

I came across a German LaTeX page and found instructions like:

  1. \Large{bit bigger}
  2. {\Large a bit bigger}
  3. \begin{Large} ... \end{Large}

Is it true that all three are "correct"? I only remember the second one being correct for 1) \Large and others don't take an argument and perhaps I forgot about 3). Can somebody enlighten me?

0

3 Answers 3

68

You are indeed correct. The \Large command and its ilk change the font size for everything following them up until the end of the group, just like \color{red}. This means that \Large{bit bigger} will appear to work in certain cases, since it's parsed as two things: first, the command \Large, and second, the group {bit bigger}. The difference—and the reason that #1 is incorrect—is easy to see: compare

In this sentence, {\Large only some text is large} and the rest is normal.

and

In this sentence, \Large{too much text is large}, including this.

The former renders as

Good usage of \Large.

The latter, however, renders as

Bad usage of \Large.

This is a useful property of \Large and its friends; for instance, to get a list in a larger font size, one can write simply

\begin{itemize}
  \Large
  \item Alpha
  \item Beta
  \item Gamma
\end{itemize}

Now, as for the third usage, it's true that \begin{Large} and \end{Large} will work, even though \Large is not defined as an environment. To see why this works, consider the \begin and \end commands. What \begin does is expand to some boilerplate (for error checking and the like), then \begingroup, and then \csname#1\endcsname. Conversely, aside from the boilerplate, \end expands to \csname end#1\endcsname, and then \endgroup. Writing \csname foo\endcsname is almost exactly like writing \foo, except with one important difference: if \foo is undefined, it's \let to \relax (the command which does nothing). This means that when you write \begin{Large} Some text here \end{Large}, this is roughly equivalent to \begingroup\Large some text here \relax\endgroup. Thus, even though \endLarge isn't defined, the environment functions just as well. Note that this ability to use switches as environments is apparently documented in Leslie Lamport's book, although I've never had the chance to read it myself; Philipp's answer clarifies the pitfalls of using switches as environments.

8
  • 8
    That switches can be used as environments is not an accident, but is documented in Lamport's book.
    – Philipp
    Commented Dec 17, 2010 at 22:15
  • 2
    @Brian M. Hunt: All font-switching commands that start with \text… or \math… take an argument, all other font-switching commands (\itshape etc.) take effect until the end of the current group.
    – Philipp
    Commented Dec 17, 2010 at 22:17
  • 1
    @Brian: To add to what Philipp said, the difference between the two commands is how they're defined. The \textbf-style commands are defined to take a single argument, which they then style. The \Large-style commands take no arguments, but change how things are to be formatted. The only way to tell the difference in general is to look at the definitions or documentation, but Philipp's comment is exactly correct for the standard commands. Commented Dec 17, 2010 at 22:20
  • 2
    Note: In Lamport's LaTeX Manual, section 2.2.5 "Declarations", it is said that \begin{em} ... \end{em} is equivalent to {\em ...}, and the former is clearer. However, as @Philipp said, it does have some pitfalls, and should be used with care.
    – Leo Liu
    Commented Jan 17, 2011 at 14:43
  • 2
    Small correction: the \begingroup comes before not after the \csname in the expansion of \begin Commented Jul 31, 2012 at 14:44
21

The first is incorrect. The second one is correct. The third version works, but has a few (possible) issues: Spaces after the first closing brace are not ignored (unlike other environments), and if the content contains a whole paragraph, the paragraph end must be inside the environment.

1
6

All the font-sizing commands like \Large are defined in the .clo files that the standard classes loads, when you specify for example the font size parameter in an article class. They are defined as:

 \newcommand\Large{\@setfontsize\Large\@xviipt{22}}

As you can see the macro does not take a parameter and hence the correct usage would be to use it as a switch or just enclose it in brackets.

You must log in to answer this question.

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