> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Learn LaTeX in 30 minutes

> The quickest way to learn LaTeX. Create your first professional document in just 30 minutes with our beginner-friendly tutorial.

This tutorial gets you from zero to a working LaTeX document in about 30 minutes. You will create a document, add structure, format text, write equations, insert images, build tables, and finish with a practical next-step path.

<Tip>
  This is the main beginner tutorial we want search engines and new readers to find first. If you want a broader orientation to tools and learning workflow, use the companion guide [How to Start Learning LaTeX in 2026](/blog/getting-started-latex-2026).
</Tip>

<Info>
  **Time to complete**: 30 minutes\
  **Prerequisites**: None\
  **What you'll learn**: Document creation, formatting, images, math, and tables
</Info>

## What You Will Build

* A minimal LaTeX document that compiles cleanly
* A title block, sections, and basic text formatting
* Lists, equations, images, and tables
* A practical path into longer guides, templates, and project workflows

## What is LaTeX?

LaTeX (pronounced "LAH-tek" or "LAY-tek") is a document preparation system that produces professional-quality documents. Unlike word processors where you see the final result as you type, LaTeX uses plain text files with markup commands that get compiled into beautiful documents.

### Why use LaTeX?

Think of LaTeX like HTML for documents. You write structured text, and LaTeX handles all the formatting consistently and professionally. It's especially powerful for:

* Academic papers and theses
* Mathematical and scientific documents
* Books and long-form content
* Professional reports and presentations

## Your First LaTeX Document

Let's dive right in! Here's the simplest possible LaTeX document:

<Tabs>
  <Tab title="Code">
    <CodeGroup>
      ```latex basic-document.tex theme={null}
      \documentclass{article}
      \begin{document}
      Hello, LaTeX!
      \end{document}
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Rendered output">
    <div className="latex-preview-shell">
      <div className="latex-preview-paper latex-preview-paper--narrow">
        <p className="latex-preview-paragraph">Hello, LaTeX!</p>
      </div>
    </div>
  </Tab>
</Tabs>

### Understanding the Structure

Every LaTeX document has two main parts:

1. **Preamble** (before `\begin{document}`): Document settings and package imports
2. **Body** (between `\begin{document}` and `\end{document}`): Your actual content

<Tip>
  LaTeX commands always start with a backslash `\` and are case-sensitive.
</Tip>

## Adding Title and Author

Let's make our document more professional by adding metadata:

<Tabs>
  <Tab title="Code">
    <CodeGroup>
      ```latex document-with-title.tex theme={null}
      \documentclass{article}
      \title{My First LaTeX Document}
      \author{Your Name}
      \date{\today}

      \begin{document}
      \maketitle

      Welcome to my first LaTeX document! This is an exciting journey into professional document preparation.

      \end{document}
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Rendered output">
    <div className="latex-preview-shell">
      <div className="latex-preview-paper latex-preview-paper--narrow">
        <h3 className="latex-preview-title">My First LaTeX Document</h3>
        <p className="latex-preview-meta">Your Name</p>
        <p className="latex-preview-meta">March 27, 2026</p>

        <hr className="latex-preview-rule" />

        <p className="latex-preview-paragraph">
          Welcome to my first LaTeX document! This is an exciting journey into
          professional document preparation.
        </p>
      </div>
    </div>
  </Tab>
</Tabs>

The `\maketitle` command creates a nicely formatted title block using the information you provided in the preamble.

## Text Formatting

LaTeX provides simple commands for text formatting:

