O'Reilly logo

LaTeX Cookbook 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

Quick-start for beginners

LaTeX provides a special syntax for math expressions. Furthermore, it has to be declared what is math but not text to get properly printed. Let's see how to write math!

How to do it...

We will practice math basics now. Let's write a document:

  1. As usual, start with a document class.
    \documentclass{article}
  2. Start the document:
    \begin{document}
  3. Let's have an unnumbered section for our text:
    \section*{The golden ratio}
  4. Write a statement containing math. Enclose each math formula within parentheses. As usual for LaTeX commands, write a backslash before each parenthesis.
    The symbol for the golden ratio is the Greek
    letter \( \varphi \). Its value is the positive
    solution of \( x^2 - x - 1 = 0 \).
  5. Continue the text; this time, math shall ...

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