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:

  1. 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}
  2. Typeset and check out the output:
    Time for action – exploring grouping by braces

What just happened?

We started with an opening curly brace. The effect of the following command \sffamily lasted until ...

Get LaTeX Beginners Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.