LaTeX is pronounced "lah-tek".
LaTeX stands for Lamport TeX or Lamport Typesetting System.

Beautiful typesetting made simple

Free online LaTeX editor: https://latexbase.com/

Save a text document with a .tex file format. The LaTeX compiler will interpret that text file and generate a .pdf file from it.

Minimal document:

  Hello World!


Commands start with a \ (backslash) and may be followed by {options}.



An environment defines a section of the document with shared layout settings.

You define environments with "begin" and "end" commands


Environments must be nested like a valid xml document.

The "document" environment must be the root environment of all other environments.


The area before the \begin{document} command. Global variables, like Title, can be set here.


Start a line with %, everything to the end of line will be ignored by the compiler.

% my comments

You can also use the "comment" package to create whole environments that will be ignored.



Sections and subsections will be automatically numbered.



You can import additional LaTeX packages.



To subtitle an image or figure

  \caption{A boat.}

Figure \ref{fig:boat1} shows a boat.

Two images with individual subtitles and one shared subtitle

    \caption{More coffee.}
  \caption{The same cup of coffee. Two times.}

Table Of Contents





Dummy text


Dummy text



List of tables, list of figures.


  \caption{Dummy figure}

  \caption{Dummy table}



Document Class

Document classes set default global layout settings for the document.

Ex: "article", "book"


The "article" document class will automatically add page numbers to the pdf.


\title{My first document}
\author{John Doe}


  Hello World!

You can skip numbering a page, and then restart numbering, like this. Note that numbering will restart at 1.


\title{My first document}
\author{John Doe}


  Hello World!



Equation is a built-in environment. Use "equation" to format mathematical equations in "display mode". Display mode means the equation will be shown on its own line.

    f{x} = x^2

Each equation will be automatically numbered for referencing.

You can only write one equation per "equation" environment.

Alternate formats:


Use the amsmath package to make not-numbered equations.

    f{x} = x^2

It will also align multiple statements along the zero-width & (ampersand) character. The \\ (double backslash) marks a line break.

    1 + 2 &= 3\\
    1 &= 3 - 2


Instead of enclosing your equations in an environment, you can use the $ (dollar sign) format to write equations inline with your text.

    Words $f(x) = x^2$ Words

Or you can use the \( \) format.


The well known Pythagorean theorem \(x^2 + y^2 = z^2\) was 
proved to be invalid for other exponents. 

Or use the inline math environment


The well known Pythagorean theorem \begin{math}x^2 + y^2 = z^2\end{math} was 
proved to be invalid for other exponents.


x to the power of 2



square root of x



1 over x



integral from a to b of one-third times x to the third power

$\int^a_b \frac{1}{3}x^3$

The a and b limits can be written in either order, but the one with ^ prefix will go on top and the _ prefix on the bottom.

This one displays the limits at the top and bottom of the integral sign, instead of inset within it.

$\int\limits^a_b \frac{1}{3}x^3$


n choose k



Brackets, parentheses, and curly braces that will resize to surround the matrix or equation or whatever.

1 & 0\\
0 & 1


Subscript Superscript

^ for superscript
_ for subscript

\[ a_1^2 + a_2^2 = a_3^2 \]

Surround long scripts with brackets

\[ a_{ij} + a_{kl} = b \]

Complex example

\[ \sum_{i=1}^{\infty} \frac{1}{n^s} 
= \prod_p \frac{1}{1 - p^{-s}} \]

Greek Letters

Lowercase | Uppercase | Variable

\alpha | A
\beta | B
\gamma | \Gamma
\delta | \Delta
\epsilon | E | \varepsilon
\zeta | Z
\eta | H
\theta | \Theta | \vartheta
\iota | I
\kappa | K
\lambda | \Lambda
\mu | M
\nu | N
\xi | \Xi
o | O
\pi | \Pi
\rho | P | \varrho
\sigma | \Sigma
\tau | T
\upsilon | \Upsilon
\phi | \Phi | \varphi
\chi | X
\psi | \Psi
\omega | \Omega

Binary Operators


Relation Operators


Misc Operators

\int = integral
\oint = o integral
\sum = big epsilon
\prod = big pi
\coprod = upside down big pi

\infty = infinity
\exists = backwards E
\nexists = crossed out backwards E
\forall = upside down A
\nabla = upside down triangle
\cdots = three dots in a row
\square = empty white square
\blacksquare = filled black square
\surd = start of root sign
\triangle = empty white triangle


Single Line | Double Line

\leftarrow | \Leftarrow
\rightarrow | \Rightarrow
\leftrightarrow | \Leftrightarrow
\uparrow | \Uparrow
\downarrow | \Downarrow

Custom Operators

Command "DeclareMathOperator" will define a custom operator that you can use throughout your document. The operator you define will be replaced (compiled to) whatever text or equation you define.

User-defined operator for matrices with Real entries
x \in \Mr

1 & 0\\
0 & 1



Create a text file saved with .bib file format.
See BibTeX generator for full format details.


AUTHOR="John Doe",
TITLE="The Book without Title",
PUBLISHER="Dummy Publisher",


The "bibliography" command both gives the filename (sans file extension) of our bibliography.

The "bibliographystyle" command gives the format for displaying the bibliography.

The "displaybibliography" command prints the bibliography.



Random citation \cite{DUMMY:1} embeddeed in text.