DEV Community

latexteada
latexteada

Posted on

LaTeX & Maths: Math Commands for Basic Operations

Hello, how are you?

In this post I talk about some basic commands to create basic operations such as sub and superscipts, roots and vectors.

Remember that you need to import the amsmath and amssymb packages, here I give you a brief introduction of these packages

Operators

  1. Basic Operations We can sum, substact, multiply and divide with +, -, \times or \cdot and \frac{a}{b}
  2. Sub and Superscripts We create a superscript with {a}^{b} and a subscript with {a}_{b}.
    • Roots We create a root with \sqrt{a} or \sqrt[a]{b}
  3. Over and Under-braces An over-brace with text is \overbrace{x+y}^{text} and an under-brace is \underbrace{a+b}_{text}
  4. Vectors We create a vector with \vec{a} or \hat{a}

Let's create something with this

code

Produces

Screenshot from 2021-07-10 12-15-44

Wait! Do you remember that in this post I told you that there was a difference between inline and displayed formulas, well

code

Produces

Screenshot from 2021-07-10 12-21-00

Did you noticed the difference? If not, in the fraction

The inline formulas adapts the size of the operator to print it in the same line while displayed formulas expands the size of the operations showing its real size :)

This is all for today. Thanks for reading

Do not forget to follow me on Twitter @latexteada

Greetings :)

Discussion (0)