O'Reilly logo

LaTeX Beginners Guide by Stefan Kottwitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required