LaTeX Basics

LaTeX is a typesetting system commonly used for producing scientific and mathematical documents due to its powerful handling of formulas and bibliographies. It is especially popular in academia for its ability to produce high-quality documents with complex formatting.

1. Introduction to LaTeX

LaTeX is a document preparation system based on the TeX typesetting system. It is widely used for technical and scientific documentation, including academic papers, theses, and reports.

2. Basic Document Structure

Every LaTeX document begins with a document class declaration and ends with the\end{document}command. The basic structure is:

\documentclass{article}

    \begin{document}
    Hello, world!
    \end{document}

3. Sections and Subsections

To organize your document, you can use sections, subsections, and subsubsections:

\section{Introduction}
    This is the introduction section.

    \subsection{Background}
    This is the background subsection.

    \subsubsection{Details}
    This is a subsubsection.

4. Formatting Text

LaTeX provides various commands for formatting text:

5. Lists

You can create ordered and unordered lists in LaTeX:

% Unordered list
    \begin{itemize}
        \item First item
        \item Second item
    \end{itemize}

    % Ordered list
    \begin{enumerate}
        \item First item
        \item Second item
    \end{enumerate}

6. Mathematics

LaTeX excels at formatting mathematical expressions. Inline math is enclosed in$ ... $, and displayed equations use\[ ... \]:

% Inline math
    The quadratic formula is $ax^2 + bx + c = 0$.

    % Displayed equation
    \[
    E = mc^2
    \]

7. Figures and Tables

To include figures and tables, use thefigureandtableenvironments:

% Figure
    \begin{figure}[h!]
        \centering
        \includegraphics[width=0.5\textwidth]{example-image}
        \caption{Example figure}
        \label{fig:example}
    \end{figure}

    % Table
    \begin{table}[h!]
        \centering
        \begin{tabular}{|c|c|}
        \hline
        Column 1 & Column 2 \\
        \hline
        Cell 1 & Cell 2 \\
        Cell 3 & Cell 4 \\
        \hline
        \end{tabular}
        \caption{Example table}
        \label{tab:example}
    \end{table}

8. References and Citations

LaTeX handles references and citations through thebibtexsystem:

% Bibliography section
    \bibliographystyle{plain}
    \bibliography{references}

9. Including Packages

Packages extend LaTeX's functionality. Include a package with\usepackage{package-name}:

\usepackage{graphicx}
    \usepackage{amsmath}

You are here for...

I think you are here to get to know me.

🌐 Connect with me across platforms.

🤝 Hit me up on these links, and let's turn ideas into action!