In the first series on LaTeX tutorial, you can see a basic introduction to setting a LaTeX system. Here, find a step by step simple procedure to add mathematical equations to a LaTeX document. LaTeX is an extremely good tool for typesetting mathematical equations. Fundamentally, there are two modes of typesetting Mathematical equations: In-Line Maths and Displayed Maths.
Inline mode helps to write the formulas and mathematical expressions that are part of the text. For example:
In equation y=mx+b, m is defined as the slope and b is the intercept.
Here the equation y=mx+b is the part of the text. Whereas, in Display Maths mode, expressions appear in separate lines For example:
Equation of line is written as : y=mx+b
In-Line Mathematics
To add an inline mathematical feature, simply write your text, typeset a mathematical symbol, and enclose it within the dollar sign. For example, if you want to write “Angular frequency, ω is also called radial or circular frequency. ”
Now to see the magic, go to the accessories tab in the menu bar and click on compile. A new window pops up on the screen as the image below:
So what we require to know is the command for a particular symbol. Believe me, it’s the easiest part as these commands are damn easy. For example if you want to write ρ, just type $rho$ in the command line and you will get the symbol. For the list of commands for all the mathematical symbols click here.
Display mode
Display mode helps in typing the mathematical equations in lines different from text. The equation appears at the center of the line with automatic numbering in order of their occurrence. Equation and equation* environments typeset single line equations. The only difference between the two is that no automatic numbering of the equations occurs in the equation* environment.
align environment helps in writing multiple equations and also in their automatic alignment. Align environment numbers every line separately. Single equations have to be separated by \ and equations in subsequent lines get aligned at ampersand (symbol &).
To remove numbering from the equations, just use align* environment. It’s just that simple.
Now let’s dive deeper and have some more fun with typesetting complex equations in just a few easy steps!! Remember that we choose different modes only because of the different appearances we want for our mathematical chunks, basic commands are the same in both the modes.
Adding superscripts and subscripts
Summation, Integral and fraction
Fractions are written as frac{}{}, in first braces numerator is added and in the second ones, the denominator is inserted. For integrals, we write int_{lower limit}^{upper limit} and then operand. Similarly, for summation, write sum_{lower limit}^{upper limit} operand. It is not mandatory to insert lower and upper limits.
How to break up long formulas
TeX does not break long formulas on its own as it is tricky. However there are some general guidelines for it. Here are some possible breaking points:
- Right before an equal sign or equivalent sign
- Before a plus or minus sign
- Between two large chunks that are multiplied
Eqnarray environment serves this purpose. The ampersand (&) is inserted both before and after the sign of equality. The use of two backslashes (\\) terminates the line. In the next line before writing other terms preceded by an operator, two ampersands are inserted.
Matrices
Before and after typing the command to insert a matrix, one needs to add two dollar sign ($$) compulsorily. There are only slight variations in the command for typing different matrices.
- begin{matrix} – matrix without brackets
- begin{pmatrix}- matrix with paranthesis
- begin{bmatrix}- matrix with square brackets
- begin{Bmatrix}- matrix with curly brackets
- begin{vmatrix}- matrix with rectangular line boundary
- begin{Vmatrix}- matrix with double vertical bars
Previous Next copyright@EasMyPhD 2020
No responses yet