Time needed: 5 minutes
Prerequisites: Access to LaTeX Cloud Studio
What you’ll learn: Basic document structure, compiling, and viewing output
Prerequisites: Access to LaTeX Cloud Studio
What you’ll learn: Basic document structure, compiling, and viewing output
The Simplest LaTeX Document
Every LaTeX journey begins with a simple “Hello World” document. Here’s the absolute minimum you need:Understanding Each Line
Let’s break down what each line does:1. Document Class
article class is perfect for:
- Short documents
- Academic papers
- Reports
- General documents
report- for longer documents with chaptersbook- for books with parts, chapters, and sectionsletter- for formal lettersbeamer- for presentations
2. Document Environment
Creating a More Complete Document
Let’s expand our document with common elements:How to Create This in LaTeX Cloud Studio
- Open LaTeX Cloud Studio in your browser
- Create a new document using the “New Document” button
- Copy and paste the code above into the editor
- Click “Compile” to generate your PDF
- View the result in the preview pane
The Document Structure
A LaTeX document has two main parts:1. The Preamble
Everything before\begin{document} is the preamble. This is where you:
- Set the document class
- Load packages (extensions)
- Define document information (title, author, date)
- Set up custom commands
- Configure document settings
2. The Document Body
Everything between\begin{document} and \end{document} is your content. This includes:
- Text
- Sections and chapters
- Equations
- Figures and tables
- References
Your First Compilation
When you compile a LaTeX document, here’s what happens:- LaTeX reads your source file (.tex)
- Processes the commands and markup
- Generates a PDF (or other output format)
- Shows any errors if something went wrong
Common Beginner Mistakes
Adding More Elements
Comments
Use% to add comments that won’t appear in the output:
Paragraphs
Leave a blank line to start a new paragraph:Basic Formatting
Practice Exercise
Try creating this document:What’s Next?
Now that you’ve created your first document, you can:- Experiment with different document classes - Try
reportorbook - Add more sections - Use
\subsectionand\subsubsection - Include mathematics - Learn about math mode
- Format your text - Explore fonts and styling
- Add images and tables - Make your documents visual
Quick Reference
| Command | Purpose | Example |
|---|---|---|
\documentclass{} | Set document type | \documentclass{article} |
\begin{document} | Start document content | Required |
\end{document} | End document content | Required |
\title{} | Set document title | \title{My Report} |
\author{} | Set author name | \author{Jane Doe} |
\date{} | Set date | \date{\today} |
\maketitle | Create title block | Place after \begin{document} |
\section{} | Create a section | \section{Introduction} |
% | Comment | % This is a note |
Tips for Success
Congratulations! You’ve created your first LaTeX document. This is the foundation for creating professional documents of any complexity. Continue with Choosing a LaTeX Compiler to understand how LaTeX processes your documents.
