Time for action – switching the font family

We will modify the previous example using font family switching commands:

  1. Modify the example to get the following code:
    \documentclass{article}
    \begin{document}
    \section{\sffamily\LaTeX\ resources in the internet}
    The best place for downloading LaTeX related software is CTAN.
    Its address is \ttfamily http://www.ctan.org\rmfamily.
    \end{document}
  2. Typeset and compare the output to the previous one; it's the same.

What just happened?

By using the command \sffamily, we switched over to sans serif font. This change has been made inside an argument, so it's valid only there.

We used the command \ttfamily to switch to a typewriter font. The typewriter font will be used from this point onwards. By using \rmfamily

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.