Time for action – exploring grouping by braces
We shall use curly braces to tell LaTeX where to apply a command and where to stop that:
Modify our first font shape example to get this code:
\documentclass{article} \begin{document} {\sffamily Text can be {\em emphasized}. Besides being {\itshape italic} words could be {\bfseries bold}, {\slshape slanted} or typeset in {\scshape Small Caps}. Such commands can be {\itshape\bfseries nested}.} {\em See how {\em emphasizing} looks when nested.} \end{document}
Typeset and check out the output:
What just happened?
We started with an opening curly brace. The effect of the following command \sffamily
lasted until we stopped it with the corresponding closing brace. That closing brace came at the end of the highlighted code. This highlighting shows the area of the code where \sffamily
is valid.
We replaced every font command by the corresponding declaration. Remember, \em
is the declaration version of \emph
. Further, we surrounded every declaration and...