LaTeX is a typesetting system used to create documents such as reports, papers, and other technical documents. Instead of formatting a document using buttons and menus, you write text and commands that describe how the document should look.
LaTeX is especially useful for documents that contain mathematical equations, scientific notation, tables, and other structured content.
A simple LaTeX document might look like this:
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
The \documentclass command specifies the type of document, while the document environment contains the main content.
LaTeX uses commands that begin with a backslash (\). Commands are used to format text and tell LaTeX how different parts of the document should be displayed.
For example:
\textbf{This is bold}
creates bold text, while:
\textit{This is italic}
creates italic text.
LaTeX also uses special characters for different purposes. Characters such as %, $, &, _, {, and } have special meanings and may need a backslash before them when you want to display them as normal text.
LaTeX provides commands for organizing a document into sections and subsections. The \section command creates a main section of a document.
For example:
\section{Introduction}
This is the introduction.
\section{Conclusion}
This is the conclusion.
You can also create smaller sections using the \subsection command:
\subsection{Background}
LaTeX automatically numbers sections and subsections. To create an unnumbered section, place an asterisk after the command name:
\section*{Conclusion}
One of the most useful features of LaTeX is its ability to create mathematical expressions. Mathematical content can be placed directly inside a sentence using dollar signs.
For example:
The equation $x^2 + y^2 = z^2$ is an example.
For a mathematical expression that should appear on its own line, you can use square brackets:
\[
x^2 + y^2 = z^2
\]
LaTeX also provides commands for common mathematical structures. For example, \frac creates a fraction and \sqrt creates a square root.
\[
\sqrt{x}
\]
LaTeX can create both unordered and numbered lists. An unordered list uses the itemize environment.
\begin{itemize}
\item First item
\item Second item
\item Third item
\end{itemize}
A numbered list uses the enumerate environment:
\begin{enumerate}
\item First item
\item Second item
\item Third item
\end{enumerate}
Each item begins with the \item command. Environments begin with \begin{...} and end with \end{...}, allowing LaTeX to treat the content inside them in a specific way.