<Tabs>
  <Tab title="Code">
    <CodeGroup>
      ```latex text-formatting.tex theme={null}
      \documentclass{article}
      \begin{document}

      \textbf{Bold text} is important.

      \textit{Italic text} adds emphasis.

      \underline{Underlined text} stands out.

      \texttt{Monospace text} for code.

      You can also \textbf{\textit{combine}} formats!

      \end{document}
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Rendered output">
    <div className="latex-preview-shell">
      <div className="latex-preview-paper latex-preview-paper--narrow">
        <p className="latex-preview-paragraph"><strong>Bold text</strong> is important.</p>
        <p className="latex-preview-paragraph"><em>Italic text</em> adds emphasis.</p>
        <p className="latex-preview-paragraph"><span style={{ textDecoration: "underline" }}>Underlined text</span> stands out.</p>
        <p className="latex-preview-paragraph"><code className="latex-preview-inline-code">Monospace text</code> for code.</p>

        <p className="latex-preview-paragraph">
          You can also <strong><em>combine</em></strong> formats!
        </p>
      </div>
    </div>
  </Tab>
</Tabs>

### Paragraphs and Line Breaks

* Leave a blank line to start a new paragraph
* Use `\\` to force a line break within a paragraph
* Use `\newpage` to start a new page

## Creating Lists

LaTeX makes it easy to create both bullet points and numbered lists:

<Tabs>
  <Tab title="Code">
    <CodeGroup>
      ```latex lists.tex theme={null}
      \documentclass{article}
      \begin{document}

      \section{Shopping List}
      \begin{itemize}
          \item Milk
          \item Eggs
          \item Bread
          \item LaTeX tutorials
      \end{itemize}

      \section{Recipe Steps}
      \begin{enumerate}
          \item Mix ingredients
          \item Bake for 30 minutes
          \item Let cool
          \item Enjoy!
      \end{enumerate}

      \end{document}
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Rendered output">
    <div className="latex-preview-shell">
      <div className="latex-preview-paper latex-preview-paper--narrow">
        <h4 className="latex-preview-section-title">1 Shopping List</h4>

        <ul className="latex-preview-list">
          <li>Milk</li>
          <li>Eggs</li>
          <li>Bread</li>
          <li>LaTeX tutorials</li>
        </ul>

        <h4 className="latex-preview-section-title">2 Recipe Steps</h4>

        <ol className="latex-preview-numbered-list">
          <li>Mix ingredients</li>
          <li>Bake for 30 minutes</li>
          <li>Let cool</li>
          <li>Enjoy!</li>
        </ol>
      </div>
    </div>
  </Tab>
</Tabs>

## Adding Math Equations

This is where LaTeX truly shines! You can add math inline with `$...$` or as display equations with `\[...\]`:

<Tabs>
  <Tab title="Code">
    <CodeGroup>
      ```latex math-examples.tex theme={null}
      \documentclass{article}
      \begin{document}

      Einstein's famous equation is $E = mc^2$.

      The quadratic formula is:
      \[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]

      Here's a more complex example:
      \[\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}\]

      \end{document}
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Rendered output">
    <div className="latex-preview-shell">
      <div className="latex-preview-paper latex-preview-paper--narrow">
        <p className="latex-preview-paragraph">Einstein's famous equation is E = mc².</p>
        <p className="latex-preview-paragraph">The quadratic formula is:</p>

        <div className="latex-preview-display-math">
          x = (-b ± √(b² - 4ac)) / 2a
        </div>

        <p className="latex-preview-paragraph">Here's a more complex example:</p>

        <div className="latex-preview-display-math">
          ∫₀^∞ e<sup>-x²</sup> dx = √π / 2
        </div>
      </div>
    </div>
  </Tab>
</Tabs>

<Info>
  LaTeX has hundreds of mathematical symbols and operators. Check our [math reference guide](/learn/reference/symbols) for a complete list.
</Info>

## Inserting Images

To add images to your document, you'll need the `graphicx` package:

<CodeGroup>
  ```latex images.tex theme={null}
  \documentclass{article}
  \usepackage{graphicx}

  \begin{document}

  \begin{figure}[h]
      \centering
      \includegraphics[width=0.5\textwidth]{example-image}
      \caption{A sample image in LaTeX}
      \label{fig:sample}
  \end{figure}

  As we can see in Figure \ref{fig:sample}, images are easy to add!

  \end{document}
  ```
</CodeGroup>

### Image Positioning Options

* `[h]` - here (approximately)
* `[t]` - top of page
* `[b]` - bottom of page
* `[p]` - separate page for floats

## Creating Tables

Tables in LaTeX are powerful but need a bit of practice:

<Tabs>
  <Tab title="Code">
    <CodeGroup>
      ```latex simple-table.tex theme={null}
      \documentclass{article}
      \begin{document}

      \begin{table}[h]
      \centering
      \begin{tabular}{|l|c|r|}
      \hline
      \textbf{Item} & \textbf{Quantity} & \textbf{Price} \\
      \hline
      Apples & 5 & \$2.50 \\
      Bananas & 12 & \$3.00 \\
      Oranges & 8 & \$4.20 \\
      \hline
      \textbf{Total} & \textbf{25} & \textbf{\$9.70} \\
      \hline
      \end{tabular}
      \caption{Fruit inventory}
      \end{table}

      \end{document}
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Rendered output">
    <div className="latex-preview-shell">
      <div className="latex-preview-paper latex-preview-paper--narrow">
        <table className="latex-preview-table">
          <thead>
            <tr>
              <th>Item</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td>Apples</td>
              <td>5</td>
              <td>\$2.50</td>
            </tr>

            <tr>
              <td>Bananas</td>
              <td>12</td>
              <td>\$3.00</td>
            </tr>

            <tr>
              <td>Oranges</td>
              <td>8</td>
              <td>\$4.20</td>
            </tr>

            <tr>
              <td><strong>Total</strong></td>
              <td><strong>25</strong></td>
              <td><strong>\$9.70</strong></td>
            </tr>
          </tbody>
        </table>

        <p className="latex-preview-table-caption">Table 1: Fruit inventory</p>
      </div>
    </div>
  </Tab>
