Equations are the most important part of the scientific document. Writing equations and mathematical expressions are easy in Latex. This tutorial will guide you about writing mathematical equations and expressions.

Equation mode

There are two mode for writing equation in Latex.

  • Inline mode
  • Displayed mode

The first method print the equation in the same line after the text. While in the displayed mode the equations are printed in the next line with center-aligned.

Example of writing equations

Both can be seen in the following example code.

\documentclass[11pt, oneside]{article}
\begin{document}

The basic formula in mathematics are $(a+b)^2 = a^2+b^2+2ab$. This is the example of inline mode.

However, the equation in displayed mode will be
\begin{equation}
(a+b)^2 = a^2+b^2+2ab
\end{equation}

\end{document}

The output PDF will be look like this.

Mathematical equations and expressions

The dollar sign “$” is used to write the equation within the text (inline mode). While the \begin{equation} and \end{equation} are used for displayed mode.

Last Updated on