Basic Syntax

Quick rewind: $\LaTeX$ syntax essentials

Document Structure

Preamble

Used to define global settings, create custom commands or environments, loading packages and much more.

\documentclass[12pt,a4paper]{article}

\usepackage{amsmath} % For advanced math typesetting
\usepackage{graphicx} % To include images
\usepackage{hyperref} % For clickable cross-references and URLs

Main Document

Enclosed between \begin{document} and \end{document}. This is where you write your text, insert figures and tables, and create sections or chapters.

Within the main content, you can structure your document using sectioning commands, such as:

\section{Introduction}
\subsection{\LaTeX is amazing!}
\subsubsection{How to pronounce it}

Composition

A well structured document can contain:

Text Formatting

\textbf{Some text} $\to$ Some text

\textit{Some other text} $\to$ Some other text

\underline{Yeah you got it} $\to$ Yeah you got it

Text Formatting

Since WYSWYG approach is no longer contemplated, of course we have to find some other way to go to a new line.

How can we do this? Just use \\\\!

Since WYSWYG approach is no longer contemplated, of course
we have to find some other way to go to a new line.\\
How can we do this?

Lists

In $\LaTeX$ there are three types of lists:

Lists

itemize lists are used to create unordered and bulleted lists.

\begin{itemize}
  \item First item
  \item Second item
  \item Third item
\end{itemize}
Lists

enumerate lists are numbered and ordered lists.

\begin{enumerate}
  \item First item
  \item Second item
  \item Third item
\end{enumerate}
  1. First item
  2. Second item
  3. Third item
Lists

description lists are rarely used, but can be very helpful in some specific situations. Each item has a label and corresponding content.

\begin{description}
  \item[Term 1] Definition or explanation of the first term.
  \item[Term 2] Definition or explanation of the second term.
  \item[Term 3] Definition or explanation of the third term.
\end{description}
  1. First item: description 1
  2. Second item: description 2
  3. Third item: description 3

All the lists that we've seen can be nested, so that is possible to define a multi-level list.

Basic Math mode

Math mode is used to typeset mathematical expressions and symbols. It's possible to write complex mathematical expressions with some practice and knowledge of the syntax!

$$\int\int_{T} (2\sin x-3y^3+5) dx\ dy$$

There are two different types of math mode: inline and display.

inline math mode

Used for typesetting mathematical expressions within a line of text. To enter inline math mode you can use a pair of dollar signs ($).

The Pythagorean theorem states that $a^2 + b^2 = c^2$

The Pythagorean theorem states that $a^2 + b^2 = c^2$

display math mode

Used for typesetting mathematical expressions on a separate line, centered and with extra vertical space above and below. You can enter display math mode using a pair of double dollar signs ($$).

$$\int\int_{T} (2\sin x-3y^3+5) dx\ dy$$

$$\int\int_{T} (2\sin x-3y^3+5) dx\ dy$$