</Tabs>

### Table Column Alignment

* `l` - left aligned
* `c` - centered
* `r` - right aligned
* `|` - vertical line

## Document Structure

For longer documents, use sections to organize your content:

<CodeGroup>
  ```latex document-structure.tex theme={null}
  \documentclass{article}
  \begin{document}

  \tableofcontents
  \newpage

  \section{Introduction}
  This is the introduction to my document.

  \subsection{Background}
  Some background information here.

  \subsection{Objectives}
  What we aim to achieve.

  \section{Methods}
  How we'll do it.

  \section{Conclusion}
  What we learned.

  \end{document}
  ```
</CodeGroup>

The `\tableofcontents` command automatically generates a table of contents based on your sections!

## Comments in LaTeX

Use `%` to add comments that won't appear in the output:

```latex theme={null}
\documentclass{article}
\begin{document}

This text will appear. % This comment won't

% You can also have full-line comments
% They're great for:
% - TODO notes
% - Temporarily disabling content
% - Explaining complex code

\end{document}
```

## Common Packages

Extend LaTeX's functionality with packages. Here are essential ones:

```latex theme={null}
\documentclass{article}
% Essential packages
\usepackage{graphicx}  % Images
\usepackage{amsmath}   % Advanced math
\usepackage{hyperref}  % Clickable links
\usepackage{geometry}  % Page margins
\usepackage{enumitem}  % Better lists
\usepackage{xcolor}    % Colors

\begin{document}
% Your content here
\end{document}
```

## Troubleshooting Common Errors

<Warning>
  LaTeX errors can be cryptic. Here are the most common ones and how to fix them:
</Warning>

### Missing \$ inserted

**Problem**: Math mode content outside math mode\
**Solution**: Wrap math symbols in `$...$`

### Undefined control sequence

**Problem**: Misspelled command or missing package\
**Solution**: Check spelling and load required packages

### Missing \begin{document}

**Problem**: Content before document begins\
**Solution**: Move content after `\begin{document}`

## Your Complete First Document

Let's put it all together! Here's a complete document showcasing everything you've learned:

