Skip to main content
Datatool360

LaTeX Basics for Maths Documents

By the Datatool360 team ·

When the Math PDF converter gives you equations as LaTeX, you will see text full of backslashes and curly brackets. It looks odd at first, but there are only a few ideas to learn, and once you know them you can read and fix the result yourself. This guide covers the ones that you will meet most often.

Want to do it right now? Open the Math PDF to LaTeX tool

The basic idea

LaTeX describes a formula in plain text, and a program draws it. A command starts with a backslash, for example \frac or \sqrt. What the command works on goes into curly brackets { }. To put a formula inside a sentence, write it between dollar signs: $x^2 + 1$. To put it on its own line, use two dollar signs on each side: $$x^2 + 1$$.

A good habit is to read LaTeX from the inside out. The curly brackets tell you what belongs together.

Fractions, powers and indices

  • Fraction: \frac{a}{b} gives a over b. For “one half”: \frac{1}{2}. The top part goes in the first pair of brackets, the bottom part in the second.
  • Power: x^2 gives x squared. If the power has more than one character, use brackets: x^{10}, not x^10, which would show x to the power 1 followed by a 0.
  • Index (subscript): x_1 gives x with a small 1 below. Again, use brackets for more than one character: a_{ij}.
  • Both together: x_i^2 or x_{i}^{2}.

Roots

  • Square root: \sqrt{x}
  • Root of another degree: \sqrt[3]{x} for the cube root.
  • A bigger expression inside: \sqrt{a^2 + b^2}. Everything inside the brackets goes under the root sign.

Sums, limits and integrals

  • Sum: \sum_{i=1}^{n} a_i. The part after the underscore goes below, the part after the hat goes above.
  • Product: \prod_{i=1}^{n} a_i
  • Limit: \lim_{x \to 0} \frac{\sin x}{x}
  • Integral: \int_{a}^{b} f(x)\,dx. The \, adds a small space before the dx.

Greek letters and common symbols

  • Greek letters are written as their names: \alpha, \beta, \gamma, \theta, \lambda, \pi, \sigma, \omega. A capital starts with a capital letter: \Delta, \Sigma, \Omega.
  • Comparisons: \leq (less than or equal), \geq (greater than or equal), \neq (not equal), \approx (about equal).
  • Other signs: \times (multiply), \pm (plus or minus), \infty (infinity), \cdot (a dot between factors).
  • Functions in upright type: \sin x, \cos x, \log x, \ln x.

Reading what the converter gives you

A typical result looks like this: $\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. Read it from the inside: b^2 - 4ac is under the root, the root goes next to -b \pm, all that is the top of a fraction, and 2a is the bottom. It is the formula for the solutions of a quadratic equation.

When you find a mistake, it is nearly always one of a few types: a missing curly bracket, a power or index without brackets (x^10 instead of x^{10}), or a symbol read wrongly, such as a letter l instead of a 1. These are easy to fix once you know where to look.

Where you can use it

  • In a LaTeX document, paste the formulas between dollar signs.
  • In Word, use the Word export of the converter, where the equations are real Word equations and you do not need to write LaTeX at all.
  • On many websites, notes apps and Markdown editors, formulas between dollar signs are shown as maths.

And whatever you do with the result, compare the equations with the original once. One wrong sign or one missing bracket can change an answer completely.

Keep reading