<CodeGroup>
  ```latex complete-document.tex theme={null}
  \documentclass{article}
  \usepackage{graphicx}
  \usepackage{amsmath}
  \usepackage{hyperref}

  \title{My LaTeX Journey}
  \author{Your Name}
  \date{\today}

  \begin{document}
  \maketitle
  \tableofcontents
  \newpage

  \section{Introduction}
  Welcome to my first complete LaTeX document! I've learned how to create professional documents with ease.

  \section{What I've Learned}

  \subsection{Text Formatting}
  I can make text \textbf{bold}, \textit{italic}, and \underline{underlined}. I can even \textbf{\textit{combine}} them!

  \subsection{Mathematics}
  LaTeX makes math beautiful. Here's the quadratic formula:
  \[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]

  \subsection{Lists and Tables}
  \begin{itemize}
      \item Create bullet points
      \item Make numbered lists
      \item Build professional tables
  \end{itemize}

  \begin{table}[h]
  \centering
  \begin{tabular}{|l|c|}
  \hline
  \textbf{Feature} & \textbf{Learned} \\
  \hline
  Basic formatting & ✓ \\
  Mathematics & ✓ \\
  Images & ✓ \\
  Tables & ✓ \\
  \hline
  \end{tabular}
  \caption{My LaTeX progress}
  \end{table}

  \section{Conclusion}
  In just 30 minutes, I've gone from zero to creating professional documents with LaTeX. The journey continues!

  \end{document}
  ```
</CodeGroup>

## Next Steps

Congratulations! You've just created your first LaTeX documents. Here's what to explore next:

<CardGroup cols={2}>
  <Card title="Document Classes" icon="file" href="/learn/reference/document-classes">
    Learn about article, report, book, and more
  </Card>

  <Card title="Advanced Math" icon="square-root-variable" href="/learn/latex/mathematics/basics">
    Matrices, theorems, and complex equations
  </Card>

  <Card title="Bibliography" icon="book" href="/learn/latex/bibliography-citations">
    Manage citations and references
  </Card>

  <Card title="Custom Styling" icon="paintbrush" href="/learn/latex/text-formatting">
    Fonts, colors, and page layouts
  </Card>
</CardGroup>

## Recommended Deep Dives

* [Sections and chapters](/learn/latex/document-structure/sections-and-chapters)
* [Table of contents](/learn/latex/document-structure/table-of-contents)
* [Hyperlinks](/learn/latex/document-structure/hyperlinks)
* [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide)
* [Choosing citation styles](/learn/latex/bibliography/choosing-citation-styles)
* [LaTeX in French](/learn/latex/languages/french)
* [LaTeX in Chinese](/learn/latex/languages/chinese)
* [Align and multline environments](/learn/latex/mathematics/align-and-multline-environments)

## Quick Reference Card

Keep this handy as you write:

| Command      | Purpose      | Example                   |
| ------------ | ------------ | ------------------------- |
| `\textbf{}`  | Bold text    | `\textbf{Important}`      |
| `\textit{}`  | Italic text  | `\textit{emphasis}`       |
| `\section{}` | New section  | `\section{Introduction}`  |
| `$...$`      | Inline math  | `$E = mc^2$`              |
| `\[...\]`    | Display math | `\[x = \frac{a}{b}\]`     |
| `\\`         | Line break   | `First line\\Second line` |
| `%`          | Comment      | `% This is a comment`     |

***

<Tip>
  **Pro tip**: Save this page as a bookmark! You'll refer back to these basics often as you learn more advanced features.
</Tip>

Ready to dive deeper? Continue with our [comprehensive LaTeX basics guide](/learn/latex/basics/creating-first-document) or explore [specific topics](/learn/latex/how-to/first-project) that interest you!

## Start in LaTeX Cloud Studio

<CardGroup cols={2}>
  <Card title="Open in LaTeX Cloud Studio" icon="cloud" href="https://app.latex-cloud-studio.com/?utm_source=resources&utm_medium=card&utm_campaign=docs_open_app&utm_content=latex_in_30_minutes_open_app">
    Write, compile, and iterate directly in your browser.
  </Card>

  <Card title="Start from Article Template" icon="file-text" href="/templates/article">
    Use a ready-made template, then adapt it to your content.
  </Card>
</CardGroup>
