# Common LaTeX Errors and How to Fix Them Source: https://resources.latex-cloud-studio.com/blog/common-latex-errors-fixes Fix common LaTeX errors fast, including Missing $ inserted, undefined control sequence, content after \end{document} is ignored, and other compile failures. Every LaTeX user eventually runs into compile errors. This guide explains common LaTeX error messages, including `Missing $ inserted`, `Undefined control sequence`, and `Content after \end{document} is ignored`, then shows how to fix them with clear examples.## How to Read LaTeX Error MessagesBefore diving into specific errors, let's understand how to read error messages:``` ! Missing $ inserted. $ l.15 The area is x^ 2 square units. ```| Part | Meaning | | - | - | | `!` | Indicates an error | | `Missing $ inserted` | The error description | | `l.15` | Line number where the error occurred | | `x^` | The specific text causing the problem |> [!TIP] > > **Pro tip:** In LaTeX Cloud Studio, click on error messages to jump directly to the problematic line.***## Error 1: Missing \$ inserted**The most common LaTeX error.** This happens when you use math symbols outside of math mode.### The Error``` ! Missing $ inserted. $ l.10 The formula x^2 + y^2 = z^ 2 shows... ```### Why It HappensCharacters like `^`, `_`, `\sum`, `\int`, and Greek letters (`\alpha`, `\beta`) only work inside math mode.### The Fix**Before (Wrong):**```latex example.tex theme=\{null} The formula x^2 + y^2 = z^2 shows the Pythagorean theorem. The value is approximately \pi. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-common-latex-errors-fixes-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=blog_common_latex_errors_fixes) **After (Correct):**```latex example.tex theme=\{null} The formula $x^2 + y^2 = z^2$ shows the Pythagorean theorem. The value is approximately $\pi$. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-common-latex-errors-fixes-02/page-1.svg)
### Quick Reference| Symbol Type | Requires Math Mode? | Example | | - | - | - | | Superscripts (`^`) | Yes | `$x^2$` | | Subscripts (`_`) | Yes | `$x_i$` | | Greek letters | Yes | `$\alpha$, $\beta$` | | Math operators | Yes | `$\sum$, $\int$` | | Regular text | No | `Hello world` |***## Error 2: Undefined control sequenceThis error occurs when LaTeX doesn't recognize a command you've used.### The Error``` ! Undefined control sequence. l.12 \begn {document} ```### Why It Happens- Typo in command name - Missing package that defines the command - Using a command in the wrong context### The Fix**Common typos:**```latex example.tex theme=\{null} % Wrong \begn{document} \sectoin{Title} \includ{file} % Correct \begin{document} \section{Title} \include{file} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is structurally incomplete and cannot be compiled honestly as a standalone document. It shows document-boundary syntax rather than a visible page result.\
**Missing package:**```latex example.tex theme=\{null} % Wrong - using \includegraphics without graphicx \documentclass{article} \begin{document} \includegraphics{image} % Error! \end{document} % Correct - add the package \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics{image} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Common Commands and Required Packages| Command | Required Package | | - | - | | `\includegraphics` | `graphicx` | | `\url`, `\href` | `hyperref` | | `\toprule`, `\midrule` | `booktabs` | | `\align` environment | `amsmath` | | `\textcolor` | `xcolor` | | `\SI`, `\si` | `siunitx` |***## Error 3: Missing } insertedLaTeX expects every `{` to have a matching `}`.### The Error``` ! Missing } inserted. } l.8 \textbf{This is bold text ```### Why It Happens- Forgot closing brace - Mismatched braces - Special character not escaped### The Fix**Before (Wrong):**```latex example.tex theme=\{null} \textbf{This is bold text \section{Introduction \textit{Nested \textbf{formatting} example ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**After (Correct):**```latex example.tex theme=\{null} \textbf{This is bold text} \section{Introduction} \textit{Nested \textbf{formatting} example} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-common-latex-errors-fixes-06/page-1.svg)
### Finding Mismatched BracesCount opening and closing braces—they should be equal:```latex example.tex theme=\{null} % Use editor brace matching (hover over { to find matching }) \textbf{This is \textit{nested} text} ^ ^ |____________________________| ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [!TIP] > > **LaTeX Cloud Studio tip:** Enable brace matching in settings to highlight matching pairs.***## Error 4: File not foundLaTeX cannot locate a file you're trying to include.### The Error``` ! LaTeX Error: File `myimage.png' not found. Type X to quit or to proceed, or enter new name. (Default extension: png) ```### Why It Happens- File doesn't exist - Wrong file path - Wrong file name (case-sensitive!) - File extension issues### The Fix**Check file location:**```latex example.tex theme=\{null} % If your file structure is: % project/ % main.tex % images/ % diagram.png % Wrong \includegraphics{diagram} % Correct \includegraphics{images/diagram} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
**Check file name (case-sensitive on Linux/Mac):**```latex example.tex theme=\{null} % File is named "Diagram.png" % Wrong (on Linux/Mac) \includegraphics{diagram} % Correct \includegraphics{Diagram} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
**For bibliography files:**```latex example.tex theme=\{null} % Wrong \bibliography{References} % But file is references.bib % Correct \bibliography{references} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
***## Error 5: Environment undefinedYou're trying to use an environment that doesn't exist or isn't loaded.### The Error``` ! LaTeX Error: Environment align undefined. ```### Why It Happens- Misspelled environment name - Missing package - Using environment incorrectly### The Fix**Misspelled environment:**```latex example.tex theme=\{null} % Wrong \begin{itemise} \end{itemise} % Correct \begin{itemize} \end{itemize} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Missing package for math environments:**```latex example.tex theme=\{null} % Wrong - align needs amsmath \documentclass{article} \begin{document} \begin{align} y &= mx + b \end{align} \end{document} % Correct \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} y &= mx + b \end{align} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Common Environments and Required Packages| Environment | Required Package | | - | - | | `align`, `gather`, `multline` | `amsmath` | | `lstlisting` | `listings` | | `minted` | `minted` | | `tikzpicture` | `tikz` | | `algorithm` | `algorithm2e` or `algorithmicx` |***## Error 6: Overfull/Underfull hboxThese are warnings (not errors) about line breaking issues.### The Warning``` Overfull \hbox (15.2pt too wide) in paragraph at lines 10--12 Underfull \hbox (badness 10000) in paragraph at lines 15--17 ```### Why It Happens- **Overfull**: Line is too long, extends into margin - **Underfull**: Line has too much space, looks stretched### The Fix**For overfull (too wide):**```latex example.tex theme=\{null} % Option 1: Allow hyphenation \usepackage[hyphens]{url} % Option 2: Use sloppypar for problematic paragraphs \begin{sloppypar} This paragraph contains a very long URL or technical term that LaTeX struggles to break properly. \end{sloppypar} % Option 3: Add manual break hints super\-cali\-fragi\-listic % Option 4: For URLs \usepackage{hyperref} \url{https://very-long-url-that-causes-problems.com/path} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-common-latex-errors-fixes-13/page-1.svg)
**For underfull (too sparse):**```latex example.tex theme=\{null} % Usually happens with \\ at paragraph end % Wrong This is the end of a paragraph.\\ % Correct This is the end of a paragraph. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-common-latex-errors-fixes-14/page-1.svg)
> [!WARNING] > > **Don't ignore these warnings!** Overfull boxes can cause text to extend beyond page margins, looking unprofessional in printed documents.***## Error 7: Missing \beginLaTeX can't find where your document content starts.### The Error``` ! LaTeX Error: Missing \begin{document}. ```### Why It Happens- Content before `\begin{document}` - Missing `\begin{document}` entirely - Encoding issues with invisible characters### The Fix**Content in preamble:**```latex example.tex theme=\{null} % Wrong \documentclass{article} \usepackage{amsmath} This text is in the wrong place! % Error here \begin{document} Actual content \end{document} % Correct \documentclass{article} \usepackage{amsmath} \begin{document} This text is in the right place! Actual content \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
**Check for invisible characters:**```latex example.tex theme=\{null} % Sometimes copy-paste introduces hidden characters % Delete and retype the line if you suspect this \documentclass{article} % Delete and retype this line \begin{document} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
***## Error 8: Too many }'sYou have more closing braces than opening ones.### The Error``` ! Too many }'s. l.15 } ```### Why It Happens- Extra closing brace - Deleted opening brace - Copy-paste error### The Fix**Find and remove the extra brace:**```latex example.tex theme=\{null} % Wrong \textbf{Some bold text}} % Correct \textbf{Some bold text} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Check for mismatched environments:**```latex example.tex theme=\{null} % Wrong \begin{itemize} \item First \end{enumerate} % Wrong environment! % Correct \begin{itemize} \item First \end{itemize} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
***## Error 9: Misplaced alignment tab character &The `&` character has special meaning in tables and math alignment.### The Error``` ! Misplaced alignment tab character &. l.10 Bread & butter ```### Why It Happens- Using `&` in regular text (it's reserved for tables) - Wrong number of `&` in a table row - `&` outside tabular environment### The Fix**In regular text, escape the ampersand:**```latex example.tex theme=\{null} % Wrong Bread & butter Smith & Jones LLC % Correct Bread \& butter Smith \& Jones LLC ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**In tables, check column count:**```latex example.tex theme=\{null} % Wrong - 3 columns defined, but 4 values in row \begin{tabular}{|l|c|r|} A & B & C & D \\ % Error! Too many & \end{tabular} % Correct \begin{tabular}{|l|c|r|l|} % 4 columns A & B & C & D \\ \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
***## Error 10: Dimension too largeA calculated dimension exceeds LaTeX's maximum.### The Error``` ! Dimension too large. l.25 \includegraphics[width=2\textwidth]{image} ```### Why It Happens- Image scaled too large - Infinite or very large calculation - Negative dimensions### The Fix**For images:**```latex example.tex theme=\{null} % Wrong \includegraphics[width=2\textwidth]{image} % Correct \includegraphics[width=\textwidth]{image} \includegraphics[width=0.8\textwidth]{image} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
**For spacing:**```latex example.tex theme=\{null} % Wrong - this creates infinite stretch \hspace{\fill}text\hspace{\fill} % Correct \hfill text \hfill ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-common-latex-errors-fixes-22/page-1.svg)
***## Bonus: General Debugging Tips### 1. Compile OftenDon't write 50 lines before compiling. Compile after each significant addition to catch errors early.### 2. Binary Search for ErrorsIf you have a mysterious error:```latex example.tex theme=\{null} % Comment out half your document \begin{document} First half of content %{ Second half of content %} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is structurally incomplete and cannot be compiled honestly as a standalone document. It shows document-boundary syntax rather than a visible page result.\
If it compiles, the error is in the second half. Repeat until you find the problematic line.### 3. Start FreshIf an error is truly mysterious:```latex example.tex theme=\{null} % Create minimal example \documentclass{article} \begin{document} % Paste suspicious code here \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### 4. Check Log FileThe `.log` file contains detailed information:``` This is pdfTeX, Version 3.141592653 ... ! Missing $ inserted. $ l.10 x^ 2 ```### 5. Clear Auxiliary FilesSometimes old `.aux`, `.log`, `.toc` files cause problems:```bash theme=\{null} # Delete auxiliary files and recompile rm *.aux *.log *.toc *.out ```## Quick Error Reference Table| Error Message | Likely Cause | Quick Fix | | - | - | - | | Missing \$ inserted | Math outside math mode | Add `$...$` | | Undefined control sequence | Typo or missing package | Check spelling, add package | | Missing } inserted | Unclosed brace | Add missing `}` | | File not found | Wrong path or name | Check path, case sensitivity | | Environment undefined | Missing package | Add required package | | Overfull hbox | Line too wide | Use `\sloppy` or break text | | Missing \begin | Content in preamble | Move text after `\begin{document}` | | Too many }'s | Extra closing brace | Remove extra `}` | | Misplaced & | & in regular text | Use `\&` to escape | | Dimension too large | Oversized element | Reduce size values |***## Need More Help?* Check our [LaTeX documentation](/learn/latex/basics/creating-first-document) * Browse [Stack Exchange TeX](https://tex.stackexchange.com) for specific issues * Use the [editor and AI assistance guide](/product/editor-and-ai-assistance) for LaTeX Cloud Studio troubleshooting workflows> [!NOTE] > > **LaTeX Cloud Studio advantage:** Our editor highlights errors in real-time and provides AI-powered suggestions to fix common issues automatically. # Switch from Word to LaTeX - Complete Beginner's Guide Source: https://resources.latex-cloud-studio.com/blog/from-word-to-latex-beginners-journey Learn how to switch from Microsoft Word to LaTeX. Step-by-step guide for academics, thesis writers, and researchers making the transition. Making the transition from Microsoft Word to LaTeX can feel daunting, especially when you're in the middle of writing a thesis or preparing for publication. This guide provides a realistic assessment of when and why to make the switch, along with practical steps to get started.## When Word Becomes the BottleneckMany researchers reach a point where Word's limitations become apparent:### Document Length and Stability- **Word struggles**: Documents over 50-100 pages become slow and unstable - **LaTeX excels**: Handles documents of any length efficiently - **Real impact**: PhD theses averaging 200+ pages benefit significantly### Mathematical Content- **Word's equation editor**: Limited functionality, inconsistent formatting - **LaTeX's math mode**: Professional typesetting, extensive symbol library - **Comparison**: `$\sum_{i=1}^{n} x_i$` vs clicking through multiple menus### Bibliography Management- **Word**: Manual formatting, inconsistent styles, broken links - **LaTeX + BibTeX/BibLaTeX**: Automatic formatting, style switching, robust cross-references### Cross-References and Numbering- **Common Word issue**: "Error! Reference source not found" - **LaTeX solution**: Automatic, reliable cross-referencing system## Realistic Assessment: Is LaTeX Right for You?### You Should Consider LaTeX If:✅ Writing documents > 20 pages regularly\ ✅ Including mathematical equations or chemical formulas\ ✅ Managing extensive bibliographies (>50 references)\ ✅ Collaborating with LaTeX users\ ✅ Submitting to journals with LaTeX templates\ ✅ Value consistent, professional formatting### Stick with Word If:❌ Writing short documents (\< 10 pages)\ ❌ Heavy collaboration with non-technical users\ ❌ Tight deadlines with no learning time\ ❌ Primarily visual/creative content\ ❌ Industry requires Word compatibility## Common Misconceptions About LaTeX### "LaTeX is only for mathematicians"**Reality**: Used across disciplines - humanities, social sciences, business- History dissertations with extensive footnotes - Psychology papers with APA formatting - Business reports with financial tables### "You need programming experience"**Reality**: Basic LaTeX requires learning \~20 commands- `\section{Title}` - creates a section - `\cite{reference}` - adds a citation - `\includegraphics{file}` - inserts an image### "It's too difficult to learn"**Reality**: Learning curve exists but plateaus quickly- **Week 1**: Basic document structure - **Week 2**: Figures, tables, references - **Month 1**: Advanced features and customization## The Transition Strategy### Phase 1: Experimentation (Week 1-2)Start with a small, non-critical document:```latex example.tex theme=\{null} \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{graphicx} \usepackage[style=authoryear]{biblatex} \addbibresource{references.bib} \begin{document} \title{My First LaTeX Document} \author{Your Name} \date{\today} \maketitle \section{Introduction} This is my introduction paragraph with a citation \cite{example2024}. \section{Methods} Here's an equation: \begin{equation} E = mc^2 \end{equation} \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Phase 2: Parallel Development (Week 3-4)- Continue your main project in Word - Recreate one chapter in LaTeX - Compare formatting quality and workflow### Phase 3: Full Transition (Month 2+)- Start new projects in LaTeX - Convert existing work gradually - Build personal template library## Practical Learning Path### Essential Skills (Priority 1)1) **Document structure**: `\chapter`, `\section`, `\subsection` 2) **Text formatting**: `\textbf{}`, `\textit{}`, `\underline{}` 3) **Lists**: `itemize`, `enumerate`, `description` 4) **Basic math**: `$x = 5$` for inline, `\begin{equation}` for display 5) **References**: `\label{}` and `\ref{}`### Intermediate Skills (Priority 2)1) **Figures**: `\includegraphics`, `figure` environment 2) **Tables**: `tabular` environment, basic formatting 3) **Bibliography**: BibTeX basics, `\cite{}` commands 4) **Packages**: Understanding `\usepackage{}`### Advanced Skills (Priority 3)1) **Custom commands**: `\newcommand{}` 2) **Complex math**: `align`, `matrix`, theorem environments 3) **Advanced graphics**: TikZ basics 4) **Document classes**: Choosing and customizing## Real-World Example: Converting a Research Paper### Original Word Workflow Issues:- Manual equation numbering - Inconsistent citation formatting - Figure positioning problems - Cross-reference errors### LaTeX Solution:```latex example.tex theme=\{null} % Automatic equation numbering \begin{align} y &= mx + b \label{eq:linear}\\ f(x) &= ax^2 + bx + c \label{eq:quadratic} \end{align} % Automatic cross-references As shown in Equation~\ref{eq:linear}... % Consistent citations \cite{smith2023} demonstrates this approach. % Reliable figure positioning \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{results.png} \caption{Experimental results showing...} \label{fig:results} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Tool Recommendations for Beginners### Cloud-Based Editors (Recommended)- **LaTeX Cloud Studio**: Full LaTeX environment, no setup required - **Overleaf**: Popular online editor with collaboration features### Local Installations- **TeXLive** (Windows/Linux) + **TeXworks** - **MacTeX** (macOS) + **TeXShop** - **VS Code** with LaTeX Workshop extension### Reference Managers Integration- **Zotero**: Best overall LaTeX integration - **Mendeley**: Good for beginners - **JabRef**: Dedicated BibTeX editor## Managing the Learning Curve### Week 1 Goals- Set up LaTeX environment - Create first document with sections - Compile successfully### Week 2 Goals- Add figures and tables - Implement basic bibliography - Master cross-referencing### Month 1 Goals- Complete first full document - Understand package system - Develop personal workflow### Common Beginner Mistakes1) **Compilation errors**: Learn to read error messages 2) **Package conflicts**: Start minimal, add packages gradually 3) **Formatting obsession**: Focus on content first 4) **Overcomplicating**: Use simple solutions initially## Measuring Success### Productivity Indicators- **Time to format**: Decreases after initial learning - **Error frequency**: Fewer formatting surprises - **Collaboration efficiency**: Easier version control - **Output quality**: More professional appearance### When You'll Know You've Made It- You stop thinking about code syntax - Formatting becomes automatic - You start helping others with LaTeX - Going back to Word feels limiting## Next Steps### Immediate Actions1) Try the basic template above 2) Convert a simple document 3) Join LaTeX communities (r/LaTeX, TeX StackExchange) 4) Build a reference collection### Long-term Development1) Learn your field's specific packages 2) Develop custom templates 3) Explore advanced features 4) Contribute to LaTeX community## ConclusionThe transition from Word to LaTeX represents a shift from manual formatting to logical document structure. While the initial learning curve is real, the long-term benefits—in terms of document quality, stability, and professional appearance—make it worthwhile for academic and technical writing.The key is realistic expectations: LaTeX won't make you a better writer, but it will free you from formatting frustrations so you can focus on what matters—your research and ideas.***__Ready to start?__ Try our [beginner templates](/templates/article) or explore our [complete LaTeX guide](/learn/latex/basics/creating-first-document) to begin your journey. # LaTeX Blog - Tutorials, Troubleshooting and Editor Comparisons Source: https://resources.latex-cloud-studio.com/blog/index LaTeX tutorials, troubleshooting guides, writing workflows, and editor comparisons from the LaTeX Cloud Studio team. Read practical LaTeX tutorials, debugging guides, writing workflow advice, and editor comparisons. If you are deciding between tools or trying to fix a stubborn compile error, start here. ## Start With These Guides > [card] Common LaTeX Errors and Fixes > > Missing `$`, undefined control sequence, content after `\end{document}`, and other common errors explained clearly. [Open](/blog/common-latex-errors-fixes) > [card] Overleaf Alternative Comparison > > Compare LaTeX Cloud Studio and Overleaf on privacy, collaboration, AI workflows, templates, and migration paths. [Open](/vs/overleaf) ## Featured Posts > [card] LaTeX vs Overleaf: 2026 Comparison > > Complete comparison guide to help you choose the best online LaTeX editor for your needs. [Open](/blog/latex-vs-overleaf-2026-comparison) > [card] LaTeX Academic Writing Guide > > A complete guide to papers, theses, citations, and academic writing workflows in LaTeX. [Open](/blog/latex-academic-writing-guide) > [card] 10 Common LaTeX Errors and Fixes > > Quick solutions for the most common LaTeX compilation errors with code examples. [Open](/blog/common-latex-errors-fixes) ## Browse by Category > [card] Tutorials > > Step-by-step guides and how-tos [Open](#tutorials) > [card] Tips & Tricks > > Quick tips to improve your LaTeX workflow [Open](#tips-tricks) > [card] User Stories > > Real success stories from our community [Open](#user-stories) > [card] Platform Updates > > Latest features and improvements [Open](#platform-updates) *** ## Tutorials > [card] LaTeX for Journal Submissions > > **August 14, 2026** • LaTeX Cloud Studio Team • 8 min read > > Compiled IEEEtran and elsarticle examples plus the checklist that prevents formatting-related bounce-backs. [Open](/blog/latex-journal-submission-guide) > [card] Bibliography Management with BibTeX & BibLaTeX > > **August 14, 2026** • LaTeX Cloud Studio Team • 8 min read > > Manage citations in LaTeX the right way. Compiled examples for thebibliography, classic BibTeX with natbib, and modern BibLaTeX with biber. [Open](/blog/latex-bibliography-management) > [card] LaTeX for Academic Writing: Complete Guide > > **January 4, 2026** • LaTeX Cloud Studio Team • 20 min read > > Master LaTeX for academic papers, theses, and dissertations. Learn document structure, citations, formatting, and collaboration best practices for scholarly writing. [Open](/blog/latex-academic-writing-guide) > [card] From Word to LaTeX: A Beginner's Journey > > **June 29, 2025** • LaTeX Cloud Studio Team • 12 min read > > A comprehensive guide to transitioning from Microsoft Word to LaTeX for academic writing. Learn the real benefits, common challenges, and practical steps to get started. [Open](/blog/from-word-to-latex-beginners-journey) ## Tips & Tricks > [card] Automating LaTeX Builds: latexmk, Makefiles, and CI > > **August 14, 2026** • LaTeX Cloud Studio Team • 8 min read > > Reproducible builds locally and CI that compiles your paper on every push. [Open](/blog/latex-automation-ci) > [card] 10 Common LaTeX Errors and How to Fix Them > > **January 4, 2026** • LaTeX Cloud Studio Team • 14 min read > > Fix common LaTeX compilation errors quickly with this comprehensive troubleshooting guide. Solutions for missing \$, undefined control sequence, and more with code examples. [Open](/blog/common-latex-errors-fixes) ## Comparisons > [card] LaTeX Cloud Studio vs Overleaf: 2026 Comparison > > **January 4, 2026** • LaTeX Cloud Studio Team • 15 min read > > Comprehensive comparison of LaTeX Cloud Studio and Overleaf. Compare features, pricing, collaboration, and performance to find the best online LaTeX editor. [Open](/blog/latex-vs-overleaf-2026-comparison) > [card] Overleaf Alternative Decision Page > > Short on time? Use the focused comparison page for a faster decision between LaTeX Cloud Studio and Overleaf. [Open](/vs/overleaf) ## User Stories > [card] Making the Switch from Word to LaTeX > > **June 29, 2025** • LaTeX Cloud Studio Team • 12 min read > > A comprehensive guide to transitioning from Microsoft Word to LaTeX for academic writing. Learn the real benefits, common challenges, and practical steps to get started. [Open](/blog/from-word-to-latex-beginners-journey) ## Platform Updates > [card] Why We Built LaTeX Cloud Studio > > **March 15, 2024** • LaTeX Cloud Studio Team • 7 min read > > The story behind LaTeX Cloud Studio and why we believe everyone deserves access to beautiful, professional document creation without the complexity. [Open](/blog/why-we-built-latex-cloud-studio) ## Announcements > [card] Welcome to LaTeX Cloud Studio > > **January 15, 2024** • LaTeX Cloud Studio Team • 4 min read > > Introducing our new cloud-based LaTeX editor with real-time collaboration and powerful features. [Open](/blog/welcome-to-latex-cloud-studio) *** > [!NOTE] > > Stay updated with the latest posts by bookmarking this page or following us on social media. > > [Blog Updates Stream](/blog/updates) > > [Visit our website](https://www.latex-cloud-studio.com/) # LaTeX Academic Writing Guide for Students & Researchers Source: https://resources.latex-cloud-studio.com/blog/latex-academic-writing-guide Master LaTeX for academic papers, theses, and dissertations. Learn document structure, citations, formatting, and collaboration best practices. LaTeX is the gold standard for academic writing, used by researchers, students, and institutions worldwide. This comprehensive guide covers everything you need to create professional academic documents—from course papers to PhD dissertations.## Why Academics Choose LaTeXBefore diving into the how, let's understand the why:### The Academic Advantage| Feature | Benefit for Academics | | - | - | | **Automatic numbering** | Figures, tables, equations, sections—all numbered automatically | | **Cross-references** | References update automatically when you reorganize | | **Bibliography management** | Integrate with Zotero, Mendeley; switch citation styles instantly | | **Mathematical typesetting** | Publication-quality equations | | **Long document handling** | Stable performance for 300+ page dissertations | | **Version control** | Works with Git for tracking changes and collaboration | | **Journal templates** | Most publishers provide LaTeX templates |> [!TIP] > > **Real talk:** LaTeX has a learning curve. But for any document over 20 pages with references, figures, and equations, that investment pays off many times over.## Choosing the Right Document ClassThe document class determines your document's overall structure and formatting.### For Research Papers and Articles```latex example.tex theme=\{null} % Standard article class - most versatile \documentclass[12pt, a4paper]{article} % For two-column journal format \documentclass[twocolumn]{article} % AMS article for mathematics \documentclass{amsart} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### For Theses and Dissertations```latex example.tex theme=\{null} % Report class - has chapters \documentclass[12pt, a4paper]{report} % Book class - for extensive dissertations \documentclass[12pt, openright]{book} % Check if your institution has a specific class \documentclass{mythesis} % Custom university class ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### For Letters and Short Documents```latex example.tex theme=\{null} \documentclass{letter} \documentclass{scrlttr2} % KOMA-Script letter ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Document Class Options```latex example.tex theme=\{null} \documentclass[ 12pt, % Font size (10pt, 11pt, 12pt) a4paper, % Paper size (letterpaper, a4paper) twoside, % Different margins for odd/even pages openright, % Chapters start on right-hand pages draft % Shows overfull boxes, doesn't load images ]{report} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Essential Packages for Academic WritingHere's a recommended preamble for academic documents:```latex example.tex theme=\{null} \documentclass[12pt, a4paper]{report} % === Encoding and Fonts === \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} % Modern font % === Page Layout === \usepackage[ margin=1in, bindingoffset=0.5cm % Extra margin for binding ]{geometry} \usepackage{setspace} \doublespacing % Or \onehalfspacing % === Mathematics === \usepackage{amsmath, amssymb, amsthm} \usepackage{mathtools} % === Graphics and Figures === \usepackage{graphicx} \usepackage{float} % Better figure placement \usepackage{subcaption} % Subfigures % === Tables === \usepackage{booktabs} % Professional tables \usepackage{longtable} % Multi-page tables \usepackage{multirow} % Multi-row cells % === Bibliography === \usepackage[ style=authoryear, % Or: numeric, apa, ieee, chicago backend=biber, natbib=true ]{biblatex} \addbibresource{references.bib} % === Cross-references and Links === \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue } \usepackage{cleveref} % Smart references % === Code Listings === \usepackage{listings} \lstset{ basicstyle=\ttfamily\small, breaklines=true, frame=single } % === Miscellaneous === \usepackage{appendix} \usepackage{glossaries} % For glossaries and acronyms ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Structuring Your Academic Document### Thesis/Dissertation Structure```latex example.tex theme=\{null} \documentclass[12pt, a4paper]{report} % ... preamble packages ... \begin{document} % === Front Matter === \frontmatter % Roman numerals, no chapter numbers \include{frontmatter/titlepage} \include{frontmatter/abstract} \include{frontmatter/acknowledgments} \include{frontmatter/dedication} \tableofcontents \listoffigures \listoftables % === Main Matter === \mainmatter % Arabic numerals, chapter numbers \include{chapters/introduction} \include{chapters/literature-review} \include{chapters/methodology} \include{chapters/results} \include{chapters/discussion} \include{chapters/conclusion} % === Back Matter === \backmatter \printbibliography[heading=bibintoc] \begin{appendices} \include{appendices/appendix-a} \include{appendices/appendix-b} \end{appendices} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Research Paper Structure```latex example.tex theme=\{null} \documentclass[12pt]{article} \begin{document} \title{Your Paper Title: A Subtitle if Needed} \author{ First Author\thanks{Corresponding author: email@university.edu}\\ \small Department, University\\ \and Second Author\\ \small Department, University } \date{\today} \maketitle \begin{abstract} Your abstract goes here. 150-250 words summarizing the problem, methods, key findings, and implications. \textbf{Keywords:} keyword1, keyword2, keyword3 \end{abstract} \section{Introduction} \label{sec:intro} % Background, problem statement, research questions, contributions \section{Related Work} \label{sec:related} % Literature review and positioning \section{Methodology} \label{sec:methods} % Your approach, data, methods \section{Results} \label{sec:results} % Findings and analysis \section{Discussion} \label{sec:discussion} % Interpretation, implications, limitations \section{Conclusion} \label{sec:conclusion} % Summary and future work \section*{Acknowledgments} % Funding, support, contributions \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Mastering Citations and Bibliography### Setting Up Your BibliographyCreate a `references.bib` file:```bibtex theme=\{null} @article{smith2024, author = {Smith, John and Johnson, Mary}, title = {A Study of Something Important}, journal = {Journal of Important Studies}, year = {2024}, volume = {42}, number = {3}, pages = {123--145}, doi = {10.1234/example.2024.001} } @book{jones2023, author = {Jones, Robert}, title = {The Comprehensive Guide}, publisher = {Academic Press}, year = {2023}, address = {New York}, edition = {3rd} } @inproceedings{chen2024, author = {Chen, Wei and Kumar, Anil}, title = {Conference Paper Title}, booktitle = {Proceedings of the International Conference}, year = {2024}, pages = {100--110}, publisher = {ACM} } @phdthesis{williams2023, author = {Williams, Sarah}, title = {Dissertation Title Here}, school = {University Name}, year = {2023} } @misc{website2024, author = {{Organization Name}}, title = {Web Page Title}, howpublished = {\url{https://example.com/page}}, year = {2024}, note = {Accessed: 2024-01-15} } ```### Citation Commands```latex example.tex theme=\{null} % With biblatex + natbib=true option: % Parenthetical citation: (Smith, 2024) \citep{smith2024} % Textual citation: Smith (2024) \citet{smith2024} % Multiple citations: (Smith, 2024; Jones, 2023) \citep{smith2024, jones2023} % With page numbers: (Smith, 2024, p. 45) \citep[p.~45]{smith2024} % With prefix: (see Smith, 2024) \citep[see][]{smith2024} % Just the year: (2024) \citeyear{smith2024} % Just the author: Smith \citeauthor{smith2024} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Popular Citation Styles```latex example.tex theme=\{null} % APA style (Psychology, Education, Social Sciences) \usepackage[style=apa, backend=biber]{biblatex} % IEEE style (Engineering, Computer Science) \usepackage[style=ieee, backend=biber]{biblatex} % Chicago style (Humanities) \usepackage[style=chicago-authordate, backend=biber]{biblatex} % Numeric style (Sciences) \usepackage[style=numeric-comp, backend=biber]{biblatex} % Harvard style \usepackage[style=authoryear, backend=biber]{biblatex} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> [!NOTE] > > **Reference Manager Integration:** > Export your library from Zotero, Mendeley, or EndNote as a `.bib` file. Keep it updated with your document.## Academic Figures and Tables### Figures with Proper Captioning```latex example.tex theme=\{null} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{figures/results-graph} \caption[Short caption for list]{ Long caption with detailed description of what the figure shows. Data collected from \cite{smith2024}. Error bars represent 95\% confidence intervals. } \label{fig:results} \end{figure} % Reference it As shown in Figure~\ref{fig:results}, the results demonstrate... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Subfigures```latex example.tex theme=\{null} \usepackage{subcaption} \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{figures/method-a} \caption{Method A results} \label{fig:method-a} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{figures/method-b} \caption{Method B results} \label{fig:method-b} \end{subfigure} \caption{Comparison of both methods showing (a) Method A and (b) Method B} \label{fig:comparison} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Professional Tables```latex example.tex theme=\{null} \usepackage{booktabs} \begin{table}[htbp] \centering \caption{Experimental results comparing methods across metrics} \label{tab:results} \begin{tabular}{lccc} \toprule \textbf{Method} & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} \\ \midrule Baseline & 78.3\% & 0.76 & 0.81 \\ Method A & 85.7\% & 0.84 & 0.87 \\ Method B & 89.2\% & 0.88 & 0.90 \\ \textbf{Ours} & \textbf{94.1\%} & \textbf{0.93} & \textbf{0.95} \\ \bottomrule \end{tabular} \vspace{0.5em} \footnotesize \textit{Note:} Results averaged over 10 runs. Bold indicates best performance. \end{table} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-latex-academic-writing-guide-12/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=blog_latex_academic_writing_guide)### Tables Spanning Multiple Pages```latex example.tex theme=\{null} \usepackage{longtable} \begin{longtable}{lp{8cm}c} \caption{Summary of Literature Review} \label{tab:literature} \\ \toprule \textbf{Author} & \textbf{Contribution} & \textbf{Year} \\ \midrule \endfirsthead \multicolumn{3}{c}{\textit{Continued from previous page}} \\ \toprule \textbf{Author} & \textbf{Contribution} & \textbf{Year} \\ \midrule \endhead \midrule \multicolumn{3}{r}{\textit{Continued on next page}} \\ \endfoot \bottomrule \endlastfoot Smith & Description of their work & 2020 \\ Jones & Another contribution & 2021 \\ % ... more rows ... \end{longtable} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-latex-academic-writing-guide-13/page-1.svg)
## Mathematics in Academic Papers### Theorems and Proofs```latex example.tex theme=\{null} \usepackage{amsthm} % Define theorem environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem*{remark}{Remark} % Usage \begin{theorem}[Optional Name] \label{thm:main} For all $x \in \mathbb{R}$, we have $x^2 \geq 0$. \end{theorem} \begin{proof} By definition of real numbers... [your proof here]. \end{proof} \begin{corollary} \label{cor:consequence} As a consequence of Theorem~\ref{thm:main}, ... \end{corollary} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-latex-academic-writing-guide-14/page-1.svg)
### Aligned Equations```latex example.tex theme=\{null} \begin{align} f(x) &= ax^2 + bx + c \label{eq:quadratic} \\ x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \label{eq:solution} \end{align} Equation~\eqref{eq:quadratic} gives the general form, and Equation~\eqref{eq:solution} provides the solutions. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-latex-academic-writing-guide-15/page-1.svg)
### Matrices and Arrays```latex example.tex theme=\{null} % Matrix types \begin{equation} A = \begin{pmatrix} % parentheses a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix} \quad B = \begin{bmatrix} % brackets 1 & 2 \\ 3 & 4 \end{bmatrix} \quad C = \begin{vmatrix} % determinant x & y \\ z & w \end{vmatrix} \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-latex-academic-writing-guide-16/page-1.svg)
## Cross-Referencing Best Practices### Using cleveref for Smart References```latex example.tex theme=\{null} \usepackage{cleveref} % In your document \begin{figure} ... \label{fig:results} \end{figure} \begin{table} ... \label{tab:data} \end{table} \begin{equation} E = mc^2 \label{eq:einstein} \end{equation} % Smart references - cleveref adds "Figure", "Table", etc. \cref{fig:results} % "Figure 1" \cref{tab:data} % "Table 1" \cref{eq:einstein} % "Equation 1" \cref{sec:intro} % "Section 1" % Multiple references \cref{fig:results,tab:data} % "Figure 1 and Table 1" % Range of references \crefrange{eq:first}{eq:last} % "Equations 1 to 5" ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Label Naming Conventions```latex example.tex theme=\{null} % Use prefixes for organization: \label{sec:introduction} % Sections \label{subsec:background} % Subsections \label{ch:methodology} % Chapters \label{fig:architecture} % Figures \label{tab:results} % Tables \label{eq:model} % Equations \label{thm:convergence} % Theorems \label{alg:algorithm1} % Algorithms \label{lst:code} % Listings \label{app:proofs} % Appendix ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Academic Document Templates### Title Page for Thesis```latex example.tex theme=\{null} \begin{titlepage} \centering \vspace*{1cm} {\LARGE\textbf{University Name}}\\[0.5cm] {\large Department of Subject} \vspace{2cm} {\huge\bfseries Your Thesis Title:\\[0.3cm] A Subtitle If Needed} \vspace{2cm} {\Large A thesis submitted in partial fulfillment\\ of the requirements for the degree of\\[0.5cm] \textbf{Doctor of Philosophy}} \vspace{2cm} {\large by\\[0.3cm] \textbf{Your Full Name}} \vfill {\large Supervisor: Prof. Supervisor Name}\\[1cm] {\large Month Year} \end{titlepage} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/blog-latex-academic-writing-guide-19/page-1.svg)
### Abstract Page```latex example.tex theme=\{null} \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract} \begin{center} \textbf{Title of Your Thesis}\\[0.5cm] Your Name\\ University Name, Year \end{center} \vspace{1cm} Your abstract text goes here. This should be a concise summary of your research including: \begin{itemize} \item The problem or research question \item Your methodology \item Key findings \item Main conclusions and contributions \end{itemize} \vspace{1cm} \noindent\textbf{Keywords:} keyword1, keyword2, keyword3, keyword4, keyword5 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Collaboration with Co-Authors### Using Git for Version Control```bash theme=\{null} # Initialize git in your LaTeX project git init git add . git commit -m "Initial thesis draft" # Create branch for revisions git checkout -b chapter-2-revision # After making changes git add chapters/chapter2.tex git commit -m "Address reviewer comments on methodology section" # Merge back git checkout main git merge chapter-2-revision ```### Track Changes with latexdiff```bash theme=\{null} # Generate a diff between versions latexdiff old-version.tex new-version.tex > diff.tex pdflatex diff.tex ```### Comments and TODOs```latex example.tex theme=\{null} % For personal notes (won't appear in output) % TODO: Add more references here % For visible notes during drafting \usepackage{todonotes} \todo{Expand this section} \todo[inline]{Need to verify these numbers} \missingfigure{Add results graph here} % For collaborative comments \usepackage{changes} \added[id=JD]{This text was added by John} \deleted[id=MS]{This text was deleted by Mary} \replaced[id=JD]{new text}{old text} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Meeting Journal Requirements### Common Journal Classes```latex example.tex theme=\{null} % IEEE \documentclass[journal]{IEEEtran} % ACM \documentclass[sigconf]{acmart} % Elsevier \documentclass[preprint,12pt]{elsarticle} % Springer \documentclass{svjour3} % Nature \documentclass{nature} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Preparing for Submission```latex example.tex theme=\{null} % Switch to final mode \documentclass[final]{article} % Remove 'draft' option % For double-blind review \author{Anonymous} \affiliation{Anonymous Institution} % Line numbers for review \usepackage{lineno} \linenumbers % Word count % Run: texcount yourfile.tex ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
> [!WARNING] > > **Always check specific journal requirements!** Each journal has unique formatting rules. Download their template and follow their author guidelines exactly.## Complete Academic TemplateHere's a ready-to-use template for academic papers:```latex example.tex theme=\{null} % academic-paper-template.tex \documentclass[12pt, a4paper]{article} % === Packages === \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1in]{geometry} \usepackage{setspace} \usepackage{amsmath, amssymb, amsthm} \usepackage{graphicx} \usepackage{booktabs} \usepackage{subcaption} \usepackage[style=authoryear, backend=biber, natbib=true]{biblatex} \usepackage{hyperref} \usepackage{cleveref} % === Configuration === \addbibresource{references.bib} \onehalfspacing \hypersetup{ colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue, pdftitle={Your Paper Title}, pdfauthor={Your Name} } % === Theorem Environments === \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} % === Document === \begin{document} \title{Your Paper Title: With an Informative Subtitle} \author{ First Author\thanks{Corresponding author: first@university.edu}\\ \small Department, University, Country \and Second Author\\ \small Department, University, Country } \date{\today} \maketitle \begin{abstract} Your abstract here (150-250 words). Summarize the problem, methods, key findings, and implications. \noindent\textbf{Keywords:} keyword1, keyword2, keyword3 \end{abstract} \section{Introduction} \label{sec:intro} Introduction text with citation \citep{smith2024}. \section{Related Work} \label{sec:related} Literature review content. \section{Methodology} \label{sec:methods} Methods description with equation: \begin{equation} y = f(x) + \epsilon \label{eq:model} \end{equation} \section{Results} \label{sec:results} Results with figure reference (\cref{fig:results}). \begin{figure}[htbp] \centering % \includegraphics[width=0.8\textwidth]{figures/results} \caption{Description of results} \label{fig:results} \end{figure} \section{Discussion} \label{sec:discussion} Discussion of findings. \section{Conclusion} \label{sec:conclusion} Conclusions and future work. \section*{Acknowledgments} Funding acknowledgments here. \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
***## Next StepsReady to advance your academic LaTeX skills?* **Templates**: Browse our [thesis templates](/templates/thesis) and [article templates](/templates/article) * **Bibliography**: Deep dive into [BibLaTeX management](/learn/latex/bibliography-citations) * **Collaboration**: Learn [collaboration workflows for LaTeX](/learn/latex/how-to/collaboration-workflow) * **Math**: Master [mathematical expressions](/learn/latex/mathematics/mathematical-expressions)> [!NOTE] > > **Need your institution's template?** Many universities provide official LaTeX thesis templates. Check with your graduate school or department. # Automating LaTeX Builds - latexmk, Makefiles, and CI Source: https://resources.latex-cloud-studio.com/blog/latex-automation-ci Stop compiling by hand. Reproducible LaTeX builds with latexmk, a minimal Makefile, and GitHub Actions CI that compiles your paper on every push. A LaTeX document with citations needs up to four compiler passes in the right order — and "run it again until the warnings stop" is not a build system. This guide sets up real automation in three steps: `latexmk` locally, a Makefile for project-specific tasks, and CI that compiles the paper on every push so a broken build can never hide until the night before a deadline. ## Step 1: `latexmk` — the Standard Nobody Told You About `latexmk` ships with TeX Live and solves the multi-pass problem completely: it runs pdfLaTeX, BibTeX/biber, and cross-reference passes as often as needed, in the right order, until the document is stable. ```bash theme={null} # One command, correct number of passes, every time: latexmk -pdf main.tex # Watch mode: recompile automatically on every save latexmk -pdf -pvc main.tex # Clean up generated files latexmk -c ``` Per-project configuration goes in a `.latexmkrc` file next to the document: ```perl theme={null} # .latexmkrc — project build configuration $pdf_mode = 1; # build PDF via pdflatex $bibtex_use = 2; # run bibtex/biber as needed @default_files = ('main.tex'); $out_dir = 'build'; # keep generated files out of the source tree ``` If you take one thing from this post: stop calling `pdflatex` by hand and use `latexmk`. Everything below builds on it. ## Step 2: A Makefile for the Project-Specific Parts `latexmk` handles compilation; a Makefile handles everything *around* it — the diff PDF for reviewers, the arXiv bundle, the word count: ```make theme={null} # Makefile — the tasks latexmk doesn't know about MAIN = main .PHONY: pdf diff arxiv clean pdf: latexmk -pdf $(MAIN).tex # Marked-up PDF against the submitted version (tag: submitted-v1) diff: latexdiff-vc --git -r submitted-v1 --pdf $(MAIN).tex # Self-contained bundle with the flattened bibliography arxiv: pdf tar czf arxiv.tar.gz $(MAIN).tex $(MAIN).bbl figures/ clean: latexmk -C rm -f arxiv.tar.gz ``` Now `make diff` answers the reviewer question "what changed since submission?" in one command, and `make arxiv` produces the upload bundle without a checklist. The `$(MAIN).bbl` in the arXiv target matters: arXiv compiles your source but does not run BibTeX, so the generated `.bbl` must ship inside the bundle. ## Step 3: CI — Compile on Every Push With the project in Git, a small GitHub Actions workflow compiles the paper on every push and fails loudly when someone commits a broken reference or a missing figure: ```yaml theme={null} # .github/workflows/build.yml name: Build paper on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Compile LaTeX uses: xu-cheng/latex-action@v3 with: root_file: main.tex latexmk_use_lualatex: false - name: Upload PDF uses: actions/upload-artifact@v4 with: name: paper path: main.pdf ``` The payoff compounds with co-authors: the PDF artifact on every commit means nobody needs a local TeX installation to check the current state, and a red ✗ on a pull request catches the broken build at commit time — not at deadline time. Two habits that keep CI useful: * **Treat warnings you care about as errors.** `latexmk` returns non-zero on errors, but undefined references are only warnings by default — grep the log in CI (`grep -q "undefined references" && exit 1`) if you want them to fail the build. * **Pin your TeX environment.** The action above uses a containerized TeX Live; avoid "latest" drift by pinning the action version, so this year's paper still compiles next year. ## Where the Browser Editor Fits Automation and a cloud editor are not competing choices — they meet in the repository. With [GitHub sync](/product/github-sync-import-export) the same repo that CI compiles is the project your co-authors edit in the browser: writers who never touch a terminal work in the editor, the Makefile-and-CI machinery runs against every push, and Git remains the single source of truth for both. **[Connect a repository and try it →](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=blog_latex_automation_ci_primary_cta)** ## Related Guides * **[LaTeX Collaboration Workflow](/learn/latex/how-to/collaboration-workflow)** - The conventions that make the Git flow calm * **[Bibliography Management](/blog/latex-bibliography-management)** - Why those extra passes exist at all * **[Common LaTeX Errors](/blog/common-latex-errors-fixes)** - What to do when CI goes red # LaTeX Bibliography Management - BibTeX and BibLaTeX Guide Source: https://resources.latex-cloud-studio.com/blog/latex-bibliography-management Manage citations in LaTeX the right way. Compiled examples for thebibliography, classic BibTeX with natbib, and modern BibLaTeX with biber. Citations are where LaTeX earns its keep. Renumber a hundred references by hand once in a word processor and you never want to again; in LaTeX, references renumber, re-sort, and re-format themselves when you switch journals. But the ecosystem has three overlapping mechanisms — `thebibliography`, classic BibTeX, and modern BibLaTeX — and choosing wrong early costs you a migration later.This guide covers all three, when each is the right call, and the errors that bite everyone once.## Level 1: `thebibliography` — No Database NeededFor a document with a handful of references — a homework set, a short report, a CV — you can write the bibliography inline. It compiles in a single pass with no external tools:```latex thebibliography.tex theme=\{null} \documentclass{article} \pagestyle{empty} \begin{document} Bidirectional pre-training improves language tasks~\cite{devlin2019}, and transformer scaling follows predictable trends~\cite{kaplan2020}. \begin{thebibliography}{9} \bibitem{devlin2019} J.~Devlin et al., \emph{BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding}, NAACL, 2019. \bibitem{kaplan2020} J.~Kaplan et al., \emph{Scaling Laws for Neural Language Models}, 2020. \end{thebibliography} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from thebibliography.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-latex-bibliography-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=blog_latex_bibliography_management)The `{9}` argument is a width sample — use `{99}` if you have ten or more entries so the labels align. Each `\bibitem{key}` becomes citable with `\cite{key}`, and LaTeX keeps numbering consistent.**When it stops scaling:** the moment you cite the same sources in a second document, or pass ten entries, move to a `.bib` database. Formatting entries by hand is exactly the busywork the next two levels remove.## Level 2: Classic BibTeXBibTeX separates *data* from *presentation*: your references live once in a `.bib` file, and a style file decides how they appear. The classic academic combination is BibTeX with the `natbib` package:```latex bibtex-setup.tex theme=\{null} % main.tex — classic BibTeX with natbib \documentclass{article} \usepackage[numbers]{natbib} \begin{document} Transformer scaling follows predictable trends~\citep{kaplan2020}. \bibliographystyle{plainnat} \bibliography{references} % loads references.bib \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
The matching `references.bib` entry looks like this:```bibtex theme=\{null} @article{kaplan2020, author = {Kaplan, Jared and McCandlish, Sam}, title = {Scaling Laws for Neural Language Models}, journal = {arXiv preprint arXiv:2001.08361}, year = {2020} } ````natbib` gives you the two citation commands that matter in author-year writing: `\citep{...}` for parenthetical "(Kaplan et al., 2020)" and `\citet{...}` for textual "Kaplan et al. (2020) show\...". Choosing between them per sentence is most of what good citation style comes down to.**The four-pass dance:** classic BibTeX needs `pdflatex → bibtex → pdflatex → pdflatex` to resolve everything. Cloud editors run this sequence for you — locally, it's the classic explanation for "why are my citations question marks?"## Level 3: Modern BibLaTeX with BiberBibLaTeX is the current-generation system: styles are configured with package options instead of hard-to-modify `.bst` files, Unicode names just work, and localization is built in:```latex biblatex-setup.tex theme=\{null} % Modern setup — biblatex with the biber backend \documentclass{article} \usepackage[backend=biber,style=authoryear]{biblatex} \addbibresource{references.bib} \begin{document} Bidirectional pre-training improves language tasks \parencite{devlin2019}. \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
Swap `style=authoryear` for `style=numeric`, `style=apa`, or `style=ieee` and the entire document reformats — no other changes. `\parencite` and `\textcite` are the BibLaTeX equivalents of natbib's `\citep`/`\citet`.**Which should you choose?** For a new project: BibLaTeX, unless your target journal's template explicitly requires a classic `.bst` style (many still do — check the author guidelines first). For an existing project: stay with what the template uses; mixing the two systems in one document does not work.## The Errors Everyone Hits Once1) **Citations show as `?`** — the bibliography passes haven't run, or the key is misspelled. Recompile fully; check the log for "Citation ... undefined". 2) **"I changed the .bib but nothing updated"** — same cause: the bibliography tool needs to re-run, not just the LaTeX pass. 3) **Empty bibliography with BibLaTeX** — you ran `bibtex` instead of `biber`. The backend option in the preamble decides which tool must run. 4) **Capitalization vanishing in titles** — BibTeX styles lowercase titles by design. Protect acronyms with braces in the `.bib` entry: `title = {Scaling Laws for {BERT}}`.## Reuse the Same Database EverywhereThe quiet payoff of a `.bib` file: it follows you. The same database drives your papers, your thesis, and your [CV's publication list](/learn/latex/how-to/cv-resume). Export from Zotero or Mendeley in BibTeX format and you never type an entry by hand.In LaTeX Cloud Studio the bibliography passes run automatically in the cloud, and citation keys autocomplete as you type `\cite{` — one less reason for question marks.**[Try it with your own .bib file →](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=blog_latex_bibliography_primary_cta)**## Related Guides- **[Bibliography and Citations docs](/learn/latex/bibliography-citations)** - The full reference - **[Choosing Citation Styles](/learn/latex/bibliography/choosing-citation-styles)** - Numeric vs author-year vs footnote - **[LaTeX Academic Writing Guide](/blog/latex-academic-writing-guide)** - The paper around the citations # LaTeX for Journal Submissions - IEEE, Elsevier, and Friends Source: https://resources.latex-cloud-studio.com/blog/latex-journal-submission-guide Prepare a LaTeX manuscript for journal submission. Compiled IEEEtran and elsarticle examples, plus the checklist that prevents desk rejections on formatting grounds. The good news about journal submissions: publishers standardized on LaTeX classes long ago, so "format for journal X" usually means changing one line — the document class — not reformatting your paper. The bad news: each family of classes has its own metadata commands and submission quirks, and formatting problems are among the most avoidable reasons manuscripts bounce back. This guide covers the two biggest class families and the checklist that keeps submissions clean. ## Rule Zero: the Author Guidelines Outrank Everything Every journal publishes author guidelines naming the required class, bibliography style, and submission format. Read them before writing the preamble — retrofitting a paper from the wrong class family costs an afternoon; starting in the right one costs nothing. ## The IEEE Family: `IEEEtran` IEEE conferences and journals use `IEEEtran`, which ships with TeX Live. It sets the two-column layout, fonts, and spacing — you write ordinary LaTeX inside it: ```latex ieee-sample.tex theme={null} \documentclass[conference]{IEEEtran} \title{Lattice Models of Active Matter Under Confinement} \author{\IEEEauthorblockN{Jane Doe} \IEEEauthorblockA{Institute for Applied Physics\\ Berlin, Germany}} \begin{document} \maketitle \begin{abstract} We study lattice models of active matter and show that the ordering transition sharpens with system size, consistent with a first-order transition. \end{abstract} \section{Introduction} The IEEE conference class sets the two-column layout, fonts, and spacing required by the venue --- the content is written exactly like any other article. \section{Method} Sections, math, and citations use standard LaTeX; only the document class and a few metadata commands are venue-specific. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from ieee-sample.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-latex-journal-submission-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=blog_latex_journal_submission_guide) What's IEEE-specific is small: the class option (`conference` vs `journal`), the `\IEEEauthorblockN`/`\IEEEauthorblockA` author commands, and the `IEEEtran` bibliography style (`\bibliographystyle{IEEEtran}` with classic BibTeX). Everything else — sections, math, figures, tables — is standard. ## The Elsevier Family: `elsarticle` Elsevier journals use `elsarticle`, also in TeX Live. Its signature feature is the class option that switches between *submission* formatting and *final* formatting: ```latex elsevier-skeleton.tex theme={null} % Typical Elsevier submission skeleton (elsarticle) \documentclass[review]{elsarticle} \usepackage{lineno} \begin{document} \begin{frontmatter} \title{Lattice Models of Active Matter} \author{Jane Doe} \begin{abstract} The review option produces double spacing and the lineno package adds line numbers for referees. \end{abstract} \end{frontmatter} \linenumbers \section{Introduction} Switching to the journal's accepted layout later is a one-line change of the class options. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from elsevier-skeleton.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-latex-journal-submission-02/page-1.svg)
The `review` option double-spaces the manuscript for referees, and `lineno`'s `\linenumbers` gives them line numbers to cite in their reports — both standard requests in review-stage submissions. When the paper is accepted, switching to the journal's final layout is a change of class options, not a rewrite. Springer (`svjour`/`sn-jnl`), ACM (`acmart`), and APS (`revtex`) follow the same pattern: a class from the publisher, a handful of metadata commands, and a named bibliography style. ## The Pre-Submission Checklist These six items cover most formatting-related bounce-backs: 1. **Exact class and options from the guidelines** — including the right variant (`conference` vs `journal`, `review` vs `final`). 2. **The required bibliography style, not your favorite one.** If the journal says `IEEEtran` or `elsarticle-num`, author-year preferences don't apply. 3. **Figures in the required format and resolution** — typically vector PDF/EPS for line art; check whether the journal wants figures embedded or as separate numbered files. 4. **No missing references or citations.** Compile from scratch and search the log for "undefined" — a `?` in a submitted PDF reads as carelessness. 5. **Submit what the system wants: source or PDF.** Many systems recompile your source; if so, include the `.bbl` file (most don't run BibTeX) and every file the document inputs. 6. **Keep the submitted state.** Tag the repository or save a named version at the moment of submission — revisions arrive months later, and `latexdiff` against the exact submitted source is what journals mean by "marked-up manuscript". ## Working with Journal Classes in the Cloud Because `IEEEtran`, `elsarticle`, and the other major classes ship with TeX Live, they compile in LaTeX Cloud Studio without installing anything — and a class file the journal supplies separately works too, dropped into the project folder like any other file. The version-history side matters at submission time: a named snapshot per submission round is exactly what step 6 above asks for. **[Start your manuscript →](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=blog_latex_journal_submission_primary_cta)** ## Related Guides * **[LaTeX Academic Writing Guide](/blog/latex-academic-writing-guide)** - The manuscript itself, start to finish * **[Bibliography Management](/blog/latex-bibliography-management)** - Getting the required citation style right * **[Automating LaTeX Builds](/blog/latex-automation-ci)** - The `make arxiv` and `latexdiff` workflow # Welcome to LaTeX Cloud Studio - Cloud LaTeX Editor Launch Source: https://resources.latex-cloud-studio.com/blog/welcome-to-latex-cloud-studio Introducing LaTeX Cloud Studio, a cloud-based LaTeX editor with real-time collaboration, fast cloud compilation, and AI-powered features. We're excited to announce the launch of LaTeX Cloud Studio, a cloud-based LaTeX editor designed to make document creation easier, faster, and more collaborative. ## Why We Built LaTeX Cloud Studio LaTeX has been the gold standard for academic and scientific document preparation for decades. However, traditional LaTeX workflows often involve: * Complex local installations * Version conflicts between collaborators * Difficult package management * Limited real-time collaboration We built LaTeX Cloud Studio to solve these problems while preserving everything that makes LaTeX powerful. ## Key Features ### 🚀 Zero Setup Required Start writing LaTeX documents immediately. No installation, no configuration, no package management headaches. Everything runs in your browser with full LaTeX compatibility. ### 👥 Real-time Collaboration Work together with your team in real-time. See changes as they happen, leave comments, and track revisions—all within the same document. ### 📦 All Packages Pre-installed Access thousands of LaTeX packages without manual installation. From `tikz` for diagrams to `biblatex` for citations, everything is ready to use. ### 🎨 Smart Templates Start with professionally designed templates for: * Research papers * Theses and dissertations * CVs and resumes * Presentations * Posters ### ⚡ Fast Cloud Compilation Compilation runs in the cloud with the full log visible, so you can see exactly what the toolchain did. Focus on writing, not maintaining a toolchain. ## Getting Started 1. **Sign up** for a free account at [latex-cloud-studio.com](https://latex-cloud-studio.com) 2. **Choose a template** or start from scratch 3. **Start writing** with our intuitive editor 4. **Share and collaborate** with your team ## What's Next This is just the beginning. In the coming months, we'll be adding: * **AI-powered writing assistance** for LaTeX commands and formatting * **GitHub integration** for version control * **Advanced bibliography management** with Zotero and Mendeley integration * **Custom template marketplace** for sharing and discovering templates * **Offline mode** for working without internet connection ## Join Our Community We're building LaTeX Cloud Studio for you, the LaTeX community. Your feedback and suggestions are invaluable to us — email us anytime at [LaTeX@hirox-software-solutions.com](mailto:LaTeX@hirox-software-solutions.com). ## Start Your Journey Ready to experience the future of LaTeX editing? [Get started for free](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=blog_welcome_get_started) and start creating beautiful documents today. *** ## Learn More > [card] LaTeX in 30 Minutes > > Get started with LaTeX quickly [Open](/learn/latex-in-30-minutes) > [card] Platform Features > > Explore our AI-powered features [Open](/platform/ai-features) > [card] Cloud Compilation > > Learn about our fast compilation system [Open](/platform/cloud-compilation) > [card] Templates > > Browse our document templates [Open](/templates/article) *** *Have questions or feedback? Email us at [LaTeX@hirox-software-solutions.com](mailto:LaTeX@hirox-software-solutions.com)* # Why We Built LaTeX Cloud Studio - Our Story Source: https://resources.latex-cloud-studio.com/blog/why-we-built-latex-cloud-studio Why we built LaTeX Cloud Studio - a browser-based LaTeX editor that removes setup friction, keeps the workflow inspectable, and adds AI help where it counts. LaTeX produces the best-looking documents in academia, and has for decades. Yet almost everyone who uses it has a story about the night it fought back: an installation that broke before the first page compiled, a collaborator whose environment produced different output, an error message that pointed nowhere near the actual problem. We kept running into the same conclusion: the hard part of LaTeX usually isn't the typesetting. It's everything around it. ## The Problems We Couldn't Ignore ### Setup before writing Before you write a single line, a local LaTeX workflow asks you to choose and install a distribution, manage packages, and configure an editor — and to debug whatever goes wrong along the way. On Windows that often means MiKTeX and PATH issues; on macOS it starts with a multi-gigabyte MacTeX download; on Linux it's package versions and dependencies. None of this teaches you LaTeX. All of it can end an attempt to learn it. ### Collaboration through workarounds Sharing a LaTeX project between machines multiplies the setup problem. Different distributions, different package versions, different build behavior — so people fall back to emailing zip files, keeping parallel installations, or giving up and drafting in a word processor to keep collaborators onboard. ### Errors written for experts LaTeX error messages are famously terse. A single missing brace can produce a cascade of complaints pointing at the wrong line. Experienced users develop an intuition for this; newcomers just see a wall of log output and a document that won't build. ## What We Decided to Build We didn't want to replace LaTeX — the typesetting is the point. We wanted to remove the friction around it. Three principles shaped the product: ### 1. Start in the browser **No installation, no configuration.** You open the editor and write. Packages are available without manual management, and compilation runs in the cloud. ```latex example.tex theme={null} % This just works, immediately: \documentclass{article} \begin{document} Hello, beautiful typography! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-why-we-built-latex-cloud-studio-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=blog_why_we_built_latex_cloud_studio) ### 2. Keep the workflow inspectable Convenience shouldn't mean opacity. Your source files, the compiler feedback, and the resulting PDF all stay visible — you can always see what the toolchain did and why. Projects move in and out through ZIP upload/export and GitHub import and sync, so your work is never locked in. ### 3. Add assistance where it actually helps The editor uses AI to do the things that eat writing time: explaining compile errors in plain language and proposing a reviewable fix, helping with rewrites and citations, and making structured edits without touching the rest of your file. Suggestions are visible before they're applied — you stay in control of your document. ## Where We Are Today What's live right now: the browser-based editor, cloud compilation with visible logs, real-time collaboration, version history, AI-assisted error fixing and writing help, and ZIP/GitHub project transfer. What isn't live stays labeled as roadmap — for example, direct Overleaf account import is a roadmap item, and we say so wherever migration comes up. The [product docs](/product) describe each workflow in detail, and the website's [migration guide](https://www.latex-cloud-studio.com/migrate), [AI & data handling](https://www.latex-cloud-studio.com/ai-data-handling), and [compliance](https://www.latex-cloud-studio.com/compliance) pages cover the trust questions — including how AI features handle your documents and our GDPR-oriented, EU-hosted posture. ## Where We're Going The direction is steady: deeper publishing workflows, better bibliography and reference-manager integration, and more educational material like the guides on this site. We'd rather ship these and then talk about them than promise dates — when something moves from roadmap to live, the product docs change first. ## Try It If you've bounced off LaTeX before — or you use it daily and are tired of maintaining the machinery around it — this is exactly the situation we built for. **[Start your first document →](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=blog_why_we_built_primary_cta)** No credit card required, no installation. Existing projects come along via ZIP or GitHub. **[See what's possible →](/getting-started/cloud-studio)** ## Learning Resources Whether you're new to LaTeX or looking to level up: * **[LaTeX in 30 Minutes](/learn/latex-in-30-minutes)** - Perfect for beginners * **[Research Paper Guide](/learn/latex/how-to/writing-research-paper)** - Academic writing workflow * **[Template Gallery](/templates/article)** - Professional starting points * **[How-to Guides](/learn/latex/how-to/first-project)** - Step-by-step tutorials ## Thank You To everyone using LaTeX Cloud Studio and sending feedback: it shapes what we build next. We started with a simple belief — beautiful documents shouldn't require ugly workflows — and every report, suggestion, and bug you send gets us closer to that. *** *Questions or feedback? Reach us at [LaTeX@hirox-software-solutions.com](mailto:LaTeX@hirox-software-solutions.com) or visit [latex-cloud-studio.com](https://www.latex-cloud-studio.com/).* **Ready to start your LaTeX journey?** [Get started for free](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=blog_why_we_built_footer_cta). # Frequently Asked Questions Source: https://resources.latex-cloud-studio.com/faq Common questions about LaTeX Cloud Studio, LaTeX typesetting, and document creation Find answers to common questions about LaTeX Cloud Studio and LaTeX document creation.## LaTeX Cloud Studio Platform> [accordion] What is LaTeX Cloud Studio? > > LaTeX Cloud Studio is a cloud-based LaTeX editor that makes professional document creation accessible to everyone. No installation required – just sign in and start creating beautiful documents with real-time collaboration, instant compilation, and AI-powered assistance.> [accordion] Do I need to install anything to use LaTeX Cloud Studio? > > No! LaTeX Cloud Studio runs entirely in your browser. We handle all the LaTeX installation, package management, and compilation on our servers. You just need a modern web browser and internet connection.> [accordion] Is LaTeX Cloud Studio free to use? > > Yes. The Free plan includes: > > * 3 projects with 50 MB of storage each > * Cloud compilation and AI assistance > * LaTeX templates > * Joining projects that a Pro user invites you to, with full editing access > > Pro adds unlimited projects, 500 MB of storage per project, and inviting collaborators to your own projects. Collaborators you invite can stay on the Free plan. See the [pricing page](https://www.latex-cloud-studio.com/pricing) for current prices.> [accordion] How do I collaborate with others? > > Collaboration is built into LaTeX Cloud Studio: > > 1. As the project owner, open project settings. Inviting collaborators requires Pro. > 2. Enter the collaborator's email address and send the invitation. > 3. The collaborator accepts while signed in with that email address. A Free account is enough. > 4. Edit together in real time. Every collaborator can edit; there are no view-only or comment-only roles. > > See [Invite Collaborators and Use Comments](/product/tasks/invite-collaborators-and-use-comments) for the steps and our [collaboration guide](/learn/latex/how-to/collaboration-workflow) for LaTeX team workflows.> [accordion] Can I work offline? > > Currently, LaTeX Cloud Studio requires an internet connection. However, we're developing offline capabilities that will allow you to: > > * Edit documents offline > * Sync changes when reconnected > * Export projects for local editing## Getting Started with LaTeX> [accordion] I'm new to LaTeX. Where should I start? > > Great question! We recommend: > > 1. Start with our [LaTeX in 30 Minutes](/learn/latex-in-30-minutes) guide > 2. Try our [Getting Started tutorial](/getting-started/cloud-studio) > 3. Use our pre-made [templates](/templates/article) for common document types > 4. Check out [beginner-friendly tutorials](/learn/latex/basics/creating-first-document) > > LaTeX Cloud Studio is designed to make learning LaTeX easier with helpful error messages and AI assistance.> [accordion] What's the difference between LaTeX and Word? > > LaTeX and Word serve different purposes: > > **LaTeX excels at:** > > * Professional typesetting and consistent formatting > * Mathematical equations and scientific notation > * Large documents (theses, books) > * Version control and collaboration > * Cross-references and bibliographies > > **Word excels at:** > > * Quick documents and letters > * WYSIWYG editing > * Track changes and comments > * Integration with Office suite > > Many academics and professionals use both, choosing the right tool for each task.> [accordion] How do I convert my Word document to LaTeX? > > While there's no perfect automatic conversion, here are your options: > > 1. **Manual conversion**: Copy text content and apply LaTeX formatting > 2. **Pandoc**: Use this tool for basic conversions > 3. **Start fresh**: Often it's easier to recreate the document in LaTeX > > See our guide: [From Word to LaTeX](/blog/from-word-to-latex-beginners-journey)## Common LaTeX Questions \> \[accordion] How do I insert images in LaTeX? \> \> Use the \`graphicx\` package:\`\`\`latex example.tex theme=\\\{null} \> \usepackage\{graphicx} \> ... \> \begin\{figure}\[h] \> \centering \> \includegraphics\[width=0.8\textwidth]\{image.png} \> \caption\{Your caption here} \> \label\{fig:mylabel} \> \end\{figure} \> \`\`\`\\\
\\\Expected effect\\\ \> \ \\> \\\\\\\[!NOTE] \> \\> \> \\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\\\
See our \[complete guide to images]\(/learn/latex/figures/inserting-images). > [accordion] How do I create tables in LaTeX? > > Basic table example: > > ```latex example.tex theme=\{null} > \begin{table}[h] > \centering > \begin{tabular}{|l|c|r|} > \hline > Left & Center & Right \\ > \hline > Data & Data & Data \\ > \hline > \end{tabular} > \caption{Table caption} > \end{table} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/faq-02/page-1.svg) >
> > **Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=faq) > For advanced tables, see our [tables tutorial](/learn/latex/tables/creating-tables).> [accordion] How do I write mathematical equations? > > LaTeX has two math modes: > > **Inline math**: `$E = mc^2$` produces $E = mc^2$ > > **Display math**: > > ```latex example.tex theme=\{null} > \begin{equation} > \int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2} > \end{equation} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/faq-03/page-1.svg) >
> > Learn more in our [mathematics guide](/learn/latex/mathematics/mathematical-expressions).> [accordion] How do I manage bibliography and citations? > > Use BibTeX or BibLaTeX: > > 1. Create a `.bib` file with your references > 2. Cite with `\cite{key}` > 3. Add bibliography with `\bibliography{references}` > > Full tutorial: [Bibliography and Citations](/learn/latex/bibliography-citations)## Troubleshooting> [accordion] Why won't my document compile? > > Common compilation issues: > > 1. **Missing packages**: Ensure all `\usepackage{}` commands are in the preamble > 2. **Syntax errors**: Check for missing braces `{}` or brackets `[]` > 3. **Undefined references**: Run compilation twice for cross-references > 4. **Special characters**: Escape characters like `&`, `%`, `$` with backslash > > Our [error fixing guide](/learn/latex/basics/errors) covers solutions in detail.> [accordion] How do I fix 'Undefined control sequence' errors? > > This error means LaTeX doesn't recognize a command. Common causes: > > * Typo in command name (e.g., `\textbf` not `\txetbf`) > * Missing package that defines the command > * Command used outside its valid scope > > LaTeX Cloud Studio's AI assistant can help identify and fix these errors automatically.> [accordion] Why are my figures appearing in the wrong place? > > LaTeX optimizes figure placement. To control positioning: > > * Use placement specifiers: `[h]` (here), `[t]` (top), `[b]` (bottom) > * Try `[H]` with the `float` package for strict placement > * Use `\clearpage` to force all floats to appear > > See [figure positioning guide](/learn/latex/figures/positioning) for more control options.## Advanced Topics> [accordion] Can I create presentations in LaTeX? > > Yes! Use the Beamer package: > > ```latex example.tex theme=\{null} > \documentclass{beamer} > \begin{document} > \begin{frame} > \frametitle{Slide Title} > Your content here > \end{frame} > \end{document} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. > > [Open SVG](/images/rendered/faq-04/page-1.svg) >
> > Check our [presentation templates](/templates/presentation) and [Beamer guide](/learn/latex/how-to/presentations).> [accordion] How do I use custom fonts in LaTeX? > > LaTeX Cloud Studio supports various font packages:- `\usepackage{times}` for Times Roman > > * `\usepackage{helvet}` for Helvetica > * `\usepackage{palatino}` for PalatinoFor custom fonts with XeLaTeX/LuaLaTeX:\`\`\`latex example.tex theme=\{null} > \usepackage > \setmainfont > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
See our [fonts guide](/learn/latex/fonts) for comprehensive coverage. > ```> [accordion] Can I use LaTeX for languages other than English? > > Absolutely! LaTeX has excellent multilingual support:\`\`\`latex example.tex theme=\{null} > \usepackage\[utf8] > \usepackage\[spanish] > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
We support all major languages including Arabic, Chinese, Japanese, and more. See our [multilingual guide](/learn/latex/how-to/multi-language-documents). > ```## Platform-Specific Questions> [accordion] How do I export my project? > > Export options in LaTeX Cloud Studio: > > 1. **PDF**: Click "Download PDF" after compilation > 2. **Source files**: Project menu → "Download Source" > 3. **ZIP archive**: Project menu → "Download as ZIP" > > You can also sync with GitHub for version control.> [accordion] Is my data secure on LaTeX Cloud Studio? > > Here is what applies today: > > * Connections are encrypted in transit (HTTPS) > * Project data, including uploaded files and compiled PDFs, is stored on EU-hosted infrastructure > * AI features send the relevant text to external AI model providers, which may process it outside the EU; your documents are not used to train AI models > * The service is designed for GDPR obligations > * You retain full ownership of your documents > > Read our full [security policy](/platform/security-privacy).> [accordion] Can I use LaTeX Cloud Studio for commercial projects? > > Yes! You can use LaTeX Cloud Studio for: > > * Commercial documents and reports > * Published books and articles > * Client work and consulting > * Any professional use > > Your content is your own, and we don't claim any rights to documents you create.***> [card] Still have questions? > > Visit our website for personalized help with your LaTeX documents[Open](https://www.latex-cloud-studio.com/) # Getting Started with LaTeX Cloud Studio Source: https://resources.latex-cloud-studio.com/getting-started/cloud-studio Quick start guide for LaTeX Cloud Studio. Learn how to create your first document, use templates, and navigate the interface in minutes. Welcome to LaTeX Cloud Studio! This guide will help you get started with our powerful cloud-based LaTeX editor and create your first professional document in minutes.> [!NOTE] > > **Already know LaTeX?** Jump to [Creating Your First Document](#creating-your-first-document). New to LaTeX? Start with our [LaTeX in 30 minutes](/learn/latex-in-30-minutes) tutorial after this quick start guide.> [!NOTE] > > **Canonical product docs**: For current app behavior, use the [Product Docs overview](/product). This guide is the quickest path to first value; the Product Docs section covers deeper operational workflows.## What is LaTeX Cloud Studio?LaTeX Cloud Studio is a powerful, cloud-based LaTeX editor that provides:> [card] No Installation Required > > Access LaTeX anywhere with just a browser - no software to install or maintain> [card] Real-time Collaboration > > Work together with teammates in real-time, like Google Docs but for LaTeX> [card] Professional Templates > > Start with ready-made templates for articles, presentations, CVs, and academic papers> [card] Instant Compilation > > See your PDF output instantly as you type with our fast cloud compiler## Creating Your First Document### Step 1: Access LaTeX Cloud Studio1) Navigate to [LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=inline_link\&utm_campaign=docs_open_app\&utm_content=cloud_studio_step1) 2) Sign up for a free account or log in if you already have one 3) Click **"New Project"** to get started### Step 2: Choose a Template```latex article-template.tex theme=\{null} \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amsfonts,amssymb} \usepackage{graphicx} \usepackage[margin=1in]{geometry} \title{Your Document Title} \author{Your Name} \date{\today} \begin{document} \maketitle \section{Introduction} Welcome to your first LaTeX document! You can start writing your content here. \section{Getting Started} LaTeX Cloud Studio makes it easy to create professional documents. Simply: \begin{enumerate} \item Write your content using LaTeX markup \item The PDF updates automatically \item Download or share when ready \end{enumerate} \section{Math Example} LaTeX excels at mathematical expressions: \begin{equation} E = mc^2 \end{equation} \section{Conclusion} You're now ready to create amazing documents with LaTeX Cloud Studio! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-template.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/getting-started-cloud-studio-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=getting_started_cloud_studio)### Step 3: Start Writing1. **Replace the title and author** with your information 2. **Edit the content** - replace the example text with your own 3. **Watch the PDF update** in real-time as you type 4. **Use the toolbar** for common formatting options> [!TIP] > > **Pro tip**: Use `Ctrl+S` (or `Cmd+S` on Mac) to manually save your work, though LaTeX Cloud Studio auto-saves every few seconds.## Interface Overview### Main Editor Components| Component | Description | Location | | - | - | - | | **File Explorer** | Browse your project files | Left sidebar | | **Code Editor** | Write your LaTeX source | Center panel | | **PDF Preview** | Live preview of output | Right panel | | **Compiler Output** | Error messages and logs | Bottom panel |### Key Features#### Real-time PreviewYour PDF updates automatically as you type. No need to manually compile!#### Syntax HighlightingLaTeX commands are color-coded to help you write error-free code.#### Error DetectionErrors are highlighted in red with helpful descriptions in the output panel.#### Auto-completionStart typing LaTeX commands and get intelligent suggestions.## Quick Start TemplatesChoose from our professional templates to get started immediately:> [card] Academic Article > > Perfect for research papers and journal submissions > > * IEEE, ACM, and custom formats > * Bibliography support > * Mathematical equations> [card] Business Report > > Professional reports and documentation > > * Executive summary layouts > * Charts and graphs > * Company branding options> [card] Presentation > > Create stunning slides with Beamer > > * Multiple themes available > * Animations and transitions > * Speaker notes support> [card] CV/Resume > > Professional CVs and resumes > > * Academic and industry formats > * Multiple column layouts > * Contact information templates## Essential LaTeX Basics### Document StructureEvery LaTeX document follows this basic structure:```latex basic-structure.tex theme=\{null} \documentclass{article} % Document type \usepackage{amsmath} % Optional: additional math features % Preamble - document settings go here \begin{document} % Your content goes here \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Common Formatting```latex formatting-examples.tex theme=\{null} % Text formatting \textbf{Bold text} \textit{Italic text} \underline{Underlined text} % Sections \section{Main Section} \subsection{Subsection} \subsubsection{Sub-subsection} % Lists \begin{itemize} \item First item \item Second item \end{itemize} \begin{enumerate} \item Numbered item \item Another numbered item \end{enumerate} % Math Inline math: $E = mc^2$ Display math: \begin{equation} \sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from formatting-examples.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/getting-started-cloud-studio-03/page-1.svg)
## Collaboration Features### Sharing Your Project1) Click the **"Share"** button in the top toolbar 2) Invite collaborators from the project workspace 3) Owners keep control of project access while editors can contribute directly 4) Use in-document comments for review and feedback### Real-time Editing- **See live cursors** of other editors - **Changes sync instantly** across all users - **Version history** tracks all changes - **Comment system** for feedback and discussion### Version ControlLaTeX Cloud Studio automatically saves versions of your work:- **Auto-save**: Every few seconds - **Manual snapshots**: Create named versions - **Restore previous versions**: Roll back changes easily - **Compare versions**: See what changed between versions## Cloud Features### File Management- **Organize projects** in folders - **Search across all files** in your account - **Import existing LaTeX projects** by uploading ZIP files - **Export projects** as ZIP files for backup### Packages and Compilation> [!NOTE] > > **All packages included**: LaTeX Cloud Studio comes with the complete TeX Live distribution - over 4,000 packages ready to use without installation.Common packages you can use immediately:```latex example.tex theme=\{null} \usepackage{amsmath} % Enhanced math \usepackage{graphicx} % Images \usepackage{booktabs} % Professional tables \usepackage{tikz} % Graphics and diagrams \usepackage{biblatex} % Bibliography management \usepackage{hyperref} % Links and cross-references ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is preamble configuration. It enables commands or changes formatting, but it does not produce a meaningful standalone page without document content.\
### Compilation OptionsLaTeX Cloud Studio supports multiple compilers:- **pdfLaTeX**: Default, fastest compilation - **XeLaTeX**: Unicode and system fonts - **LuaLaTeX**: Advanced features and scripting - **LaTeX → DVI**: Traditional workflow## Getting Help### Learning Resources> [card] What is LaTeX? > > Understand LaTeX fundamentals and why it's the standard for professional documents[Open](/learn/latex/basics/what-is-latex)> [card] LaTeX in 30 Minutes > > Complete beginner tutorial covering all essential LaTeX concepts[Open](/learn/latex-in-30-minutes)> [card] LaTeX Basics > > Step-by-step guides for document creation, formatting, and structure[Open](/learn/latex/basics/creating-first-document)> [card] Math & Science > > Comprehensive guides for mathematical typesetting and scientific documents[Open](/learn/latex/mathematics/basics)> [card] Templates Gallery > > Ready-to-use templates for articles, reports, presentations, and more[Open](/templates/article)> [card] FAQ > > Answers to common questions about LaTeX and LaTeX Cloud Studio[Open](/faq)### Product Docs> [card] Editor & AI Assistance > > Canonical guide for the editor, inline AI, proofreading, and search[Open](/product/editor-and-ai-assistance)> [card] Collaboration & History > > Current sharing, comments, version-history, and snapshots workflows[Open](/product/collaboration-comments-and-history)> [card] Projects & Files > > Project creation, ZIP upload, template usage, and file-management guidance[Open](/product/projects-files-and-templates)> [card] GitHub Sync & Transfer > > Import repositories, push/pull changes, and move projects with ZIP exports[Open](/product/github-sync-import-export)### Support Options- **Product behavior**: Start with the [Product Docs overview](/product) - **LaTeX learning help**: Use the [Learn](/learn/latex-in-30-minutes) and [How-to Guides](/learn/latex/how-to/first-project) - **Common questions**: Check the [FAQ](/faq) - **Website contact path**: Visit the [main website](https://www.latex-cloud-studio.com/)### Common Issues> [!WARNING] > > **Compilation errors**: Check the output panel for error messages and line numbers. Most errors are due to: > > * Missing `\end{...}` commands > * Typos in command names > * Missing packages (though rare in Cloud Studio) > * Unmatched braces `{` or `}`## Next StepsNow that you've created your first document, explore these features:1. **Try different templates** - See what's possible with LaTeX 2. **Learn basic LaTeX** - Follow our [30-minute tutorial](/learn/latex-in-30-minutes) 3. **Learn the editor workflow** - Review [Editor & AI Assistance](/product/editor-and-ai-assistance) 4. **Invite collaborators** - Review [Collaboration & History](/product/collaboration-comments-and-history) 5. **Move projects in and out** - Review [GitHub Sync & Import/Export](/product/github-sync-import-export)> [!TIP] > > **Pro tip**: Start with templates similar to what you want to create, then customize them. This is faster than starting from scratch and helps you learn LaTeX patterns.## Quick Reference### Essential Shortcuts| Shortcut | Action | | - | - | | `Ctrl+S` / `Cmd+S` | Save document | | `Ctrl+/` / `Cmd+/` | Comment/uncomment line | | `Ctrl+D` / `Cmd+D` | Duplicate line | | `Ctrl+F` / `Cmd+F` | Find and replace | | `Ctrl+Z` / `Cmd+Z` | Undo | | `Ctrl+Y` / `Cmd+Y` | Redo |### Common LaTeX Commands```latex example.tex theme=\{null} % Document structure \section{Title} \subsection{Subtitle} \paragraph{Paragraph title} % Text formatting \textbf{bold} \textit{italic} \texttt{monospace} % Math $inline math$ \begin{equation} display math \end{equation} % Lists \begin{itemize} \item bullet point \end{itemize} % References \label{key} \ref{key} \cite{citation-key} \begin{thebibliography}{1} \bibitem{citation-key} Author. \emph{Example reference}. 2026. \end{thebibliography} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/getting-started-cloud-studio-05/page-1.svg)
***> [!NOTE] > > **Ready to dive deeper?** Continue with our comprehensive [LaTeX in 30 minutes](/learn/latex-in-30-minutes) tutorial to master the fundamentals, or browse our [template gallery](/templates/article) for inspiration.## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=cloud_studio_open_app)> [card] Start from Article Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/article)> [card] Browse Product Docs > > Use the canonical product documentation for current app workflows and feature behavior.[Open](/product)Still comparing options? See the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=cloud_studio_online_editor) overview and the [pricing and free plan](https://www.latex-cloud-studio.com/pricing?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=cloud_studio_pricing). # Learn LaTeX: Free Tutorials, Examples, Templates, and Reference Source: https://resources.latex-cloud-studio.com/index Learn LaTeX with free tutorials, copy-paste examples, troubleshooting guides, templates, and quick reference for equations, tables, citations, and formatting. Learn LaTeX with step-by-step tutorials, syntax references, copy-paste examples, and troubleshooting guides. Use this hub when you need to start from zero, fix a specific syntax problem, find a command quickly, or open a working template instead of building from scratch. ## Choose the Fastest Starting Point > [card] [Learn LaTeX from zero](/learn/latex-in-30-minutes) > > [Build a working document in 30 minutes](/learn/latex-in-30-minutes), then continue with the [core syntax guide](/learn/latex/basics). > [card] [Find syntax or fix an error](/learn/reference/symbols) > > [Look up a command quickly](/learn/reference/symbols) or diagnose a failed build with the [common-errors guide](/blog/common-latex-errors-fixes). > [card] [Start a real document](/templates/article) > > [Choose a working template](/templates/article) for an article, thesis, CV, or presentation, then adapt it with a [step-by-step guide](/learn/latex/how-to/using-templates). > [card] [Build a research workflow](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=docs_home) > > [Connect source material](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=docs_home), literature discovery, citations, and writing in one project with the [product docs](/product). ## Popular LaTeX Guides > [card] How to Make Text Bold in LaTeX > > `\textbf{}`, italics, underline, and `\emph{}` with copy-paste examples. [Open](/learn/latex/basics/bold-italics-underlining) > [card] LaTeX Figure Positioning > > Learn float placement, `[h]`, `[t]`, `[b]`, `[p]`, and `[H]` without layout surprises. [Open](/learn/latex/figures/positioning) > [card] LaTeX Tables > > Build tables with `tabular`, `booktabs`, decimal alignment, and multi-column cells. [Open](/learn/latex/tables/creating-tables) > [card] Brackets and Parentheses > > Use `()`, `[]`, `\{ \}`, `\left`, and `\right` correctly in math expressions. [Open](/learn/latex/mathematics/brackets-parentheses) > [card] Subscripts and Superscripts > > Write `x_1`, `x_{n+1}`, exponents, tensor notation, and chemistry formulas without syntax errors. [Open](/learn/latex/mathematics/subscripts-superscripts) > [card] Page Numbering > > Set roman or arabic numbering, restart counters, and build page styles for long documents. [Open](/learn/latex/formatting/page-numbering) > [card] Headers and Footers > > Control running heads, page styles, and `fancyhdr` layouts for reports and books. [Open](/learn/latex/formatting/headers-footers) ## Learning Paths ### For Absolute Beginners Start with [Learn LaTeX in 30 minutes](/learn/latex-in-30-minutes), then move into [LaTeX Basics](/learn/latex/basics) and [What is LaTeX?](/learn/latex/basics/what-is-latex). ### For Academic Writing Use [Bibliography and Citations](/learn/latex/bibliography-citations), [Writing a Research Paper](/learn/latex/how-to/writing-research-paper), and [Cross-referencing](/learn/latex/cross-referencing). ### For Figures, Tables, and Math Jump to [Tables](/learn/latex/tables/creating-tables), [Figure Positioning](/learn/latex/figures/positioning), [Matrices](/learn/latex/mathematics/matrices), and [Brackets and Parentheses](/learn/latex/mathematics/brackets-parentheses). ### For Real Document Workflows Follow guides for [presentations](/learn/latex/how-to/presentations), [CVs and resumes](/learn/latex/how-to/cv-resume), [theses and dissertations](/templates/thesis), and [large documents](/learn/latex/how-to/large-documents). ## Best Starting Pages By Goal * Learn the syntax from scratch: [Learn LaTeX in 30 minutes](/learn/latex-in-30-minutes) * Understand what LaTeX is and when to use it: [What is LaTeX?](/learn/latex/basics/what-is-latex) * Build a working project quickly: [Creating your first LaTeX project](/learn/latex/how-to/first-project) * Start from a working paper template: [Article templates](/templates/article) * Start from a thesis structure: [Thesis templates](/templates/thesis) * Start from a CV or resume template: [CV templates](/templates/cv) * Search symbols and commands fast: [Reference](/learn/reference/symbols) ## Why People Use LaTeX LaTeX is widely used for research papers, technical reports, theses, books, and presentations because it handles structure and formatting reliably. * **Consistent formatting**: Structure the document once, then write without fighting layout by hand. * **Strong math support**: Equations, symbols, matrices, and scientific notation are first-class. * **Plain-text workflow**: Files work well with Git, code review, and long-term collaboration. * **Reusable templates**: Start from established article, thesis, CV, and presentation structures. * **Free and open source**: LaTeX itself is free to use. ## Popular Topics > [card] Mathematics > > Equations, matrices, theorems [Open](/learn/latex/mathematics/basics) > [card] Tables > > Create professional tables [Open](/learn/latex/tables/creating-tables) > [card] Figures > > Insert and position images [Open](/learn/latex/figures/inserting-images) > [card] Bibliography > > Citations and references [Open](/learn/latex/bibliography-citations) > [card] Beamer > > Create presentations [Open](/learn/latex/how-to/presentations) > [card] Errors > > Troubleshooting guide [Open](/learn/latex/basics/errors) ## Product Docs > [card] Editor & AI Assistance > > Current editor workflows, inline AI, proofreading, search, and problem-fixing guidance. [Open](/product/editor-and-ai-assistance) > [card] Collaboration & History > > Invites, comments, live collaboration signals, version history, and snapshots. [Open](/product/collaboration-comments-and-history) > [card] Projects & Templates > > Create projects, upload ZIPs, manage files, and start from templates. [Open](/product/projects-files-and-templates) > [card] Account & Settings > > Profile, theme, compile-engine defaults, syntax colors, and account-level context. [Open](/product/account-and-settings) > [card] Knowledge Base > > Keep papers and extracted source text inside the same project as the manuscript. [Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=docs_home) > [card] AI Research Agent > > Run literature discovery, expand from accepted sources, and move evidence toward citations. [Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=docs_home) ## Compare Editors And Migrate > [card] Overleaf Alternative Comparison > > Compare LaTeX Cloud Studio and Overleaf on collaboration, privacy, AI workflows, templates, and Git support. [Open](/vs/overleaf) > [card] TeXstudio vs Cloud Editor > > Decide whether a local editor or a browser-based LaTeX workflow fits your next project. [Open](/vs/texstudio) ## Latest Updates > [!NOTE] > > We now separate product behavior from LaTeX learning content. Use [Product Docs](/product) for editor, project, research workflow, collaboration, and integration guidance, and explore our [blog](/blog/index) for broader updates. ## Get Help * **Quick Questions**: Check our [FAQ](/faq) * **Contact Support**: Visit our [website](https://www.latex-cloud-studio.com/) *** Ready to start? Jump into our [Learn LaTeX in 30 minutes](/learn/latex-in-30-minutes) tutorial and create your first professional document today! ## Start in LaTeX Cloud Studio > [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=cta\&utm_campaign=research_workflow\&utm_content=docs_home_open_app) > [card] Start from Article Template > > Use a ready-made template, then adapt it to your content. [Open](/templates/article) > [card] Read Product Docs > > See the canonical documentation for editor workflows, collaboration, GitHub sync, and troubleshooting. [Open](/product) > [card] Research Workflow Docs > > See how the knowledge base and AI research agent fit into a paper-writing workflow. [Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=docs_home_start_section) # Learn LaTeX in 30 minutes Source: https://resources.latex-cloud-studio.com/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).> [!NOTE] > > **Time to complete**: 30 minutes\ > **Prerequisites**: None\ > **What you'll learn**: Document creation, formatting, images, math, and tables## 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 DocumentLet's dive right in! Here's the simplest possible LaTeX document:```latex basic-document.tex theme=\{null} \documentclass{article} \begin{document} Hello, LaTeX! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-document.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_in_30_minutes)### Understanding the StructureEvery 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.## Adding Title and AuthorLet's make our document more professional by adding metadata:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from document-with-title.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-02/page-1.svg)
The `\maketitle` command creates a nicely formatted title block using the information you provided in the preamble.## Text FormattingLaTeX provides simple commands for text formatting:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from text-formatting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-03/page-1.svg)
### 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 ListsLaTeX makes it easy to create both bullet points and numbered lists:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from lists.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-04/page-1.svg)
## Adding Math EquationsThis is where LaTeX truly shines! You can add math inline with `$...$` or as display equations with `\[...\]`:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-examples.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-05/page-1.svg)
> [!NOTE] > > LaTeX has hundreds of mathematical symbols and operators. Check our [math reference guide](/learn/reference/symbols) for a complete list.## Inserting ImagesTo add images to your document, you'll need the `graphicx` package:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from images.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-07/page-1.svg)
### Image Positioning Options- `[h]` - here (approximately) - `[t]` - top of page - `[b]` - bottom of page - `[p]` - separate page for floats## Creating TablesTables in LaTeX are powerful but need a bit of practice:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from simple-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-06/page-1.svg)
### Table Column Alignment- `l` - left aligned - `c` - centered - `r` - right aligned - `|` - vertical line## Document StructureFor longer documents, use sections to organize your content:```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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from document-structure.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-08/page-1.svg) Open zoomable preview: Compiled PDF page 2 from document-structure.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-08/page-2.svg)
The `\tableofcontents` command automatically generates a table of contents based on your sections!## Comments in LaTeXUse `%` to add comments that won't appear in the output:```latex example.tex 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} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-in-30-minutes-09/page-1.svg)
## Common PackagesExtend LaTeX's functionality with packages. Here are essential ones:```latex example.tex 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} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code performs setup or defines reusable behavior without producing visible page content on its own. It must be used inside a complete document to have a rendered result.\
## Troubleshooting Common Errors> [!WARNING] > > LaTeX errors can be cryptic. Here are the most common ones and how to fix them:### 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**Problem**: Content before document begins\ **Solution**: Move content after `\begin{document}`## Your Complete First DocumentLet's put it all together! Here's a complete document showcasing everything you've learned:```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} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Next StepsCongratulations! You've just created your first LaTeX documents. Here's what to explore next:> [card] Document Classes > > Learn about article, report, book, and more[Open](/learn/reference/document-classes)> [card] Advanced Math > > Matrices, theorems, and complex equations[Open](/learn/latex/mathematics/basics)> [card] Bibliography > > Manage citations and references[Open](/learn/latex/bibliography-citations)> [card] Custom Styling > > Fonts, colors, and page layouts[Open](/learn/latex/text-formatting)## 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 CardKeep 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.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> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=latex_in_30_minutes_open_app)> [card] Start from Article Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/article) # Create a LaTeX Document Class Source: https://resources.latex-cloud-studio.com/learn/latex/advanced/create-a-document-class Build custom LaTeX document classes (.cls) for standardized structure and formatting across teams. Use a custom class when multiple documents must follow one format policy.A shared look can live at three levels: a customized preamble, a `.sty` package, or a `.cls` document class. Start at the lowest level that does the job and move up only when you need to.## Level 1: Customize the Preamble`article`, `report` and `book` are more customizable than they look. `titlesec` (section styling), `fancyhdr` (headers and footers) and `geometry` (margins) cover most "we want our own look" requirements:```latex customized-article.tex theme=\{null} \documentclass[11pt]{article} \usepackage[margin=2.5cm]{geometry} \usepackage{titlesec} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\itshape Lattice Models of Active Matter} \fancyhead[R]{\thepage} \titleformat{\section} {\large\bfseries\sffamily}{\thesection}{1em}{}[\titlerule] \begin{document} \section{Introduction} This article class is customized in the preamble: sans-serif ruled section titles via \texttt{titlesec} and a running header via \texttt{fancyhdr} --- no custom class file needed yet. \section{Method} When several documents share this preamble, that is the moment to move it into a class of its own. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from customized-article.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-latex-document-classes-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_advanced_create_a_document_class)If only one or two documents need this look, stop here. A preamble is the easiest level to understand, debug and hand to a co-author.## Level 2: Move the Preamble into a `.sty` PackageWhen the same preamble appears in a second document, move it into a package:```latex groupstyle.sty theme=\{null} % groupstyle.sty — shared look for all group documents \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{groupstyle}[2026/08/14 Group house style] \RequirePackage[margin=2.5cm]{geometry} \RequirePackage{titlesec} \RequirePackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyhead[R]{\thepage} \titleformat{\section} {\large\bfseries\sffamily}{\thesection}{1em}{}[\titlerule] \endinput ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
Each document then starts with `\documentclass{article}` and `\usepackage{groupstyle}`. Inside package files, use `\RequirePackage` instead of `\usepackage`, and give `\ProvidesPackage` a date so LaTeX can report version mismatches. A package builds on a standard class, so everything written for `article` keeps working. For most teams this is the right stopping point; see [Create a LaTeX package](/learn/latex/advanced/create-a-latex-package) for more.## Level 3: Write a `.cls` Document ClassWrite a class when you need to change what the document is (its title layout, sectioning model or default structure), not only its styling.### Minimal Class Skeleton```latex myreport.cls theme=\{null} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myreport}[2026/02/16 Team report class] \LoadClass[11pt,a4paper]{article} \RequirePackage{geometry} \geometry{margin=1in} \RequirePackage{hyperref} \newcommand{\reporttitle}[1]{\def\@reporttitle{#1}} \newcommand{\@reporttitle}{Untitled Report} \AtBeginDocument{\title{\@reporttitle}} \endinput ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### Usage```latex class-usage.tex theme=\{null} \documentclass{myreport} \reporttitle{Quarterly Technical Report} \author{Team Name} \date{\today} \begin{document} \maketitle \section{Overview} Report body. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Forward Options and Override the TitleA class that builds on `article` follows one pattern: declare the class, forward unknown options to the base class, load the base class, then override what must change. This class reuses the Level 2 package and replaces `\maketitle`:```latex groupreport.cls theme=\{null} % groupreport.cls — a class for the group's reports \NeedsTeXFormat{LaTeX2e} \ProvidesClass{groupreport}[2026/08/14 Group report class] % Pass unknown options (e.g. 12pt) through to article \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions\relax \LoadClass[11pt]{article} \RequirePackage{groupstyle} % reuse the level-2 package % Class-level behavior: a custom title block \renewcommand{\maketitle}{% \begin{flushleft} {\LARGE\bfseries\sffamily \@title\par} \vspace{4pt} {\normalsize \@author \,---\, \@date\par} \end{flushleft} \vspace{1em}\hrule\vspace{2em}% } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
Documents that use the class stay short:```latex using-class.tex theme=\{null} % report.tex — a document using the custom class \documentclass{groupreport} % loads groupreport.cls \title{Quarterly Simulation Report} \author{Jane Doe} \begin{document} \maketitle \section{Results} Every report in the group now shares one look, maintained in one file. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
Building on `article` with `\LoadClass` means you inherit its tested behavior and maintain only your differences. Writing a class from scratch is rarely the right call.## Practical Rules- **`\makeatletter` and `\makeatother` are only needed in documents.** Inside `.sty` and `.cls` files, `@` is already a letter, so commands such as `\@title` work directly. - **Date the `\ProvidesClass` line** and update it on every change, so you can tell which class version produced a PDF. - **Keep content out of the class.** A class defines how documents look, not what they say. Boilerplate text belongs in a template document. - **Ship the class with the documents.** Put the `.cls` file in the project, or in a shared Git repository, instead of a local `texmf` tree. TeX finds files in the project folder first, so every collaborator and every CI build compiles with the same class.## Related Pages- [Create a LaTeX package](/learn/latex/advanced/create-a-latex-package) - [Document classes reference](/learn/reference/document-classes) # Create a LaTeX Package Source: https://resources.latex-cloud-studio.com/learn/latex/advanced/create-a-latex-package Build reusable LaTeX packages (.sty) for custom commands and environments across multiple projects. Create a package when custom commands are reused across multiple documents.## Minimal Package Skeleton```latex mypackage.sty theme=\{null} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mypackage}[2026/02/16 Custom macros] \RequirePackage{xcolor} \newcommand{\todoitem}[1]{\textcolor{red}{TODO: #1}} \newenvironment{note}{\begin{quote}\itshape}{\end{quote}} \endinput ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Use the Package```latex use-package.tex theme=\{null} \documentclass{article} \usepackage{mypackage} \begin{document} \todoitem{Refine experiment section} \begin{note} Internal drafting note. \end{note} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Related Pages- [Create a LaTeX document class](/learn/latex/advanced/create-a-document-class) - [Package management](/learn/latex/package-management) # Understanding TeX Boxes with LuaTeX - Advanced Guide Source: https://resources.latex-cloud-studio.com/learn/latex/advanced/luatex-boxes Deep dive into TeX's box model using LuaTeX. Learn how LaTeX creates pages, debug layout issues, and manipulate boxes programmatically. Explore the **inner workings of TeX's box model** using LuaTeX's powerful Lua integration. This advanced guide reveals how LaTeX constructs documents internally and provides practical techniques for debugging and manipulating the typesetting process.> [!WARNING] > > **Advanced Topic**: This guide assumes strong LaTeX knowledge and basic programming experience. For LaTeX basics, start with [Creating Your First Document](/learn/latex/basics/creating-first-document).## What You'll Learn- ✅ TeX's fundamental box model concepts - ✅ How LaTeX builds pages from boxes - ✅ Using LuaTeX to inspect box contents - ✅ Practical debugging techniques - ✅ Manipulating boxes programmatically - ✅ Real-world applications - ✅ Performance considerations## Introduction to TeX Boxes### What Are Boxes?In TeX, everything on a page is built from **boxes**. Think of boxes as rectangular containers that hold content:> [card] Expected output > > The TeX Box Hierarchy shows the progression from smallest to largest units: Character (single glyph box) flows into hbox (horizontal list of characters/words), which combines into vbox (vertical list of lines/paragraphs), ultimately forming the complete Page output. Each level nests within the next, building the document structure from individual glyphs up to full pages.### Box Types> [card] hbox (Horizontal Box) > > Contains items arranged horizontally: > > * Characters in a word > * Words in a line > * Inline math > > `\hbox{Hello World}`> [card] vbox (Vertical Box) > > Contains items arranged vertically: > > * Lines in a paragraph > * Paragraphs on a page > * Display math > > `\vbox{Line 1\\Line 2}`> [card] Glue (Flexible Space) > > Stretchable/shrinkable space: > > * Between words > * Between paragraphs > * For justification > > `\hskip 1em plus 2pt minus 1pt`## LuaTeX: Opening Pandora's Box### What Makes LuaTeX Special?LuaTeX embeds the Lua programming language directly into TeX, providing:1) **Direct access** to TeX's internal structures 2) **Ability to manipulate** nodes and boxes 3) **Powerful debugging** capabilities 4) **Performance optimizations** through callbacks### Basic Box Inspection```latex inspect-box-basic.tex theme=\{null} \documentclass{article} \begin{document} % Create a simple box \setbox0=\hbox{Hello World} % Inspect it with Lua \directlua{ local box = tex.box[0] print("Box width: " .. box.width / 65536 .. "pt") print("Box height: " .. box.height / 65536 .. "pt") print("Box depth: " .. box.depth / 65536 .. "pt") } % Use the box \box0 \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from inspect-box-basic.tex Generated from the shown source with LuaLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-advanced-luatex-boxes-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_advanced_luatex_boxes)**Console output:**``` Box width: 50.27774pt Box height: 6.94444pt Box depth: 0.0pt ```### Understanding Node ListsEvery box contains a **node list** - a linked list of items:```latex node-list-inspection.tex theme=\{null} \documentclass{article} \begin{document} \setbox0=\hbox{Hi} \directlua{ local box = tex.box[0] local head = box.head -- Traverse the node list for node in node.traverse(head) do print("Node type: " .. node.id .. " (" .. node.type(node.id) .. ")") if node.id == node.id("glyph") then print(" Character: " .. unicode.utf8.char(node.char)) print(" Font: " .. node.font) elseif node.id == node.id("glue") then print(" Width: " .. node.width / 65536 .. "pt") end end } \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
**Console output:**``` Node type: 0 (glyph) Character: H Font: 1 Node type: 0 (glyph) Character: i Font: 1 ```## Practical Box Visualization### Creating a Box Inspector```latex box-inspector.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \directlua{ function inspect_box(n) local box = tex.box[n] if not box then print("Box " .. n .. " is empty") return end print("\string\nBox " .. n .. " properties:") print(" Type: " .. (box.id == 0 and "hbox" or "vbox")) print(" Width: " .. box.width / 65536 .. "pt") print(" Height: " .. box.height / 65536 .. "pt") print(" Depth: " .. box.depth / 65536 .. "pt") -- Count nodes local count = 0 for node in node.traverse(box.head) do count = count + 1 end print(" Nodes: " .. count) end } \newcommand{\inspectbox}[1]{% \directlua{inspect_box(#1)}% } \begin{document} % Create different types of boxes \setbox1=\hbox{Simple text} \setbox2=\hbox{$x^2 + y^2 = z^2$} \setbox3=\vbox{\hsize=3cm Lorem ipsum dolor sit amet.} \inspectbox{1} \inspectbox{2} \inspectbox{3} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
### Visualizing Box Structure```latex visualize-boxes.tex theme=\{null} \documentclass{article} \usepackage{tikz} \directlua{ function draw_box_structure(n, x, y) local box = tex.box[n] if not box then return end -- Draw box outline tex.print("\string\\draw[red,thick] (" .. x .. "," .. y .. ") rectangle +(" .. box.width/65536 .. "pt," .. box.height/65536 .. "pt);") -- Draw baseline tex.print("\string\\draw[blue,dashed] (" .. x .. "," .. y .. ") -- +(" .. box.width/65536 .. "pt,0);") -- Add dimensions tex.print("\string\\node[above,font=\string\\tiny] at (" .. x + box.width/131072 .. "," .. y + box.height/65536 .. ") {" .. string.format("%.1f", box.width/65536) .. "pt};") end } \begin{document} \setbox0=\hbox{Sample Text} \begin{tikzpicture} \directlua{draw_box_structure(0, 0, 0)} \node at (0,0) {\box0}; \end{tikzpicture} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
**Expected output:**> [card] Expected output > > The visualization displays "Sample Text" enclosed in a red rectangular border representing the hbox boundaries. A blue dashed line runs horizontally through the box indicating the baseline. Above the box, the width measurement "53.1pt" is displayed, showing the precise box dimensions calculated by TeX. This visual debugging technique helps identify box boundaries, baselines, and measurements during document development.## Advanced Box Manipulation### Modifying Box Contents```latex modify-boxes.tex theme=\{null} \documentclass{article} \directlua{ function add_color_to_glyphs(head) for n in node.traverse(head) do if n.id == node.id("glyph") then -- Insert color node before glyph local color = node.new(node.id("whatsit"), node.subtype("pdf_colorstack")) color.stack = 0 color.cmd = 1 -- push color.data = "1 0 0 rg" -- red color head = node.insert_before(head, n, color) -- Insert color reset after glyph local reset = node.new(node.id("whatsit"), node.subtype("pdf_colorstack")) reset.stack = 0 reset.cmd = 2 -- pop head = node.insert_after(head, n, reset) end end return head end -- Register callback luatexbase.add_to_callback("pre_linebreak_filter", add_color_to_glyphs, "color glyphs") } \begin{document} This text will have each character colored individually! \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
### Box Metrics Analysis```latex box-metrics.tex theme=\{null} \documentclass{article} \directlua{ function analyze_paragraph_boxes() local head = tex.lists.page_head if not head then return end local line_count = 0 local total_badness = 0 for n in node.traverse(head) do if n.id == node.id("hlist") then line_count = line_count + 1 -- Check glue settings if n.glue_sign == 1 then -- stretching print("Line " .. line_count .. " stretched by factor " .. n.glue_set) elseif n.glue_sign == 2 then -- shrinking print("Line " .. line_count .. " shrunk by factor " .. n.glue_set) end end end end -- Add to shipout callback luatexbase.add_to_callback("pre_shipout_filter", function(head) analyze_paragraph_boxes() return head end, "analyze paragraphs") } \begin{document} \parbox{3cm}{ This is a narrow paragraph that will likely have some badly stretched or compressed lines that we can detect and analyze using our Lua code. } \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
## Real-World Applications### 1. Debugging Overfull/Underfull Boxes```latex debug-badboxes.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \directlua{ -- Highlight overfull hboxes function highlight_overfull_boxes(head, groupcode) for n in node.traverse(head) do if n.id == node.id("hlist") and n.width > tex.hsize then -- Create a rule to highlight local rule = node.new(node.id("rule")) rule.width = n.width rule.height = n.height rule.depth = n.depth -- Add color local color = node.new(node.id("whatsit"), node.subtype("pdf_colorstack")) color.stack = 0 color.cmd = 1 color.data = "1 0 0 0.2 k" -- light red n.head = node.insert_before(n.head, n.head, color) n.head = node.insert_before(n.head, n.head, rule) end end return head end luatexbase.add_to_callback("post_linebreak_filter", highlight_overfull_boxes, "highlight overfull") } \begin{document} This line contains a verylongwordthatwillcauseanoverfullhbox in our text. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from debug-badboxes.tex Generated from the shown source with LuaLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-advanced-luatex-boxes-07/page-1.svg)
### 2. Custom Line Breaking```latex custom-linebreak.tex theme=\{null} \documentclass{article} \directlua{ function custom_linebreak_filter(head, is_display) -- Get natural breaks local copy = node.copy_list(head) local params = { hsize = tex.hsize, emergencystretch = tex.emergencystretch, pretolerance = tex.pretolerance, tolerance = tex.tolerance } local breaks, info = tex.linebreak(copy, params) -- Analyze break quality if info.prevgraf > 5 then -- For long paragraphs, try different parameters params.tolerance = 2000 params.emergencystretch = tex.sp("3em") local alt_breaks, alt_info = tex.linebreak(head, params) if alt_info.demerits < info.demerits then print("Using alternative line breaking") return alt_breaks end end return breaks end luatexbase.add_to_callback("linebreak_filter", custom_linebreak_filter, "custom linebreak") } \begin{document} \noindent This paragraph demonstrates custom line breaking logic that adjusts parameters based on paragraph length and quality metrics. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
### 3. Box Measurement Tools```latex measure-content.tex theme=\{null} \documentclass{article} \directlua{ function measure_content(text) -- Create temporary box local box = node.hpack( node.copy_list( tex.nest[tex.nest.ptr].head ) ) print("Content measurements:") print(" Width: " .. box.width / 65536 .. "pt") print(" Height: " .. box.height / 65536 .. "pt") print(" Depth: " .. box.depth / 65536 .. "pt") -- Calculate ink coverage local glyph_area = 0 for n in node.traverse(box.head) do if n.id == node.id("glyph") then glyph_area = glyph_area + n.width * n.height end end local total_area = box.width * (box.height + box.depth) local coverage = glyph_area / total_area * 100 print(" Ink coverage: " .. string.format("%.1f%%", coverage)) end } \newcommand{\measure}[1]{% \setbox0=\hbox{#1}% \directlua{ local b = tex.box[0] measure_content() }% \box0% } \begin{document} \measure{Sample text for measurement} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
## Debugging Techniques### Visual Box Debugging```latex visual-debug.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \directlua{ local show_boxes = true function visualize_boxes(head, groupcode) if not show_boxes then return head end for n in node.traverse(head) do if n.id == node.id("hlist") or n.id == node.id("vlist") then -- Add colored frame local rule = node.new(node.id("rule")) rule.width = tex.sp("0.1pt") rule.height = n.height + tex.sp("2pt") rule.depth = n.depth + tex.sp("2pt") -- Different colors for different box types local color = n.id == node.id("hlist") and "0 0 1" or "1 0 0" -- blue/red -- Insert visualization -- (simplified for clarity) end end return head end } % Toggle command \newcommand{\showboxes}{\directlua{show_boxes = true}} \newcommand{\hideboxes}{\directlua{show_boxes = false}} \begin{document} \showboxes This text will show box boundaries. \hideboxes This text will not. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
### Performance Profiling```latex profile-boxes.tex theme=\{null} \documentclass{article} \directlua{ local stats = { total_boxes = 0, total_glyphs = 0, total_glue = 0, processing_time = 0 } function profile_document(head) local start_time = os.clock() for n in node.traverse_id(node.id("hlist"), head) do stats.total_boxes = stats.total_boxes + 1 for m in node.traverse(n.head) do if m.id == node.id("glyph") then stats.total_glyphs = stats.total_glyphs + 1 elseif m.id == node.id("glue") then stats.total_glue = stats.total_glue + 1 end end end stats.processing_time = os.clock() - start_time return head end function print_stats() print("\string\nDocument Statistics:") print(" Total boxes: " .. stats.total_boxes) print(" Total glyphs: " .. stats.total_glyphs) print(" Total glue nodes: " .. stats.total_glue) print(" Processing time: " .. string.format("%.3f", stats.processing_time) .. "s") end luatexbase.add_to_callback("post_linebreak_filter", profile_document, "profile") } \AtEndDocument{\directlua{print_stats()}} \begin{document} Your document content here... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is a partial LuaLaTeX programming excerpt whose result depends on the surrounding Lua and TeX program. It is kept as source-level guidance rather than presented as a standalone rendered page.\
## Best Practices### 1. Performance Considerations> [!TIP] > > **Performance Tips** > > * **Cache calculations**: Store results of expensive operations > * **Minimize traversals**: Use specific node types when possible > * **Batch operations**: Group modifications together > * **Clean up**: Free unused nodes with `node.free()`### 2. Safety Guidelines> [!WARNING] > > **Important Safety Rules:** > > * Always check if nodes exist before accessing > * Use `node.copy_list()` when modifying shared content > * Be careful with callbacks - they affect all processing > * Test thoroughly - box manipulation can break output### 3. Debugging Workflow1) **Start simple**: Test with minimal examples 2) **Use print statements**: Track execution flow 3) **Visualize**: Draw boxes to understand structure 4) **Compare**: Check against known good output 5) **Profile**: Measure performance impact## Quick Reference> [card] Expected output > > LuaTeX Box Commands Quick Reference covers three key areas: Box Access functions include tex.box\[n] for accessing numbered boxes, node.traverse(head) for iterating node lists, node.traverse_id(id, head) for type-specific traversal, and node.copy_list(head) for duplicating lists. Node Properties include node.id/next/prev for navigation, box.width/height/depth for dimensions, glyph.char/font for character info, and glue.width/stretch for spacing. Common Callbacks include pre_linebreak_filter, post_linebreak_filter, pre_shipout_filter, and buildpage_filter for intercepting TeX processing at different stages.## Related Pages- [Create a LaTeX package](/learn/latex/advanced/create-a-latex-package) - [Create a document class](/learn/latex/advanced/create-a-document-class) - [Theorems and proof environments](/learn/latex/advanced/theorems-and-proof-environments) - [Align and multline environments](/learn/latex/mathematics/align-and-multline-environments) - [Package management](/learn/latex/package-management)## Further Resources> [card] LuaTeX Reference > > Official LuaTeX documentation[Open](https://www.luatex.org/svn/trunk/manual/luatex.pdf)> [card] TeX by Topic > > Deep dive into TeX internals[Open](https://texdoc.org/serve/texbytopic/0)> [card] Node Library > > Complete node reference[Open](https://www.luatex.org/svn/trunk/manual/luatex-nodes.pdf)> [card] Article Template > > Starter article template with common patterns[Open](/templates/article)> [!NOTE] > > **LaTeX Cloud Studio** supports LuaTeX! Enable it in your project settings to use these advanced features. Our platform provides enhanced debugging output and visualization tools. # Theorems and Proof Environments in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/advanced/theorems-and-proof-environments Define theorem-like environments in LaTeX with amsthm and create clean proof structures for academic writing. Use `amsthm` to build consistent theorem, lemma, and proof sections.## Setup```latex amsthm-setup.tex theme=\{null} \usepackage{amsthm} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Usage```latex theorem-usage.tex theme=\{null} \begin{theorem}[Convergence] Let $f_n$ be a Cauchy sequence in a complete normed space. Then $f_n$ converges. \end{theorem} \begin{proof} Apply completeness and standard norm arguments. \end{proof} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from theorem-usage.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-advanced-theorems-and-proof-environments-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_advanced_theorems_and_proof_environments)## Related Pages- [Align and multline environments](/learn/latex/mathematics/align-and-multline-environments) - [Writing a research paper](/learn/latex/how-to/writing-research-paper) # How to Make Text Bold in LaTeX: \textbf{}, Italics, and Underline Source: https://resources.latex-cloud-studio.com/learn/latex/basics/bold-italics-underlining Make text bold in LaTeX with `\textbf{}`. Copy the exact syntax and learn when to use `\textit{}`, `\emph{}`, or `\underline{}` instead. To make text bold in LaTeX, write `\textbf{bold text}`. Use `\textit{italic text}` for a fixed italic style, `\emph{emphasized text}` for meaning-aware emphasis, and `\underline{underlined text}` only when an underline is specifically required. > [!NOTE] > > **Copy-paste syntax**: `\textbf{bold}`, `\textit{italic}`, `\emph{emphasis}`, `\underline{underline}` > > For the common “bold text in LaTeX” use case, the command you need is `\textbf{}`. It works in normal text and can contain other text-formatting commands. ## Basic Text Formatting ### Bold Text Use `\textbf{}` to make text bold: ```latex bold.tex theme={null} \documentclass{article} \begin{document} This is \textbf{bold text} in a sentence. \textbf{This entire sentence is bold.} You can \textbf{nest other commands like \textit{italic} inside bold}. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from bold.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_bold_italics_underlining) ### Italic Text Use `\textit{}` for italics: ```latex italic.tex theme={null} \documentclass{article} \begin{document} This is \textit{italic text} in a sentence. \textit{This entire sentence is italicized.} LaTeX uses \textit{emphasis} for semantic meaning. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from italic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-02/page-1.svg)
### Underlined Text Use `\underline{}` for underlining: ```latex underline.tex theme={null} \documentclass{article} \begin{document} This is \underline{underlined text} in a sentence. \underline{This entire sentence is underlined.} % Note: Underlining can look messy with descenders The letters \underline{g, j, p, q, y} have descenders. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from underline.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-04/page-1.svg)
> [!WARNING] > > **Avoid overusing underline**: In professional typography, underlining is rarely used. Consider bold or italic for emphasis instead. ## Combining Formats You can combine multiple formatting commands: ```latex combining.tex theme={null} \documentclass{article} \begin{document} % Bold and italic \textbf{\textit{Bold and italic text}} % Italic and underlined \textit{\underline{Italic and underlined}} % All three \textbf{\textit{\underline{Bold, italic, and underlined}}} % Alternative nesting order (same result) \underline{\textbf{\textit{Also all three formats}}} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from combining.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-05/page-1.svg)
## Emphasis Command The `\emph{}` command provides semantic emphasis: ```latex emphasis.tex theme={null} \documentclass{article} \begin{document} % Normal emphasis (produces italic) This is \emph{emphasized text}. % Nested emphasis (toggles back to normal) \emph{This is italic with \emph{nested} emphasis.} % Emphasis is semantic - it adapts to context \textit{In italic text, \emph{emphasis} becomes upright.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from emphasis.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-03/page-1.svg)
> [!TIP] > > Use `\emph{}` when you want to emphasize meaning. Use `\textit{}` when you specifically want italic style. ## Additional Text Styles ### Small Caps ```latex smallcaps.tex theme={null} \documentclass{article} \begin{document} % Small capitals \textsc{Small Capitals Look Like This} % Useful for names and acronyms \textsc{nasa} announced the launch. Written by \textsc{John Smith}, \textsc{phd}. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from smallcaps.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-06/page-1.svg)
### Typewriter (Monospace) ```latex typewriter.tex theme={null} \documentclass{article} \begin{document} % Monospace font for code Type \texttt{latex document.tex} to compile. % File paths Save your file as \texttt{/home/user/document.tex} % Inline code The \texttt{\\textbf} command makes text bold. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from typewriter.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-07/page-1.svg)
### Sans Serif ```latex sans-serif.tex theme={null} \documentclass{article} \begin{document} % Sans serif text \textsf{This is sans serif text.} % Useful for modern look \textsf{\textbf{Bold Sans Serif Heading}} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from sans-serif.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-08/page-1.svg)
### Slanted Text ```latex slanted.tex theme={null} \documentclass{article} \begin{document} % Slanted is different from italic \textsl{This is slanted text.} Compare: \textit{italic} vs \textsl{slanted} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from slanted.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-09/page-1.svg)
## Font Size Commands Combine with text formatting: ```latex sizes.tex theme={null} \documentclass{article} \begin{document} {\large \textbf{Large Bold Text}} {\Large \textit{Even Larger Italic}} {\small \texttt{Small monospace text}} % Size commands from smallest to largest: {\tiny tiny} {\scriptsize scriptsize} {\footnotesize footnotesize} {\small small} {\normalsize normalsize} {\large large} {\Large Large} {\LARGE LARGE} {\huge huge} {\Huge Huge} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from sizes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-10/page-1.svg)
## Color Text (Optional Package) Add color to your formatting: ```latex color.tex theme={null} \documentclass{article} \usepackage{xcolor} \begin{document} % Basic colors \textcolor{red}{Red text} \textcolor{blue}{\textbf{Bold blue text}} \textcolor{green}{\textit{Italic green text}} % Custom colors \definecolor{myorange}{RGB}{255, 96, 55} \textcolor{myorange}{Custom orange color} % Highlighting \colorbox{yellow}{Highlighted text} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from color.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-11/page-1.svg)
## Advanced Formatting ### Strikethrough ```latex strikethrough.tex theme={null} \documentclass{article} \usepackage{soul} \begin{document} % Strikethrough \st{This text is struck through} % Highlighting with soul package \hl{This text is highlighted} % Letter spacing \so{SPACED OUT TEXT} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from strikethrough.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-12/page-1.svg)
### Better Underlines ```latex better-underline.tex theme={null} \documentclass{article} \usepackage{ulem} \begin{document} % Normal underline \uline{Better underline with ulem} % Double underline \uuline{Double underlined text} % Wavy underline \uwave{Wavy underline for errors} % Strike out \sout{Struck out text} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from better-underline.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-13/page-1.svg)
## Environment-Based Formatting For longer passages: ```latex environments.tex theme={null} \documentclass{article} \begin{document} % Bold environment \begin{bfseries} This entire paragraph is bold. You can write multiple sentences and they will all be bold. This is useful for longer passages. \end{bfseries} % Italic environment \begin{itshape} This entire paragraph is in italics. Every sentence here will be italicized until we close the environment. \end{itshape} % Typewriter environment \begin{ttfamily} This looks like computer code. All text here is monospaced. \end{ttfamily} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from environments.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-14/page-1.svg)
## Declaration Commands Alternative syntax using declarations: ```latex declarations.tex theme={null} \documentclass{article} \begin{document} % Declarations affect all following text {\bfseries Bold text using declaration} {\itshape Italic text using declaration} {\bfseries\itshape Bold and italic together} % Limiting scope with braces Normal text {\sffamily sans serif text} normal again \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from declarations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-15/page-1.svg)
## Common Use Cases ### Document Structure ```latex structure.tex theme={null} \documentclass{article} \begin{document} \textbf{\large 1. Introduction} This section introduces the topic with \emph{emphasis} on key concepts. \textbf{Key Terms:} \begin{itemize} \item \textbf{LaTeX:} A typesetting system \item \textbf{Markup:} Text with formatting codes \item \textbf{Compiler:} Processes \texttt{.tex} files \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from structure.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-16/page-1.svg)
### Academic Writing ```latex academic.tex theme={null} \documentclass{article} \begin{document} According to \textit{Smith et al.} (2023), the results were \textbf{statistically significant} (p < 0.05). \emph{Note:} These findings contradict earlier work by \textsc{Johnson} (2020). \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from academic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-17/page-1.svg)
## Best Practices > [!TIP] > > **Formatting guidelines:** > > 1. **Use sparingly** - Too much formatting reduces impact > 2. **Be consistent** - Use the same style for similar elements > 3. **Semantic meaning** - Use `\emph` for emphasis, not just italics > 4. **Avoid underlines** - Use bold or italic instead > 5. **Consider readers** - Some formats don't work well in all media ## Common Mistakes > [!WARNING] > > **Avoid these errors:** > > 1. **Over-formatting** - Don't combine too many styles > 2. **Underline with descenders** - Looks messy with g, j, p, q, y > 3. **All caps** - Use `\textsc{}` for small caps instead > 4. **Forgetting braces** - `\textbf{text}` not `\textbf text` > 5. **Wrong nesting** - Close commands in reverse order ## Quick Reference Table | Command | Output | Usage | | - | - | - | | `\textbf{text}` | **text** | Bold | | `\textit{text}` | *text* | Italic | | `\underline{text}` | text | Underline | | `\emph{text}` | *text* | Emphasis | | `\textsc{text}` | TEXT | Small caps | | `\texttt{text}` | `text` | Monospace | | `\textsf{text}` | text | Sans serif | | `\textsl{text}` | *text* | Slanted | ## Troubleshooting ### Text Not Formatting Check for: * Missing braces: `\textbf{text}` not `\textbf text` * Typos in commands * Missing packages for special formatting ### Nested Commands Not Working Ensure proper nesting: ```latex example.tex theme={null} % Correct \textbf{\textit{text}} % Incorrect \textbf{\textit{text}} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-bold-italics-underlining-18/page-1.svg)
## Try Text Formatting in the Editor > [card] Open a formatting example > > Paste the commands into a project and compile them to compare bold, italic, underline, and semantic emphasis. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=bold_text_open_app) > [card] See the online LaTeX editor > > Review the browser editor workflow and current product capabilities on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=bold_text_online_editor) page. These formatting commands are standard LaTeX, so they work the same in Overleaf. If you are comparing editors, see the [Overleaf alternative](https://www.latex-cloud-studio.com/alternatives/overleaf?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=bold_text_overleaf_alternative) page. *** > [!NOTE] > > **Next**: Learn how to create [Lists](/learn/latex/basics/lists) for organizing information effectively, or explore [Advanced text formatting](/learn/latex/text-formatting) for more sophisticated typography options. # Choosing a LaTeX Compiler Source: https://resources.latex-cloud-studio.com/learn/latex/basics/choosing-compiler Understand different LaTeX compilers and engines. Learn about pdfLaTeX, XeLaTeX, and LuaLaTeX to choose the right one for your documents. A LaTeX compiler (also called an engine) transforms your `.tex` source files into the final output format (usually PDF). Understanding the differences between compilers helps you choose the right tool for your project.> [!NOTE] > > **In LaTeX Cloud Studio**: We handle compiler selection automatically, but you can switch between engines in your document settings for specific needs.## What is a LaTeX Compiler?A LaTeX compiler:1) **Reads** your source file (.tex) 2) **Processes** all commands and content 3) **Generates** output (PDF, DVI, etc.) 4) **Reports** any errors or warningsThink of it as a translator that converts your human-readable LaTeX code into a beautifully formatted document.## Main LaTeX Compilers### pdfLaTeX (Default Choice)The most common and widely-supported compiler.**Pros:**- Fast compilation - Excellent compatibility - Mature and stable - Supports most packages - Default in most systems**Cons:**- Limited to 8-bit fonts - No direct Unicode support - Can't use system fonts**Best for:**- Most documents - Academic papers - When compatibility matters - Beginning LaTeX users```latex pdflatex-example.tex theme=\{null} \documentclass{article} \usepackage[utf8]{inputenc} % Needed for special characters \usepackage[T1]{fontenc} % Better font encoding \begin{document} This document compiles perfectly with pdfLaTeX! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-choosing-compiler-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_choosing_compiler)### XeLaTeX (Modern Typography)A modern engine with excellent font support.**Pros:**- Full Unicode support - Use any system font - Better multilingual support - Advanced typography features - Handles complex scripts**Cons:**- Slower compilation - Some packages incompatible - Larger file sizes**Best for:**- Documents with special fonts - Multilingual documents - Non-Latin scripts - Typography-focused work```latex xelatex-example.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % XeLaTeX font selection % Use any font installed on your system \setmainfont{Helvetica Neue} \setsansfont{Arial} \setmonofont{Consolas} \begin{document} XeLaTeX lets you use any font: English, 中文, العربية, ελληνικά! \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
### LuaLaTeX (Programmable Power)The newest engine with embedded Lua scripting.**Pros:**- Full Unicode support - Lua scripting capability - Modern font handling - Microtype improvements - Active development**Cons:**- Slowest compilation - Newest (less documentation) - Some compatibility issues**Best for:**- Complex programmatic documents - Advanced typography - When you need scripting - Future-proof projects```latex lualatex-example.tex theme=\{null} \documentclass{article} \usepackage{fontspec} \usepackage{luacode} \begin{document} LuaLaTeX can execute Lua code: \begin{luacode} for i = 1, 5 do tex.print("Line " .. i .. "\\\\") end \end{luacode} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from lualatex-example.tex Generated from the shown source with LuaLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-choosing-compiler-03/page-1.svg)
## Comparison Table| Feature | pdfLaTeX | XeLaTeX | LuaLaTeX | | - | - | - | - | | **Speed** | Fast ⚡⚡⚡ | Medium ⚡⚡ | Slow ⚡ | | **Unicode** | Limited | Full ✓ | Full ✓ | | **System Fonts** | No ✗ | Yes ✓ | Yes ✓ | | **Compatibility** | Excellent | Good | Good | | **Scripting** | No | No | Lua ✓ | | **Memory Usage** | Low | Medium | High | | **Output Quality** | Excellent | Excellent | Excellent |## How to Choose### Use pdfLaTeX when:- You're just starting with LaTeX - Writing standard academic documents - Need maximum compatibility - Want fastest compilation - Using traditional LaTeX packages### Use XeLaTeX when:- Need specific fonts (corporate branding) - Writing in multiple languages - Using non-Latin scripts - Want OpenType font features - Typography is crucial### Use LuaLaTeX when:- Need programmatic document generation - Want the latest features - Require advanced typography - Can accept slower compilation - Building complex automated documents## Compiler-Specific Commands### Checking Your CompilerYou can make your document adapt to different compilers:```latex compiler-check.tex theme=\{null} \documentclass{article} % Load appropriate packages based on compiler \usepackage{ifxetex,ifluatex} \ifxetex \usepackage{fontspec} \newcommand{\mycompiler}{XeLaTeX} \else\ifluatex \usepackage{fontspec} \newcommand{\mycompiler}{LuaLaTeX} \else \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \newcommand{\mycompiler}{pdfLaTeX} \fi\fi \begin{document} This document was compiled with \mycompiler. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from compiler-check.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-choosing-compiler-04/page-1.svg)
### Font Selection by Compiler```latex font-selection.tex theme=\{null} \documentclass{article} \usepackage{ifxetex,ifluatex} % Modern font setup for XeLaTeX/LuaLaTeX \ifxetex\else\ifluatex\else % pdfLaTeX font setup \usepackage[T1]{fontenc} \usepackage{lmodern} % Latin Modern fonts \fi\fi \ifxetex \usepackage{fontspec} \setmainfont{Times New Roman} \else\ifluatex \usepackage{fontspec} \setmainfont{Times New Roman} \fi\fi \begin{document} Fonts work correctly regardless of compiler! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-selection.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-choosing-compiler-05/page-1.svg)
## Special Use Cases### Mathematical Documents**Recommended**: pdfLaTeX- Best package support - Fast compilation - All math packages work### Multilingual Documents**Recommended**: XeLaTeX- Full Unicode support - Easy font switching - Proper script handling### Presentations**Recommended**: pdfLaTeX with Beamer- Fast compilation for iterations - Full Beamer compatibility - Reliable output### Books with Custom Fonts**Recommended**: XeLaTeX or LuaLaTeX- Professional typography - Font flexibility - Advanced features## In LaTeX Cloud StudioLaTeX Cloud Studio makes compiler selection easy:1) **Automatic Detection**: We analyze your document and suggest the best compiler 2) **Easy Switching**: Change compilers in document settings 3) **Error Handling**: Clear messages if packages need a different compiler 4) **Preconfiqured**: All compilers are ready to use### Setting Compiler in Your DocumentYou can specify your preferred compiler using a magic comment:```latex example.tex theme=\{null} % !TEX program = xelatex \documentclass{article} \usepackage{fontspec} ... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Troubleshooting Compiler Issues> [!WARNING] > > **Common compiler-related errors:** > > 1. **"Package requires XeLaTeX/LuaLaTeX"** > * Switch to the appropriate compiler > * Or use alternative packages > 2. **"Unicode character not set up"** > * Use XeLaTeX/LuaLaTeX for full Unicode > * Or add `\usepackage[utf8]{inputenc}` for pdfLaTeX > 3. **"Font not found"** > * System fonts need XeLaTeX/LuaLaTeX > * Or use LaTeX font packages with pdfLaTeX## Migration Guide### From pdfLaTeX to XeLaTeXRemove these packages:```latex example.tex theme=\{null} % Remove these: \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % Add this: \usepackage{fontspec} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### From XeLaTeX to pdfLaTeXReplace font commands:```latex example.tex theme=\{null} % Remove: \setmainfont{Arial} % Add: \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Performance Tips> [!TIP] > > **Speed up compilation:** > > 1. Use pdfLaTeX for drafts > 2. Switch to XeLaTeX/LuaLaTeX for final version > 3. Enable draft mode: `\documentclass[draft]{article}` > 4. Compile only changed parts during writing > 5. Use LaTeX Cloud Studio's incremental compilation## Quick Decision Chart``` Need special fonts? ──> Yes ──> XeLaTeX │ No │ ▼ Need Unicode? ──> Yes ──> XeLaTeX/LuaLaTeX │ No │ ▼ Need scripting? ──> Yes ──> LuaLaTeX │ No │ ▼ pdfLaTeX (Best default choice) ```## Summary- **Start with pdfLaTeX** - It's fast and compatible - **Switch to XeLaTeX** - When you need fonts or languages - **Try LuaLaTeX** - For advanced programmable documentsRemember: All compilers produce high-quality output. The differences are mainly about features and speed, not quality.***> [!NOTE] > > **Next step**: Learn about [Paragraphs and new lines](/learn/latex/basics/paragraphs-new-lines) to structure your content effectively. # Creating your first LaTeX document Source: https://resources.latex-cloud-studio.com/learn/latex/basics/creating-first-document Learn how to create your first LaTeX document from scratch. Step-by-step guide for beginners using LaTeX Cloud Studio. Let's create your very first LaTeX document! This guide will walk you through the essential steps to get started with LaTeX using LaTeX Cloud Studio.> [!NOTE] > > **Time needed**: 5 minutes\ > **Prerequisites**: Access to LaTeX Cloud Studio\ > **What you'll learn**: Basic document structure, compiling, and viewing output## The Simplest LaTeX DocumentEvery LaTeX journey begins with a simple "Hello World" document. Here's the absolute minimum you need:```latex hello-world.tex theme=\{null} \documentclass{article} \begin{document} Hello World! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from hello-world.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-creating-first-document-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_creating_first_document)That's it! These four lines create a complete LaTeX document.## Understanding Each LineLet's break down what each line does:### 1. Document Class```latex example.tex theme=\{null} \documentclass{article} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
This tells LaTeX what kind of document you're creating. The `article` class is perfect for:- Short documents - Academic papers - Reports - General documentsOther common classes include:- `report` - for longer documents with chapters - `book` - for books with parts, chapters, and sections - `letter` - for formal letters - `beamer` - for presentations### 2. Document Environment```latex example.tex theme=\{null} \begin{document} ...content... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This fragment demonstrates the document boundary. Visible output depends on the content placed between the begin and end commands.\
Everything between these commands is your actual document content. Think of it as the "body" of your HTML page.## Creating a More Complete DocumentLet's expand our document with common elements:```latex complete-first.tex theme=\{null} \documentclass{article} % Preamble - setup goes here \title{My First LaTeX Document} \author{Your Name} \date{December 2024} \begin{document} % Create title from preamble info \maketitle % First section \section{Introduction} Welcome to my first LaTeX document! This is an exciting moment in my journey to create professional documents. \section{Why I'm Learning LaTeX} I'm learning LaTeX because: \begin{itemize} \item It creates beautiful documents \item It handles mathematics perfectly \item It's used by professionals worldwide \item It gives me complete control over formatting \end{itemize} \section{My First Equation} Einstein's famous equation is $E = mc^2$, which shows the relationship between energy and mass. \section{Conclusion} This is just the beginning of my LaTeX journey! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from complete-first.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-creating-first-document-04/page-1.svg)
## How to Create This in LaTeX Cloud Studio1. **Open LaTeX Cloud Studio** in your browser 2. **Create a new document** using the "New Document" button 3. **Copy and paste** the code above into the editor 4. **Click "Compile"** to generate your PDF 5. **View the result** in the preview pane> [!TIP] > > LaTeX Cloud Studio automatically saves your work and provides real-time preview, making it perfect for beginners!## The Document StructureA LaTeX document has two main parts:### 1. The PreambleEverything 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 BodyEverything between `\begin{document}` and `\end{document}` is your content. This includes:- Text - Sections and chapters - Equations - Figures and tables - References## Your First CompilationWhen you compile a LaTeX document, here's what happens:1) **LaTeX reads your source file** (.tex) 2) **Processes the commands** and markup 3) **Generates a PDF** (or other output format) 4) **Shows any errors** if something went wrongIn LaTeX Cloud Studio, this happens automatically when you click "Compile" or enable auto-compilation.## Common Beginner Mistakes> [!WARNING] > > **Avoid these common errors:** > > 1. **Forgetting `\end{document}`** - Every document must end with this > 2. **Content before `\begin{document}`** - Only setup goes in the preamble > 3. **Mismatched braces** - Every `{` needs a matching `}` > 4. **Wrong quotes** - Use \`\` ` ` '' for quotes, not " "## Adding More Elements### CommentsUse `%` to add comments that won't appear in the output:```latex example.tex theme=\{null} % This is a comment This text appears % but this comment doesn't ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-creating-first-document-05/page-1.svg)
### ParagraphsLeave a blank line to start a new paragraph:```latex example.tex theme=\{null} This is the first paragraph. It can be as long as you want. This is the second paragraph. LaTeX automatically handles spacing. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-creating-first-document-06/page-1.svg)
### Basic Formatting```latex example.tex theme=\{null} \textbf{Bold text} \textit{Italic text} \underline{Underlined text} \texttt{Monospace text} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-creating-first-document-07/page-1.svg)
## Practice ExerciseTry creating this document:```latex exercise.tex theme=\{null} \documentclass{article} \title{My LaTeX Practice} \author{[Your Name]} \date{\today} % Automatically uses today's date \begin{document} \maketitle \section{About Me} % Write a paragraph about yourself \section{My Favorite Formula} % Add a simple math equation using $ $ \section{Things I Want to Learn} % Create a list using \begin{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from exercise.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-creating-first-document-08/page-1.svg)
## What's Next?Now that you've created your first document, you can:1) **Experiment with different document classes** - Try `report` or `book` 2) **Add more sections** - Use `\subsection` and `\subsubsection` 3) **Include mathematics** - Learn about math mode 4) **Format your text** - Explore fonts and styling 5) **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> [!TIP] > > 1. **Start simple** - Don't try to use every feature at once > 2. **Compile often** - Check your work frequently > 3. **Read error messages** - They usually point to the exact problem > 4. **Use templates** - Build on working examples > 5. **Keep the documentation handy** - Reference it as you work***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](/learn/latex/basics/choosing-compiler) to understand how LaTeX processes your documents. # LaTeX Common Errors & Troubleshooting Source: https://resources.latex-cloud-studio.com/learn/latex/basics/errors Fix LaTeX errors quickly with our comprehensive troubleshooting guide. Solutions for the most common LaTeX compilation errors and warnings. Don't panic! LaTeX errors can look scary, but most are easy to fix once you understand them. This guide covers the most common errors with clear solutions.> [!NOTE] > > **Quick tip**: LaTeX error messages show the line number where the error occurred. Look for `l.123` in the error message to find line 123 in your document.## Understanding LaTeX Error MessagesLaTeX errors follow this pattern:``` ! LaTeX Error: [Error description] See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.123 \textbf{This is the problematic line ```Key parts:- `!` indicates an error (not a warning) - Error description tells you what went wrong - `l.123` shows the line number - The line content helps locate the issue## Most Common Errors### 1. Missing \$ inserted**Error message:**``` ! Missing $ inserted. $ l.42 The value of x_1 is important ```**Cause**: Math symbols used outside math mode**Solutions:**```latex wrong.tex theme=\{null} The value of x_1 is important % Wrong The equation x^2 + y^2 = r^2 holds % Wrong ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex correct.tex theme=\{null} The value of $x_1$ is important % Correct The equation $x^2 + y^2 = r^2$ holds % Correct ```
Rendered output Open zoomable preview: Compiled PDF page 1 from correct.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-errors-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_errors)> [!TIP] > > Common math symbols that need math mode: `_`, `^`, `\alpha`, `\sum`, etc.#### Finding the character in the logTeX Live 2026 with `-file-line-error` prints the file and line first:```log main.log theme=\{null} ./main.tex:3: Missing $ inserted. $ l.3 The value x_ 1 is positive. ```The `l.3` line breaks where TeX stopped reading. The character just before the break, `_` here, is the one that needs math mode. TeX inserts a `$` to recover, so a second `Missing $ inserted` often follows later in the same paragraph, where TeX closes the math it opened. Fix the first one and recompile.#### Other causes- **`_` or `^` in ordinary text**, such as file names, variable names, and identifiers. Escape the character as `\_`, or put the name in `\texttt{data\_2026.csv}`. For web addresses, use `\url` from the `url` or `hyperref` package. - **Math-only commands in text**, such as `\alpha`, `\geq`, `\frac`, or `\sum`. Wrap them in `$...$`. - **A blank line inside display math.** A blank line inside `\[ ... \]` ends the paragraph while math is still open, and TeX reports `Missing $ inserted` on the blank line. Delete the blank line, or put `%` on it.```latex underscore.tex theme=\{null} \documentclass{article} \begin{document} The results are saved in data_2026.csv. \end{document} ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`Missing \$ inserted\`.\
```latex underscore-fixed.tex theme=\{null} \documentclass{article} \begin{document} The results are saved in \texttt{data\_2026.csv}. The first value, $x_1$, is positive. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from underscore-fixed.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-errors-19/page-1.svg)
In LaTeX Cloud Studio, the Problems panel lists this error as `Math mode character found outside math mode`.### 2. Undefined control sequence**Error message:**``` ! Undefined control sequence. l.15 \textcolor {red}{This text} ```**Cause**: Using a command that doesn't exist or missing package**Solutions:**```latex solution1.tex theme=\{null} % Add required package \usepackage{xcolor} % For \textcolor \usepackage{amsmath} % For \text \usepackage{graphicx} % For \includegraphics ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
```latex solution2.tex theme=\{null} % Check spelling \texbf{bold} % Wrong (missing 't') \textbf{bold} % Correct \begin{centre} % Wrong spelling \begin{center} % Correct ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
#### Finding the undefined command in the logThe undefined command is the last one on the first `l.` line, just before the line break:```log main.log theme=\{null} ./main.tex:3: Undefined control sequence. l.3 Hello \textbold {world}. ```Here it is `\textbold`. TeX's own help text says the same: "The control sequence at the end of the top line of your error message was never \def'ed."#### Commands that need a packageIf the command is spelled correctly, the package that defines it is probably not loaded:| Command | Load in the preamble | | - | - | | `\toprule`, `\midrule`, `\bottomrule` | `\usepackage{booktabs}` | | `\textcolor`, `\color` | `\usepackage{xcolor}` | | `\includegraphics` | `\usepackage{graphicx}` | | `\mathbb` | `\usepackage{amssymb}` | | `\text`, `\eqref` | `\usepackage{amsmath}` | | `\url` | `\usepackage{url}` or `\usepackage{hyperref}` | | `\href` | `\usepackage{hyperref}` | | `\multirow` | `\usepackage{multirow}` | | `\SI`, `\qty` | `\usepackage{siunitx}` |Two other causes are common. `\chapter` only exists in the `book` and `report` classes, so it is undefined in `article`. A command made with `\newcommand` must be defined before its first use, usually in the preamble of the main file.```latex toprule.tex theme=\{null} \documentclass{article} % booktabs is not loaded, so \toprule does not exist \begin{document} \begin{tabular}{lr} \toprule Item & Cost \\ \midrule Paper & 12 \\ \bottomrule \end{tabular} \end{document} ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`Undefined control sequence\`.\
```latex toprule-fixed.tex theme=\{null} \documentclass{article} \usepackage{booktabs} % defines \toprule, \midrule, \bottomrule \begin{document} \begin{tabular}{lr} \toprule Item & Cost \\ \midrule Paper & 12 \\ \bottomrule \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from toprule-fixed.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-errors-21/page-1.svg)
In LaTeX Cloud Studio, the Problems panel lists this error as `Undefined command in:` followed by the line that contains it.### 3. Missing \begin**Error message:**``` ! LaTeX Error: Missing \begin{document}. ```**Cause**: Content before `\begin{document}` or missing the command entirely**Solution:**```latex wrong.tex theme=\{null} \documentclass{article} \title{My Document} This is my text % Wrong - content before \begin{document} \begin{document} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex correct.tex theme=\{null} \documentclass{article} \title{My Document} \begin{document} This is my text % Correct - content after \begin{document} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from correct.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-errors-06/page-1.svg)
### 4. File not found**Error message:**``` ! LaTeX Error: File `mycustom.sty' not found. ```**Cause**: Missing package, image, or bibliography file**Solutions:**1) Install missing package: ```bash theme=\{null} tlmgr install packagename # TeX Live # or use your TeX distribution's package manager ``` 2) Check file paths: ```latex theme=\{null} \includegraphics{images/photo.png} % Make sure path is correct \bibliography{references} % Check references.bib exists ``` 3) Use correct file extensions: ```latex theme=\{null} \usepackage{mycustom} % Looks for mycustom.sty \input{chapter1} % Looks for chapter1.tex ```### 5. Missing } inserted**Error message:**``` ! Missing } inserted. } l.33 \textbf{Bold text ```**Cause**: Unmatched braces**Solution:**```latex wrong.tex theme=\{null} \textbf{Bold text % Missing closing brace \textit{Italic {nested} % Missing closing brace $x^{2+3$ % Missing closing brace ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex correct.tex theme=\{null} \textbf{Bold text} % Correct \textit{Italic {nested}} % Correct $x^{2+3}$ % Correct ```
Rendered output Open zoomable preview: Compiled PDF page 1 from correct.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-errors-08/page-1.svg)
> [!TIP] > > Use a text editor with brace matching to catch these errors early.### 6. Environment undefined**Error message:**``` ! LaTeX Error: Environment equation* undefined. ```**Cause**: Using an environment that doesn't exist or missing package**Solution:**```latex example.tex theme=\{null} % For equation* environment \usepackage{amsmath} % Check spelling \begin{ennumerate} % Wrong \begin{enumerate} % Correct ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### 7. Runaway argument**Error message:**``` Runaway argument? {This is a very long... ! Paragraph ended before \textbf was complete. ```**Cause**: Missing closing brace or bracket spanning paragraphs**Solution:**```latex wrong.tex theme=\{null} \textbf{This is bold This is a new paragraph} % Error - can't span paragraphs ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex correct.tex theme=\{null} \textbf{This is bold} This is a new paragraph % Correct - close before paragraph ```
Rendered output Open zoomable preview: Compiled PDF page 1 from correct.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-errors-11/page-1.svg)
### 8. Overfull/Underfull hbox**Warning message:**``` Overfull \hbox (15.0pt too wide) in paragraph at lines 42--45 ```**Cause**: Text doesn't fit properly in the line**Solutions:**1) Let LaTeX hyphenate: ```latex theme=\{null} \usepackage[english]{babel} ``` 2) Force hyphenation: ```latex theme=\{null} super\-cali\-fragi\-listic ``` 3) Rewrite the sentence 4) Allow stretchy spacing: ```latex theme=\{null} \sloppy % For whole document {\sloppy This problematic paragraph} % For specific text ```### 9. Table/Figure positioning problems**Issue**: Tables or figures appear in wrong locations**Solutions:**```latex positioning.tex theme=\{null} % Use positioning options \begin{figure}[htbp] % here, top, bottom, page \centering \includegraphics{image} \caption{My figure} \end{figure} % Force position (not recommended) \usepackage{float} \begin{figure}[H] % Exactly Here ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### 10. Bibliography not showing**Issue**: References not appearing**Solution sequence:**```bash theme=\{null} pdflatex document.tex bibtex document # or biber document pdflatex document.tex pdflatex document.tex ```## Error Categories### Math Mode Errors> [!WARNING] > > **Common math mode mistakes:** > > * Text in math: Use `\text{...}` from amsmath > * Wrong delimiter size: Use `\left(` and `\right)` > * Display math in wrong place: Can't use `$$` in some environments```latex math-fixes.tex theme=\{null} % Text in math mode $x = 2 when y = 3$ % Wrong $x = 2 \text{ when } y = 3$ % Correct % Delimiter sizing $(\frac{a}{b})$ % Small parentheses $\left(\frac{a}{b}\right)$ % Auto-sized parentheses % Display math \begin{center} $$x = y$$ % Wrong in center environment \end{center} \begin{center} $x = y$ % Correct \end{center} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-fixes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-errors-13/page-1.svg)
### Package ConflictsSome packages don't work well together:```latex example.tex theme=\{null} % Common conflicts \usepackage{subfigure} % Old, conflicts with many \usepackage{subfig} % Use this instead \usepackage{pdfpages} % Load after graphicx \usepackage{hyperref} % Usually load last ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Font Errors```latex example.tex theme=\{null} % Font not found \usepackage{times} % Deprecated \usepackage{mathptmx} % Use this instead % Font size errors \fontsize{50} % Wrong - missing unit \fontsize{50pt}{60pt}\selectfont % Correct ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Debugging Strategies### 1. Binary Search MethodComment out half your document to isolate errors:```latex example.tex theme=\{null} \begin{document} First part... %{ Second part... % This part is now commented %} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is structurally incomplete and cannot be compiled honestly as a standalone document. It shows document-boundary syntax rather than a visible page result.\
### 2. Minimal Working Example (MWE)Create a minimal file that reproduces the error:```latex example.tex theme=\{null} \documentclass{article} \usepackage{[only needed packages]} \begin{document} [Minimal code that causes error] \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### 3. Check the Log FileLook for:- First error (fix this first) - Line numbers - Package warnings - Overfull/underfull boxes### 4. Common Quick Fixes> [card] Clear auxiliary files > > Delete `.aux`, `.log`, `.toc` files and recompile> [card] Update packages > > Keep your TeX distribution updated> [card] Check encoding > > Save files as UTF-8> [card] Simplify first > > Remove packages/commands until it works## Prevention Tips> [!TIP] > > **Best practices to avoid errors:** > > 1. Compile frequently (after every few lines when learning) > 2. Use a good editor with syntax highlighting > 3. Keep backups before major changes > 4. Organize long documents into multiple files > 5. Comment your code for complex parts > 6. Use version control (Git)## Platform-Specific Issues### Windows- Path issues: Use forward slashes `/` or double backslashes `\\` - Font issues: Install fonts system-wide - Encoding: Save as UTF-8, not ANSI### macOS- Missing fonts: Install MacTeX fully - Path issues: Don't use spaces in filenames - Preview issues: Use external PDF viewer### Linux- Permission issues: Check file permissions - Missing packages: Use distribution package manager - Font issues: Update font cache## Getting HelpWhen asking for help online, include:1) Minimal Working Example (MWE) 2) Complete error message 3) TeX distribution and version 4) What you've already tried### Help Resources> [card] TeX StackExchange > > Q\&A community for TeX/LaTeX[Open](https://tex.stackexchange.com)> [card] LaTeX Community > > Official LaTeX forum[Open](https://latex.org/forum/)> [card] Reddit r/LaTeX > > Reddit community[Open](https://reddit.com/r/latex)> [card] CTAN > > Package documentation[Open](https://ctan.org)## Quick Reference Card| Error | Quick Fix | | - | - | | Missing \$ | Wrap math in `$...$` | | Undefined control sequence | Check spelling or add package | | Missing } | Match all opening braces | | File not found | Check path and filename | | Overfull hbox | Add hyphenation or rewrite | | Figure in wrong place | Use `[htbp]` positioning | | Bibliography missing | Run BibTeX/Biber | | Package unknown | Install with package manager | | `! Emergency stop` | Read the `***` line below it, then see [Emergency stop](/learn/latex/troubleshooting/emergency-stop) | | `Font unisong30 ... not found` | Compile ctex documents with XeLaTeX, see [Chinese font not found](/learn/latex/troubleshooting/ctex-font-unisong-not-found) |***> [!NOTE] > > **Remember**: Every LaTeX user encounters errors. They're not a sign of failure but an opportunity to learn. The more errors you fix, the better you become at LaTeX!Still stuck? Create a Minimal Working Example (MWE) - a small, self-contained document that reproduces your error - and ask for help in the community forums. Happy TeXing!## You've Completed the Basics!Congratulations on finishing the LaTeX basics! Here's where to go next:> [card] Mathematics > > Learn to write beautiful equations and formulas[Open](/learn/latex/mathematics/basics)> [card] Tables & Figures > > Add professional tables and images to your documents[Open](/learn/latex/tables/creating-tables)> [card] Bibliography > > Manage citations and references like a pro[Open](/learn/latex/bibliography-citations)> [card] Templates > > Start with ready-made professional templates[Open](/templates/article) # LaTeX Basics Source: https://resources.latex-cloud-studio.com/learn/latex/basics/index Learn the core LaTeX basics, from what LaTeX is to your first document, lists, paragraphs, and common beginner errors. This hub is the best starting point if you want a step-by-step path through the core LaTeX basics. ## Start Here 1. [What is LaTeX?](/learn/latex/basics/what-is-latex) 2. [Creating your first LaTeX document](/learn/latex/basics/creating-first-document) 3. [Choosing a compiler](/learn/latex/basics/choosing-compiler) ## Core Writing Skills * [Paragraphs and new lines](/learn/latex/basics/paragraphs-new-lines) * [Bold, italics, and underlining](/learn/latex/basics/bold-italics-underlining) * [Lists in LaTeX](/learn/latex/basics/lists) ## Troubleshooting * [Common beginner errors](/learn/latex/basics/errors) * [Learn LaTeX in 30 minutes](/learn/latex-in-30-minutes) ## Recommended Next Steps * [Text formatting](/learn/latex/text-formatting) * [Mathematics basics](/learn/latex/mathematics/basics) * [Writing your first project](/learn/latex/how-to/first-project) # LaTeX Bullet Points and Numbered Lists: itemize and enumerate Source: https://resources.latex-cloud-studio.com/learn/latex/basics/lists Create bullet points with itemize and numbered lists with enumerate in LaTeX. Copy the syntax and learn nesting, numbering styles, and custom labels. For bullet points in LaTeX, put each `\item` inside an `itemize` environment. For a numbered list, use `enumerate` instead. Use `description` for labeled terms, and add the `enumitem` package only when you need custom numbering, labels, or spacing.> [!NOTE] > > **Quick answer**: `\begin{itemize} ... \end{itemize}` creates bullet points; `\begin{enumerate} ... \end{enumerate}` creates an automatically numbered list.## Choose the Right List Environment| Environment | Best for | Typical output | | - | - | - | | `itemize` | Bullet points and unordered lists | Bullets | | `enumerate` | Steps, rankings, ordered instructions | Numbers or letters | | `description` | Definitions, glossaries, option lists | Bold label + explanation |## Quick Start```latex example.tex theme=\{null} \begin{itemize} \item First bullet \item Second bullet \end{itemize} \begin{enumerate} \item First step \item Second step \end{enumerate} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-lists-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_lists)## Unordered Lists (Bullets)Use the `itemize` environment for bullet points:```latex basic-itemize.tex theme=\{null} \documentclass{article} \begin{document} Shopping list: \begin{itemize} \item Milk \item Eggs \item Bread \item LaTeX books \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-itemize.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-02/page-1.svg)
### Nested Bullet ListsYou can nest lists up to four levels deep:```latex nested-itemize.tex theme=\{null} \documentclass{article} \begin{document} \begin{itemize} \item First level \begin{itemize} \item Second level \begin{itemize} \item Third level \begin{itemize} \item Fourth level \end{itemize} \end{itemize} \end{itemize} \item Back to first level \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from nested-itemize.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-03/page-1.svg)
## Ordered Lists (Numbers)Use the `enumerate` environment for numbered lists:```latex basic-enumerate.tex theme=\{null} \documentclass{article} \begin{document} Recipe steps: \begin{enumerate} \item Preheat oven to 350°F \item Mix ingredients \item Pour into pan \item Bake for 30 minutes \item Let cool and enjoy \end{enumerate} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-enumerate.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-04/page-1.svg)
### Nested Numbered ListsDifferent numbering styles at each level:```latex nested-enumerate.tex theme=\{null} \documentclass{article} \begin{document} \begin{enumerate} \item First item \begin{enumerate} \item Sub-item A \item Sub-item B \begin{enumerate} \item Detail i \item Detail ii \end{enumerate} \end{enumerate} \item Second item \end{enumerate} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from nested-enumerate.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-05/page-1.svg)
## Description ListsUse the `description` environment for term-definition pairs:```latex description.tex theme=\{null} \documentclass{article} \begin{document} \begin{description} \item[LaTeX] A document preparation system \item[PDF] Portable Document Format \item[Typography] The art of arranging type \item[Compiler] Software that processes LaTeX code \end{description} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from description.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-06/page-1.svg)
## Mixing List TypesYou can combine different list types:```latex mixed-lists.tex theme=\{null} \documentclass{article} \begin{document} \begin{enumerate} \item Prepare ingredients: \begin{itemize} \item 2 cups flour \item 1 cup sugar \item 3 eggs \end{itemize} \item Mixing process: \begin{itemize} \item Beat eggs \item Add sugar gradually \item Fold in flour \end{itemize} \item Baking times: \begin{description} \item[Cupcakes] 15-20 minutes \item[Layer cake] 25-30 minutes \item[Bundt cake] 45-50 minutes \end{description} \end{enumerate} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from mixed-lists.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-07/page-1.svg)
## Customizing Lists### Custom Bullets```latex custom-bullets.tex theme=\{null} \documentclass{article} \begin{document} % Temporarily change bullet symbol \begin{itemize} \item[→] First point \item[→] Second point \item[→] Third point \end{itemize} % Using different symbols \begin{itemize} \item[*] Asterisk bullet \item[†] Dagger bullet \item[§] Section symbol \item[¶] Paragraph symbol \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-bullets.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-08/page-1.svg)
### How to Change Numbering in LaTeXTo change numbering in LaTeX, set a custom label on each `\item` for a short list, or use the `enumitem` package when the numbering style should apply consistently. The example below shows Roman numerals, a different start value, and letters.```latex custom-numbering.tex theme=\{null} \documentclass{article} \begin{document} % Roman numerals \begin{enumerate} \item[(i)] First item \item[(ii)] Second item \item[(iii)] Third item \end{enumerate} % Custom starting number \begin{enumerate} \setcounter{enumi}{4} \item This is item 5 \item This is item 6 \end{enumerate} % Letters instead of numbers \begin{enumerate} \item[(a)] Option A \item[(b)] Option B \item[(c)] Option C \end{enumerate} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-numbering.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-09/page-1.svg)
## List Spacing### Compact Lists```latex compact-lists.tex theme=\{null} \documentclass{article} \usepackage{enumitem} \begin{document} % Normal spacing \begin{itemize} \item First item \item Second item \item Third item \end{itemize} % Compact spacing \begin{itemize}[noitemsep] \item First item \item Second item \item Third item \end{itemize} % No spacing at all \begin{itemize}[noitemsep,topsep=0pt] \item First item \item Second item \item Third item \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from compact-lists.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-10/page-1.svg)
### Wide Spacing```latex wide-spacing.tex theme=\{null} \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[itemsep=1em] \item First item with extra space after \item Second item with extra space after \item Third item \end{enumerate} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from wide-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-11/page-1.svg)
## Advanced List Formatting### The enumitem PackageFor full control over lists:```latex enumitem-examples.tex theme=\{null} \documentclass{article} \usepackage[inline]{enumitem} \begin{document} % Custom labels \begin{enumerate}[label=\arabic*)] \item First item \item Second item \end{enumerate} \begin{enumerate}[label=\Alph*.] \item First item \item Second item \end{enumerate} % Inline lists \begin{enumerate*}[label=(\alph*)] \item First \item Second \item Third \end{enumerate*} % Resume numbering \begin{enumerate} \item First item \item Second item \end{enumerate} Text in between... \begin{enumerate}[resume] \item This is item 3 \item This is item 4 \end{enumerate} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from enumitem-examples.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-12/page-1.svg)
### List Alignment```latex list-alignment.tex theme=\{null} \documentclass{article} \usepackage{enumitem} \begin{document} % Left-aligned labels \begin{itemize}[align=left] \item Short \item A much longer item label \end{itemize} % Right-aligned labels \begin{enumerate}[align=right] \item First \item Second \item Third \end{enumerate} % Hanging indent \begin{itemize}[leftmargin=*] \item This is a long item that will wrap to the next line and maintain proper indentation \item Another item \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from list-alignment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-13/page-1.svg)
## Inline ListsFor lists within paragraphs:```latex inline-lists.tex theme=\{null} \documentclass{article} \usepackage[inline]{enumitem} \begin{document} The process involves: \begin{enumerate*}[label=(\roman*)] \item preparation, \item execution, \item evaluation, and \item revision. \end{enumerate*} This keeps the list inline with the text. My favorite colors are: \begin{itemize*} \item red, \item blue, and \item green. \end{itemize*} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from inline-lists.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-14/page-1.svg)
## Common List Patterns### To-Do Lists```latex todo-list.tex theme=\{null} \documentclass{article} \usepackage{amssymb} \begin{document} \begin{itemize} \item[$\square$] Write introduction \item[$\square$] Add examples \item[$\boxtimes$] Review content \item[$\square$] Submit document \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from todo-list.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-15/page-1.svg)
### Pros and Cons```latex pros-cons.tex theme=\{null} \documentclass{article} \begin{document} \textbf{Pros:} \begin{itemize} \item[+] Easy to learn \item[+] Professional output \item[+] Free and open source \end{itemize} \textbf{Cons:} \begin{itemize} \item[--] Initial setup required \item[--] Compilation needed \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pros-cons.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-16/page-1.svg)
### Multi-column Lists```latex multicolumn-lists.tex theme=\{null} \documentclass{article} \usepackage{multicol} \begin{document} \begin{multicols}{2} \begin{itemize} \item Apple \item Banana \item Cherry \item Date \item Elderberry \item Fig \end{itemize} \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicolumn-lists.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-lists-17/page-1.svg)
## Best Practices> [!TIP] > > **List guidelines:** > > 1. **Consistency** - Use the same list type for similar content > 2. **Parallel structure** - Start items with the same part of speech > 3. **Punctuation** - Be consistent with periods and commas > 4. **Nesting depth** - Rarely go beyond three levels > 5. **Item length** - Keep items concise when possible## How to Change the Space Between ItemsThe gap between `itemize` or `enumerate` items is set by `\itemsep`. The clean way to change it is the `enumitem` package, which lets you set spacing per list without touching internal lengths.Load `\usepackage{enumitem}`, then:- `\begin{itemize}[itemsep=0pt]` removes the extra space between items - `\begin{itemize}[noitemsep]` is shorthand for the same thing - `\begin{itemize}[itemsep=1em]` opens the list up - `\begin{itemize}[nosep]` removes space between items *and* around the listTo apply it everywhere rather than per list, set it once in the preamble with `\setlist{itemsep=0pt}`, or target one type with `\setlist[itemize]{itemsep=0pt}`.Compact lists are a common request for CVs and slides, where the default spacing looks loose.## Common Mistakes> [!WARNING] > > **Avoid these errors:** > > 1. **Missing `\item`** - Every list entry needs this command > 2. **Incorrect nesting** - Close inner lists before outer ones > 3. **Too many levels** - More than 3-4 levels is hard to follow > 4. **Inconsistent formatting** - Match punctuation and capitalization > 5. **Wrong environment** - Use the appropriate list type## Troubleshooting### List Not AppearingCheck for:```latex example.tex theme=\{null} % Wrong - missing \item \begin{itemize} First item % Error! \end{itemize} % Correct \begin{itemize} \item First item \end{itemize} ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`Something's wrong--perhaps a missing\`.\
### Spacing IssuesAdjust with enumitem:```latex example.tex theme=\{null} \usepackage{enumitem} \setlist{noitemsep} % Global setting % Or per-list \begin{itemize}[topsep=0pt, partopsep=0pt] \item First compact item \item Second compact item \end{itemize} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-lists-19/page-1.svg)
## Quick Reference| Environment | Purpose | Basic Syntax | | - | - | - | | `itemize` | Bullet points | `\item Text` | | `enumerate` | Numbered list | `\item Text` | | `description` | Term definitions | `\item[Term] Definition` || Package | Purpose | | - | - | | `enumitem` | Full list customization | | `multicol` | Multi-column lists |## Try a List in LaTeX Cloud Studio> [card] Open the list example in the editor > > Paste one of the examples into a project and compile it to check numbering, nesting, and spacing.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=lists_open_app)> [card] See the online LaTeX editor > > Compare the browser editor workflow on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=lists_online_editor) page before starting a project.These list commands are standard LaTeX, so they work the same in Overleaf. If you are comparing editors, see the [Overleaf alternative](https://www.latex-cloud-studio.com/alternatives/overleaf?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=lists_overleaf_alternative) page.***> [!NOTE] > > **Next**: Learn about handling [Errors](/learn/latex/basics/errors) in LaTeX to troubleshoot your documents effectively. # New Line in LaTeX: \\, \newline, and Paragraph Breaks Source: https://resources.latex-cloud-studio.com/learn/latex/basics/paragraphs-new-lines Start a new line in LaTeX with `\\` or `\newline`, and start a new paragraph with a blank source line. See when each method is correct. To start a new line in LaTeX without beginning a new paragraph, use `\\` or `\newline`. To start a new paragraph, leave one blank line in the source. Do not insert manual breaks just to wrap ordinary prose—LaTeX calculates those line endings automatically.> [!NOTE] > > **Choose the right break**: use a blank source line for a paragraph, `\\` for a deliberate line break, and `\\[6pt]` only when that manual break also needs extra vertical space.## How LaTeX Handles Paragraphs### Creating ParagraphsIn LaTeX, a blank line creates a new paragraph:```latex paragraphs.tex theme=\{null} \documentclass{article} \begin{document} This is the first paragraph. It can span multiple lines in your source file, but LaTeX will format it as one continuous paragraph in the output. This is the second paragraph. Notice the blank line above - that's what tells LaTeX to start a new paragraph. LaTeX automatically indents the first line. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from paragraphs.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_paragraphs_new_lines)### Multiple Spaces and Line BreaksLaTeX treats multiple spaces as one and ignores single line breaks:```latex spacing.tex theme=\{null} This has multiple spaces. This is on multiple lines in the source. This is a new paragraph. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-02/page-1.svg)
> [!TIP] > > LaTeX ignores extra whitespace to give you flexibility in formatting your source code without affecting the output.## Manual Line Breaks### Using Double BackslashForce a line break within a paragraph using `\\`:```latex line-breaks.tex theme=\{null} \documentclass{article} \begin{document} First line\\ Second line\\ Third line This is still the same paragraph, but with forced line breaks. This is a new paragraph. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from line-breaks.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-03/page-1.svg)
### Line Break with Extra SpaceAdd vertical space after a line break:```latex line-break-space.tex theme=\{null} First line\\[10pt] Second line with 10pt gap\\[0.5cm] Third line with 0.5cm gap Normal line break:\\ Next line ```
Rendered output Open zoomable preview: Compiled PDF page 1 from line-break-space.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-04/page-1.svg)
### The \newline CommandAlternative to `\\`:```latex example.tex theme=\{null} This is one line\newline This is the next line ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-05/page-1.svg)
## Preventing Line Breaks### Non-breaking SpaceUse `~` to prevent line breaks between words:```latex non-breaking.tex theme=\{null} % Prevent breaks in names Dr.~Smith wrote Chapter~5. % Keep units together The temperature is 25~°C. % Prevent awkward breaks See Figure~\ref{fig:example} on page~\pageref{fig:example}. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
### \mbox CommandKeep text together on one line:```latex example.tex theme=\{null} The URL is \mbox{www.example.com/very-long-path}. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-07/page-1.svg)
## Paragraph Formatting### Paragraph IndentationControl first-line indentation:```latex indentation.tex theme=\{null} \documentclass{article} % Remove indentation globally \setlength{\parindent}{0pt} % Or set custom indentation % \setlength{\parindent}{1cm} \begin{document} This paragraph has no indentation because we set parindent to 0pt. This paragraph also has no indentation. All paragraphs follow the global setting. \indent This paragraph is manually indented using the indent command. \noindent This paragraph has no indentation even if parindent is set. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from indentation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-08/page-1.svg)
### Paragraph SpacingControl space between paragraphs:```latex paragraph-spacing.tex theme=\{null} \documentclass{article} % Add space between paragraphs \setlength{\parskip}{1em} % Remove indent when using parskip \setlength{\parindent}{0pt} \begin{document} First paragraph with spacing after it. Second paragraph with spacing before and after it. Third paragraph. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from paragraph-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-09/page-1.svg)
## Special Paragraph Commands### \par CommandExplicitly end a paragraph:```latex example.tex theme=\{null} This is a paragraph.\par This is another paragraph. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-10/page-1.svg)
### Centered Text```latex centering.tex theme=\{null} \begin{center} This text is centered.\\ Multiple lines\\ can be centered. \end{center} % Or for short text: {\centering This is also centered.\par} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from centering.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-11/page-1.svg)
### Flush Left and Right```latex alignment.tex theme=\{null} \begin{flushleft} This text is\\ aligned to\\ the left. \end{flushleft} \begin{flushright} This text is\\ aligned to\\ the right. \end{flushright} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from alignment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-12/page-1.svg)
## Advanced Line Breaking### Preventing Hyphenation```latex hyphenation.tex theme=\{null} % Prevent hyphenation for specific words \hyphenation{LaTeX JavaScript Python} % Prevent hyphenation in a word \mbox{unbreakableword} % Allow hyphenation at specific points super\-cali\-fragi\-listic ```
Rendered output Open zoomable preview: Compiled PDF page 1 from hyphenation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-13/page-1.svg)
### Line Breaking Commands| Command | Effect | Usage | | - | - | - | | `\\` | Line break | Most common | | `\\*` | Line break (no page break) | Keeps lines together | | `\newline` | Line break | Alternative to `\\` | | `\linebreak` | Suggests line break | LaTeX decides | | `\nolinebreak` | Prevents line break | Keeps on same line |### Page BreakingControl where pages break:```latex example.tex theme=\{null} \newpage % Start new page \pagebreak % Suggest page break \nopagebreak % Prevent page break \clearpage % New page after floats ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Common Patterns### Address Format```latex address.tex theme=\{null} John Smith\\ 123 Main Street\\ Anytown, ST 12345\\ USA ```
Rendered output Open zoomable preview: Compiled PDF page 1 from address.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-15/page-1.svg)
### Poetry or Verses```latex poetry.tex theme=\{null} \begin{verse} Roses are red,\\ Violets are blue,\\ LaTeX is awesome,\\ And so are you! \end{verse} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from poetry.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-16/page-1.svg)
### Quotations```latex quotations.tex theme=\{null} \begin{quote} This is a short quotation. It's indented from both margins and has no paragraph indentation. \end{quote} \begin{quotation} This is a longer quotation that might span multiple paragraphs. The first line of each paragraph is indented. This is the second paragraph of the quotation. \end{quotation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from quotations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-17/page-1.svg)
## Best Practices> [!TIP] > > **Paragraph and line break tips:** > > 1. **Let LaTeX decide** - Don't force line breaks unless necessary > 2. **Use blank lines** - Clear paragraph separation in source > 3. **Be consistent** - Choose either indentation or spacing > 4. **Use non-breaking spaces** - Keep related items together > 5. **Avoid `\\` at paragraph ends** - Use blank lines instead## Common Mistakes> [!WARNING] > > **Avoid these errors:** > > 1. **Using `\\` for paragraph breaks** - Use blank lines > 2. **Multiple `\\` in a row** - Use `\\[space]` instead > 3. **Ending paragraphs with `\\`** - Creates underfull hbox warnings > 4. **Too many manual breaks** - Trust LaTeX's algorithm## Troubleshooting### Underfull/Overfull hboxIf you get these warnings:- Let LaTeX handle line breaking - Use `\sloppy` for problematic paragraphs - Rewrite sentences if needed### Unwanted Page Breaks```latex example.tex theme=\{null} % Keep content together \begin{samepage} This content stays together on one page. \end{samepage} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-paragraphs-new-lines-18/page-1.svg)
### Inconsistent SpacingCheck these settings:```latex example.tex theme=\{null} \setlength{\parindent}{15pt} % First line indent \setlength{\parskip}{0pt} % Between paragraphs \setlength{\baselineskip}{12pt} % Between lines ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Quick Reference| What you want | How to do it | Example | | - | - | - | | New paragraph | Blank line | `text\n\ntext` | | Line break | `\\` | `line\\line` | | No indentation | `\noindent` | `\noindent Text` | | Keep together | `~` | `Fig.~1` | | Center text | `\begin{center}` | Centered | | Extra space | `\\[1cm]` | With gap |## Try Paragraph and Line Breaks> [card] Open the line-break example > > Paste the examples into a project and compile them to compare automatic wrapping, paragraphs, and manual line breaks.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=new_lines_open_app)> [card] See the online LaTeX editor > > Review the browser editor workflow on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=new_lines_online_editor) page before starting a project.These line-break commands are standard LaTeX, so they work the same in Overleaf. If you are comparing editors, see the [Overleaf alternative](https://www.latex-cloud-studio.com/alternatives/overleaf?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=new_lines_overleaf_alternative) page.***> [!NOTE] > > **Next**: Learn about [Bold, italics and underlining](/learn/latex/basics/bold-italics-underlining) to add emphasis to your text. # What is LaTeX? Source: https://resources.latex-cloud-studio.com/learn/latex/basics/what-is-latex Understand what LaTeX is, why it's the gold standard for professional document preparation, and how it compares to traditional word processors. LaTeX is a document preparation system for structured writing. You write plain text with commands such as `\section{}` or `\textbf{}`, then compile that source into a finished document, usually a PDF.## Short Answer- Use LaTeX when document structure, equations, references, and consistency matter more than manual drag-and-drop formatting. - It is common for research papers, theses, books, reports, CVs, and slide decks. - It is usually not the best choice for quick one-off memos or heavily art-directed layout work.## LaTeX vs Word Processors> [card] Word Processors (WYSIWYG) > > **What You See Is What You Get** > > * You format as you type > * Focus on appearance while writing > * Manual formatting for each element > * Inconsistent styling across documents > > ``` > [Toolbar with formatting buttons] > > My Document > [Manually make title big and bold] > > This is my text with some > bold words that I click to format. > ```> [card] LaTeX (WYSIWYM) > > **What You See Is What You Mean** > > * You describe structure, not appearance > * Focus on content while writing > * Consistent, professional formatting > * Separation of content and style > > ```latex example.tex theme=\{null} > \documentclass{article} > \title{My Document} > \begin{document} > \maketitle > > This is my text with some > \textbf{bold} words using commands. > \end{document} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. > > [Open SVG](/images/rendered/learn-latex-basics-what-is-latex-01/page-1.svg) >
> > **Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_basics_what_is_latex)## Why People Use LaTeX### 1. **Professional Typography**LaTeX produces publication-quality documents with superior typography:* Perfect mathematical equations * Consistent spacing and formatting * Professional ligatures and kerning * Optimal line breaking and justification> [!NOTE] > > LaTeX was created by Donald Knuth, a computer scientist who was dissatisfied with the quality of his published papers. He spent years perfecting the typography algorithms.### 2. **Content-First Approach**Write first, format once:- Focus on your ideas, not formatting - Consistent styling throughout your document - Easy to change entire document style - No manual formatting needed### 3. **Superior Math Support**Compare these examples:**Word Processor Attempt:**``` x = (-b ± √(b² - 4ac)) / 2a ```**LaTeX Result:**```latex example.tex theme=\{null} $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-basics-what-is-latex-02/page-1.svg)
Renders as: *x = (-b ± √(b² - 4ac)) / 2a* (but perfectly formatted)### 4. **Version Control Friendly**- Plain text files work with Git - Track changes meaningfully - Collaborate without conflicts - No binary file corruption### 5. **Cross-Reference Management**- Automatic numbering of sections, figures, tables - Smart references that update automatically - Bibliography management with BibTeX - Table of contents generation## Real-World LaTeX Examples### Academic Paper```latex academic-paper.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \title{Quantum Mechanics} \author{Dr. Smith} \begin{document} \maketitle \begin{abstract} This paper explores... \end{abstract} \section{Introduction} The Schrödinger equation: \begin{equation} i\hbar\frac{\partial}{\partial t} \Psi = \hat{H}\Psi \end{equation} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from academic-paper.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-basics-what-is-latex-03/page-1.svg)
> [card] Expected output > > A professionally typeset academic paper with a centered title "Quantum Mechanics" and author "Dr. Smith", followed by an indented abstract block, numbered section "1. Introduction", and a beautifully rendered Schrödinger equation with proper mathematical symbols and spacing.### Business Report```latex business-report.tex theme=\{null} \documentclass{report} \usepackage{graphicx} \title{Annual Report 2024} \author{Finance Department} \begin{document} \maketitle \tableofcontents \chapter{Executive Summary} This year showed growth... \chapter{Financial Results} \section{Revenue} See Figure \ref{fig:revenue}... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
> [card] Expected output > > A polished business report with an automatic table of contents, properly numbered chapters ("1. Executive Summary", "2. Financial Results") and sections ("2.1 Revenue"), smart cross-references to figures, and a professional print-ready layout.## When to Use LaTeX### Perfect For:- 📚 Academic papers and theses - 🧮 Documents with lots of mathematics - 📖 Books and long documents - 🔬 Scientific and technical reports - 📊 Documents with many cross-references - 🎓 CVs and resumes - 📽️ Professional presentations### Maybe Not Ideal For:* 📝 Quick notes or memos * 🎨 Heavily designed marketing materials * 📱 Documents needing specific layouts * ⏱️ Last-minute documents> [!TIP] > > **Rule of thumb**: If you'll use the document once, use Word. If you'll reuse the format or need professional quality, use LaTeX.## How LaTeX Works```mermaid theme=\{null} graph LR A[Write .tex file] --> B[LaTeX Compiler] B --> C[PDF Output] style A fill:#f9f9f9 style B fill:#FF6037,color:#fff style C fill:#e8f5e9 ```1) **Write**: Create a plain text file with LaTeX commands 2) **Compile**: Run LaTeX to process your document 3) **Output**: Get a beautiful PDF (or other formats)## Common Misconceptions> [!WARNING] > > **Myth**: "LaTeX is only for academics"\ > **Truth**: While popular in academia, LaTeX is used by publishers, businesses, and anyone wanting professional documents. > > **Myth**: "LaTeX is too hard to learn"\ > **Truth**: Basic LaTeX can be learned in 30 minutes. You don't need to know everything to start. > > **Myth**: "LaTeX is outdated"\ > **Truth**: LaTeX is actively developed and has modern packages for everything from presentations to posters.## The LaTeX Ecosystem### Core Components> [card] TeX > > The underlying typesetting engine> [card] LaTeX > > User-friendly macros built on TeX> [card] Packages > > Extensions for additional features> [card] Classes > > Document templates (article, book, etc.)### Popular Distributions- **TeX Live**: Comprehensive, cross-platform - **MiKTeX**: Popular on Windows - **MacTeX**: TeX Live for macOS - **Online**: LaTeX Cloud Studio and other online editors## Getting StartedReady to begin your LaTeX journey? Here are your next steps:1. **Learn the Basics**: Start with our [30-minute tutorial](/learn/latex-in-30-minutes) 2. **Try It Online**: Use an online editor to experiment without installation 3. **Pick a Project**: Choose a simple document to recreate in LaTeX 4. **Join the Community**: Get help when you need it> [!NOTE] > > **Did you know?** Major publishers like Springer, Elsevier, and IEEE prefer LaTeX submissions because of its quality and consistency.## SummaryLaTeX is more than just a typesetting system – it's a different philosophy of document creation. Instead of fighting with formatting while you write, you focus on your content and let LaTeX handle the professional presentation.Whether you're writing your first research paper, creating a thesis, or just want beautifully formatted documents, LaTeX provides the tools you need for professional results.***## Next Steps> [card] Create Your First Document > > Step-by-step guide to writing your first LaTeX document[Open](/learn/latex/basics/creating-first-document)> [card] LaTeX in 30 Minutes > > Quick tutorial covering all the essentials[Open](/learn/latex-in-30-minutes)> [!NOTE] > > **Learning path**: This page → [Creating your first document](/learn/latex/basics/creating-first-document) → [Choosing a compiler](/learn/latex/basics/choosing-compiler) → [Paragraphs](/learn/latex/basics/paragraphs-new-lines) → [Text formatting](/learn/latex/basics/bold-italics-underlining) → [Lists](/learn/latex/basics/lists) → [Errors](/learn/latex/basics/errors) # Bibliography and Citations in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/bibliography-citations Master bibliography management and citations in LaTeX. Learn BibTeX, BibLaTeX, citation styles, and reference management for academic writing. Learn to manage references and citations professionally in LaTeX. This comprehensive guide covers both traditional BibTeX and modern BibLaTeX approaches.> [!NOTE] > > **Quick start**: LaTeX Cloud Studio supports both BibTeX and BibLaTeX. Choose BibLaTeX for new projects as it offers more features and flexibility.## Bibliography Systems Overview### BibTeX vs BibLaTeX Comparison| Feature | BibTeX | BibLaTeX | | - | - | - | | **Age** | Older (1985) | Modern (2006+) | | **Backend** | bibtex | biber (recommended) | | **Languages** | Limited | Full Unicode support | | **Styles** | Fixed styles | Highly customizable | | **Sorting** | Basic | Advanced options | | **Multiple bibliographies** | Difficult | Easy | | **Customization** | Limited | Extensive | | **Recommendation** | Legacy projects | New projects |> [!TIP] > > **For new documents**: Use BibLaTeX with Biber backend for the best experience and most features.## BibLaTeX: Modern Bibliography Management### Basic Setup```latex biblatex-setup.tex theme=\{null} \documentclass{article} \usepackage[ backend=biber, % Use biber (recommended) style=authoryear, % Citation style sorting=nyt, % Sort by name, year, title maxbibnames=10, % Max names in bibliography maxcitenames=2, % Max names in citations hyperref=true, % Clickable links backref=true % Back references ]{biblatex} % Add bibliography file \addbibresource{references.bib} \begin{document} \section{Introduction} This research builds on \textcite{smith2020} and \textcite{jones2021}. Multiple studies \parencite{brown2019,wilson2022,taylor2023} confirm... \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Citation Commands```latex biblatex-citations.tex theme=\{null} % In-text citations \textcite{smith2020} % Smith (2020) argues... \parencite{smith2020} % Recent studies (Smith 2020) show... \cite{smith2020} % Basic citation % Multiple citations \parencite{smith2020,jones2021,brown2019} \textcite{smith2020,jones2021} % Smith (2020) and Jones (2021) % Author and year separately \citeauthor{smith2020} (\citeyear{smith2020}) % Smith (2020) \citeauthor{smith2020} % Smith \citeyear{smith2020} % 2020 % Page numbers and prenotes \parencite[15]{smith2020} % (Smith 2020, 15) \parencite[see][15-20]{smith2020} % (see Smith 2020, 15-20) \parencite[cf.][]{smith2020} % (cf. Smith 2020) % Footnote citations \footcite{smith2020} % Footnote with full citation \footcitetext{smith2020} % Only footnote text % Full citations in text \fullcite{smith2020} % Complete reference inline ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Bibliography File (.bib)```bibtex references.bib theme=\{null} % Journal article @article{smith2020, author = {Smith, John A. and Doe, Jane B.}, title = {Advanced Machine Learning Techniques}, journal = {Journal of Artificial Intelligence}, year = {2020}, volume = {45}, number = {3}, pages = {123--145}, doi = {10.1234/jai.2020.45.123}, url = {https://example.com/article}, abstract = {This paper presents novel approaches to...} } % Book @book{jones2021, author = {Jones, Alice M.}, title = {Introduction to Data Science}, publisher = {Academic Press}, year = {2021}, edition = {3rd}, address = {New York}, isbn = {978-0123456789}, pages = {450} } % Book chapter @incollection{brown2019, author = {Brown, Robert C.}, title = {Statistical Methods in Research}, booktitle = {Handbook of Research Methods}, editor = {Wilson, Sarah D.}, publisher = {Scientific Publishers}, year = {2019}, pages = {45--67}, address = {London} } % Conference paper @inproceedings{wilson2022, author = {Wilson, Mark E. and Taylor, Lisa F.}, title = {Neural Networks for Image Classification}, booktitle = {Proceedings of the International Conference on Machine Learning}, year = {2022}, pages = {234--245}, address = {Vienna, Austria}, publisher = {PMLR}, month = {July} } % PhD thesis @phdthesis{taylor2023, author = {Taylor, Emma R.}, title = {Deep Learning Applications in Computer Vision}, school = {Massachusetts Institute of Technology}, year = {2023}, type = {PhD thesis}, address = {Cambridge, MA} } % Online source @online{website2024, author = {Organization Name}, title = {Important Guidelines}, url = {https://example.com/guidelines}, urldate = {2024-01-15}, year = {2024} } % Technical report @techreport{report2023, author = {Research Team}, title = {Annual Technical Report}, institution = {National Laboratory}, year = {2023}, number = {TR-2023-001}, address = {Washington, DC} } ```### Citation Styles```latex citation-styles.tex theme=\{null} % Author-year styles \usepackage[style=authoryear]{biblatex} % (Smith 2020) \usepackage[style=authoryear-comp]{biblatex} % (Smith 2020; Jones 2021) \usepackage[style=apa]{biblatex} % APA style % Numeric styles \usepackage[style=numeric]{biblatex} % [1] \usepackage[style=numeric-comp]{biblatex} % [1-3,5] \usepackage[style=ieee]{biblatex} % IEEE style % Alphabetic styles \usepackage[style=alphabetic]{biblatex} % [Smi20] \usepackage[style=alphabetic-verb]{biblatex} % [Smith2020] % Verbose styles (footnotes) \usepackage[style=verbose]{biblatex} % Full footnotes \usepackage[style=verbose-ibid]{biblatex} % With ibid. % Field-specific styles \usepackage[style=nature]{biblatex} % Nature journal \usepackage[style=science]{biblatex} % Science journal \usepackage[style=chicago-authordate]{biblatex} % Chicago style ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Advanced BibLaTeX Features```latex advanced-biblatex.tex theme=\{null} % Multiple bibliographies \begin{refsection} \section{Chapter 1} Citations for chapter 1 \cite{ref1,ref2}. \printbibliography[heading=subbibliography,title={Chapter 1 References}] \end{refsection} \begin{refsection} \section{Chapter 2} Citations for chapter 2 \cite{ref3,ref4}. \printbibliography[heading=subbibliography,title={Chapter 2 References}] \end{refsection} % Filtered bibliographies \printbibliography[type=article,title={Journal Articles}] \printbibliography[type=book,title={Books}] \printbibliography[keyword=primary,title={Primary Sources}] \printbibliography[nottype=online,title={Print Sources}] % Custom categories \DeclareBibliographyCategory{primary} \addtocategory{primary}{smith2020,jones2021} \printbibliography[category=primary,title={Primary Sources}] % Split by language \printbibliography[langid=english,title={English Sources}] \printbibliography[langid=german,title={German Sources}] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Traditional BibTeX### Basic BibTeX Setup```latex bibtex-setup.tex theme=\{null} \documentclass{article} \usepackage{natbib} % Enhanced citation commands \begin{document} \section{Introduction} \citet{smith2020} argues that machine learning... Multiple studies \citep{jones2021,brown2019} confirm... % Bibliography \bibliographystyle{plainnat} % or apalike, unsrt, etc. \bibliography{references} % references.bib file \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### BibTeX Citation Commands (with natbib)```latex bibtex-citations.tex theme=\{null} % Basic citations \cite{smith2020} % Smith et al. (2020) or [1] \citep{smith2020} % (Smith et al., 2020) \citet{smith2020} % Smith et al. (2020) % Multiple citations \citep{smith2020,jones2021} % (Smith et al., 2020; Jones, 2021) % Author/year separation \citeauthor{smith2020} % Smith et al. \citeyear{smith2020} % 2020 % Alternative forms \citealp{smith2020} % Smith et al., 2020 \citealt{smith2020} % Smith et al. 2020 % Page numbers \citep[p.~15]{smith2020} % (Smith et al., 2020, p. 15) \citep[see][pp.~10-15]{smith2020} % (see Smith et al., 2020, pp. 10-15) % Starred versions (full author list) \citet*{multiauthor2020} % All authors listed \citep*{multiauthor2020} % All authors in parentheses ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### BibTeX Styles```latex bibtex-styles.tex theme=\{null} % Standard styles (without natbib) \bibliographystyle{plain} % Numbered, sorted alphabetically \bibliographystyle{unsrt} % Numbered, order of citation \bibliographystyle{alpha} % Alphabetic labels [Smi20] \bibliographystyle{abbrv} % Abbreviated names/journals % With natbib package \bibliographystyle{plainnat} % Author-year, full names \bibliographystyle{abbrvnat} % Author-year, abbreviated \bibliographystyle{unsrtnat} % Author-year, citation order \bibliographystyle{apalike} % APA-like style % Field-specific styles \bibliographystyle{ieeetr} % IEEE Transactions \bibliographystyle{acm} % ACM style \bibliographystyle{amsplain} % AMS style \bibliographystyle{chicago} % Chicago style ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Reference Management Integration### Popular Reference Managers```latex reference-managers.tex theme=\{null} % Most reference managers can export BibTeX: % Zotero % 1. Select references % 2. File → Export Library % 3. Choose BibTeX format % 4. Include file in LaTeX project % Mendeley % 1. Select references % 2. File → Export % 3. Choose BibTeX format % EndNote % 1. Select references % 2. File → Export % 3. Choose BibTeX format % JabRef (dedicated BibTeX manager) % Native BibTeX editor with LaTeX integration % Example workflow with Zotero: \addbibresource{zotero-export.bib} % In preamble \cite{key-from-zotero} % In document ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Automated Bibliography Management```latex automated-bib.tex theme=\{null} % Better BibTeX for Zotero % - Automatic citation key generation % - Real-time sync with LaTeX projects % - Custom key patterns % Example citation keys: % [auth:lower][year] → smith2020 % [authorsAlpha][year] → SJB20 % [title:clean:select,1,1][year] → Advanced2020 % In your .bib file generated by Better BibTeX: @article{smith2020advanced, author = {Smith, John A.}, title = {Advanced Machine Learning}, journal = {AI Journal}, year = {2020} } ```
Rendered output Open zoomable preview: Compiled PDF page 1 from automated-bib.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-bibliography-citations-09/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_bibliography_citations)## Journal-Specific Styles### Academic Journal Templates```latex journal-styles.tex theme=\{null} % Nature journals \documentclass{nature} \bibliographystyle{naturemag} % Science \documentclass{sciencepaper} \bibliographystyle{Science} % IEEE journals \documentclass{IEEEtran} \bibliographystyle{IEEEtran} % ACM journals \documentclass{acmart} \bibliographystyle{ACM-Reference-Format} % Elsevier journals \documentclass{elsarticle} \bibliographystyle{elsarticle-num} % Springer journals \documentclass{svjour3} \bibliographystyle{spbasic} % APA style (psychology) \usepackage[style=apa]{biblatex} \DeclareLanguageMapping{american}{american-apa} % Chicago style (history, literature) \usepackage[style=chicago-authordate]{biblatex} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Working with Bibliography Databases### Organizing Large Bibliography Files```latex organizing-bibs.tex theme=\{null} % Split bibliographies by topic \addbibresource{primary-sources.bib} \addbibresource{secondary-sources.bib} \addbibresource{methodology.bib} \addbibresource{background.bib} % Or use categories within one file @article{smith2020, author = {Smith, John}, title = {Primary Research}, journal = {Main Journal}, year = {2020}, keywords = {primary, experimental, machine-learning} } % Filter by keywords \printbibliography[keyword=primary,title={Primary Sources}] \printbibliography[keyword=methodology,title={Methodological References}] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Bibliography Entry Fields Reference> [tab] Required Fields > > ```bibtex theme=\{null} > % Article - Required: author, title, journal, year > @article{key, > author = {Last, First and Coauthor, Name}, > title = {Article Title}, > journal = {Journal Name}, > year = {2024} > } > > % Book - Required: author/editor, title, publisher, year > @book{key, > author = {Author, Name}, > title = {Book Title}, > publisher = {Publisher Name}, > year = {2024} > } > > % InProceedings - Required: author, title, booktitle, year > @inproceedings{key, > author = {Author, Name}, > title = {Paper Title}, > booktitle = {Conference Proceedings Title}, > year = {2024} > } > ```> [tab] Optional Fields > > ```bibtex theme=\{null} > % Comprehensive article entry > @article{complete2024, > author = {Author, First and Second, Author}, > title = {Complete Article Example}, > journal = {Journal of Examples}, > year = {2024}, > volume = {12}, > number = {3}, > pages = {123--145}, > month = {March}, > doi = {10.1234/example.2024.123}, > url = {https://doi.org/10.1234/example.2024.123}, > abstract = {This abstract describes...}, > keywords = {latex, bibliography, example}, > note = {Special issue on bibliography management} > } > ```> [tab] Special Fields > > ```bibtex theme=\{null} > % Electronic sources > @online{web2024, > author = {Organization}, > title = {Web Resource}, > url = {https://example.com}, > urldate = {2024-01-15}, > year = {2024}, > note = {Accessed: January 15, 2024} > } > > % Datasets > @dataset{data2024, > author = {Researcher, Name}, > title = {Research Dataset v1.0}, > year = {2024}, > publisher = {Data Repository}, > version = {1.0}, > doi = {10.5281/zenodo.123456}, > url = {https://doi.org/10.5281/zenodo.123456} > } > > % Software > @software{software2024, > author = {Developer, Name}, > title = {Software Package}, > year = {2024}, > publisher = {GitHub}, > version = {2.1.0}, > url = {https://github.com/user/repo} > } > ```### Managing Cross-References```bibtex crossref-example.bib theme=\{null} % Parent entry (conference proceedings) @proceedings{conference2024, title = {Proceedings of the International Conference}, year = {2024}, editor = {Editor, Name}, publisher = {ACM}, address = {New York} } % Child entries using crossref @inproceedings{paper1_2024, author = {First, Author}, title = {First Paper Title}, pages = {1--10}, crossref = {conference2024} } @inproceedings{paper2_2024, author = {Second, Author}, title = {Second Paper Title}, pages = {11--20}, crossref = {conference2024} } % The crossref field automatically inherits: % - booktitle from title % - publisher, year, editor, address from parent ```## Advanced Citation Techniques### Custom Citation Commands```latex custom-citations.tex theme=\{null} % Define custom citation commands \newcommand{\citepos}[1]{\citeauthor{#1}'s (\citeyear{#1})} % Usage: \citepos{smith2020} → Smith's (2020) \newcommand{\citeposs}[1]{\citeauthor{#1}' (\citeyear{#1})} % For plural possessive: \citeposs{authors2020} → Authors' (2020) % Parenthetical citations with page ranges \newcommand{\citepp}[2]{\citep[pp.~#2]{#1}} % Usage: \citepp{smith2020}{15-20} → (Smith 2020, pp. 15-20) % Compare citations \newcommand{\citecf}[1]{\citep[cf.][]{#1}} % Usage: \citecf{smith2020} → (cf. Smith 2020) % See also citations \newcommand{\citesee}[1]{\citep[see][]{#1}} % Usage: \citesee{smith2020} → (see Smith 2020) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Handling Special Cases```latex special-citations.tex theme=\{null} % Anonymous authors @article{anonymous2020, author = {{Anonymous}}, title = {Confidential Research Results}, journal = {Secret Journal}, year = {2020} } % Corporate authors @report{who2021, author = {{World Health Organization}}, title = {Global Health Report 2021}, institution = {WHO}, year = {2021} } % Multiple works by same author, same year @article{smith2020a, author = {Smith, John A.}, title = {First Paper in 2020}, journal = {Journal A}, year = {2020} } @article{smith2020b, author = {Smith, John A.}, title = {Second Paper in 2020}, journal = {Journal B}, year = {2020} } % Forthcoming publications @article{jones2024, author = {Jones, Mary}, title = {Future Research}, journal = {Future Journal}, year = {2024}, note = {forthcoming} } ```
Rendered output Open zoomable preview: Compiled PDF page 1 from special-citations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-bibliography-citations-13/page-1.svg)
## Customizing Bibliography Appearance### BibLaTeX Style Customization```latex customize-biblatex.tex theme=\{null} % Customize bibliography appearance \usepackage[ backend=biber, style=authoryear, dashed=false, % Repeat author names maxnames=3, % Show up to 3 names before et al. minnames=1, % At least 1 name before et al. giveninits=true, % Use initials uniquename=init, % Disambiguate by initials uniquelist=false, % Don't expand name lists doi=true, % Show DOIs isbn=false, % Hide ISBNs url=false, % Hide URLs (when DOI present) eprint=false % Hide eprint info ]{biblatex} % Customize field formats \DeclareFieldFormat{title}{\mkbibemph{#1}} % Italicize titles \DeclareFieldFormat[article]{title}{\mkbibquote{#1}} % Quote article titles \DeclareFieldFormat{journaltitle}{\textit{#1}} % Italicize journal names \DeclareFieldFormat{doi}{% \mkbibacro{DOI}\addcolon\space \href{https://doi.org/#1}{\nolinkurl{#1}}} % Remove "In:" before journal names \renewbibmacro{in:}{% \ifentrytype{article}{}{ \printtext{\bibstring{in}\intitlepunct}}} % Custom name format \DeclareNameAlias{sortname}{family-given} \DeclareNameAlias{default}{family-given} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code performs setup or defines reusable behavior without producing visible page content on its own. It must be used inside a complete document to have a rendered result.\
### Creating Custom Bibliography Drivers```latex custom-drivers.tex theme=\{null} % Define a new entry type for preprints \DeclareBibliographyDriver{preprint}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{author/translator+others}% \setunit{\printdelim{nametitledelim}}\newblock \usebibmacro{title}% \newunit\newblock \printfield{howpublished}% \newunit\newblock \printfield{note}% \newunit\newblock \usebibmacro{doi+eprint+url}% \newunit\newblock \usebibmacro{addendum+pubstate}% \setunit{\bibpagerefpunct}\newblock \usebibmacro{pageref}% \newunit\newblock \iftoggle{bbx:related} {\usebibmacro{related:init}% \usebibmacro{related}} {}% \usebibmacro{finentry}} % Use in .bib file @preprint{arxiv2024, author = {Researcher, Name}, title = {Preprint Title}, year = {2024}, eprint = {2401.12345}, eprinttype = {arXiv}, eprintclass = {cs.LG} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Bibliography Formatting Examples```latex formatting-examples.tex theme=\{null} % Numbered bibliography with custom labels \defbibenvironment{bibliography} {\enumerate {\setlength{\leftmargin}{\bibhang}% \setlength{\itemindent}{-\leftmargin}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}} {\endenumerate} {\item[\printfield{labelnumber}.]} % Add period after number % Custom bibliography heading \defbibheading{bibliography}[\bibname]{% \section*{#1}% \markboth{#1}{#1}% \addcontentsline{toc}{section}{#1}} % Split bibliography by decade \defbibcheck{2020s}{\iffieldint{year} {\ifnumless{\thefield{year}}{2020} {\skipentry}{\ifnumgreater{\thefield{year}}{2029} {\skipentry}{}}}} {\skipentry}} \defbibcheck{2010s}{\iffieldint{year} {\ifnumless{\thefield{year}}{2010} {\skipentry}{\ifnumgreater{\thefield{year}}{2019} {\skipentry}{}}}} {\skipentry}} % Print by decade \printbibliography[check=2020s,title={2020s Publications}] \printbibliography[check=2010s,title={2010s Publications}] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Handling Complex Citation Scenarios### Multi-Volume Works```bibtex multivolume.bib theme=\{null} % Multi-volume book set @mvbook{encyclopedia2024, author = {Editor, Chief}, title = {Encyclopedia of Computer Science}, year = {2024}, volumes = {5}, publisher = {Academic Press} } % Individual volume @book{encyclopedia2024_vol2, author = {Editor, Chief}, title = {Encyclopedia of Computer Science}, year = {2024}, volume = {2}, maintitle = {Encyclopedia of Computer Science}, mainsubtitle = {Complete Edition}, publisher = {Academic Press} } % Reference within multi-volume work @inbook{smith2024_encyclopedia, author = {Smith, John}, title = {Machine Learning Fundamentals}, booktitle = {Encyclopedia of Computer Science}, year = {2024}, volume = {3}, pages = {234--267}, publisher = {Academic Press}, crossref = {encyclopedia2024} } ```### Legal Citations```latex legal-citations.tex theme=\{null} % Legal citation package \usepackage[style=apa]{biblatex} % Case law @legal{brown1954, title = {Brown v. Board of Education}, year = {1954}, volume = {347}, reporter = {U.S.}, pages = {483}, court = {Supreme Court} } % Statute @legislation{ada1990, title = {Americans with Disabilities Act}, year = {1990}, volume = {42}, section = {12101}, code = {U.S.C.} } % Custom legal citation format \DeclareFieldFormat[legal]{title}{\textit{#1}} \DeclareBibliographyDriver{legal}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \printfield{title}% \setunit{\addcomma\space}% \printfield{volume}% \setunit{\space}% \printfield{reporter}% \setunit{\space}% \printfield{pages}% \setunit{\space}% \mkbibparens{\printfield{year}}% \usebibmacro{finentry}} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### Citation Call-Outs and Annotations```latex annotations.tex theme=\{null} % Annotated bibliography @article{smith2020, author = {Smith, John}, title = {Important Study}, journal = {Key Journal}, year = {2020}, annotation = {This seminal work established the foundation for modern approaches to the problem. The author uses innovative methodology to demonstrate...} } % Print with annotations \renewbibmacro*{finentry}{% \finentrypunct \iffieldundef{annotation} {} {\par\vspace{0.5\baselineskip}% \begin{quotation}\small \printfield{annotation}% \end{quotation}}% \finentry} % In-text annotation references \newcommand{\citenote}[2]{% \cite{#1}\footnote{#2}} % Usage: \citenote{smith2020}{This study is particularly % relevant because it addresses our specific use case.} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Best Practices> [!TIP] > > **Bibliography best practices:** > > 1. **Consistent formatting**: Use a reference manager for consistency > 2. **Complete information**: Include all required fields (DOI, pages, etc.) > 3. **Verification**: Double-check all citations against original sources > 4. **Style compliance**: Follow your target journal's requirements exactly > 5. **Backup**: Keep backup copies of your .bib files > 6. **Organization**: Use meaningful citation keys > 7. **Updates**: Keep reference information current > 8. **Permissions**: Ensure you have rights to cite all sources### Citation Key Best Practices```bibtex citation-keys.bib theme=\{null} % Good citation key patterns @article{smith2020ml, % author + year + topic author = {Smith, John}, title = {Machine Learning Advances}, year = {2020} } @book{johnson2021deeplearning, % author + year + keywords author = {Johnson, Mary}, title = {Deep Learning Fundamentals}, year = {2021} } @inproceedings{lee2024cvpr, % author + year + venue author = {Lee, David}, title = {Computer Vision Paper}, booktitle = {CVPR}, year = {2024} } % Avoid these patterns @article{1, % Too generic @article{ml_paper, % No year/author info @article{my_favorite_paper, % Personal references @article{temp, % Temporary names ```### Managing Bibliography Errors> [accordion] Common BibTeX/BibLaTeX Errors > > **Error: Citation undefined** > > * Check spelling of citation key > * Ensure .bib file is included > * Run compilation sequence completely > > **Error: Empty bibliography** > > * Verify \cite commands exist in document > * Check .bib file path > * Ensure bibliography style is defined > > **Error: I found no \citation commands** > > * At least one \cite must appear before \bibliography > * Check for typos in \cite commands > * Verify .aux file is being generated > > **Error: Repeated entry** > > * Check for duplicate keys in .bib file > * Look for entries in multiple .bib files > * Use unique keys for each entry## Troubleshooting> [!WARNING] > > **Common issues and solutions:** > > 1. **Missing references**: Check citation keys match .bib entries exactly > 2. **Style errors**: Ensure you're using the correct bibliography style > 3. **Compilation order**: Run LaTeX → Biber/BibTeX → LaTeX → LaTeX > 4. **Unicode issues**: Use BibLaTeX with UTF-8 encoding > 5. **Multiple authors**: Use `and` to separate authors in .bib files > 6. **Special characters**: Use LaTeX escape sequences or UTF-8 > 7. **Page ranges**: Use `--` for page ranges (123--145) > 8. **URLs**: Use `\url{}` command or proper URL fields## Working with Multiple Bibliographies### Chapter-Based Bibliographies```latex chapter-bibs.tex theme=\{null} % Using refsection (BibLaTeX) \documentclass{book} \usepackage[style=authoryear,refsection=chapter]{biblatex} \addbibresource{references.bib} \begin{document} \chapter{Introduction} \begin{refsection} Content with citations \cite{ref1,ref2}. \printbibliography[heading=subbibliography] \end{refsection} \chapter{Methods} \begin{refsection} More content \cite{ref3,ref4}. \printbibliography[heading=subbibliography] \end{refsection} % Global bibliography at end \printbibliography[title={Complete Bibliography}] \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Topic-Based Bibliographies```latex topic-bibs.tex theme=\{null} % Categorize references by topic \DeclareBibliographyCategory{theory} \DeclareBibliographyCategory{experiments} \DeclareBibliographyCategory{applications} % Assign categories \addtocategory{theory}{einstein1905,bohr1913} \addtocategory{experiments}{miller2020,jones2021} \addtocategory{applications}{smith2022,brown2023} % Print categorized bibliographies \printbibheading{\section{References by Topic}} \printbibliography[ category=theory, title={Theoretical Foundations}] \printbibliography[ category=experiments, title={Experimental Studies}] \printbibliography[ category=applications, title={Practical Applications}] % Or filter by keywords in .bib entries \printbibliography[ keyword={machine-learning}, title={Machine Learning References}] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Integration with LaTeX Features### Hyperlinked Citations```latex hyperref-citations.tex theme=\{null} % Setup hyperref with biblatex \usepackage{hyperref} \hypersetup{ colorlinks=true, citecolor=blue, linkcolor=blue, urlcolor=blue } % Custom link colors for different citation types \DeclareFieldFormat{citehyperref}{% \DeclareFieldAlias{bibhyperref}{noformat}% \bibhyperref{#1}} \DeclareFieldFormat{textcitehyperref}{% \DeclareFieldAlias{bibhyperref}{noformat}% \bibhyperref{\textcolor{green}{#1}}} % Backref - show where each reference is cited \usepackage[style=authoryear,backref=true]{biblatex} % Custom backref text \DefineBibliographyStrings{english}{% backrefpage = {cited on page}, backrefpages = {cited on pages} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### Bibliography in Table of Contents```latex bib-toc.tex theme=\{null} % Add bibliography to TOC \printbibliography[heading=bibintoc,title={References}] % Or manually \printbibliography \addcontentsline{toc}{chapter}{Bibliography} % For numbered sections \printbibliography[heading=bibnumbered] % Custom heading with TOC \defbibheading{custom}[\bibname]{% \chapter*{#1}% \markboth{#1}{#1}% \addcontentsline{toc}{chapter}{#1}% \vspace{2em}% \center\textit{All sources have been carefully verified.}% \vspace{1em}} \printbibliography[heading=custom] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Glossary Integration with Citations```latex glossary-citations.tex theme=\{null} % Using glossaries package with citations \usepackage{glossaries} \makeglossaries % Define term with citation \newglossaryentry{machinelearning}{ name={machine learning}, description={A subset of artificial intelligence that enables systems to learn from data \cite{mitchell1997}} } % In text The concept of \gls{machinelearning} has evolved significantly since its inception. % Print glossary with citations \printglossary[title={Glossary with References}] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Quick Reference### Compilation Process```bash theme=\{null} # For BibLaTeX (recommended) pdflatex document.tex biber document pdflatex document.tex pdflatex document.tex # For BibTeX pdflatex document.tex bibtex document pdflatex document.tex pdflatex document.tex ```### Essential Entry Types| Type | Purpose | Required Fields | | - | - | - | | `@article` | Journal articles | author, title, journal, year | | `@book` | Books | author/editor, title, publisher, year | | `@incollection` | Book chapters | author, title, booktitle, publisher, year | | `@inproceedings` | Conference papers | author, title, booktitle, year | | `@phdthesis` | Dissertations | author, title, school, year | | `@techreport` | Technical reports | author, title, institution, year | | `@online` | Web sources | author, title, url, urldate |***> [!NOTE] > > **Next**: Learn about [Cross-referencing systems](/learn/latex/cross-referencing) to create professional internal references in your documents.## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=cta\&utm_campaign=research_workflow\&utm_content=bibliography_citations_open_app)> [card] Start from Article Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/article)> [card] Knowledge Base Docs > > Keep source PDFs and reusable project context close to the manuscript.[Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=bibliography_citations)> [card] AI Research Agent Docs > > Use accepted sources, follow-up literature, and citation handoff inside the same project.[Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=bibliography_citations) # LaTeX Bibliography with BibLaTeX and Biber: Complete Setup Guide Source: https://resources.latex-cloud-studio.com/learn/latex/bibliography/biblatex-guide Create a LaTeX bibliography with BibLaTeX and Biber. Includes a working .bib file, citation commands, styles, build order, and common error fixes. To create a bibliography in LaTeX with BibLaTeX, load the `biblatex` package, connect a `.bib` file with `\addbibresource{...}`, cite entries in the document, and print the reference list with `\printbibliography`. Use Biber as the bibliography processor unless your template explicitly requires another backend.> [!NOTE] > > **Quick answer**: the modern setup is `\usepackage[backend=biber]{biblatex}`, `\addbibresource{references.bib}`, a citation such as `\parencite{smith2024}`, and `\printbibliography`.## Minimal Working LaTeX BibliographyCreate `main.tex`:```latex main.tex theme=\{null} \documentclass{article} \usepackage[ backend=biber, style=authoryear, sorting=nyt ]{biblatex} \addbibresource{references.bib} \begin{document} Recent work \parencite{smith2024} extends prior results. Smith's argument can also be introduced in the sentence \textcite{smith2024}. \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
Create `references.bib` in the same directory:```bibtex references.bib theme=\{null} @article{smith2024, author = {Smith, Ada and Lee, Morgan}, title = {A Reproducible Writing Workflow}, journal = {Journal of Research Tools}, year = {2024}, volume = {12}, number = {3}, pages = {45--61}, doi = {10.0000/example-doi} } ```The key `smith2024` connects the citation command in `main.tex` with the database entry in `references.bib`.## BibLaTeX Build OrderWhen you compile locally, the usual sequence is:1) LaTeX 2) Biber 3) LaTeX 4) LaTeXThe first LaTeX run creates the bibliography instructions, Biber processes the `.bib` data, and the final LaTeX runs resolve citations and references. Many editors automate this sequence, but the log still tells you whether Biber ran successfully.## Common Citation Commands| Command | Typical result | Use it for | | - | - | - | | `\parencite{smith2024}` | (Smith and Lee 2024) | Parenthetical citation | | `\textcite{smith2024}` | Smith and Lee (2024) | Authors as part of the sentence | | `\autocite{smith2024}` | Style-dependent | Let the selected style choose the form | | `\footcite{smith2024}` | Citation in a footnote | Note-based styles | | `\citeauthor{smith2024}` | Smith and Lee | Author names only | | `\citeyear{smith2024}` | 2024 | Year only |Use multiple keys in one command when several sources support the same statement:```latex example.tex theme=\{null} \parencite{smith2024,jones2023,garcia2022} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Choose a Bibliography StyleSet the style in the package options:```latex example.tex theme=\{null} \usepackage[backend=biber,style=numeric]{biblatex} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
Common starting points are:- `numeric` for numbered citations such as `[1]`. - `authoryear` for author-year citations. - `alphabetic` for compact labels derived from authors and years. - `verbose` for detailed note-based citations.Journal and university templates may require a specific style or package. Follow the template when it conflicts with a general recommendation.## Add More Than One Bibliography FileYou can load multiple databases:```latex example.tex theme=\{null} \addbibresource{books.bib} \addbibresource{articles.bib} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
Keep entry keys unique across all files. Splitting a database by source type or project chapter can help large teams, but one well-maintained file is simpler for small projects.## Fix Missing Citations or an Empty Bibliography### Citation shows as a question markCheck that the citation key exactly matches the key in the `.bib` file, including capitalization. Then run the complete LaTeX–Biber–LaTeX–LaTeX sequence.### `\printbibliography` is emptyBy default, BibLaTeX prints cited entries. To include every database entry while debugging, add:```latex example.tex theme=\{null} \nocite{*} \printbibliography ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
Remove `\nocite{*}` if the final bibliography should contain only cited work.### Biber cannot find the data sourceMake sure the file name in `\addbibresource{references.bib}` matches the real file and includes the `.bib` extension. Also confirm that the editor is configured to run Biber rather than BibTeX.### Special characters break an entryKeep names in `author = {Family, Given and Family, Given}` form and protect capitalization that must be preserved:```bibtex theme=\{null} title = {Using {LaTeX} for {DNA} Sequence Reports} ```## BibLaTeX or Traditional BibTeX?| Need | BibLaTeX + Biber | Traditional BibTeX | | - | - | - | | New general-purpose project | Recommended starting point | Use when required by a template | | Flexible citation commands | Strong support | Depends on the selected style/package | | Unicode data | Better Biber support | More limited workflow | | Legacy journal template | Check instructions | Often required |Do not migrate a working journal template solely for consistency. The publisher's build requirements are the governing constraint.## Try a Bibliography in LaTeX Cloud Studio> [card] Open a bibliography project > > Create `main.tex` and `references.bib`, then compile the minimal example and inspect the build log if a citation is missing.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=biblatex_open_app)> [card] See the online LaTeX editor > > Review the browser editor workflow on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=biblatex_online_editor) page before moving an existing bibliography project.## Related Pages- [Natbib guide](/learn/latex/bibliography/natbib-guide) - [Choosing citation styles](/learn/latex/bibliography/choosing-citation-styles) - [Bibliography and citations overview](/learn/latex/bibliography-citations) # Bibliography Management with BibTeX - Complete Guide Source: https://resources.latex-cloud-studio.com/learn/latex/bibliography/bibliography-management-bibtex Master bibliography management in LaTeX using BibTeX. Learn citation styles, .bib files, and automated reference formatting with examples. Master **professional bibliography management** in LaTeX using BibTeX. This comprehensive guide covers everything from basic citations to advanced bibliography customization for academic papers, theses, and publications.> [!NOTE] > > **Quick start**: BibTeX automates bibliography formatting in LaTeX. Create a `.bib` file with your references, cite them with `\cite{key}`, and LaTeX handles the formatting based on your chosen style. > > **Prerequisites**: Basic LaTeX knowledge. For citations basics, see [Bibliography & Citations](/learn/latex/bibliography-citations).## What You'll Learn- ✅ How BibTeX works with LaTeX - ✅ Creating and managing .bib files - ✅ Citation commands and variations - ✅ Bibliography styles (plain, alpha, abbrv, etc.) - ✅ Advanced customization techniques - ✅ Best practices for reference management - ✅ Troubleshooting common issues## How BibTeX WorksBibTeX is a bibliography management tool that works alongside LaTeX to handle citations and references automatically. Here's the workflow:> [card] BibTeX Workflow > > The BibTeX workflow follows four steps: (1) Create a .bib file to store your references in a structured format, (2) Cite references in your .tex document using \cite commands, (3) Compile using LaTeX followed by BibTeX and then LaTeX again, (4) Output shows your formatted bibliography with properly numbered or author-year citations matching your chosen style.## Basic Setup### Step 1: Create Your Main Document```latex main.tex theme=\{null} \documentclass{article} \usepackage[utf8]{inputenc} \title{Sample Article with Bibliography} \author{Your Name} \date{\today} \begin{document} \maketitle \section{Introduction} According to \cite{einstein1905}, the theory of special relativity revolutionized physics. Later work by \cite{hawking1988} expanded our understanding of the universe. % Bibliography \bibliographystyle{plain} % Choose citation style \bibliography{references} % Link to .bib file (without extension) \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Step 2: Create Your Bibliography File```bibtex references.bib theme=\{null} @article{einstein1905, author = {Einstein, Albert}, title = {On the Electrodynamics of Moving Bodies}, journal = {Annalen der Physik}, year = {1905}, volume = {17}, pages = {891--921}, doi = {10.1002/andp.19053221004} } @book{hawking1988, author = {Hawking, Stephen}, title = {A Brief History of Time}, publisher = {Bantam Books}, year = {1988}, address = {New York}, isbn = {978-0553380163} } ```### Step 3: Compile Your Document**1. First LaTeX pass**`pdflatex main.tex` - Creates auxiliary files with citation information**2. Process bibliography**`bibtex main` - Reads .aux file, processes .bib file, creates .bbl file**3. Second LaTeX pass**`pdflatex main.tex` - Incorporates bibliography entries**4. Final LaTeX pass**`pdflatex main.tex` - Resolves all cross-references**Expected output:**> [card] Expected output > > The compiled document displays "Sample Article with Bibliography" as the centered title, followed by the author name and date. The Introduction section shows in-text citations as bracketed numbers \[1] and \[2]. The References section at the bottom lists the formatted bibliography entries: \[1] shows Einstein's article with author, title in sentence case, journal name in italics, volume, pages, and year; \[2] shows Hawking's book with author, title in italics, publisher, city, and year.## BibTeX Entry Types### Common Entry Types> [card] @article > > Journal articles, magazine articles > > ```bibtex theme=\{null} > @article{key, > author = {Author Name}, > title = {Article Title}, > journal = {Journal Name}, > year = {2023} > } > ```> [card] @book > > Books with publisher > > ```bibtex theme=\{null} > @book{key, > author = {Author Name}, > title = {Book Title}, > publisher = {Publisher Name}, > year = {2023} > } > ```> [card] @inproceedings > > Conference papers > > ```bibtex theme=\{null} > @inproceedings{key, > author = {Author Name}, > title = {Paper Title}, > booktitle = {Conference Name}, > year = {2023} > } > ```> [card] @phdthesis > > PhD dissertations > > ```bibtex theme=\{null} > @phdthesis{key, > author = {Author Name}, > title = {Thesis Title}, > school = {University Name}, > year = {2023} > } > ```### Complete Entry Types Reference> [accordion] All BibTeX entry types with required and optional fields > > #### @article > > **Required**: author, title, journal, year\ > **Optional**: volume, number, pages, month, doi, note > > #### @book > > **Required**: author/editor, title, publisher, year\ > **Optional**: volume/number, series, address, edition, month, isbn, note > > #### @booklet > > **Required**: title\ > **Optional**: author, howpublished, address, month, year, note > > #### @inbook > > **Required**: author/editor, title, chapter/pages, publisher, year\ > **Optional**: volume/number, series, type, address, edition, month, note > > #### @incollection > > **Required**: author, title, booktitle, publisher, year\ > **Optional**: editor, volume/number, series, type, chapter, pages, address, edition, month, note > > #### @inproceedings / @conference > > **Required**: author, title, booktitle, year\ > **Optional**: editor, volume/number, series, pages, address, month, organization, publisher, note > > #### @manual > > **Required**: title\ > **Optional**: author, organization, address, edition, month, year, note > > #### @mastersthesis > > **Required**: author, title, school, year\ > **Optional**: type, address, month, note > > #### @misc > > **Required**: none\ > **Optional**: author, title, howpublished, month, year, note, url > > #### @phdthesis > > **Required**: author, title, school, year\ > **Optional**: type, address, month, note > > #### @proceedings > > **Required**: title, year\ > **Optional**: editor, volume/number, series, address, month, publisher, organization, note > > #### @techreport > > **Required**: author, title, institution, year\ > **Optional**: type, number, address, month, note > > #### @unpublished > > **Required**: author, title, note\ > **Optional**: month, year## Citation Commands### Basic Citation Commands```latex citation-examples.tex theme=\{null} % Basic citation \cite{einstein1905} % Output: [1] % Multiple citations \cite{einstein1905,hawking1988} % Output: [1, 2] % Citation with page number \cite[p.~42]{hawking1988} % Output: [2, p. 42] % Citation with prefix \cite[see][]{einstein1905} % Output: [see 1] % Citation with prefix and page \cite[see][p.~15]{einstein1905} % Output: [see 1, p. 15] % Textual citations (with natbib package) \usepackage{natbib} \citet{einstein1905} % Output: Einstein (1905) \citep{einstein1905} % Output: (Einstein, 1905) \citeauthor{einstein1905} % Output: Einstein \citeyear{einstein1905} % Output: 1905 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
**Rendered output examples:**> [card] Expected output > > Citation commands produce different outputs depending on the bibliography style. With the plain style: \cite produces \[1], multiple citations produce \[1, 2], and page references produce \[2, p. 42]. With author-year styles (natbib): \cite produces (Einstein, 1905), multiple citations produce (Einstein, 1905; Hawking, 1988), \citet produces Einstein (1905) for textual citations, and \citep produces (Einstein, 1905) for parenthetical citations.## Bibliography Styles### Standard BibTeX Styles> [card] plain > > `\bibliographystyle{plain}` > > Entries sorted alphabetically by author, numbered \[1], \[2], \[3]... > > **Example:** > > * \[1] A. Einstein. On the electrodynamics... > * \[2] S. Hawking. A Brief History of Time...> [card] alpha > > `\bibliographystyle{alpha}` > > Labels like \[Ein05], \[Haw88] based on author and year > > **Example:** > > * \[Ein05] A. Einstein. On the electrodynamics... > * \[Haw88] S. Hawking. A Brief History of Time...> [card] abbrv > > `\bibliographystyle{abbrv}` > > Like plain but with abbreviated first names, journal names > > **Example:** > > * \[1] A. Einstein. On the electrodynamics... *Ann. Phys.* > * \[2] S. Hawking. A Brief History of Time...> [card] unsrt > > `\bibliographystyle{unsrt}` > > Entries in order of citation, not alphabetically > > **Example:** > > * \[1] S. Hawking. A Brief History of Time... > * \[2] A. Einstein. On the electrodynamics...### Author-Year Styles (natbib)```latex natbib-styles.tex theme=\{null} \usepackage{natbib} % Choose one of these styles: \bibliographystyle{plainnat} % Author-year version of plain \bibliographystyle{abbrvnat} % Author-year version of abbrv \bibliographystyle{unsrtnat} % Author-year version of unsrt % Popular journal styles: \bibliographystyle{apalike} % APA-like style \bibliographystyle{chicago} % Chicago Manual of Style \bibliographystyle{harvard} % Harvard citation style \bibliographystyle{agsm} % Australian Government Style Manual ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Custom Bibliography Styles> [!TIP] > > Many journals and institutions provide their own `.bst` files. Common examples: > > * **IEEEtran.bst** - IEEE Transactions > * **ACM-Reference-Format.bst** - ACM publications > * **apa.bst** - American Psychological Association > * **vancouver.bst** - Biomedical journals > * **nature.bst** - Nature journals## Managing Large Bibliographies### Organizing Your .bib File```bibtex organized-references.bib theme=\{null} % ========================================== % BOOKS % ========================================== @book{knuth1984tex, author = {Knuth, Donald E.}, title = {The {\TeX}book}, publisher = {Addison-Wesley}, year = {1984}, address = {Reading, Massachusetts}, isbn = {0-201-13447-0}, keywords = {tex, typography, typesetting} } @book{lamport1994latex, author = {Lamport, Leslie}, title = {{\LaTeX}: A Document Preparation System}, publisher = {Addison-Wesley}, year = {1994}, edition = {2nd}, isbn = {0-201-52983-1}, keywords = {latex, documentation} } % ========================================== % JOURNAL ARTICLES % ========================================== @article{shannon1948mathematical, author = {Shannon, Claude E.}, title = {A Mathematical Theory of Communication}, journal = {Bell System Technical Journal}, year = {1948}, volume = {27}, number = {3}, pages = {379--423}, month = jul, doi = {10.1002/j.1538-7305.1948.tb01338.x}, keywords = {information theory, communication} } % ========================================== % CONFERENCE PAPERS % ========================================== @inproceedings{turing1950computing, author = {Turing, Alan M.}, title = {Computing Machinery and Intelligence}, booktitle = {Mind}, year = {1950}, volume = {59}, number = {236}, pages = {433--460}, keywords = {artificial intelligence, turing test} } ```### Using Multiple .bib Files```latex multiple-bibs.tex theme=\{null} % You can use multiple bibliography files \bibliography{books,articles,conferences} % Or keep project-specific references separate \bibliography{general-refs,project-specific-refs} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### String Definitions for Consistency```bibtex string-definitions.bib theme=\{null} % Define common strings to ensure consistency @string{ieee = "IEEE Transactions on"} @string{acm = "ACM Computing Surveys"} @string{springer = "Springer-Verlag"} @string{mit = "MIT Press"} % Use the strings in entries @article{example2023, author = {Example, Author}, title = {Example Article}, journal = ieee # " Software Engineering", % String concatenation year = {2023}, publisher = springer } ```## Advanced Features### Cross-References```bibtex cross-references.bib theme=\{null} @book{edited-volume2023, editor = {Smith, Jane and Doe, John}, title = {Advances in Computer Science}, publisher = {Academic Press}, year = {2023} } @incollection{chapter2023, author = {Johnson, Alice}, title = {Machine Learning Applications}, pages = {45--67}, crossref = {edited-volume2023} % Inherits book details } ```### Custom Fields and Notes```bibtex custom-fields.bib theme=\{null} @article{example2023custom, author = {Author, Example}, title = {Article with Custom Fields}, journal = {Example Journal}, year = {2023}, % Standard optional fields note = {Forthcoming}, abstract = {This article discusses...}, keywords = {keyword1, keyword2, keyword3}, % URL and access information url = {https://example.com/article}, urldate = {2023-11-28}, % Modern identifiers doi = {10.1234/example.2023}, eprint = {2301.00000}, archivePrefix = {arXiv} } ```### Special Characters and Formatting```bibtex special-characters.bib theme=\{null} @article{special-chars2023, % Preserving capitalization title = {The {NASA} {M}ars {R}over: A Study of {AI} in Space}, % Special characters author = {M{\"u}ller, Hans and Garc{\'\i}a, Jos{\'e}}, % Math in titles title = {On the $\mathcal{O}(n\log n)$ Complexity of Sorting}, % Preserving spaces and formatting title = {The {{\TeX}} and {{\LaTeX}} Companion}, % Corporate authors author = {{Microsoft Corporation}}, % Multiple authors with "and others" author = {First, A. and Second, B. and Third, C. and others}, journal = {Example Journal}, year = {2023} } ```## Best Practices### 1. Consistent Key Naming> [!TIP] > > **Good Key Naming Conventions** > > * `author2023keyword` - e.g., `einstein1905relativity` > * `author2023a`, `author2023b` - for multiple papers same year > * `conference2023author` - e.g., `icml2023smith`> [!WARNING] > > **Poor Key Names to Avoid** > > * `paper1`, `paper2` - not descriptive > * `my-favorite-paper` - too subjective > * `ref:2023/05/28` - uses special characters### 2. Complete InformationAlways include:* **DOI** when available - for reliable access * **URL** for online resources * **ISBN** for books * **Abstract** for searchability * **Keywords** for organization### 3. Version Control```bash git-workflow\.sh theme=\{null} # Track your bibliography files git add references.bib git commit -m "Add quantum computing references" # Create backups before major changes cp references.bib references.bib.backup # Use meaningful commit messages git commit -m "Update author names to include middle initials" ```## Troubleshooting> [accordion] Bibliography not appearing > > **Common causes:** > > 1. Missing `\bibliography{filename}` command > 2. Incorrect filename (don't include .bib extension) > 3. Didn't run BibTeX: `bibtex main` > 4. Need additional LaTeX passes > > **Solution:** > > ```bash theme=\{null} > pdflatex main > bibtex main > pdflatex main > pdflatex main > ```> [accordion] Citation shows as \[?] or bold > > **Common causes:**1) Typo in citation key > 2\) Entry not in .bib file > 3\) BibTeX compilation failed > 4\) Multiple .bib files not all included**Debugging:**\`\`\`latex example.tex theme=\{null} > % Check the .blg file for errors > % Look for "Warning--I didn't find a database entry for..." > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ```> [accordion] Incorrect sorting or formatting > > **Common causes:** > > 1. Wrong bibliography style > 2. Missing required fields > 3. Special characters not escaped > > **Solutions:** > > * Verify all required fields are present > * Use `{}` to preserve capitalization > * Check .bst file compatibility> [accordion] Encoding and special character issues > > **For UTF-8 support:**\`\`\`latex example.tex theme=\{null} > \usepackage\[utf8] % For pdfLaTeX > % or use XeLaTeX/LuaLaTeX for native UTF-8 > > ````\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
**For special characters:**```bibtex theme=\{null} > author = {M{\"u}ller, J{\"o}rg} % ü, ö > author = {Garc{\'\i}a, Jos{\'e}} % í, é > ````## Modern Alternatives### BibLaTeX (Advanced Users)> [!NOTE] > > **BibLaTeX** is a modern replacement for BibTeX with more features: > > * Better Unicode support > * More entry types and fields > * Customizable citation styles > * Multiple bibliographies in one document > > Learn more about advanced bibliography management in our comprehensive [Bibliography & Citations guide](/learn/latex/bibliography-citations).### Reference ManagersPopular tools that export to BibTeX:- **Zotero** - Free, open-source - **Mendeley** - Free with Elsevier account - **JabRef** - BibTeX-specific manager - **EndNote** - Commercial, widely used - **Paperpile** - Modern web-based## Quick Reference Card> [card] Expected output > > BibTeX Quick Reference shows three key areas: Essential Commands include \bibliographystyle for setting the style, \bibliography for linking the .bib file, \cite for citations, and \nocite for including uncited references. Compilation Order requires running pdflatex, then bibtex, then pdflatex twice more. Common Styles include plain (numbered, alphabetical), alpha (author-year labels like \[Ein05]), abbrv (abbreviated names), unsrt (citation order), and apalike (APA format).## Next Steps> [card] Bibliography & Citations > > Explore different citation formats and journal requirements[Open](/learn/latex/bibliography-citations)> [card] Cross-Referencing > > Learn to reference figures, tables, and sections[Open](/learn/latex/cross-referencing)> [card] Article Templates > > Ready-to-use document templates with bibliographies[Open](/templates/article)> [card] Thesis Guide > > Managing references for large documents[Open](/templates/thesis)## Related Pages* [Bibliography hub](/learn/latex/bibliography) * [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) * [Natbib guide](/learn/latex/bibliography/natbib-guide) * [Choosing citation styles](/learn/latex/bibliography/choosing-citation-styles) * [Writing a research paper](/learn/latex/how-to/writing-research-paper)> [!WARNING] > > **LaTeX Cloud Studio** handles BibTeX compilation automatically! Simply upload your `.bib` file and cite your references - we take care of the compilation sequence for you. # Choosing Citation Styles in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/bibliography/choosing-citation-styles Decide between APA, IEEE, numeric, and author-year citation styles based on publication and discipline requirements. Choose citation style early to avoid expensive formatting changes before submission.## Selection Checklist1) Start with journal or university author guidelines. 2) Confirm whether template expects BibLaTeX or BibTeX. 3) Match in-text behavior (numeric vs author-year). 4) Validate edge cases: multiple authors, page ranges, online sources.## Common Families| Family | In-text format | Typical use | | - | - | - | | Numeric | \[1], \[2-4] | Engineering, computer science | | Author-year | (Smith, 2024) | Social sciences, management | | Notes/footnote | Footnotes/endnotes | History, law, humanities |## BibLaTeX Style Examples```latex style-examples.tex theme=\{null} \usepackage[backend=biber,style=numeric-comp]{biblatex} \usepackage[backend=biber,style=authoryear]{biblatex} \usepackage[backend=biber,style=ieee]{biblatex} \usepackage[backend=biber,style=apa]{biblatex} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Related Pages- [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) - [Natbib guide](/learn/latex/bibliography/natbib-guide) - [Writing a research paper](/learn/latex/how-to/writing-research-paper) # Bibliography in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/bibliography/index Choose and configure BibTeX, BibLaTeX, natbib, and citation styles for academic and technical writing. This hub helps you pick the right bibliography workflow for your document. ## Choose Your Workflow * [Bibliography and citations overview](/learn/latex/bibliography-citations) * [BibTeX management](/learn/latex/bibliography/bibliography-management-bibtex) * [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) * [Natbib guide](/learn/latex/bibliography/natbib-guide) * [Choosing citation styles](/learn/latex/bibliography/choosing-citation-styles) ## Related Pages * [Writing a research paper](/learn/latex/how-to/writing-research-paper) * [LaTeX packages reference](/learn/reference/packages) * [Knowledge Base](/product/knowledge-base) * [AI Research Agent](/product/ai-research-agent) ## Start in LaTeX Cloud Studio > [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=cta\&utm_campaign=research_workflow\&utm_content=bibliography_hub_open_app) > [card] Start from Article Template > > Use a ready-made template, then adapt it to your content. [Open](/templates/article) > [card] Knowledge Base Docs > > Keep project papers and extracted source text inside the same workflow as the manuscript. [Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=bibliography_hub) > [card] AI Research Agent Docs > > Find external literature and move accepted evidence toward bibliography and citation handoff. [Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=bibliography_hub) # Natbib Guide Source: https://resources.latex-cloud-studio.com/learn/latex/bibliography/natbib-guide Use natbib for author-year and numerical citations in BibTeX-based LaTeX projects. Use `natbib` when legacy BibTeX workflows or journal templates require it.## Basic Setup```latex natbib-basic.tex theme=\{null} \documentclass{article} \usepackage[authoryear,round]{natbib} \begin{document} \citet{smith2024} reports a strong baseline. Replications confirm this \citep{lee2025,nguyen2025}. \bibliographystyle{plainnat} \bibliography{references} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Commands- `\citet{key}` textual citation. - `\citep{key}` parenthetical citation. - `\citeauthor{key}` and `\citeyear{key}` for split control.## Related Pages- [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) - [BibTeX management](/learn/latex/bibliography/bibliography-management-bibtex) # Cross-referencing in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/cross-referencing Master LaTeX cross-referencing system. Learn to reference figures, tables, equations, sections with labels, and use advanced packages like cleveref. Learn to create professional cross-references in LaTeX documents. This guide covers the complete referencing system from basic labels to advanced automated references.> [!NOTE] > > **Why cross-references matter**: They maintain consistency automatically, update numbering when you reorganize content, and provide clickable navigation in PDF documents.## Basic Cross-referencing System### Labels and References```latex basic-references.tex theme=\{null} \documentclass{article} \begin{document} \section{Introduction} \label{sec:intro} This is the introduction section. \section{Methods} \label{sec:methods} As mentioned in Section~\ref{sec:intro}, we will now discuss methods. \subsection{Data Collection} \label{subsec:data} Data collection procedures are described here. \section{Results} According to the methods in Section~\ref{sec:methods} and specifically the data collection in Section~\ref{subsec:data}, our results show... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-references.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-cross-referencing-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_cross_referencing)### The Label-Reference Workflow1) **Create labels** with `\label{prefix:name}` 2) **Reference labels** with `\ref{prefix:name}` 3) **Compile twice** to resolve all references```latex label-reference-workflow\.tex theme=\{null} % Step 1: Add labels to elements you want to reference \section{Literature Review} \label{sec:literature} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{diagram.png} \caption{System architecture} \label{fig:architecture} \end{figure} \begin{equation} E = mc^2 \label{eq:einstein} \end{equation} % Step 2: Reference them in text As shown in Figure~\ref{fig:architecture}, the system... Einstein's equation (Equation~\ref{eq:einstein}) demonstrates... The literature review in Section~\ref{sec:literature} covers... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Recommended Label Prefixes### Standard Naming Convention```latex label-conventions.tex theme=\{null} % Sections and chapters \chapter{Introduction} \label{chap:intro} \section{Background} \label{sec:background} \subsection{Previous Work} \label{subsec:previous} % Figures and tables \begin{figure} \caption{Results overview} \label{fig:results} \end{figure} \begin{table} \caption{Performance comparison} \label{tab:performance} \end{table} % Equations \begin{equation} y = mx + b \label{eq:linear} \end{equation} % Algorithms and listings \begin{algorithm} \caption{Sorting algorithm} \label{alg:sort} \end{algorithm} % Appendices \appendix \section{Additional Data} \label{app:data} % Examples and theorems \begin{theorem} \label{thm:main} Statement of theorem... \end{theorem} \begin{example} \label{ex:basic} Example content... \end{example} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Label Naming Best Practices| Element Type | Prefix | Example | Reference | | - | - | - | - | | Chapter | `chap:` | `\label{chap:intro}` | `Chapter~\ref{chap:intro}` | | Section | `sec:` | `\label{sec:methods}` | `Section~\ref{sec:methods}` | | Subsection | `subsec:` | `\label{subsec:data}` | `Section~\ref{subsec:data}` | | Figure | `fig:` | `\label{fig:results}` | `Figure~\ref{fig:results}` | | Table | `tab:` | `\label{tab:stats}` | `Table~\ref{tab:stats}` | | Equation | `eq:` | `\label{eq:main}` | `Equation~\ref{eq:main}` | | Algorithm | `alg:` | `\label{alg:sort}` | `Algorithm~\ref{alg:sort}` | | Theorem | `thm:` | `\label{thm:main}` | `Theorem~\ref{thm:main}` | | Lemma | `lem:` | `\label{lem:helper}` | `Lemma~\ref{lem:helper}` | | Appendix | `app:` | `\label{app:code}` | `Appendix~\ref{app:code}` |> [!TIP] > > **Label naming tips:** > > * Use descriptive names: `fig:sales-growth` not `fig:1` > * Keep it concise but meaningful > * Use hyphens for multi-word labels > * Be consistent throughout your document## Advanced Reference Commands### Page References```latex page-references.tex theme=\{null} % Basic page reference See the discussion on page~\pageref{sec:methods}. % Combined references Figure~\ref{fig:results} on page~\pageref{fig:results} shows... % Reference with both number and page Equation~\ref{eq:main} (page~\pageref{eq:main}) demonstrates... % Checking if reference is on current page \ifthenelse{\equal{\pageref{fig:test}}{\thepage}}{% Figure~\ref{fig:test} above shows... }{% Figure~\ref{fig:test} on page~\pageref{fig:test} shows... } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Equation References```latex equation-references.tex theme=\{null} \usepackage{amsmath} % Numbered equation with reference \begin{equation} \label{eq:quadratic} x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \end{equation} % Reference equation in text The quadratic formula (Equation~\ref{eq:quadratic}) provides... % Using \eqref for automatic parentheses The solution is given by~\eqref{eq:quadratic}. % Multiple equations with sub-references \begin{subequations} \label{eq:system} \begin{align} x + y &= 5 \label{eq:system-a} \\ 2x - y &= 1 \label{eq:system-b} \end{align} \end{subequations} % Referencing the system and individual equations The system~\eqref{eq:system} consists of equations~\eqref{eq:system-a} and~\eqref{eq:system-b}. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from equation-references.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-cross-referencing-05/page-1.svg)
### Subfigure References```latex subfigure-references.tex theme=\{null} \usepackage{subcaption} \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{image1.png} \caption{First result} \label{fig:results-a} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{image2.png} \caption{Second result} \label{fig:results-b} \end{subfigure} \caption{Experimental results} \label{fig:results} \end{figure} % Referencing main figure and subfigures Figure~\ref{fig:results} shows our experimental results. Specifically, Figure~\ref{fig:results-a} demonstrates the first outcome, while Figure~\ref{fig:results-b} shows the second. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## The cleveref Package### Smart Automatic References```latex cleveref-setup.tex theme=\{null} \usepackage{cleveref} % cleveref automatically determines reference type \cref{sec:intro} % → section 1 \cref{fig:results} % → figure 2 \cref{tab:data} % → table 3 \cref{eq:main} % → equation (4) % Capitalized versions \Cref{sec:intro} % → Section 1 \Cref{fig:results} % → Figure 2 % Multiple references \cref{fig:a,fig:b,fig:c} % → figures 1, 2 and 3 \cref{eq:1,eq:2,eq:3} % → equations (1) to (3) \cref{sec:intro,sec:methods} % → sections 1 and 2 % Range references \crefrange{fig:first}{fig:last} % → figures 1 to 5 \Crefrange{eq:start}{eq:end} % → Equations (1) to (3) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
### Customizing cleveref```latex cleveref-customization.tex theme=\{null} \usepackage{cleveref} % Customize reference formats \crefname{figure}{fig.}{figs.} % figure → fig. \Crefname{figure}{Fig.}{Figs.} % Figure → Fig. \crefname{table}{tab.}{tabs.} % table → tab. \Crefname{table}{Tab.}{Tabs.} % Table → Tab. \crefname{equation}{eq.}{eqs.} % equation → eq. \Crefname{equation}{Eq.}{Eqs.} % Equation → Eq. \crefname{section}{sect.}{sects.} % section → sect. \Crefname{section}{Sect.}{Sects.} % Section → Sect. % Custom theorem-like environments \newtheorem{theorem}{Theorem} \crefname{theorem}{theorem}{theorems} \Crefname{theorem}{Theorem}{Theorems} % Usage examples \cref{fig:test} % → fig. 1 \Cref{fig:test} % → Fig. 1 \cref{thm:main} % → theorem 1 \Cref{thm:main} % → Theorem 1 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
### Advanced cleveref Features```latex cleveref-advanced.tex theme=\{null} % Conjunctions and lists \cref{fig:a,fig:b} % → figures 1 and 2 \cref{fig:a,fig:b,fig:c} % → figures 1, 2 and 3 \cref{fig:a,fig:b,fig:c,fig:d} % → figures 1 to 4 % Custom conjunctions \crefname{figure}{figure}{figures} \newcommand{\crefrangeconjunction}{--} % Change "to" to "--" \crefrange{fig:first}{fig:last} % → figures 1--5 % Sorting and compression \cref{fig:c,fig:a,fig:b} % → figures 1, 2 and 3 (auto-sorted) \cref{eq:1,eq:2,eq:3,eq:4,eq:5} % → equations (1) to (5) (compressed) % Cross-reference without number \namecref{fig:test} % → figure (without number) \nameCref{fig:test} % → Figure (without number) % Reference format for specific instances \labelcref{fig:test} % → 1 (just the number) \labelcpageref{fig:test} % → 5 (just the page number) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Hyperref Integration### Clickable References```latex hyperref-setup.tex theme=\{null} \usepackage{hyperref} \usepackage{cleveref} % Load AFTER hyperref % Configure hyperref \hypersetup{ colorlinks=true, linkcolor=blue, % Internal links citecolor=green, % Citations filecolor=magenta, % File links urlcolor=cyan, % URL links bookmarks=true, % PDF bookmarks pdfborder={0 0 0} % Remove boxes around links } % All references are now clickable \section{Introduction} \label{sec:intro} \section{Methods} As discussed in \cref{sec:intro}... % Clickable blue link % Customize link appearance \hypersetup{ linkcolor=black, % Black links colorlinks=false, % Boxes instead of colors pdfborder={0 0 1} % Thin border } ```
Rendered output Open zoomable preview: Compiled PDF page 1 from hyperref-setup.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-cross-referencing-10/page-1.svg)
### PDF Bookmarks and Metadata```latex pdf-bookmarks.tex theme=\{null} \usepackage{hyperref} \hypersetup{ pdftitle={Document Title}, pdfauthor={Author Name}, pdfsubject={Subject}, pdfkeywords={keyword1, keyword2, keyword3}, bookmarks=true, bookmarksopen=true, bookmarksdepth=3, % Depth of bookmark tree pdfstartview=FitH % Initial view } % Bookmarks are automatically generated from sections \section{Introduction} % Appears in PDF bookmarks \subsection{Background} % Nested bookmark \subsubsection{Related Work} % Deeper nesting % Custom bookmark entries \pdfbookmark[0]{Custom Entry}{custom} % Level 0 bookmark \pdfbookmark[1]{Sub Entry}{sub} % Level 1 bookmark ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdf-bookmarks.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-cross-referencing-11/page-1.svg)
## Special Reference Types### Theorem Environments```latex theorem-references.tex theme=\{null} \usepackage{amsthm} \usepackage{cleveref} % Define theorem environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} % Configure cleveref names \crefname{theorem}{theorem}{theorems} \Crefname{theorem}{Theorem}{Theorems} \crefname{lemma}{lemma}{lemmas} \Crefname{lemma}{Lemma}{Lemmas} \crefname{definition}{definition}{definitions} \Crefname{definition}{Definition}{Definitions} % Usage \begin{theorem} \label{thm:main} This is the main theorem. \end{theorem} \begin{proof} The proof follows from \cref{thm:main}... \end{proof} \begin{lemma} \label{lem:helper} This lemma supports the main theorem. \end{lemma} % References in text \Cref{thm:main} establishes... % → Theorem 1 establishes... \cref{lem:helper} provides... % → lemma 2 provides... ```
Rendered output Open zoomable preview: Compiled PDF page 1 from theorem-references.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-cross-referencing-12/page-1.svg)
### Algorithm References```latex algorithm-references.tex theme=\{null} \usepackage{algorithm} \usepackage{algpseudocode} \usepackage{cleveref} % Configure algorithm references \crefname{algorithm}{algorithm}{algorithms} \Crefname{algorithm}{Algorithm}{Algorithms} \begin{algorithm} \caption{Quicksort algorithm} \label{alg:quicksort} \begin{algorithmic}[1] \Procedure{QuickSort}{$A, p, r$} \If{$p < r$} \State $q \gets \Call{Partition}{A, p, r}$ \State \Call{QuickSort}{$A, p, q-1$} \State \Call{QuickSort}{$A, q+1, r$} \EndIf \EndProcedure \end{algorithmic} \end{algorithm} % Reference in text \Cref{alg:quicksort} shows the implementation... The complexity of \cref{alg:quicksort} is... ```
Rendered output Open zoomable preview: Compiled PDF page 1 from algorithm-references.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-cross-referencing-13/page-1.svg)
## Cross-document References### External References with xr Package```latex external-references.tex theme=\{null} % In main document \usepackage{xr} \externaldocument{chapter1} % References chapter1.tex \externaldocument{chapter2} % References chapter2.tex % Can now reference labels from external documents As shown in \cref{fig:external-result} (from Chapter 1)... \Cref{tab:comparison} in Chapter 2 demonstrates... % Avoiding label conflicts \externaldocument[ch1-]{chapter1} % Prefix all labels with "ch1-" \externaldocument[ch2-]{chapter2} % Prefix all labels with "ch2-" % References now need prefixes \cref{ch1-fig:result} \cref{ch2-tab:data} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Managing Large Documents```latex large-document-refs.tex theme=\{null} % Main document structure % main.tex \documentclass{book} \usepackage{hyperref} \usepackage{cleveref} % Include chapters \include{chapters/introduction} % \input doesn't work with xr \include{chapters/literature} \include{chapters/methodology} \include{chapters/results} \include{chapters/conclusion} % Each chapter file can reference others % chapters/results.tex \chapter{Results} \label{chap:results} As discussed in \cref{chap:introduction}, our methodology (\cref{chap:methodology}) leads to the following results... \section{Experimental Setup} \label{sec:setup} The setup described here builds on \cref{sec:literature-review}... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Best Practices> [!TIP] > > **Cross-referencing best practices:** > > 1. **Consistent labeling**: Use standard prefixes and descriptive names > 2. **Non-breaking spaces**: Always use `~` before `\ref{}` commands > 3. **Meaningful labels**: Choose names that describe content, not position > 4. **Compile multiple times**: Run LaTeX twice to resolve all references > 5. **Use cleveref**: Automate reference types and formatting > 6. **Check broken refs**: Look for "??" in output indicating unresolved references > 7. **Hyperref last**: Load hyperref before cleveref but after most other packages > 8. **Backup strategy**: Keep label conventions documented for large projects## Troubleshooting> [!WARNING] > > **Common cross-referencing issues:** > > 1. **"??" in output**: Reference not found - check label spelling and compile twice > 2. **Wrong reference numbers**: Labels may have moved - recompile completely > 3. **Missing hyperlinks**: Ensure hyperref is loaded before cleveref > 4. **Broken subfigure refs**: Check subcaption package and label placement > 5. **cleveref not working**: Load after hyperref and other reference packages > 6. **External refs failing**: Ensure external documents compiled first > 7. **Theorem refs wrong**: Check theorem numbering and cleveref configuration > 8. **PDF bookmarks broken**: Check special characters in section titles## Advanced Tips### Conditional References```latex conditional-references.tex theme=\{null} \usepackage{ifthen} % Check if reference exists \newcommand{\safecref}[1]{% \ifthenelse{\equal{\ref{#1}}{??}}{% [Reference not found]% }{% \cref{#1}% }% } % Check if on same page \newcommand{\smartref}[1]{% \ifthenelse{\equal{\pageref{#1}}{\thepage}}{% \cref{#1} above% }{% \cref{#1} on page~\pageref{#1}% }% } % Usage \smartref{fig:test} % → "figure 1 above" or "figure 1 on page 5" ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Custom Reference Macros```latex custom-ref-macros.tex theme=\{null} % Define convenient macros \newcommand{\figref}[1]{Figure~\ref{#1}} \newcommand{\tabref}[1]{Table~\ref{#1}} \newcommand{\eqnref}[1]{Equation~\eqref{#1}} \newcommand{\secref}[1]{Section~\ref{#1}} \newcommand{\chapref}[1]{Chapter~\ref{#1}} % Enhanced macros with page references \newcommand{\figpref}[1]{Figure~\ref{#1} on page~\pageref{#1}} \newcommand{\tabpref}[1]{Table~\ref{#1} on page~\pageref{#1}} % Usage \figref{fig:results} shows... % → Figure 1 shows... \tabpref{tab:data} contains... % → Table 1 on page 3 contains... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
## Quick Reference### Essential Commands| Command | Purpose | Example Output | | - | - | - | | `\label{name}` | Create label | (invisible) | | `\ref{name}` | Reference number | 1, 2, 3... | | `\pageref{name}` | Reference page | 5, 10, 15... | | `\eqref{name}` | Equation reference | (1), (2), (3)... | | `\cref{name}` | Smart reference | figure 1, table 2... | | `\Cref{name}` | Capitalized reference | Figure 1, Table 2... |### Compilation Order```bash theme=\{null} # Standard compilation for references pdflatex document.tex pdflatex document.tex # With bibliography pdflatex document.tex biber document # or bibtex document pdflatex document.tex pdflatex document.tex ```***> [!NOTE] > > **Next**: Learn about [Package management](/learn/latex/package-management) to understand how to find, install, and use LaTeX packages effectively. # filecontents Package in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/filecontents-package Generate auxiliary files such as .bib files directly from your LaTeX source using filecontents. `filecontents` is useful for self-contained examples and reproducible templates.## Create Embedded Files```latex filecontents-example.tex theme=\{null} \begin{filecontents*}{references.bib} @article{smith2024, author={Smith, John}, title={Example Article}, journal={Journal of Examples}, year={2024} } \end{filecontents*} \documentclass{article} \usepackage[backend=biber,style=authoryear]{biblatex} \addbibresource{references.bib} \begin{document} See \parencite{smith2024}. \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## When To Use It- Compact tutorials and teaching snippets. - Reproducible examples in docs. - Quick test cases for bibliography workflows.## Related Pages- [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) - [Multi-file projects](/learn/latex/document-structure/multi-file-projects) # Footnotes and Margin Notes in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/footnotes-and-margin-notes Add footnotes and margin notes in LaTeX with clean formatting and readable long-form documents. Use footnotes for references and margin notes for short editorial context.## Footnotes```latex footnotes.tex theme=\{null} This sentence has a footnote.\footnote{Footnote text with citation or context.} Another note can reference prior work.\footnote{See also Section~\ref{sec:methods}.} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
## Margin Notes```latex marginnote.tex theme=\{null} \usepackage{marginnote} Main text paragraph.\marginnote{Short side comment} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from marginnote.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-footnotes-and-margin-notes-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_document_structure_footnotes_and_margin_notes)## Styling Footnotes```latex footnote-style.tex theme=\{null} \usepackage[hang,flushmargin]{footmisc} \setlength{\footnotemargin}{0.8em} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Best Practices- Keep footnotes short and specific. - Do not stack multiple long footnotes in one paragraph. - Use margin notes for quick guidance, not primary content.## Related Pages- [Sections and chapters](/learn/latex/document-structure/sections-and-chapters) - [Hyperlinks](/learn/latex/document-structure/hyperlinks) # Glossaries and Acronyms in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/glossaries Create glossaries and acronym lists in LaTeX with the glossaries package and a stable build workflow. Use the `glossaries` package to define terms once and reuse them consistently. ## Setup ```latex glossary-basic.tex theme={null} \documentclass{report} \usepackage[colorlinks=true]{hyperref} \usepackage[acronym]{glossaries} \makeglossaries \newglossaryentry{latex}{ name=LaTeX, description={A high-quality typesetting system} } \newacronym{api}{API}{Application Programming Interface} \begin{document} \gls{latex} is widely used in academia. First use: \gls{api}. Later use: \gls{api}. \printglossary \printglossary[type=\acronymtype,title=Acronyms] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from glossary-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-glossaries-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_document_structure_glossaries) ## Build Steps 1. Run LaTeX. 2. Run `makeglossaries `. 3. Run LaTeX twice. ## Related Pages * [Indexes](/learn/latex/document-structure/indexes) * [Cross-referencing](/learn/latex/cross-referencing) # LaTeX hyperref: Clickable Links, URLs, References, and Colors Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/hyperlinks Create clickable links in LaTeX with hyperref. Use href and url, link internal references, set colors or hidelinks, add anchors, and fix common errors. To create clickable links in a LaTeX PDF, load `hyperref` near the end of the preamble. Use `\url` to print a URL, `\href` for custom link text, and ordinary `\label`/`\ref` commands for clickable internal references.> [!NOTE] > > **Quick answer**: add `\usepackage{hyperref}` near the end of your preamble. Use `\url{https://example.com}` for a visible URL, `\href{https://example.com}{link text}` for descriptive text, and `\autoref{sec:methods}` for a clickable reference that includes its type.## Which hyperlink command should you use?| You need... | Command | | - | - | | A visible web address | `\url{https://example.com}` | | Custom clickable text | `\href{https://example.com}{Example site}` | | A clickable email address | `\href{mailto:name@example.com}{name@example.com}` | | A numbered internal reference | `\ref{sec:methods}` | | An automatic name such as “Section 2” | `\autoref{sec:methods}` | | A link to a custom anchor | `\hyperlink{results}{Jump to results}` | | Clickable links without colored text or boxes | `\usepackage[hidelinks]{hyperref}` |## Minimal Setup```latex hyperref-setup.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \usepackage[ colorlinks=true, linkcolor=blue, citecolor=teal, urlcolor=magenta ]{hyperref} \hypersetup{ pdftitle={Project Title}, pdfauthor={Your Name}, pdfsubject={Technical Report} } \begin{document} Visit \href{https://www.latex-cloud-studio.com}{LaTeX Cloud Studio}. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from hyperref-setup.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-hyperlinks-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_document_structure_hyperlinks)Load `hyperref` after most other packages so it can patch references correctly. Packages that extend its references may have their own order requirements; for example, load `cleveref` after `hyperref`.If you want clickable links without colored text or border boxes, use this instead:```latex hidden-link-style.tex theme=\{null} \usepackage[hidelinks]{hyperref} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## External LinksUse `\url` when you want to print the URL itself, and use `\href` when you want custom anchor text.```latex external-links.tex theme=\{null} \url{https://www.latex-cloud-studio.com} \href{https://www.overleaf.com/learn}{Overleaf Learn} \href{mailto:team@example.com}{Email the team} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from external-links.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-hyperlinks-02/page-1.svg)
## Internal Hyperlinks and Clickable ReferencesInternal links usually come from labels and references:```latex internal-links.tex theme=\{null} \section{Methods}\label{sec:methods} \section{Results}\label{sec:results} See Section~\ref{sec:methods}. Use \autoref{sec:results} for automatic label text. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from internal-links.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-hyperlinks-03/page-1.svg)
If `hyperref` is loaded, these references become clickable in the final PDF.## Custom anchors and jump linksUse `\hypertarget` to create a named destination and `\hyperlink` to jump to it. These commands are useful when the destination is not a numbered section, figure, table, or equation.```latex custom-anchor.tex theme=\{null} \hyperlink{results-summary}{Jump to the results summary} % Later in the document: \hypertarget{results-summary}{% \section*{Results summary} } ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-anchor.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-hyperlinks-04/page-1.svg)
Prefer `\label` with `\ref` or `\autoref` when the destination already has a LaTeX number. Those references stay correct when sections or figures move.## Link appearance and PDF metadata`colorlinks=true` colors the link text. Without it, many PDF viewers draw colored boxes around links. Use separate colors so readers can distinguish internal references, citations, and external URLs.```latex hyperlink-options.tex theme=\{null} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, % internal references and table of contents citecolor=teal, % citations urlcolor=purple, % external URLs pdftitle={Project Title}, pdfauthor={Your Name}, pdfkeywords={latex, research, report} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
For print-oriented documents, `hidelinks` is often preferable because it keeps links active without changing the visible text style.## Hyperlinks in the Table of Contents and Unnumbered HeadingsFor unnumbered sections, add a manual anchor before writing the label:```latex phantomsection.tex theme=\{null} \section*{Appendix Resources} \phantomsection \addcontentsline{toc}{section}{Appendix Resources} \label{sec:appendix-resources} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from phantomsection.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-hyperlinks-05/page-1.svg)
This ensures the PDF link points to the right place.## Common `hyperref` problems| Problem | Fix | | - | - | | Links are not clickable | Confirm that `\usepackage{hyperref}` is loaded and compile the document again | | Link text has boxes around it | Use `hidelinks`, or set `colorlinks=true` and explicit colors | | An internal link jumps above or below the intended heading | Put `\phantomsection` immediately before the manual contents entry or label | | A reference shows `??` | Compile enough times for labels to resolve and check that the label name matches | | PDF bookmarks contain LaTeX warnings | Use plain text in headings or provide a PDF-safe alternative with `\texorpdfstring{LaTeX text}{PDF text}` | | Another package breaks references | Load `hyperref` late, then follow the documented order for packages such as `cleveref` | | A long URL runs past the margin | Use `\url{...}` rather than typing the address as ordinary text |## Related Pages- [Cross-referencing](/learn/latex/cross-referencing) - [Table of contents](/learn/latex/document-structure/table-of-contents) - [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX Document Structure Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/index Build well-structured LaTeX documents with sections, TOC, glossaries, indexes, links, and multi-file organization. This hub covers document structure patterns for reports, theses, and books. ## Start Here * [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) ## Long-Document Essentials * [Multi-file projects](/learn/latex/document-structure/multi-file-projects) * [Footnotes and margin notes](/learn/latex/document-structure/footnotes-and-margin-notes) * [Glossaries and acronyms](/learn/latex/document-structure/glossaries) * [Indexes](/learn/latex/document-structure/indexes) * [filecontents package](/learn/latex/document-structure/filecontents-package) ## Related Guides * [Managing large documents](/learn/latex/how-to/large-documents) * [Cross-referencing](/learn/latex/cross-referencing) ## Start in LaTeX Cloud Studio > [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=document_structure_hub_open_app) > [card] Start from Thesis Template > > Use a ready-made template, then adapt it to your content. [Open](/templates/thesis) # Creating Indexes in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/indexes Add an alphabetical index to books and theses with imakeidx, index entries, and makeindex workflows. Indexes help readers find concepts quickly in long documents. ## Basic Setup ```latex index-basic.tex theme={null} \documentclass{book} \usepackage{imakeidx} \makeindex \begin{document} \chapter{Foundations} LaTeX\index{LaTeX} supports structured writing. Bibliography\index{bibliography} workflows are flexible. \chapter{Methods} Hyperlinks\index{hyperlinks} improve navigation. \printindex \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from index-basic.tex Page 1 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-indexes-01/page-1.svg) Open zoomable preview: Compiled PDF page 2 from index-basic.tex Page 2 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-indexes-01/page-2.svg) Open zoomable preview: Compiled PDF page 3 from index-basic.tex Page 3 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-indexes-01/page-3.svg) Open zoomable preview: Compiled PDF page 4 from index-basic.tex Page 4 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-indexes-01/page-4.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_document_structure_indexes) ## Build Steps 1. Run LaTeX. 2. Run `makeindex `. 3. Run LaTeX again. ## Subentries ```latex subentries.tex theme={null} Neural networks\index{machine learning!neural networks} Transformers\index{machine learning!transformers} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from subentries.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-indexes-02/page-1.svg)
## Related Pages * [Glossaries](/learn/latex/document-structure/glossaries) * [Table of contents](/learn/latex/document-structure/table-of-contents) # Multi-file LaTeX Projects Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/multi-file-projects Organize large LaTeX projects with input, include, and subfiles for theses, books, and reports. Split large projects into focused files to improve maintainability and collaboration.## Recommended Structure``` project/ |- main.tex |- preamble.tex |- chapters/ | |- 01-introduction.tex | |- 02-methods.tex | |- 03-results.tex |- appendices/ | |- appendix-a.tex |- refs.bib ```## input vs include- `\input{file}` inserts content inline. - `\include{file}` starts on a new page and works with `\includeonly`.```latex main.tex theme=\{null} \documentclass{report} \input{preamble} \begin{document} \tableofcontents \include{chapters/01-introduction} \include{chapters/02-methods} \include{chapters/03-results} \appendix \input{appendices/appendix-a} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Faster Draft Builds```latex includeonly.tex theme=\{null} \includeonly{chapters/02-methods} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Related Pages- [Managing large documents](/learn/latex/how-to/large-documents) - [Table of contents](/learn/latex/document-structure/table-of-contents) - [Cross-referencing](/learn/latex/cross-referencing) # Sections and Chapters in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/sections-and-chapters Structure LaTeX documents with parts, chapters, sections, and subsections using consistent numbering and hierarchy. Use heading levels to build a clear document hierarchy.## Basic Hierarchy```latex hierarchy.tex theme=\{null} \part{Part I} \chapter{Introduction} \section{Background} \subsection{Motivation} \subsubsection{Scope} \paragraph{Note} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Numbered vs Unnumbered Headings```latex numbered-unnumbered.tex theme=\{null} \section{Numbered Section} \section*{Unnumbered Section} \addcontentsline{toc}{section}{Unnumbered Section} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from numbered-unnumbered.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-document-structure-sections-and-chapters-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_document_structure_sections_and_chapters)## Is There a `\subsubsubsection`?No. The standard classes stop at `\subsubsection`, and the next level down is `\paragraph`, followed by `\subparagraph`.`\paragraph{Title}` is a genuine sectioning command, not a paragraph break. By default it is a run-in heading — the text starts on the same line — which surprises people expecting another numbered level.By default `\paragraph` is also unnumbered and absent from the table of contents, because `secnumdepth` and `tocdepth` stop above it. To number it and list it, raise both counters in the preamble:`\setcounter{secnumdepth}{4}` and `\setcounter{tocdepth}{4}`If you genuinely need five levels of nesting, that is usually a sign the document wants restructuring rather than another heading level. The `titlesec` package can define deeper levels if you truly need them.## Best Practices- Keep heading depth consistent across chapters. - Avoid skipping levels (for example chapter directly to subsubsection). - Use unnumbered headings only for front/back matter sections.## Related Pages- [Table of contents](/learn/latex/document-structure/table-of-contents) - [Multi-file projects](/learn/latex/document-structure/multi-file-projects) # Table of Contents in LaTeX: \tableofcontents, Depth, and Links Source: https://resources.latex-cloud-studio.com/learn/latex/document-structure/table-of-contents Create a LaTeX table of contents with \tableofcontents. Control heading depth, add unnumbered sections, enable links, and fix missing entries. Add `\tableofcontents` where the table of contents should appear. LaTeX collects numbered chapters, sections, and subsections automatically, but you normally need to compile the document twice before every title and page number is current.> [!NOTE] > > **Quick answer**: place `\tableofcontents` after `\begin{document}` and before the first chapter or section. Use `hyperref` when the entries should be clickable in the PDF.## How a LaTeX Table of Contents WorksDuring the first compilation, LaTeX writes section titles and page numbers to an auxiliary `.toc` file. During the next compilation, it reads that file and prints the finished list. Compile again whenever headings or pagination have changed.| Document class | Typical top-level TOC entry | | - | - | | `article` | `\section` | | `report` | `\chapter` | | `book` | `\chapter` |## Create a Basic Table of ContentsThis complete example creates a linked TOC. The rendered pages show the TOC followed by the chapter content it references.```latex basic-toc.tex theme=\{null} \documentclass{report} \usepackage[colorlinks=true,linkcolor=blue]{hyperref} \begin{document} \tableofcontents \chapter{Introduction} \section{Background} \subsection{Scope} \chapter{Methods} \section{Dataset} \section{Evaluation} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-toc.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-table-of-contents-01/page-1.svg) Open zoomable preview: Compiled PDF page 2 from basic-toc.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-table-of-contents-01/page-2.svg) Open zoomable preview: Compiled PDF page 3 from basic-toc.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-document-structure-table-of-contents-01/page-3.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_document_structure_table_of_contents)> [!NOTE] > > Compile at least twice so LaTeX can resolve TOC entries and page numbers. A third run can be necessary when a changed TOC alters pagination again.## Control TOC and Heading Depth`tocdepth` controls which heading levels appear in the table of contents. `secnumdepth` separately controls which heading levels receive numbers in the document.| Counter value | `article` includes through | `report` / `book` includes through | | - | - | - | | `-1` | `part` | `part` | | `0` | No section-level entry | `chapter` | | `1` | `section` | `section` | | `2` | `subsection` | `subsection` | | `3` | `subsubsection` | `subsubsection` |```latex toc-depth.tex theme=\{null} \setcounter{tocdepth}{2} % 0=chapter, 1=section, 2=subsection \setcounter{secnumdepth}{3} % controls numbering depth ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
Set these counters in the preamble when the rule should apply to the whole document. Changing them later affects the headings that follow.## Add an Unnumbered Heading to the TOCStarred headings such as `\chapter*` and `\section*` are omitted from the TOC by default. Add the visible title explicitly with `\addcontentsline`.```latex addcontentsline.tex theme=\{null} \chapter*{Acknowledgments} \addcontentsline{toc}{chapter}{Acknowledgments} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
The middle argument must match the heading level: use `chapter` for a `\chapter*` entry and `section` for a `\section*` entry. Keep the displayed heading and TOC text identical unless a shorter navigation label is intentional. With `hyperref`, place `\phantomsection` before `\addcontentsline` when the manual entry needs a link anchor at the unnumbered heading.## Make TOC Entries ClickableLoad `hyperref`, preferably near the end of the preamble, to turn TOC entries and cross-references into PDF links. Options such as `colorlinks=true` change their appearance; they do not change which headings are collected.See [Hyperlinks in LaTeX](/learn/latex/document-structure/hyperlinks) for link colors, hidden borders, URLs, and cross-references.## Common Table of Contents Problems| Problem | Likely cause | Fix | | - | - | - | | TOC is empty | The document has only been compiled once | Compile again | | Page numbers are outdated | Headings or pagination changed | Compile until the output stabilizes | | A subsection is missing | `tocdepth` is too shallow | Increase `tocdepth` for the required level | | A starred heading is missing | Starred headings are excluded automatically | Add it with `\addcontentsline` | | A removed heading remains | An old `.toc` file is still being read | Recompile; if necessary, clean auxiliary files once | | Links are not clickable | `hyperref` is not loaded | Add the package in the preamble |## TOC Practices for Long Documents- Keep headings short enough to scan in both the page and the TOC. - Do not include every paragraph-level heading; a very deep TOC hides the document's structure. - Use the same heading hierarchy throughout the project, including files loaded with `\input` or `\include`. - Treat manual `\addcontentsline` entries as exceptions for front matter such as acknowledgments or an unnumbered introduction.## Try a Table of Contents in LaTeX Cloud Studio> [card] Compile the complete TOC example > > Run the document twice and inspect how headings, page numbers, and PDF links are generated.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=table_of_contents_open_app)> [card] Structure a multi-file project > > Split chapters into separate files while keeping one automatically generated table of contents.[Open](/learn/latex/document-structure/multi-file-projects)## Related Pages- [Hyperlinks](/learn/latex/document-structure/hyperlinks) - [Multi-file projects](/learn/latex/document-structure/multi-file-projects) - [Managing large documents](/learn/latex/how-to/large-documents) # LaTeX \includegraphics: Insert, Resize, Trim, and Crop Images Source: https://resources.latex-cloud-studio.com/learn/latex/figures/inserting-images Use \includegraphics and graphicx to insert, resize, trim, and crop images in LaTeX. Includes trim order, clip, figure captions, paths, and fixes. To insert an image in LaTeX, load `graphicx` and use `\includegraphics{...}`. Add `width` or `height` to resize it, and use `trim=left bottom right top,clip` to crop unwanted margins.> [!NOTE] > > **Quick answer**: add `\usepackage{graphicx}` to the preamble, then write `\includegraphics[width=0.8\textwidth]{image-file}`. To crop, use `\includegraphics[trim=1cm 2cm 1cm 2cm,clip]{image-file}`. The trim values are always ordered **left, bottom, right, top**. > > **Related topics**: [Figure positioning](/learn/latex/figures/positioning) | [Tabular environment](/learn/latex/tables/tabular) | [Package management](/learn/latex/package-management)## Common image tasks| If you need... | Use | | - | - | | Insert one image | `\includegraphics{image}` | | Set width relative to the page | `\includegraphics[width=0.7\textwidth]{image}` | | Keep the aspect ratio | `\includegraphics[width=5cm,keepaspectratio]{image}` | | Crop whitespace | `\includegraphics[trim=1cm 0.5cm 1cm 0.5cm,clip]{image}` | | Add caption and label | wrap the image in `\begin{figure}...\end{figure}` | | Put two images side by side | use two `\includegraphics` commands with widths like `0.45\textwidth` |## Quick Start```latex quick-image.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure}[htbp] \centering \includegraphics[width=0.7\textwidth]{example-image} \caption{Example image} \label{fig:example} \end{figure} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from quick-image.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-figures-inserting-images-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_figures_inserting_images)## Trim and crop images with `includegraphics`The `trim` option removes material from the four edges. Its order is **left, bottom, right, top**—not the clockwise order that many users expect. Add `clip`; without it, LaTeX changes the image's bounding box but can still draw the trimmed material.```latex trim-image.tex theme=\{null} % Remove 1 cm left/right and 2 cm bottom/top \includegraphics[ width=0.8\textwidth, trim=1cm 2cm 1cm 2cm, clip ]{image.pdf} % Remove only 12 mm from the top \includegraphics[trim=0 0 0 12mm,clip]{image.pdf} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> [card] Expected output > > The PDF shows the cropped image at 80% of the text width. The first example removes material from all four sides; the second removes only the top 12 mm.LaTeX applies `width` to the cropped result. Use units such as `cm`, `mm`, `pt`, or `bp`; four bare numbers are interpreted differently depending on the graphics driver and are easier to misread.> [!WARNING] > > If `trim` appears to do nothing, check for a missing `clip` option first. If the wrong edge disappears, verify that the values follow `left bottom right top`.## Basic Image Insertion### Simple Image Include```latex basic-image.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} % Basic image insertion \includegraphics{example-image} % With file extension \includegraphics{photo.jpg} % From subfolder \includegraphics{images/diagram.png} % With full path (use forward slashes) \includegraphics{/Users/name/pictures/graph.pdf} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Supported Image Formats| Compiler | Formats Supported | | - | - | | **pdfLaTeX** | PDF, PNG, JPG/JPEG | | **XeLaTeX** | PDF, PNG, JPG/JPEG, EPS\* | | **LuaLaTeX** | PDF, PNG, JPG/JPEG, EPS\* | | **LaTeX (DVI)** | EPS, PS |\*EPS requires additional configuration> [!TIP] > > **Best practices for formats:** > > * **PDF**: Vector graphics, diagrams, plots > * **PNG**: Screenshots, images with transparency > * **JPG**: Photographs, images without transparency## Scaling Images### Width and Height Control```latex scaling-images.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} % Scale by width \includegraphics[width=5cm]{image} \includegraphics[width=0.8\textwidth]{image} \includegraphics[width=\columnwidth]{image} % Scale by height \includegraphics[height=3cm]{image} \includegraphics[height=0.25\textheight]{image} % Scale by both (may distort) \includegraphics[width=5cm,height=3cm]{image} % Keep aspect ratio with one dimension \includegraphics[width=5cm,keepaspectratio]{image} % Scale factor \includegraphics[scale=0.5]{image} % 50% of original \includegraphics[scale=1.2]{image} % 120% of original \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Common Width References```latex width-references.tex theme=\{null} % Page dimensions \includegraphics[width=\textwidth]{image} % Full text width \includegraphics[width=\columnwidth]{image} % Column width \includegraphics[width=\linewidth]{image} % Current line width \includegraphics[width=\paperwidth]{image} % Full paper width % Relative sizes \includegraphics[width=0.5\textwidth]{image} % Half text width \includegraphics[width=0.33\columnwidth]{image} % Third of column % Using calc package \usepackage{calc} \includegraphics[width=\textwidth-2cm]{image} % Text width minus 2cm ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Figure Environment### Basic Figure```latex figure-environment.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{example-image} \caption{A sample figure with caption} \label{fig:sample} \end{figure} As shown in Figure \ref{fig:sample}, the image demonstrates... % Alternative with short caption for list of figures \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{graph} \caption[Short caption]{Long descriptive caption that appears below the figure} \label{fig:graph} \end{figure} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Figure Placement Options| Option | Meaning | Priority | | - | - | - | | `h` | Here (approximately) | Low | | `t` | Top of page | Medium | | `b` | Bottom of page | Medium | | `p` | Page of floats | Low | | `H` | HERE (exactly)\* | Forced | | `!` | Override LaTeX's rules | Modifier |\*Requires `\usepackage{float}````latex figure-placement.tex theme=\{null} % Preferred placement order \begin{figure}[htbp] % Try here, then top, bottom, finally float page % Force placement \usepackage{float} \begin{figure}[H] % Place exactly here % Override LaTeX's aesthetic rules \begin{figure}[!h] % Try harder to place here ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Multiple Images### Side by Side Images```latex side-by-side.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} % Method 1: Simple side by side \begin{figure}[h] \centering \includegraphics[width=0.45\textwidth]{image1} \hfill \includegraphics[width=0.45\textwidth]{image2} \caption{Two images side by side} \end{figure} % Method 2: With individual captions (subcaption package) \usepackage{subcaption} \begin{figure}[h] \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{image1} \caption{First subcaption} \label{fig:sub1} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{image2} \caption{Second subcaption} \label{fig:sub2} \end{subfigure} \caption{Main figure caption} \label{fig:main} \end{figure} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Grid of Images```latex image-grid.tex theme=\{null} \usepackage{subcaption} \begin{figure}[h] \centering % First row \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{img1} \caption{Image 1} \end{subfigure} \hfill \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{img2} \caption{Image 2} \end{subfigure} \hfill \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{img3} \caption{Image 3} \end{subfigure} % Second row \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{img4} \caption{Image 4} \end{subfigure} \hfill \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{img5} \caption{Image 5} \end{subfigure} \hfill \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{img6} \caption{Image 6} \end{subfigure} \caption{Grid of six images} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Image Transformations### Rotation and Flipping```latex transformations.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} % Rotate image \includegraphics[angle=90]{image} % 90 degrees \includegraphics[angle=-45]{image} % -45 degrees \includegraphics[angle=180]{image} % Upside down % Rotate and scale \includegraphics[angle=45,width=5cm]{image} % Origin of rotation \includegraphics[angle=90,origin=c]{image} % Center (default) \includegraphics[angle=90,origin=tl]{image} % Top left \includegraphics[angle=90,origin=br]{image} % Bottom right % Reflection (negative scaling) \includegraphics[width=5cm]{image} % Normal \includegraphics[width=-5cm]{image} % Horizontal flip \includegraphics[width=5cm,height=-3cm]{image} % Vertical flip \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Advanced Techniques### Wrapping Text Around Images```latex wrap-text.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \begin{document} \begin{wrapfigure}{r}{0.4\textwidth} \centering \includegraphics[width=0.38\textwidth]{image} \caption{A wrapped figure} \end{wrapfigure} This text wraps around the figure. The figure is positioned on the right side of the page, and the text flows around it naturally. This is useful for smaller images that don't need the full width of the page. Continue with more text to see the wrapping effect... % Options: r (right), l (left), i (inner), o (outer) \begin{wrapfigure}{l}{0.3\textwidth} \vspace{-20pt} % Adjust vertical position \centering \includegraphics[width=0.28\textwidth]{small-image} \vspace{-20pt} \caption{Left aligned} \vspace{-10pt} \end{wrapfigure} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Image Paths```latex image-paths.tex theme=\{null} % Set graphics path \graphicspath{{images/}{figures/}{../pics/}} % Now you can use just the filename \includegraphics{photo} % Searches in all specified paths % Multiple paths with subdirectories \graphicspath{ {./images/} {./figures/photos/} {./figures/diagrams/} {../common/images/} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Draft Mode```latex draft-mode.tex theme=\{null} % Show boxes instead of images (faster compilation) \usepackage[draft]{graphicx} % Or document-wide \documentclass[draft]{article} % Override draft mode for specific image \includegraphics[draft=false,width=5cm]{important-image} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Image Formats and Conversion### Working with Different Formats```latex format-handling.tex theme=\{null} % Let LaTeX determine format \DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg} \includegraphics{image} % Finds image.pdf, image.png, etc. % Force specific format \includegraphics[ext=.png]{image} % EPS to PDF conversion (pdfLaTeX) \usepackage{epstopdf} \includegraphics{diagram.eps} % Automatically converted ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Best Practices> [!TIP] > > **Image guidelines:** > > 1. **Resolution**: Use 300 DPI for print, 96-150 DPI for screen > 2. **File size**: Optimize images before including them > 3. **Formats**: Use vector (PDF) for diagrams, raster (PNG/JPG) for photos > 4. **Naming**: Avoid spaces and special characters in filenames > 5. **Organization**: Keep images in a dedicated folder > 6. **Captions**: Always include descriptive captions > 7. **References**: Label all figures for cross-referencing## Troubleshooting| Problem | Likely cause | Fix | | - | - | - | | `Undefined control sequence \includegraphics` | `graphicx` is not loaded | Add `\usepackage{graphicx}` to the preamble | | `File ... not found` | Wrong path, extension, or filename case | Check the uploaded filename and use forward slashes in paths | | `trim` does not visibly crop | `clip` is missing | Add `clip` after the four trim values | | The wrong edge is cropped | Trim values are in the wrong order | Reorder them as left, bottom, right, top | | Image looks stretched | Both width and height force a new aspect ratio | Set only one dimension, or add `keepaspectratio` | | Image extends beyond the margins | Fixed size is wider than the current text area | Start with `width=\linewidth` or a smaller fraction | | Figure moves to another page | A `figure` is a float | Use `[htbp]` and let LaTeX place it, or review [figure positioning](/learn/latex/figures/positioning) |For path-specific compiler messages, see [image and path errors](/learn/latex/troubleshooting/image-and-path-errors).## Quick Reference### Essential Commands| Command | Purpose | Example | | - | - | - | | `\includegraphics{}` | Insert image | `\includegraphics{pic}` | | `width=` | Set width | `width=5cm` | | `height=` | Set height | `height=3cm` | | `scale=` | Scale factor | `scale=0.5` | | `angle=` | Rotate | `angle=90` | | `trim=` with `clip` | Crop edges | `trim=1cm 0 1cm 0,clip` | | `\caption{}` | Add caption | `\caption{Description}` | | `\label{}` | Add reference | `\label{fig:name}` |### Figure Template```latex example.tex theme=\{null} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{filename} \caption{Descriptive caption} \label{fig:reference-name} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
***> [!NOTE] > > **Next**: Master [Figure positioning](/learn/latex/figures/positioning) to control exactly where your images appear, or learn about [Creating tables](/learn/latex/tables/creating-tables) for structured data presentation. To compile these figure examples without a local TeX installation, see the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=inserting_images_online_editor). # Plotting with pgfplots in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/figures/plotting-with-pgfplots Create publication-quality plots in LaTeX using pgfplots for line charts, scatter plots, and axis customization. `pgfplots` lets you generate vector plots directly in LaTeX.## Basic Plot```latex pgfplots-basic.tex theme=\{null} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{tikzpicture} \begin{axis}[xlabel={$x$},ylabel={$f(x)$},grid=major] \addplot[blue,thick,domain=0:5,samples=100]{x^2}; \end{axis} \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pgfplots-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-figures-plotting-with-pgfplots-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_figures_plotting_with_pgfplots)## Plot from Data Table```latex pgfplots-table.tex theme=\{null} \begin{axis}[xlabel=Epoch,ylabel=Accuracy] \addplot table[row sep=\\]{ 1 0.61\\ 2 0.68\\ 3 0.74\\ 4 0.79\\ }; \end{axis} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Related Pages- [Inserting images](/learn/latex/figures/inserting-images) - [TikZ diagrams](/learn/latex/how-to/tikz-diagrams) # LaTeX Figure Positioning: [h], [t], [b], [p], [H], and Float Placement Source: https://resources.latex-cloud-studio.com/learn/latex/figures/positioning Learn LaTeX figure positioning and float placement. Understand [h], [t], [b], [p], [H], why figures move, and how to place images cleanly. If you need to control LaTeX figure positioning, you need to understand floats first. The placement options `[h]`, `[t]`, `[b]`, `[p]`, and `[H]` do not mean "put the image exactly here" in the way many beginners expect. This guide explains what each option actually does, why figures move, and how to get cleaner layouts without fighting the compiler.> [!NOTE] > > **Key concept**: Figures are "floats" in LaTeX - they can move to optimize page layout. Understanding this behavior is essential for controlling positioning.## Understanding Floats### What Are Floats?Floats are elements (figures, tables) that LaTeX can move to avoid awkward page breaks and maintain good typography. LaTeX uses sophisticated algorithms to determine optimal placement.```latex float-basics.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} Text before the figure. \begin{figure}[h] % 'h' suggests "here" \centering \includegraphics[width=0.5\textwidth]{example-image} \caption{LaTeX may move this figure} \label{fig:float} \end{figure} Text after the figure definition continues here, but the figure might appear elsewhere in the final document. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from float-basics.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-figures-positioning-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_figures_positioning)### Why Floats MoveLaTeX moves floats to:- Avoid large white spaces - Prevent awkward page breaks - Keep related content together - Maintain consistent page density## Positioning Options### Basic Float Specifiers```latex positioning-options.tex theme=\{null} % Single option \begin{figure}[h] % Here \begin{figure}[t] % Top of page \begin{figure}[b] % Bottom of page \begin{figure}[p] % Page of floats % Multiple options (order matters) \begin{figure}[ht] % Try here, then top \begin{figure}[hb] % Try here, then bottom \begin{figure}[tb] % Try top, then bottom \begin{figure}[htbp] % Try all positions % With override \begin{figure}[!h] % Try harder to place here \begin{figure}[!t] % Override constraints for top ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Positioning Priority| Specifier | Placement | Notes | | - | - | - | | `h` | Here (approximately) | Where defined in source | | `t` | Top of page | Current or next page | | `b` | Bottom of page | Current or next page | | `p` | Float page | Page with only floats | | `!` | Override | Relax LaTeX's rules |### Forcing Exact Placement```latex force-placement.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \usepackage{float} % Required for H \begin{document} % Force exact placement \begin{figure}[H] \centering \includegraphics[width=0.5\textwidth]{image} \caption{This appears exactly here} \end{figure} % Alternative: suppress floating \begin{center} \includegraphics[width=0.5\textwidth]{image} \captionof{figure}{Non-floating figure} \label{fig:nonfloat} \end{center} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> [!WARNING] > > **Caution**: Using `[H]` can create large white spaces and poor page breaks. Use sparingly.## Advanced Positioning Control### Float Parameters```latex float-parameters.tex theme=\{null} % Control float placement rules \setcounter{topnumber}{2} % Max floats at top of page \setcounter{bottomnumber}{1} % Max floats at bottom \setcounter{totalnumber}{3} % Max floats per page % Fraction of page for floats \renewcommand{\topfraction}{0.8} % Max 80% of page for top floats \renewcommand{\bottomfraction}{0.5} % Max 50% for bottom floats \renewcommand{\textfraction}{0.2} % Min 20% must be text \renewcommand{\floatpagefraction}{0.7} % Min 70% of float page % Vertical spacing \setlength{\floatsep}{12pt} % Between floats \setlength{\textfloatsep}{20pt} % Between text and float \setlength{\intextsep}{12pt} % For wrapfig ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Clearing Floats```latex clearing-floats.tex theme=\{null} % Force all pending floats \clearpage % Start new page after floats % Clear without page break \usepackage{afterpage} \afterpage{\clearpage} % Clear after current page % Clear specific float type \usepackage{placeins} \FloatBarrier % Prevent floats from passing % Section-wise float barriers \usepackage[section]{placeins} % Floats don't cross sections ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Multiple Figures Layout### Side-by-Side Positioning```latex side-by-side-advanced.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \begin{document} % Method 1: Minipage \begin{figure}[htbp] \centering \begin{minipage}{0.45\textwidth} \centering \includegraphics[width=\textwidth]{image1} \caption{First figure} \end{minipage} \hfill \begin{minipage}{0.45\textwidth} \centering \includegraphics[width=\textwidth]{image2} \caption{Second figure} \end{minipage} \end{figure} % Method 2: Subfigures with references \begin{figure}[htbp] \centering \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{imageA} \caption{Subfigure A} \label{fig:subA} \end{subfigure} \hfill \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{imageB} \caption{Subfigure B} \label{fig:subB} \end{subfigure} \caption{Main caption for both figures} \label{fig:both} \end{figure} Reference: Figure \ref{fig:subA} shows X, while Figure \ref{fig:subB} shows Y. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Custom Arrangements```latex custom-arrangements.tex theme=\{null} % Three figures with different sizes \begin{figure}[htbp] \centering % Large figure on left \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{large} \end{minipage} \hfill % Two small figures on right \begin{minipage}{0.45\textwidth} \includegraphics[width=\textwidth]{small1}\\[0.5cm] \includegraphics[width=\textwidth]{small2} \end{minipage} \caption{Custom arrangement} \end{figure} % L-shaped arrangement \begin{figure}[htbp] \centering \begin{tabular}{cc} \includegraphics[width=0.3\textwidth]{img1} & \includegraphics[width=0.3\textwidth]{img2} \\ \multicolumn{2}{c}{ \includegraphics[width=0.6\textwidth]{img3} } \end{tabular} \caption{L-shaped layout} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Page-Wide Figures### Full Width in Two-Column```latex full-width.tex theme=\{null} \documentclass[twocolumn]{article} \usepackage{graphicx} \begin{document} % Regular figure (one column) \begin{figure}[htbp] \centering \includegraphics[width=\columnwidth]{small-image} \caption{Column-width figure} \end{figure} % Full page width \begin{figure*}[htbp] \centering \includegraphics[width=\textwidth]{wide-image} \caption{Full page-width figure} \end{figure*} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Landscape Figures```latex landscape-figures.tex theme=\{null} \usepackage{rotating} \usepackage{pdflscape} % Rotates PDF page % Rotated figure \begin{sidewaysfigure} \centering \includegraphics[width=\textwidth]{wide-diagram} \caption{Rotated to fit} \end{sidewaysfigure} % Landscape page \begin{landscape} \begin{figure} \centering \includegraphics[width=\linewidth]{very-wide-image} \caption{On landscape page} \end{figure} \end{landscape} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Precise Positioning### Absolute Positioning```latex absolute-positioning.tex theme=\{null} \usepackage{tikz} \usepackage{eso-pic} % Place at specific coordinates \AddToShipoutPictureBG{% \AtPageUpperLeft{% \put(2cm,-5cm){% \includegraphics[width=3cm]{logo} }% }% } % Using TikZ \begin{tikzpicture}[remember picture,overlay] \node at (current page.center) { \includegraphics[width=5cm]{watermark} }; \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Margin Figures```latex margin-figures.tex theme=\{null} % For books/reports with wide margins \marginpar{ \centering \includegraphics[width=\marginparwidth]{small-image} \captionof{figure}{Margin figure} } % Using marginfigure (tufte-latex) \begin{marginfigure} \includegraphics[width=\textwidth]{image} \caption{In the margin} \end{marginfigure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Float Management Strategies### Document-Wide Settings```latex global-settings.tex theme=\{null} % Preamble settings for better float handling % Allow more floats \setcounter{totalnumber}{6} \setcounter{topnumber}{4} \setcounter{bottomnumber}{4} % Relax float constraints \renewcommand{\topfraction}{0.9} \renewcommand{\bottomfraction}{0.8} \renewcommand{\textfraction}{0.1} \renewcommand{\floatpagefraction}{0.8} % Penalties for float placement \setlength{\floatsep}{10pt plus 3pt minus 2pt} \setlength{\textfloatsep}{15pt plus 3pt minus 3pt} \setlength{\intextsep}{10pt plus 3pt minus 2pt} % Stricter float placement \usepackage[section]{placeins} % Floats within sections ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Managing Many Figures```latex many-figures.tex theme=\{null} % Strategy 1: Group related figures \begin{figure}[p] % Float page \centering \includegraphics[width=0.45\textwidth]{fig1} \includegraphics[width=0.45\textwidth]{fig2}\\[1em] \includegraphics[width=0.45\textwidth]{fig3} \includegraphics[width=0.45\textwidth]{fig4} \caption{Related figures grouped} \end{figure} % Strategy 2: Process floats periodically Text and figures... \clearpage % Force processing % Strategy 3: Use non-floating alternatives \begin{center} \includegraphics[width=0.8\textwidth]{image} \captionof{figure}{Non-floating alternative} \end{center} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Debugging Float Issues### Common Problems and Solutions```latex float-debugging.tex theme=\{null} % Problem: Figure appears too late % Solution 1: Add more placement options \begin{figure}[!htbp] % Try harder % Solution 2: Clear floats \clearpage % Before problematic section % Problem: "Too many unprocessed floats" % Solution: Process pending floats \clearpage % Or increase counter \usepackage{morefloats} % Allows more floats % Problem: Large gaps % Solution: Adjust parameters \setlength{\textfloatsep}{10pt plus 2pt minus 2pt} % Check float queue \usepackage{showframe} % Shows page layout \usepackage{layout} % \layout command ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## How to Force a Figure to Stay in Its Own SectionA float can drift several pages past the point where it was declared, which often means it appears under the wrong heading. This is normal float behaviour, not a bug: LaTeX moves floats to wherever they fit.The reliable fix is a float barrier. `\usepackage{placeins}` provides `\FloatBarrier`, which forces every pending float to be placed before the document continues. Put it at the end of a section, and no figure can escape into the next one.`\usepackage[section]{placeins}` does this automatically at every `\section`, which is usually what people want when they ask this question.`\clearpage` also flushes floats, but it starts a new page, so it is a heavier tool. Reach for `\FloatBarrier` first.Forcing exact placement with `[H]` from `float` is a different thing and a worse default — it disables floating entirely and tends to leave large gaps.## Best Practices> [!TIP] > > **Float positioning guidelines:** > > 1. **Default first**: Start with `[htbp]` for most figures > 2. **Avoid `[h]` only**: Too restrictive, add alternatives > 3. **Group related**: Put related figures together > 4. **Clear periodically**: Use `\clearpage` at chapter/section ends > 5. **Size appropriately**: Oversized figures cause problems > 6. **Think document-wide**: Consider overall flow, not just local placement > 7. **Use packages wisely**: `float`, `placeins`, `afterpage` for control## Quick Reference### Placement Options```latex example.tex theme=\{null} [h] % Here [t] % Top [b] % Bottom [p] % Page of floats [!] % Override constraints [H] % HERE (requires float package) [htbp] % Recommended default ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-figures-positioning-15/page-1.svg)
### Key Commands| Command | Purpose | | - | - | | `\clearpage` | Process all floats | | `\FloatBarrier` | Boundary for floats | | `\captionof{figure}{}` | Caption without float | | `figure*` | Full width in two-column |***> [!NOTE] > > **Next**: Learn about [Creating tables](/learn/latex/tables/creating-tables) to present structured data effectively. Tables use similar positioning concepts to figures. You might also be interested in [Cross-referencing](/learn/latex/cross-referencing) to link to your figures and tables. To test float placement without a local TeX installation, see the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=figure_positioning_online_editor). # LaTeX Fonts Guide: Change Font Family, Size, and System Fonts Source: https://resources.latex-cloud-studio.com/learn/latex/fonts Learn how to change fonts in LaTeX with pdfLaTeX, XeLaTeX, and LuaLaTeX. Covers font families, fontspec, system fonts, and font packages. If you want to change the font in LaTeX, the right method depends on your compiler. Use font packages such as `lmodern` or `newtxtext` with pdfLaTeX, and use `fontspec` with XeLaTeX or LuaLaTeX when you want system fonts such as Times New Roman, Arial, or EB Garamond.> [!NOTE] > > **Quick answer**: use pdfLaTeX with font packages for traditional LaTeX workflows, and use XeLaTeX or LuaLaTeX with `fontspec` when you need system fonts or modern OpenType features. > > **Related topics**: [Text formatting](/learn/latex/text-formatting) | [Document classes](/learn/reference/document-classes) | [Choosing a compiler](/learn/latex/basics/choosing-compiler)## How to Change the Font in LaTeX| Goal | Recommended approach | | - | - | | Use a better default serif/sans/mono font with pdfLaTeX | Load a font package such as `lmodern`, `newtxtext`, or `mathpazo` | | Use fonts installed on your computer | Compile with XeLaTeX or LuaLaTeX and load `fontspec` | | Keep math fonts consistent with text fonts | Choose a matching text + math package pair | | Improve spacing and justification | Add `microtype` |## Font Basics### The Three Font AttributesLaTeX fonts have three independent attributes:```latex font-attributes.tex theme=\{null} \documentclass{article} \begin{document} % Family (shape of letters) \textrm{Roman family (serif)} \textsf{Sans serif family} \texttt{Typewriter family (monospace)} % Series (weight/width) \textmd{Medium series (normal)} \textbf{Bold series} % Shape (slant/style) \textup{Upright shape} \textit{Italic shape} \textsl{Slanted shape} \textsc{Small Caps Shape} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-attributes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_fonts)### Combining Font Attributes```latex combining-fonts.tex theme=\{null} % All combinations work \textsf{\textbf{Sans serif bold}} \texttt{\textit{Typewriter italic}} \textrm{\textbf{\textit{Roman bold italic}}} \textsc{\textbf{Bold Small Caps}} % Using declarations {\sffamily\bfseries\itshape Sans serif bold italic} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from combining-fonts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-fonts-02/page-1.svg)
## Font Packages (pdfLaTeX)### Popular Font Packages```latex font-packages.tex theme=\{null} \documentclass{article} % Choose one matching text-and-math family per document. \usepackage{lmodern} % Alternatives (activate one pair instead of lmodern): % \usepackage{newtxtext,newtxmath} % Times-like % \usepackage{newpxtext,newpxmath} % Palatino-like % \usepackage{libertine} % Linux Libertine \begin{document} Latin Modern text with matching mathematics: $E = mc^2$. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-packages.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-03/page-1.svg)
### Font Package Comparison| Package | Style | Math Support | Use Case | | - | - | - | - | | `lmodern` | Modern | Yes | Default improvement | | `mathptmx` | Times | Yes | Traditional papers | | `helvet` | Helvetica | No | Modern look | | `mathpazo` | Palatino | Yes | Books, elegant | | `libertine` | Libertine | Yes | Professional | | `fourier` | Utopia | Yes | Technical docs |## System Fonts (XeLaTeX/LuaLaTeX)### Using System Fonts```latex system-fonts.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % Portable fonts installed in the LaTeXCloud compiler image \setmainfont[ Ligatures=TeX, Numbers=OldStyle, Scale=1.0 ]{Times New Roman} \setsansfont{Arial} \setmonofont{Courier New} \begin{document} This document uses a system serif font directly.\\ {\sffamily This line uses the configured sans-serif font.}\\ {\ttfamily This line uses the configured monospaced font.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from system-fonts.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-04/page-1.svg)
### Font Selection by Name```latex font-by-name.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % Define custom font commands \newfontfamily\headingfont{Arial} \newfontfamily\specialfont{Times New Roman} \newfontfamily\codefont{Courier New} \begin{document} {\headingfont\Large This is a heading in Arial} Regular text in the main font. {\specialfont\itshape Special serif text} {\codefont\small Code examples in Courier New} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-by-name.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-05/page-1.svg)
## Font Features### OpenType Features (XeLaTeX/LuaLaTeX)```latex opentype-features.tex theme=\{null} \documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman}[ Ligatures=TeX, Numbers=OldStyle ] % Specific features \newfontfamily\displayfont{Times New Roman}[ Numbers={Proportional,OldStyle}, Ligatures=TeX ] \begin{document} % Ligatures Office, shelf, affiliate (fi, fl, ffi ligatures) % Old style numbers Regular: 0123456789 vs {\addfontfeatures{Numbers=OldStyle}0123456789} % Small caps require a font family that provides small-cap glyphs. % {\scshape Small Capitals Text} % A separately configured display face {\displayfont Display text with proportional old-style numbers: 0123456789} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from opentype-features.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-06/page-1.svg)
### Microtype Package```latex microtype.tex theme=\{null} \documentclass{article} % Full features (pdfLaTeX) \usepackage[ protrusion=true, expansion=true, tracking=true, kerning=true, spacing=true ]{microtype} % Fine-tuning \microtypesetup{ protrusion={true,alltext}, expansion={true,alltext,compat} } \begin{document} Microtype improves typography through: \begin{itemize} \item Character protrusion (margin kerning) \item Font expansion (better justification) \item Tracking (letter spacing) \item Additional kerning \end{itemize} The improvements are subtle but create more professional results. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from microtype.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-07/page-1.svg)
## Font Sizes### Changing Font Size```latex font-sizes.tex theme=\{null} \documentclass[12pt]{article} % Base size: 10pt, 11pt, or 12pt % Exact sizes \fontsize{14}{17}\selectfont % 14pt font, 17pt baseline This text is exactly 14 points. % Relative sizes {\tiny Tiny text (5pt at 10pt base)} {\small Small text (9pt at 10pt base)} {\large Large text (12pt at 10pt base)} {\Huge Huge text (25pt at 10pt base)} % Custom size commands \newcommand{\customsize}{\fontsize{13}{16}\selectfont} {\customsize Custom 13pt text} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Size Commands Reference| Command | 10pt Article | 11pt Article | 12pt Article | | - | - | - | - | | `\tiny` | 5pt | 6pt | 6pt | | `\scriptsize` | 7pt | 8pt | 8pt | | `\footnotesize` | 8pt | 9pt | 10pt | | `\small` | 9pt | 10pt | 10.95pt | | `\normalsize` | 10pt | 10.95pt | 12pt | | `\large` | 12pt | 12pt | 14.4pt | | `\Large` | 14.4pt | 14.4pt | 17.28pt | | `\LARGE` | 17.28pt | 17.28pt | 20.74pt | | `\huge` | 20.74pt | 20.74pt | 24.88pt | | `\Huge` | 24.88pt | 24.88pt | 24.88pt |## Mathematical Fonts### Math Font Packages```latex math-fonts.tex theme=\{null} % Load one matching text-and-math family. \usepackage{lmodern} % Alternatives (activate one family instead): % \usepackage{newtxtext,newtxmath} % \usepackage{newpxtext,newpxmath} % Math alphabets \usepackage{amsfonts} \usepackage{amssymb} \usepackage{mathrsfs} % \mathscr % Usage $\mathbb{R}$, $\mathcal{A}$, $\mathscr{L}$, $\mathfrak{g}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-fonts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-fonts-09/page-1.svg)
### Unicode Math (XeLaTeX/LuaLaTeX)```latex unicode-math.tex theme=\{null} \documentclass{article} \usepackage{unicode-math} % Select a TeX-distributed OpenType math font by its portable file name. \setmathfont{latinmodern-math.otf} % Alternative: % \setmathfont{texgyretermes-math.otf} \begin{document} Unicode math allows: $α + β = γ$ and $∫_0^∞ e^{-x²} dx = \frac{√π}{2}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from unicode-math.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-10/page-1.svg)
## Special Typography### Drop Caps```latex drop-caps.tex theme=\{null} \documentclass{article} \usepackage{lettrine} \begin{document} \lettrine[lines=3]{O}{nce upon a time}, in a land far away, there lived a typographer who loved beautiful drop caps. This elegant initial letter adds a classic touch to the beginning of chapters or sections. \lettrine[lines=2,loversize=0.1]{T}{his} is a smaller drop cap. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from drop-caps.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-11/page-1.svg)
### Custom Fonts for Special Text```latex special-fonts.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % XeLaTeX/LuaLaTeX % Define special purpose fonts \newfontfamily\chapterfont{Arial} \newfontfamily\quotefont{Times New Roman}[Scale=1.1] \newfontfamily\symbolfont{Arial} \begin{document} {\chapterfont\Huge Chapter One} {\quotefont\itshape "Beautiful typography is invisible, yet it shapes how we perceive the written word."} {\symbolfont ★ ♫ ✦} % Portable Unicode symbols \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from special-fonts.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-fonts-12/page-1.svg)
## Font Troubleshooting### Common Issues and Solutions```latex font-fixes.tex theme=\{null} % Font not found (XeLaTeX/LuaLaTeX) \setmainfont{Arial}[ Extension = .ttf, Path = /path/to/fonts/, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Italic ] % Missing characters \usepackage{textcomp} % Additional symbols \usepackage[T1]{fontenc} % Better encoding % Font substitution warnings \usepackage{silence} \WarningFilter{latexfont}{Font shape} % Check available fonts (XeLaTeX/LuaLaTeX) % Run in terminal: fc-list : family ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`cannot be found\`.\
## How to Set the Document Font to Times New RomanTimes New Roman itself is a proprietary Microsoft font, so what you normally want is a metric-compatible equivalent that ships with TeX.With pdfLaTeX, load one package in the preamble and everything follows:- `\usepackage{newtxtext,newtxmath}` — the current recommendation, Times for text and matching maths - `\usepackage{mathptmx}` — older, still widely used, Times text and maths - `\usepackage{times}` — obsolete, leaves maths in Computer Modern; avoid itWith XeLaTeX or LuaLaTeX you can use the real system font directly through `fontspec`: `\setmainfont{Times New Roman}`, provided the font is installed. On a Linux build machine it usually is not, in which case `\setmainfont{TeX Gyre Termes}` gives you the same metrics.Journals that ask for "Times New Roman 12pt" accept any of the metric-compatible options above.## Best Practices> [!TIP] > > **Font guidelines:** > > 1. **Consistency**: Use maximum 2-3 font families per document > 2. **Readability**: Test fonts at actual reading size > 3. **Purpose**: Match font to document type (serif for print, sans for screen) > 4. **Licensing**: Ensure fonts are properly licensed > 5. **Fallbacks**: Provide alternatives for missing fonts > 6. **Testing**: Check output on different systems/viewers## Font Comparison> [card] For Traditional Documents > > * Times (mathptmx) > * Palatino (mathpazo) > * Computer Modern (default) > * Latin Modern (lmodern)> [card] For Modern Documents > > * Helvetica (helvet) > * Open Sans > * Source Sans Pro > * Roboto> [card] For Technical Documents > > * Computer Modern > * STIX Two > * Libertinus > * KP Fonts> [card] For Books > > * Minion Pro > * Sabon > * Garamond > * Baskerville## Quick Reference| Task | pdfLaTeX | XeLaTeX/LuaLaTeX | | - | - | - | | Times font | `\usepackage{mathptmx}` | `\setmainfont{Times New Roman}` | | Sans default | `\renewcommand{\familydefault}{\sfdefault}` | `\setmainfont{Arial}` | | Math fonts | `\usepackage{newtxmath}` | `\usepackage{unicode-math}` | | Custom font | Use packages | `\newfontfamily\myfont{FontName}` |***> [!NOTE] > > **Next**: Learn about [Mathematical equations](/learn/latex/mathematics/equations) to create complex mathematical expressions with proper formatting. # LaTeX listings vs minted: Code Blocks, Highlighting, and Setup Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/code-listings-minted Compare listings and minted for LaTeX code blocks. Includes copy-ready setup, minted v3 requirements, inline code, file imports, caching, and fixes. Use `listings` when you need portable code blocks with no external highlighter. Use `minted` when syntax quality matters and the build environment provides the `latexminted` executable and Pygments. On current TeX Live 2024+ installations, `minted` v3 can normally use trusted restricted shell escape without the unsafe global `-shell-escape` flag.> [!NOTE] > > **Quick answer**: choose `listings` for journals, CI systems, or editors where external commands may be unavailable. Choose `minted` for richer Pygments highlighting. TeX Live 2024+ with `minted` v3 usually compiles normally; older TeX Live and some MiKTeX setups require explicit permission for `latexminted`. > > **Related topics**: [Text formatting](/learn/latex/text-formatting) | [Fonts](/learn/latex/fonts) | [Headers & footers](/learn/latex/formatting/headers-footers) | [Errors](/learn/latex/basics/errors)## `listings` vs `minted`| Requirement | `listings` | `minted` | | - | - | - | | Syntax highlighting | Built-in, configured in LaTeX | Pygments-based, usually more accurate | | External executable | None | `latexminted` plus Pygments | | Current TeX Live 2024+ | Normal compilation | Normally works through trusted restricted shell escape | | Older TeX Live or MiKTeX | Normal compilation | May require `-shell-escape`, `-enable-write18`, or a trusted-command configuration | | Locked-down CI or journal build | Safest default | Use only if the environment supports it or accepts a frozen cache | | Inline code | `\lstinline` | `\mintinline` | | Import source files | `\lstinputlisting` | `\inputminted` | | Built-in result caching | No Pygments cache needed | Enabled by default; frozen cache is available | | Best fit | Portability and predictable builds | High-quality highlighting and themes |### Choose in 30 seconds- Choose **`listings`** if the PDF must compile anywhere, the source is untrusted, or the publisher controls the build. - Choose **`minted`** if highlighting quality matters and you control or have verified the toolchain. - Choose **`listings`** when you are unsure. You can switch later without changing the surrounding document structure.## Quick Start### Minimal `listings` setupUse this when you want a simple code block and do not want to change your compiler settings.```latex listings-quickstart.tex theme=\{null} \documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting}[language=Python] def hello(): print("Hello, world!") \end{lstlisting} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from listings-quickstart.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-code-listings-minted-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_code_listings_minted)### Minimal `minted` setupUse this when you want Pygments syntax highlighting and the build environment provides `minted` v3 and `latexminted`.```latex minted-quickstart.tex theme=\{null} \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}{python} def hello(): print("Hello, world!") \end{minted} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
With an up-to-date TeX Live 2024+ installation, compile normally:```bash theme=\{null} pdflatex file.tex ```For older TeX Live releases, full shell escape may still be required:```bash theme=\{null} pdflatex -shell-escape file.tex ```> [!WARNING] > > Full `-shell-escape` allows LaTeX to run arbitrary system commands. Use it only for documents you trust. Prefer current `minted` v3 with the restricted `latexminted` executable, or use `listings` in untrusted and locked-down environments.### The usual `minted` failureIf `minted` does not compile, the problem is usually one of these:- `minted`, `latexminted`, or its Python dependencies are not installed - the TeX distribution does not permit `latexminted` through restricted shell escape - an older TeX Live or MiKTeX setup needs explicit permission - the editor, CI runner, or publisher blocks all external commandsIf you cannot change the build setup, use `listings` instead.> [!NOTE] > > LaTeX Cloud Studio keeps unrestricted `-shell-escape` disabled for untrusted compilation. Use `listings` for guaranteed portability. `minted` v3 may work through the restricted, trusted `latexminted` path when it is available in the active compiler image.### Cache highlighted code for restricted builds`minted` caches highlighted output in `_minted` by default. If the final build cannot run `latexminted`, generate the cache in an allowed environment and then enable `frozencache`:```latex minted-frozen-cache.tex theme=\{null} % Enable this only after the complete cache has been generated. \usepackage[frozencache]{minted} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
Keep the generated cache with the document. With `frozencache=true`, compilation fails when a required cache entry is missing instead of trying to execute the highlighter. This is useful for publisher and CI workflows, but `listings` remains simpler when cached artifacts are not accepted.### Inline codeFor short snippets inside a paragraph:```latex inline-code.tex theme=\{null} Use \lstinline|-shell-escape| with listings examples. Use \mintinline{latex}{\usepackage{minted}} for minted inline code. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## The listings Package### Basic Code Formatting```latex listings-basic.tex theme=\{null} \documentclass{article} \usepackage{listings} \usepackage{xcolor} % Basic configuration \lstset{ basicstyle=\ttfamily\footnotesize, breaklines=true, frame=single, numbers=left, numberstyle=\tiny, stepnumber=1, showstringspaces=false } \begin{document} \section{Code Examples} \begin{lstlisting}[language=Python] def fibonacci(n): """Calculate the nth Fibonacci number.""" if n <= 1: return n return fibonacci(n-1) + fibonacci(n-2) # Example usage for i in range(10): print(f"F({i}) = {fibonacci(i)}") \end{lstlisting} % Inline code The function \lstinline|fibonacci(n)| calculates Fibonacci numbers. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from listings-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-code-listings-minted-05/page-1.svg)
**Expected output:**> [card] Expected output > > A code block with a light gray background and single-line frame border. Line numbers (1-10) appear in the left margin in a subtle gray color. The Python code displays in a monospace font with consistent formatting: the function definition, docstring, conditional logic, and loop are all clearly visible with proper indentation preserved.### Language-Specific Styling```latex listings-languages.tex theme=\{null} \documentclass{article} \usepackage{listings} \usepackage{xcolor} % Python style \lstdefinestyle{pythonstyle}{ language=Python, basicstyle=\ttfamily\small, keywordstyle=\color{blue}\bfseries, stringstyle=\color{red}, commentstyle=\color{gray}\itshape, numberstyle=\tiny\color{gray}, breaklines=true, showstringspaces=false, frame=leftline, framerule=2pt, rulecolor=\color{blue!30}, backgroundcolor=\color{blue!5} } % Java style \lstdefinestyle{javastyle}{ language=Java, basicstyle=\ttfamily\small, keywordstyle=\color{purple}\bfseries, stringstyle=\color{orange}, commentstyle=\color{green!60!black}\itshape, numberstyle=\tiny\color{gray}, breaklines=true, showstringspaces=false, frame=tb, framerule=1pt } % C++ style \lstdefinestyle{cppstyle}{ language=C++, basicstyle=\ttfamily\small, keywordstyle=\color{blue}\bfseries, stringstyle=\color{red!80!black}, commentstyle=\color{green!60!black}\itshape, numberstyle=\tiny\color{gray}, breaklines=true, showstringspaces=false, frame=single, frameround=tttt } \begin{document} \section{Python Example} \begin{lstlisting}[style=pythonstyle] class DataProcessor: def __init__(self, data): self.data = data def process(self): """Process the data using advanced algorithms.""" result = [] for item in self.data: if self.validate(item): result.append(self.transform(item)) return result \end{lstlisting} \section{Java Example} \begin{lstlisting}[style=javastyle] public class Calculator { private double result; public Calculator() { this.result = 0.0; } public double add(double value) { result += value; return result; } public void reset() { result = 0.0; } } \end{lstlisting} \section{C++ Example} \begin{lstlisting}[style=cppstyle] #include #include #include template class Container { private: std::vector data; public: void add(const T& item) { data.push_back(item); } void sort() { std::sort(data.begin(), data.end()); } }; \end{lstlisting} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from listings-languages.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-code-listings-minted-06/page-1.svg) Open zoomable preview: Compiled PDF page 2 from listings-languages.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-code-listings-minted-06/page-2.svg)
**Expected output:**> [card] Expected output > > **Language-specific syntax highlighting** - Each style applies different colors and formatting: > > * **Python style**: Blue keywords, red strings, gray comments, light blue background with left border > * **Java style**: Purple keywords, orange strings, green comments, top/bottom frame > * **C++ style**: Blue keywords, dark red strings, green comments, rounded frame > > The code appears in a monospace font with proper indentation and language-specific keyword coloring.### Custom Language Definitions```latex listings-custom-language.tex theme=\{null} \documentclass{article} \usepackage{listings} \usepackage{xcolor} % Define custom language (LaTeX commands) \lstdefinelanguage{LaTeX}{ morekeywords={ documentclass, usepackage, begin, end, section, subsection, title, author, maketitle, textbf, textit, emph, label, ref, cite, bibliography, includegraphics, caption }, morecomment=[l]{\%}, morestring=[b]", morestring=[b]', sensitive=true } % Style for LaTeX \lstdefinestyle{latexstyle}{ language=LaTeX, basicstyle=\ttfamily\small, keywordstyle=\color{blue}\bfseries, stringstyle=\color{red}, commentstyle=\color{green!60!black}\itshape, breaklines=true, showstringspaces=false, frame=single, backgroundcolor=\color{yellow!10}, escapeinside={(*@}{@*)} % Allow LaTeX commands inside } % Define SQL language \lstdefinelanguage{SQL}{ morekeywords={ SELECT, FROM, WHERE, INSERT, UPDATE, DELETE, CREATE, TABLE, INDEX, PRIMARY, KEY, FOREIGN, REFERENCES, JOIN, INNER, LEFT, RIGHT, OUTER, GROUP, BY, ORDER, HAVING, DISTINCT, COUNT, SUM, AVG, MAX, MIN, AND, OR, NOT, NULL, TRUE, FALSE }, morecomment=[l]{--}, morecomment=[s]{/*}{*/}, morestring=[b]", morestring=[b]', sensitive=false } \begin{document} \section{LaTeX Code Example} \begin{lstlisting}[style=latexstyle] \documentclass{article} \usepackage{graphicx} \usepackage{amsmath} \title{My Document} \author{John Doe} \begin{document} \maketitle \section{Introduction} This is an example of (*@\textbf{LaTeX}@*) code formatting. \begin{equation} E = mc^2 \end{equation} \end{document} \end{lstlisting} \section{SQL Example} \begin{lstlisting}[language=SQL, style=javastyle] -- Create a table for user information CREATE TABLE users ( id INTEGER PRIMARY KEY, username VARCHAR(50) NOT NULL UNIQUE, email VARCHAR(100) NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); -- Insert sample data INSERT INTO users (username, email) VALUES ('john_doe', 'john_doe_mail'), ('jane_smith', 'jane_smith_mail'); -- Query with joins SELECT u.username, p.title, p.created_at FROM users u INNER JOIN posts p ON u.id = p.user_id WHERE p.published = TRUE ORDER BY p.created_at DESC; \end{lstlisting} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## The minted Package### Basic minted Setup> [!WARNING] > > `minted` v3 uses the `latexminted` executable and Pygments. TeX Live 2024+ normally permits `latexminted` through restricted shell escape; older TeX Live and some MiKTeX configurations need explicit permission. Do not enable unrestricted shell escape for untrusted documents.```latex minted-basic.tex theme=\{null} \documentclass{article} \usepackage{minted} % Global minted settings \setminted{ fontsize=\footnotesize, linenos, breaklines, frame=lines, framesep=2mm } \begin{document} \section{Python with minted} \begin{minted}{python} import numpy as np import matplotlib.pyplot as plt def mandelbrot(c, max_iter): """Calculate the Mandelbrot set value for complex number c.""" z = 0 for n in range(max_iter): if abs(z) > 2: return n z = z*z + c return max_iter # Generate Mandelbrot set width, height = 800, 600 xmin, xmax = -2.0, 1.0 ymin, ymax = -1.5, 1.5 mandelbrot_set = np.zeros((height, width)) for i in range(height): for j in range(width): c = complex(xmin + (xmax - xmin) * j / width, ymin + (ymax - ymin) * i / height) mandelbrot_set[i, j] = mandelbrot(c, 100) plt.imshow(mandelbrot_set, extent=[xmin, xmax, ymin, ymax], cmap='hot', origin='lower') plt.colorbar() plt.title('Mandelbrot Set') plt.show() \end{minted} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
### Advanced minted Styling```latex minted-advanced.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{mdframed} \usepackage{xcolor} % Define custom style \definecolor{codegray}{rgb}{0.95,0.95,0.95} \definecolor{codeframe}{rgb}{0.7,0.7,0.7} % Custom environment for highlighted code \newenvironment{mintedbox}[1]{% \begin{mdframed}[ linecolor=codeframe, backgroundcolor=codegray, roundcorner=5pt, linewidth=1pt, innertopmargin=10pt, innerbottommargin=10pt, innerleftmargin=10pt, innerrightmargin=10pt ] \begin{minted}[ fontsize=\small, linenos, breaklines, numbersep=5pt, gobble=2 ]{#1} }{% \end{minted} \end{mdframed} } \begin{document} \section{Styled Code Blocks} \begin{mintedbox}{javascript} // Advanced JavaScript example with ES6+ features class APIClient { constructor(baseURL) { this.baseURL = baseURL; this.headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' }; } async request(endpoint, options = {}) { const url = `${this.baseURL}${endpoint}`; const config = { ...options, headers: { ...this.headers, ...options.headers } }; try { const response = await fetch(url, config); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { console.error('API request failed:', error); throw error; } } // Convenience methods get(endpoint) { return this.request(endpoint, { method: 'GET' }); } post(endpoint, data) { return this.request(endpoint, { method: 'POST', body: JSON.stringify(data) }); } } // Usage example const client = new APIClient('https://api.example.com'); client.get('/users') .then(users => console.log('Users:', users)) .catch(error => console.error('Failed to fetch users:', error)); \end{mintedbox} \section{Rust Example} \begin{minted}[ bgcolor=codegray, fontsize=\footnotesize, linenos, breaklines, frame=single, framerule=0.5pt, framesep=3mm ]{rust} use std::collections::HashMap; use std::fs::File; use std::io::{BufRead, BufReader, Result}; #[derive(Debug, Clone)] pub struct WordCounter { counts: HashMap, total_words: usize, } impl WordCounter { pub fn new() -> Self { Self { counts: HashMap::new(), total_words: 0, } } pub fn add_word(&mut self, word: &str) { let normalized = word.to_lowercase(); *self.counts.entry(normalized).or_insert(0) += 1; self.total_words += 1; } pub fn count_from_file(&mut self, filename: &str) -> Result<()> { let file = File::open(filename)?; let reader = BufReader::new(file); for line in reader.lines() { let line = line?; for word in line.split_whitespace() { // Remove punctuation let clean_word: String = word .chars() .filter(|c| c.is_alphabetic()) .collect(); if !clean_word.is_empty() { self.add_word(&clean_word); } } } Ok(()) } pub fn most_frequent(&self, n: usize) -> Vec<(&String, &usize)> { let mut pairs: Vec<_> = self.counts.iter().collect(); pairs.sort_by(|a, b| b.1.cmp(a.1)); pairs.into_iter().take(n).collect() } } \end{minted} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
### Highlighting Specific Lines```latex minted-highlighting.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{xcolor} % Define highlight colors \definecolor{highlightgray}{rgb}{0.9,0.9,0.9} \definecolor{highlightyellow}{rgb}{1.0,1.0,0.8} \begin{document} \section{Line Highlighting Examples} \subsection{Highlighting Specific Lines} \begin{minted}[ linenos, highlightlines={3,7-9}, highlightcolor=highlightyellow ]{python} def binary_search(arr, target): left, right = 0, len(arr) - 1 while left <= right: # Main loop condition mid = (left + right) // 2 if arr[mid] == target: # Found target return mid # Return index elif arr[mid] < target: # Target in right half left = mid + 1 else: # Target in left half right = mid - 1 return -1 # Target not found \end{minted} \subsection{Multiple Highlight Ranges} \begin{minted}[ linenos, highlightlines={1-2,8-10}, highlightcolor=highlightgray ]{cpp} #include #include #include int main() { std::vector numbers = {64, 34, 25, 12, 22, 11, 90}; std::cout << "Original array: "; for (int num : numbers) { std::cout << num << " "; } std::cout << std::endl; std::sort(numbers.begin(), numbers.end()); std::cout << "Sorted array: "; for (int num : numbers) { std::cout << num << " "; } std::cout << std::endl; return 0; } \end{minted} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Code Listings in Floats### Floating Code Listings```latex code-floats.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{caption} \usepackage{float} % Define new float type for code \newfloat{listing}{tbp}{lol} \floatname{listing}{Listing} % Caption setup for listings \captionsetup[listing]{position=below} \begin{document} \section{Algorithm Examples} Listing~\ref{lst:quicksort} shows an implementation of the quicksort algorithm. \begin{listing}[H] \begin{minted}[ fontsize=\footnotesize, linenos, frame=single, framesep=2mm ]{python} def quicksort(arr): """ Sorts an array using the quicksort algorithm. Args: arr: List of comparable elements Returns: Sorted list """ if len(arr) <= 1: return arr pivot = arr[len(arr) // 2] left = [x for x in arr if x < pivot] middle = [x for x in arr if x == pivot] right = [x for x in arr if x > pivot] return quicksort(left) + middle + quicksort(right) # Example usage if __name__ == "__main__": test_array = [3, 6, 8, 10, 1, 2, 1] print(f"Original: {test_array}") print(f"Sorted: {quicksort(test_array)}") \end{minted} \caption{Quicksort algorithm implementation in Python} \label{lst:quicksort} \end{listing} The algorithm shown in Listing~\ref{lst:quicksort} has an average time complexity of O(n log n). \begin{listing}[t] \begin{minted}[ fontsize=\small, linenos, frame=leftline, framerule=2pt, rulecolor=blue ]{java} public class BinaryTree> { private Node root; private static class Node { T data; Node left, right; Node(T data) { this.data = data; this.left = this.right = null; } } public void insert(T data) { root = insertRec(root, data); } private Node insertRec(Node root, T data) { if (root == null) { root = new Node<>(data); return root; } if (data.compareTo(root.data) < 0) { root.left = insertRec(root.left, data); } else if (data.compareTo(root.data) > 0) { root.right = insertRec(root.right, data); } return root; } public boolean search(T data) { return searchRec(root, data); } private boolean searchRec(Node root, T data) { if (root == null) { return false; } if (data.compareTo(root.data) == 0) { return true; } return data.compareTo(root.data) < 0 ? searchRec(root.left, data) : searchRec(root.right, data); } } \end{minted} \caption{Generic binary search tree implementation in Java} \label{lst:bst} \end{listing} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
### Code Listings with Subfigures```latex code-subfigures.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{subcaption} \usepackage{caption} \begin{document} \section{Algorithm Comparison} Figure~\ref{fig:sorting-algorithms} compares different sorting algorithm implementations. \begin{figure}[htbp] \centering \begin{subfigure}[t]{0.45\textwidth} \begin{minted}[ fontsize=\tiny, linenos, frame=single, framesep=1mm ]{python} def bubble_sort(arr): """Bubble sort - O(n²)""" n = len(arr) for i in range(n): for j in range(0, n - i - 1): if arr[j] > arr[j + 1]: arr[j], arr[j + 1] = arr[j + 1], arr[j] return arr # Example numbers = [64, 34, 25, 12, 22, 11, 90] print("Bubble sort:", bubble_sort(numbers.copy())) \end{minted} \caption{Bubble sort algorithm} \label{fig:bubble-sort} \end{subfigure} \hfill \begin{subfigure}[t]{0.45\textwidth} \begin{minted}[ fontsize=\tiny, linenos, frame=single, framesep=1mm ]{python} def merge_sort(arr): """Merge sort - O(n log n)""" if len(arr) <= 1: return arr mid = len(arr) // 2 left = merge_sort(arr[:mid]) right = merge_sort(arr[mid:]) return merge(left, right) def merge(left, right): result = [] i = j = 0 while i < len(left) and j < len(right): if left[i] <= right[j]: result.append(left[i]) i += 1 else: result.append(right[j]) j += 1 result.extend(left[i:]) result.extend(right[j:]) return result # Example numbers = [64, 34, 25, 12, 22, 11, 90] print("Merge sort:", merge_sort(numbers.copy())) \end{minted} \caption{Merge sort algorithm} \label{fig:merge-sort} \end{subfigure} \caption{Comparison of sorting algorithms with different time complexities} \label{fig:sorting-algorithms} \end{figure} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Inline Code and Escaping### Inline Code with Special Characters```latex inline-code.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{listings} % Configure listings for inline code \lstset{ basicstyle=\ttfamily, breaklines=true } \begin{document} \section{Inline Code Examples} % Simple inline code The \lstinline|print()| function outputs text to the console. % Inline code with special characters Use \lstinline|arr[i] = arr[j]| to swap array elements. % Different delimiters for special characters The regular expression \lstinline/[a-zA-Z0-9]+/ matches alphanumeric strings. % Minted inline code The \mintinline{python}|lambda x: x**2| function squares its input. % Inline code with highlighting The key function is \mintinline[bgcolor=yellow!30]{python}|process_data()|. \section{Code with LaTeX Escapes} \begin{lstlisting}[language=Python, escapeinside={(*@}{@*)}] def calculate_(*@\textbf{mean}@*)(values): """Calculate the arithmetic (*@\emph{mean}@*) of a list.""" if not values: return 0 return sum(values) / len(values) # (*@$\frac{\sum x_i}{n}$@*) # Example: (*@\textcolor{red}{Important note}@*) result = calculate_mean([1, 2, 3, 4, 5]) print(f"Mean: {result}") # Output: (*@\texttt{Mean: 3.0}@*) \end{lstlisting} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Performance and Customization### Custom Color Schemes```latex custom-colors.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{xcolor} % Define custom color scheme \definecolor{darkblue}{rgb}{0.0,0.2,0.4} \definecolor{darkgreen}{rgb}{0.0,0.4,0.2} \definecolor{darkred}{rgb}{0.4,0.0,0.2} \definecolor{darkorange}{rgb}{0.8,0.4,0.0} \definecolor{codebg}{rgb}{0.98,0.98,0.98} % Custom minted style \newminted{python}{ bgcolor=codebg, fontsize=\footnotesize, linenos, numbersep=8pt, frame=leftline, framerule=2pt, rulecolor=darkblue, breaklines, breaksymbolleft=\raisebox{0.8ex}{\small\reflectbox{\carriagereturn}}, breaksymbolindentleft=0pt, breaksymbolsepleft=0pt, breaksymbolright=\small\carriagereturn, breaksymbolindentright=0pt, breaksymbolsepright=0pt } % Custom environment \newenvironment{darkcode} {% \begin{tcolorbox}[ colback=black!95, coltext=white, colframe=gray!50, arc=2mm, boxrule=0.5pt ] \begin{minted}[ bgcolor={}, fontsize=\small, style=monokai ]{python} }{% \end{minted} \end{tcolorbox} } \begin{document} \section{Custom Styled Code} \begin{pythoncode} import asyncio import aiohttp from typing import List, Dict, Optional class AsyncWebScraper: def __init__(self, max_concurrent: int = 10): self.max_concurrent = max_concurrent self.session: Optional[aiohttp.ClientSession] = None async def __aenter__(self): connector = aiohttp.TCPConnector(limit=self.max_concurrent) self.session = aiohttp.ClientSession(connector=connector) return self async def __aexit__(self, exc_type, exc_val, exc_tb): if self.session: await self.session.close() async def fetch_url(self, url: str) -> Dict[str, str]: """Fetch content from a single URL.""" try: async with self.session.get(url) as response: content = await response.text() return { 'url': url, 'status': response.status, 'content': content[:1000], # First 1000 chars 'headers': dict(response.headers) } except Exception as e: return { 'url': url, 'error': str(e), 'status': None, 'content': None } async def scrape_urls(self, urls: List[str]) -> List[Dict[str, str]]: """Scrape multiple URLs concurrently.""" tasks = [self.fetch_url(url) for url in urls] results = await asyncio.gather(*tasks, return_exceptions=True) return [r for r in results if not isinstance(r, Exception)] # Usage example async def main(): urls = [ 'https://httpbin.org/json', 'https://httpbin.org/xml', 'https://httpbin.org/html' ] async with AsyncWebScraper(max_concurrent=5) as scraper: results = await scraper.scrape_urls(urls) for result in results: print(f"URL: {result['url']}") print(f"Status: {result.get('status', 'Error')}") print("-" * 50) if __name__ == "__main__": asyncio.run(main()) \end{pythoncode} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
### Code Import from Files```latex code-import.tex theme=\{null} \documentclass{article} \usepackage{minted} \begin{document} \section{Importing Code from Files} % Import entire file \inputminted{python}{example_script.py} % Import specific lines from file \inputminted[firstline=10,lastline=25]{python}{large_script.py} % Import with custom styling \inputminted[ fontsize=\footnotesize, linenos, numbersep=5pt, frame=lines, framesep=2mm, bgcolor=gray!10 ]{python}{algorithm.py} \section{Code Snippets} % You can also use external command to include processed code \immediate\write18{pygmentize -l python -f latex example.py > example_highlighted.tex} \input{example_highlighted.tex} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Best Practices> [!TIP] > > **Code formatting guidelines:** > > 1. **Choose appropriate package** - Use `listings` for simple formatting, `minted` for syntax highlighting > 2. **Consistent styling** - Define styles once and reuse throughout document > 3. **Font size** - Use `\footnotesize` or `\small` for better readability > 4. **Line numbers** - Include for longer code blocks, omit for short snippets > 5. **Break long lines** - Enable `breaklines` for better page layout > 6. **Escape special characters** - Use proper delimiters for inline code### Production-Ready Setup```latex production-code.tex theme=\{null} \documentclass{article} \usepackage{minted} \usepackage{tcolorbox} \usepackage{caption} % Global minted configuration \setminted{ fontsize=\footnotesize, linenos=true, numbersep=8pt, frame=leftline, framerule=1pt, breaklines=true, breaksymbolleft=\raisebox{0.8ex}{\small\reflectbox{\carriagereturn}}, autogobble=true } % Professional code environment \newtcolorbox{codebox}[2][]{ colback=blue!5!white, colframe=blue!50!black, title=#2, fonttitle=\bfseries, #1 } % Language-specific environments \newenvironment{pythoncode}[1][] {% \begin{codebox}[#1]{Python Code} \begin{minted}{python} }{% \end{minted} \end{codebox} } \newenvironment{javacode}[1][] {% \begin{codebox}[colback=orange!5!white,colframe=orange!50!black,#1]{Java Code} \begin{minted}{java} }{% \end{minted} \end{codebox} } \begin{document} \section{Professional Code Presentation} \begin{pythoncode}[title=Data Analysis Pipeline] import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import classification_report, confusion_matrix class DataAnalysisPipeline: """A complete data analysis pipeline for machine learning.""" def __init__(self, random_state=42): self.random_state = random_state self.scaler = StandardScaler() self.model = RandomForestClassifier( n_estimators=100, random_state=self.random_state ) self.is_fitted = False def preprocess_data(self, X, y=None, fit_transform=True): """Preprocess the input data.""" if fit_transform: X_scaled = self.scaler.fit_transform(X) else: X_scaled = self.scaler.transform(X) return X_scaled def train(self, X, y, test_size=0.2): """Train the model with the provided data.""" # Split the data X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=test_size, random_state=self.random_state ) # Preprocess X_train_scaled = self.preprocess_data(X_train, fit_transform=True) X_test_scaled = self.preprocess_data(X_test, fit_transform=False) # Train model self.model.fit(X_train_scaled, y_train) self.is_fitted = True # Evaluate train_score = self.model.score(X_train_scaled, y_train) test_score = self.model.score(X_test_scaled, y_test) return { 'train_score': train_score, 'test_score': test_score, 'X_test': X_test_scaled, 'y_test': y_test } def predict(self, X): """Make predictions on new data.""" if not self.is_fitted: raise ValueError("Model must be trained before making predictions") X_scaled = self.preprocess_data(X, fit_transform=False) return self.model.predict(X_scaled) def feature_importance(self): """Get feature importance scores.""" if not self.is_fitted: raise ValueError("Model must be trained first") return self.model.feature_importances_ # Example usage if __name__ == "__main__": # Load your dataset here # X, y = load_your_data() pipeline = DataAnalysisPipeline() results = pipeline.train(X, y) print(f"Training accuracy: {results['train_score']:.3f}") print(f"Testing accuracy: {results['test_score']:.3f}") \end{pythoncode} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Troubleshooting & FAQ> [accordion] minted says latexminted is unavailable or not permitted > > First confirm that `minted` v3 and `latexminted` are installed and available on `PATH`. TeX Live 2024+ normally permits `latexminted` through restricted shell escape. Older TeX Live or MiKTeX may require an explicit trusted-command configuration or, for trusted documents only, full shell escape. If you cannot change the environment, use `listings` or a complete frozen cache.> [accordion] Do I need Python, Pygments, and latexminted installed? > > `minted` v3 performs highlighting through `latexminted`, which uses Pygments. A current TeX package manager may install these components together; otherwise install `latexminted` and its dependencies in the Python environment used by the compiler. A document with a complete frozen cache no longer needs Python or Pygments during the final build.> [accordion] minted vs listings – which should I use? > > Use `listings` for lightweight, dependency-free code blocks; choose `minted` for high-quality syntax highlighting and extensive styling. For journal-ready output, minted is usually preferred.> [accordion] How do I avoid shell-escape for strict environments? > > Use current `minted` v3 on TeX Live 2024+ through its trusted restricted executable, use a verified frozen cache, or choose `listings`. If a journal or CI service forbids external execution and cached artifacts, `listings` is the portable choice.> [accordion] Colored backgrounds and line highlighting don’t appear > > Ensure your document isn’t forcing monochrome (e.g., via print mode) and that options like `bgcolor`, `highlightlines`, and `frame` are set on the environment or via `\setminted{...}`.## Quick Reference### Essential Commands| Package | Command | Purpose | Example | | - | - | - | - | | listings | `\lstset{}` | Global configuration | `\lstset{language=Python}` | | listings | `\begin{lstlisting}` | Code block | `\begin{lstlisting}[language=Java]` | | listings | `\lstinline` | Inline code | \`\lstinline | code | \` | | minted | `\setminted{}` | Global configuration | `\setminted{fontsize=\small}` | | minted | `\begin{minted}` | Code block | `\begin{minted}{python}` | | minted | `\mintinline` | Inline code | \`\mintinline | code | \` |### Common Options| Option | Effect | Example | | - | - | - | | `language` | Set programming language | `language=Python` | | `linenos` | Show line numbers | `linenos=true` | | `fontsize` | Set font size | `fontsize=\footnotesize` | | `breaklines` | Allow line breaking | `breaklines=true` | | `frame` | Add frame around code | `frame=single` | | `bgcolor` | Background color | `bgcolor=gray!10` |### Supported LanguagesBoth packages support many languages including:- Python, Java, C++, C, JavaScript, TypeScript - HTML, CSS, SQL, LaTeX, Bash, PowerShell - Go, Rust, Swift, Kotlin, Scala, Haskell - MATLAB, R, Julia, Perl, Ruby, PHP***> [!NOTE] > > **Next**: Learn about [Headers and footers](/learn/latex/formatting/headers-footers) for page decoration and numbering, or explore [Multiple columns](/learn/latex/formatting/multiple-columns) for layout. # LaTeX Counters and Numbering Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/counters-numbering Complete guide to LaTeX counters and custom numbering systems. Learn to create, modify, and customize automatic numbering for any document element. LaTeX counters control all automatic numbering in your document. This guide covers how to create custom counters, modify existing ones, and implement sophisticated numbering schemes for any document element.> [!NOTE] > > **Key concept**: LaTeX uses counters to track numbers for sections, figures, tables, equations, and more. Understanding counters lets you create custom numbering schemes and control how elements are numbered throughout your document. > > **Related topics**: [Page numbering](/learn/latex/formatting/page-numbering) | [Cross-referencing](/learn/latex/cross-referencing) | [Document structure](/components/document-structure)## Understanding LaTeX Counters### Built-in CountersLaTeX provides many predefined counters:| Counter | Purpose | Example | | - | - | - | | `page` | Page numbers | 1, 2, 3... | | `chapter` | Chapter numbers | 1, 2, 3... | | `section` | Section numbers | 1.1, 1.2, 2.1... | | `subsection` | Subsection numbers | 1.1.1, 1.1.2... | | `figure` | Figure numbers | Figure 1, Figure 2... | | `table` | Table numbers | Table 1, Table 2... | | `equation` | Equation numbers | (1), (2), (3)... | | `footnote` | Footnote numbers | ¹, ², ³... |```latex viewing-counters.tex theme=\{null} \documentclass{article} \begin{document} % Display current counter values Current page: \thepage Current section: \thesection Current figure: \thefigure Current table: \thetable % Show counter values in different formats Page (arabic): \arabic{page} Section (roman): \roman{section} Chapter (Roman): \Roman{chapter} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Counter Operations```latex counter-operations.tex theme=\{null} \documentclass{article} \begin{document} % View current value Current page counter: \thepage % Set counter to specific value \setcounter{page}{5} New page value: \thepage % Add to counter \addtocounter{page}{3} After adding 3: \thepage % Step counter (increment by 1) \stepcounter{page} After stepping: \thepage % Reset counter to zero \setcounter{page}{0} After reset: \thepage \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from counter-operations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_counters_numbering)## Creating Custom Counters### Basic Counter Creation```latex custom-counters.tex theme=\{null} \documentclass{article} % Create new counters \newcounter{example} \newcounter{problem} \newcounter{solution} % Create counter that resets with another \newcounter{subproblem}[problem] \begin{document} % Use custom counters \stepcounter{example} Example \theexample: This is the first example. \stepcounter{example} Example \theexample: This is the second example. \stepcounter{problem} Problem \theproblem: Solve this equation. \stepcounter{subproblem} Subproblem \theproblem.\thesubproblem: First part. \stepcounter{subproblem} Subproblem \theproblem.\thesubproblem: Second part. \stepcounter{problem} Problem \theproblem: New problem resets subproblem. \stepcounter{subproblem} Subproblem \theproblem.\thesubproblem: Starts at 1 again. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-counters.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-03/page-1.svg)
### Counter Display Formats```latex counter-formats.tex theme=\{null} \documentclass{article} \newcounter{demo} % Redefine how counter is displayed \renewcommand{\thedemo}{\Roman{demo}} \begin{document} % Default arabic format \stepcounter{demo} Demo \thedemo % Change to alphabetic \renewcommand{\thedemo}{\Alph{demo}} \stepcounter{demo} Demo \thedemo % Change to roman numerals \renewcommand{\thedemo}{\roman{demo}} \stepcounter{demo} Demo \thedemo % Custom format with prefix/suffix \renewcommand{\thedemo}{Example-\arabic{demo}} \stepcounter{demo} Demo \thedemo % Complex format combining counters \newcounter{chapter} \newcounter{section}[chapter] \renewcommand{\thesection}{\thechapter.\arabic{section}} \setcounter{chapter}{3} \stepcounter{section} Section \thesection \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Advanced Counter Techniques### Conditional Counter Reset```latex conditional-reset.tex theme=\{null} \documentclass{article} \usepackage{ifthen} \newcounter{task} \newcounter{step} % Custom reset behavior \newcommand{\newtask}{% \stepcounter{task}% \setcounter{step}{0}% \textbf{Task \thetask:}% } \newcommand{\newstep}{% \stepcounter{step}% \ifthenelse{\value{step}=1}% {Step \thestep:}% {Step \thestep:}% } \begin{document} \newtask \newstep First step of first task. \newstep Second step of first task. \newtask \newstep First step of second task. \newstep Second step of second task. \newstep Third step of second task. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from conditional-reset.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-05/page-1.svg)
### Counter Dependencies```latex counter-dependencies.tex theme=\{null} \documentclass{book} % Create hierarchical counters \newcounter{exercise}[chapter] \newcounter{question}[exercise] \newcounter{part}[question] % Define display formats \renewcommand{\theexercise}{\thechapter.\arabic{exercise}} \renewcommand{\thequestion}{\theexercise.\arabic{question}} \renewcommand{\thepart}{\thequestion(\alph{part})} % Commands for easy use \newcommand{\exercise}{% \stepcounter{exercise}% \setcounter{question}{0}% \textbf{Exercise \theexercise}% } \newcommand{\question}{% \stepcounter{question}% \setcounter{part}{0}% \par\textbf{Question \thequestion:}% } \newcommand{\part}{% \stepcounter{part}% \par(\thepart)% } \begin{document} \chapter{Linear Algebra} \exercise \question What is a vector? \part Define vector space. \part Give three examples. \question How do you add vectors? \part Component-wise addition. \part Geometric interpretation. \exercise \question What is a matrix? \chapter{Calculus} \exercise \question What is a derivative? \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Custom Numbering Environments### Creating Numbered Environments```latex numbered-environments.tex theme=\{null} \documentclass{article} % Create counter for custom environment \newcounter{theorem}[section] \newcounter{lemma}[section] \newcounter{corollary}[section] % Define display format \renewcommand{\thetheorem}{\thesection.\arabic{theorem}} \renewcommand{\thelemma}{\thesection.\arabic{lemma}} \renewcommand{\thecorollary}{\thesection.\arabic{corollary}} % Create environments \newenvironment{theorem}[1][] {% \stepcounter{theorem}% \textbf{Theorem \thetheorem}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{.} \itshape% } {% \par\medskip% } \newenvironment{lemma}[1][] {% \stepcounter{lemma}% \textbf{Lemma \thelemma}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{.} \itshape% } {% \par\medskip% } \begin{document} \section{Basic Theory} \begin{theorem}[Fundamental Theorem] This is an important theorem in the first section. \end{theorem} \begin{lemma} A supporting lemma for the theorem. \end{lemma} \begin{theorem} Another theorem in the same section. \end{theorem} \section{Advanced Topics} \begin{theorem} New section resets the counter. \end{theorem} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Shared Counter Systems```latex shared-counters.tex theme=\{null} \documentclass{article} % Create shared counter for all theorem-like environments \newcounter{theorem}[section] % All environments share the same counter \newenvironment{theorem}[1][] {% \stepcounter{theorem}% \textbf{Theorem \thesection.\arabic{theorem}}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{.} \itshape% }{\par\medskip} \newenvironment{lemma}[1][] {% \stepcounter{theorem}% \textbf{Lemma \thesection.\arabic{theorem}}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{.} \itshape% }{\par\medskip} \newenvironment{corollary}[1][] {% \stepcounter{theorem}% \textbf{Corollary \thesection.\arabic{theorem}}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{.} \itshape% }{\par\medskip} \begin{document} \section{Mathematical Results} \begin{theorem} First result. \end{theorem} \begin{lemma} Supporting lemma numbered consecutively. \end{lemma} \begin{corollary} Follows from the theorem. \end{corollary} \begin{theorem} Fourth result in the sequence. \end{theorem} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## List Numbering Customization### Custom List Counters```latex custom-list-numbering.tex theme=\{null} \documentclass{article} \usepackage{enumitem} % Create custom counter for special lists \newcounter{priority} \renewcommand{\thepriority}{P-\arabic{priority}} % Define custom list \newlist{prioritylist}{enumerate}{1} \setlist[prioritylist]{% label=\stepcounter{priority}\thepriority:, ref=\thepriority } \begin{document} \section{Project Tasks} \begin{prioritylist} \item High importance task \item Medium importance task \item Low importance task \end{prioritylist} \section{Requirements} \begin{prioritylist}[resume] \item Continue numbering from previous list \item Another requirement \end{prioritylist} % Reset counter for new project \setcounter{priority}{0} \section{New Project} \begin{prioritylist} \item First task of new project \item Second task of new project \end{prioritylist} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Multi-Level Custom Numbering```latex multilevel-numbering.tex theme=\{null} \documentclass{article} \usepackage{enumitem} % Create counters for hierarchical numbering \newcounter{requirement} \newcounter{subrequirement}[requirement] \newcounter{detail}[subrequirement] % Define display formats \renewcommand{\therequirement}{R\arabic{requirement}} \renewcommand{\thesubrequirement}{\therequirement.\arabic{subrequirement}} \renewcommand{\thedetail}{\thesubrequirement.\alph{detail}} % Custom environments \newenvironment{requirements} {\begin{enumerate}[label=\stepcounter{requirement}\therequirement:]} {\end{enumerate}} \newenvironment{subrequirements} {\begin{enumerate}[label=\stepcounter{subrequirement}\thesubrequirement:]} {\end{enumerate}} \newenvironment{details} {\begin{enumerate}[label=\stepcounter{detail}\thedetail)]} {\end{enumerate}} \begin{document} \section{System Requirements} \begin{requirements} \item User Authentication \begin{subrequirements} \item Login functionality \begin{details} \item Username validation \item Password encryption \item Session management \end{details} \item Registration process \begin{details} \item Email verification \item Data validation \end{details} \end{subrequirements} \item Data Management \begin{subrequirements} \item Database design \item Backup procedures \end{subrequirements} \end{requirements} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Cross-Counter References### Referencing Custom Counters```latex counter-references.tex theme=\{null} \documentclass{article} \newcounter{definition}[section] \renewcommand{\thedefinition}{\thesection.\arabic{definition}} \newenvironment{definition}[1][] {% \stepcounter{definition}% \textbf{Definition \thedefinition}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{.} \itshape% } {\par\medskip} \begin{document} \section{Basic Concepts} \begin{definition}[Vector Space]\label{def:vector-space} A vector space is a collection of objects called vectors. \end{definition} \begin{definition}[Linear Independence]\label{def:linear-independence} Vectors are linearly independent if no vector can be written as a linear combination of the others. \end{definition} \section{Applications} In Definition~\ref{def:vector-space}, we established the concept of vector spaces. Building on Definition~\ref{def:linear-independence}, we can now discuss bases. The relationship between Definition~\ref{def:vector-space} and Definition~\ref{def:linear-independence} is fundamental to linear algebra. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Counter-Based Indexing```latex counter-indexing.tex theme=\{null} \documentclass{article} % Create index counter system \newcounter{item} \newcounter{subitem}[item] \renewcommand{\theitem}{\arabic{item}} \renewcommand{\thesubitem}{\theitem.\arabic{subitem}} % Commands for index entries \newcommand{\indexitem}[2]{% \stepcounter{item}% \setcounter{subitem}{0}% \textbf{\theitem. #1} \dotfill #2\par% } \newcommand{\indexsubitem}[2]{% \stepcounter{subitem}% \quad\textbf{\thesubitem} #1 \dotfill #2\par% } \begin{document} \section{Index} \indexitem{Introduction}{Page 1} \indexsubitem{Overview}{Page 1} \indexsubitem{Scope}{Page 2} \indexsubitem{Methodology}{Page 3} \indexitem{Theory}{Page 5} \indexsubitem{Basic Concepts}{Page 5} \indexsubitem{Advanced Topics}{Page 8} \indexitem{Applications}{Page 12} \indexsubitem{Example 1}{Page 12} \indexsubitem{Example 2}{Page 15} \indexsubitem{Case Studies}{Page 18} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from counter-indexing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-12/page-1.svg)
## Specialized Numbering Systems### Legal Document Numbering```latex legal-numbering.tex theme=\{null} \documentclass{article} % Legal document counter system \newcounter{article} \newcounter{section}[article] \newcounter{subsection}[section] \newcounter{paragraph}[subsection] % Custom display formats \renewcommand{\thearticle}{\Roman{article}} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\thesubsection}{\alph{subsection}} \renewcommand{\theparagraph}{\roman{paragraph}} % Commands for legal structure \newcommand{\legalArticle}[1]{% \stepcounter{article}% \setcounter{section}{0}% \textbf{ARTICLE \thearticle}\par% \textbf{#1}\par\medskip% } \newcommand{\legalSection}[1]{% \stepcounter{section}% \setcounter{subsection}{0}% \textbf{Section \thearticle.\thesection.} #1\par% } \newcommand{\legalSubsection}[1]{% \stepcounter{subsection}% \setcounter{paragraph}{0}% \textbf{(\thesubsection)} #1\par% } \newcommand{\legalParagraph}[1]{% \stepcounter{paragraph}% \textbf{(\theparagraph)} #1\par% } \begin{document} \legalArticle{GENERAL PROVISIONS} \legalSection{Definitions} \legalSubsection{In this document, unless the context otherwise requires:} \legalParagraph{"Company" means the organization defined herein;} \legalParagraph{"Agreement" refers to this contract;} \legalParagraph{"Party" means any signatory to this agreement.} \legalSection{Scope of Application} \legalSubsection{This agreement applies to all parties involved.} \legalArticle{TERMS AND CONDITIONS} \legalSection{Obligations} \legalSubsection{Each party shall:} \legalParagraph{Fulfill their contractual obligations;} \legalParagraph{Maintain confidentiality;} \legalParagraph{Report any violations.} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Scientific Paper Numbering```latex scientific-numbering.tex theme=\{null} \documentclass{article} % Scientific numbering system \newcounter{hypothesis} \newcounter{experiment} \newcounter{observation}[experiment] \newcounter{conclusion} \renewcommand{\thehypothesis}{H\arabic{hypothesis}} \renewcommand{\theexperiment}{E\arabic{experiment}} \renewcommand{\theobservation}{\theexperiment.\arabic{observation}} \renewcommand{\theconclusion}{C\arabic{conclusion}} % Scientific environments \newenvironment{hypothesis}[1][] {% \stepcounter{hypothesis}% \textbf{Hypothesis \thehypothesis}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{:} \itshape% }{\par\medskip} \newenvironment{experiment}[1][] {% \stepcounter{experiment}% \setcounter{observation}{0}% \textbf{Experiment \theexperiment}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{:}% }{\par\medskip} \newenvironment{observation}[1][] {% \stepcounter{observation}% \textbf{Observation \theobservation}% \ifthenelse{\equal{#1}{}}{}{ (#1)}% \textbf{:} \itshape% }{\par\medskip} \begin{document} \section{Research Methodology} \begin{hypothesis}[Primary] Increased temperature will accelerate the reaction rate. \end{hypothesis} \begin{hypothesis}[Secondary] Pressure changes will have minimal effect on the reaction. \end{hypothesis} \begin{experiment}[Temperature Study] Conduct reaction at various temperatures. \begin{observation}[25°C] Reaction completed in 60 minutes. \end{observation} \begin{observation}[50°C] Reaction completed in 30 minutes. \end{observation} \begin{observation}[75°C] Reaction completed in 15 minutes. \end{observation} \end{experiment} \begin{experiment}[Pressure Study] Conduct reaction at various pressures. \begin{observation}[1 atm] Reaction rate unchanged from baseline. \end{observation} \begin{observation}[2 atm] Minimal change in reaction rate. \end{observation} \end{experiment} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Best Practices> [!TIP] > > **Counter management guidelines:** > > 1. **Plan your numbering scheme** - Design consistent hierarchy before implementation > 2. **Use descriptive counter names** - `problem` is better than `prob` or `p` > 3. **Reset appropriately** - Child counters should reset when parent increments > 4. **Document your system** - Comment complex counter relationships > 5. **Test thoroughly** - Check numbering across document sections > 6. **Consider references** - Ensure counter formats work well with `\ref{}`### Professional Counter Setup```latex professional-counters.tex theme=\{null} \documentclass{report} % Professional counter hierarchy \newcounter{requirement}[chapter] \newcounter{subrequirement}[requirement] \newcounter{specification}[chapter] \newcounter{testcase}[specification] % Clear numbering formats \renewcommand{\therequirement}{\thechapter.\arabic{requirement}} \renewcommand{\thesubrequirement}{\therequirement.\arabic{subrequirement}} \renewcommand{\thespecification}{\thechapter.\arabic{specification}} \renewcommand{\thetestcase}{\thespecification.\arabic{testcase}} % Consistent formatting commands \newcommand{\Requirement}[1]{% \stepcounter{requirement}% \setcounter{subrequirement}{0}% \paragraph{Requirement \therequirement:} #1% } \newcommand{\SubRequirement}[1]{% \stepcounter{subrequirement}% \subparagraph{Requirement \thesubrequirement:} #1% } \newcommand{\Specification}[1]{% \stepcounter{specification}% \setcounter{testcase}{0}% \paragraph{Specification \thespecification:} #1% } \newcommand{\TestCase}[1]{% \stepcounter{testcase}% \subparagraph{Test Case \thetestcase:} #1% } \begin{document} \chapter{User Interface Requirements} \Requirement{The system shall provide a user-friendly interface.} \SubRequirement{All buttons shall be clearly labeled.} \SubRequirement{Navigation shall be intuitive.} \Requirement{The interface shall be responsive.} \SubRequirement{Layout shall adapt to screen size.} \Specification{Login form implementation} \TestCase{Valid credentials acceptance} \TestCase{Invalid credentials rejection} \Specification{Menu navigation implementation} \TestCase{Menu accessibility} \TestCase{Submenu functionality} \chapter{Performance Requirements} \Requirement{Response times shall be minimal.} \SubRequirement{Page loads under 2 seconds.} \SubRequirement{Database queries under 1 second.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from professional-counters.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-15/page-1.svg) Open zoomable preview: Compiled PDF page 2 from professional-counters.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-15/page-2.svg)
## Troubleshooting Counters### Common Counter Issues```latex counter-troubleshooting.tex theme=\{null} \documentclass{article} % Problem: Counter not resetting properly % Solution: Ensure proper counter dependency \newcounter{main} \newcounter{sub}[main] % Correctly reset sub when main increments % Problem: Wrong display format % Solution: Check \renewcommand{\thecounter} \renewcommand{\themain}{\arabic{main}} % Correct format \renewcommand{\thesub}{\themain.\arabic{sub}} % Problem: Counter value not updating % Solution: Use \stepcounter or \addtocounter \newcommand{\newmain}{% \stepcounter{main}% % Correct: increments counter % \setcounter{main}{\value{main}+1} % Wrong: doesn't work } % Problem: References showing wrong number % Solution: Ensure counter is stepped before labeling \newcommand{\labeleditem}[1]{% \stepcounter{main}% % Step BEFORE label \label{#1}% Item \themain% } \begin{document} \newmain Main item \themain \stepcounter{sub} Sub item \thesub \newmain Next main item (sub resets): \themain, \thesub \labeleditem{item:first} This can be referenced as \ref{item:first}. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from counter-troubleshooting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-counters-numbering-16/page-1.svg)
## Quick Reference### Essential Counter Commands| Command | Purpose | Example | | - | - | - | | `\newcounter{name}` | Create new counter | `\newcounter{example}` | | `\newcounter{name}[parent]` | Create with reset dependency | `\newcounter{sub}[main]` | | `\setcounter{name}{value}` | Set counter to value | `\setcounter{page}{1}` | | `\addtocounter{name}{value}` | Add to counter | `\addtocounter{page}{5}` | | `\stepcounter{name}` | Increment by 1 | `\stepcounter{section}` | | `\value{name}` | Get counter value | `\value{page}` | | `\thename` | Display counter | `\thepage` |### Counter Display Formats| Format | Command | Output Example | | - | - | - | | Arabic | `\arabic{counter}` | 1, 2, 3, 4... | | Roman (lower) | `\roman{counter}` | i, ii, iii, iv... | | Roman (upper) | `\Roman{counter}` | I, II, III, IV... | | Alphabetic (lower) | `\alph{counter}` | a, b, c, d... | | Alphabetic (upper) | `\Alph{counter}` | A, B, C, D... |***> [!NOTE] > > **Next**: Learn about [Advanced code listings and minted](/learn/latex/formatting/code-listings-minted) for displaying source code, or explore [Headers and footers](/learn/latex/formatting/headers-footers) for additional content placement. # Single-sided vs Double-sided Documents Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/document-sides Guide to single-sided and double-sided layouts in LaTeX. Learn oneside/twoside options, margins, and printing tips. Understanding the difference between single-sided and double-sided document layouts is crucial for professional document preparation. This guide covers layout options, margin considerations, and best practices for both digital and print documents.> [!NOTE] > > **Key concept**: The choice between oneside and twoside affects not just printing but also margins, headers, page breaks, and overall document flow. Understanding these differences helps you choose the right option for your specific use case. > > **Related topics**: [Page numbering](/learn/latex/formatting/page-numbering) | [Headers and footers](/learn/latex/formatting/headers-footers) | [Multiple columns](/learn/latex/formatting/multiple-columns)## Understanding Document Sides### Single-sided Documents (oneside)Single-sided documents are designed for:- Digital viewing (PDFs on screen) - Single-sided printing - Simple document structure - Consistent margins on all pages### Double-sided Documents (twoside)Double-sided documents are designed for:- Professional book-like printing - Bound documents - Academic papers and theses - Different margins for odd/even pages## Basic Configuration### Document Class Options```latex document-options.tex theme=\{null} % Single-sided document (default for article) \documentclass[oneside]{article} % Double-sided document (default for book and report) \documentclass[twoside]{article} % Explicit specification \documentclass[12pt,letterpaper,oneside]{article} \documentclass[12pt,a4paper,twoside]{book} \begin{document} \section{Sample Content} This content will be formatted according to the chosen option. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Class Defaults| Document Class | Default Setting | | - | - | | `article` | `oneside` | | `report` | `oneside` | | `book` | `twoside` | | `memoir` | `twoside` |## Margin Differences### Single-sided Margins```latex oneside-margins.tex theme=\{null} \documentclass[oneside]{article} \usepackage[showframe]{geometry} % Shows margin boxes \usepackage{lipsum} % For dummy text % All pages have identical margins \geometry{ left=3cm, right=3cm, top=3cm, bottom=3cm } \begin{document} \section{Page 1} \lipsum[1-2] \newpage \section{Page 2} \lipsum[3-4] \newpage \section{Page 3} \lipsum[5-6] % All pages have the same margin layout \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from oneside-margins.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-02/page-1.svg) Open zoomable preview: Compiled PDF page 2 from oneside-margins.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-02/page-2.svg) Open zoomable preview: Compiled PDF page 3 from oneside-margins.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-02/page-3.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_document_sides)### Double-sided Margins```latex twoside-margins.tex theme=\{null} \documentclass[twoside]{article} \usepackage[showframe]{geometry} \usepackage{lipsum} % Different margins for odd and even pages \geometry{ inner=3.5cm, % Binding side (left on odd, right on even) outer=2.5cm, % Outer edge (right on odd, left on even) top=3cm, bottom=3cm } % Alternative: specify explicitly % \geometry{ % left=2.5cm, % Left margin on odd pages % right=3.5cm, % Right margin on odd pages % bindingoffset=0.5cm, % Extra space for binding % top=3cm, % bottom=3cm % } \begin{document} \section{Odd Page (1)} \lipsum[1-2] Notice the larger inner margin for binding. \newpage \section{Even Page (2)} \lipsum[3-4] The margins are mirrored compared to odd pages. \newpage \section{Odd Page (3)} \lipsum[5-6] Back to the odd page margin layout. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from twoside-margins.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from twoside-margins.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-03/page-2.svg) Open zoomable preview: Compiled PDF page 3 from twoside-margins.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-03/page-3.svg)
## Page Layout Differences### Headers and Footers```latex headers-comparison.tex theme=\{null} \documentclass[twoside]{article} \usepackage{fancyhdr} \usepackage{lipsum} \pagestyle{fancy} \fancyhf{} % Single-sided approach (same on all pages) % \fancyhead[L]{Document Title} % \fancyhead[R]{\thepage} % Double-sided approach (different for odd/even) \fancyhead[LE,RO]{\thepage} % Page number on outer edge \fancyhead[LO,RE]{Document Title} % Title on inner edge % Footers can also vary \fancyfoot[LE]{Even Page Footer} \fancyfoot[RO]{Odd Page Footer} \fancyfoot[C]{Center Footer on All Pages} \begin{document} \section{Headers Demo} \lipsum[1] \newpage \section{Page 2} \lipsum[2] \newpage \section{Page 3} \lipsum[3] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from headers-comparison.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-04/page-1.svg) Open zoomable preview: Compiled PDF page 2 from headers-comparison.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-04/page-2.svg) Open zoomable preview: Compiled PDF page 3 from headers-comparison.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-04/page-3.svg)
### Chapter Opening Pages```latex chapter-openings.tex theme=\{null} \documentclass[twoside,openright]{book} \usepackage{lipsum} % openright: chapters always start on odd pages (right-hand side) % openany: chapters can start on any page % Default: book uses openright, report uses openany \begin{document} \chapter{First Chapter} \lipsum[1-3] This chapter starts on an odd page. \chapter{Second Chapter} \lipsum[4-6] If the previous chapter ended on an odd page, a blank even page will be inserted before this chapter. \chapter{Third Chapter} \lipsum[7-9] Consistent odd-page chapter openings. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from chapter-openings.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-05/page-1.svg) Open zoomable preview: Compiled PDF page 2 from chapter-openings.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-05/page-2.svg) Open zoomable preview: Compiled PDF page 3 from chapter-openings.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-05/page-3.svg) Open zoomable preview: Compiled PDF page 4 from chapter-openings.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-05/page-4.svg) Open zoomable preview: Compiled PDF page 5 from chapter-openings.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-05/page-5.svg)
## Practical Implementations### Academic Paper Layout```latex academic-layout.tex theme=\{null} \documentclass[12pt,letterpaper,twoside]{article} \usepackage{fancyhdr} \usepackage[inner=1.5in,outer=1in,top=1in,bottom=1in]{geometry} % Academic-style headers \pagestyle{fancy} \fancyhf{} \fancyhead[LE]{\textit{Author Name}} \fancyhead[RO]{\textit{Paper Title}} \fancyfoot[LE,RO]{\thepage} % Special style for first page \fancypagestyle{firstpage}{% \fancyhf{} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0pt} } \begin{document} \thispagestyle{firstpage} \title{Academic Paper Title} \author{Author Name} \maketitle \begin{abstract} Paper abstract content... \end{abstract} \section{Introduction} Main content begins here with regular headers. \newpage \section{Literature Review} Content continues with appropriate headers for even pages. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from academic-layout.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-06/page-1.svg) Open zoomable preview: Compiled PDF page 2 from academic-layout.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-06/page-2.svg)
### Book Layout```latex book-layout.tex theme=\{null} \documentclass[11pt,twoside,openright]{book} \usepackage{fancyhdr} \usepackage[inner=1.25in,outer=0.75in,top=1in,bottom=1in,bindingoffset=0.25in]{geometry} % Book-style headers \pagestyle{fancy} \fancyhf{} \fancyhead[LE]{\leftmark} % Chapter on left of even pages \fancyhead[RO]{\rightmark} % Section on right of odd pages \fancyfoot[LE,RO]{\thepage} % Chapter pages use plain style \fancypagestyle{plain}{% \fancyhf{} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0pt} } \begin{document} \frontmatter \tableofcontents \mainmatter \chapter{Introduction} Book content with professional layout. \section{Overview} Sections appear in headers on odd pages. \chapter{Main Content} New chapters start on odd pages with binding considerations. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from book-layout.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-07/page-1.svg) Open zoomable preview: Compiled PDF page 2 from book-layout.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-07/page-2.svg) Open zoomable preview: Compiled PDF page 3 from book-layout.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-07/page-3.svg) Open zoomable preview: Compiled PDF page 4 from book-layout.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-07/page-4.svg) Open zoomable preview: Compiled PDF page 5 from book-layout.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-07/page-5.svg)
### Business Report Layout```latex business-layout.tex theme=\{null} \documentclass[11pt,oneside]{article} \usepackage{fancyhdr} \usepackage[margin=1in]{geometry} % Business document typically uses oneside for simplicity \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\textbf{Business Report}} \fancyhead[R]{\today} \fancyfoot[L]{Company Name} \fancyfoot[C]{Page \thepage} \fancyfoot[R]{Confidential} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \begin{document} \title{Quarterly Business Report} \author{Analysis Team} \maketitle \section{Executive Summary} Business reports often use single-sided layout for easier digital distribution. \section{Financial Analysis} Consistent margins and headers work well for business documents. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from business-layout.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-08/page-1.svg)
## Converting Between Layouts### From Oneside to Twoside```latex convert-to-twoside.tex theme=\{null} % Original oneside document % \documentclass[oneside]{article} % Convert to twoside \documentclass[twoside]{article} \usepackage{fancyhdr} % Update margins for binding \usepackage[inner=1.5in,outer=1in,top=1in,bottom=1in]{geometry} % Update headers for two-sided layout \pagestyle{fancy} \fancyhf{} % Change from: % \fancyhead[L]{Title} % \fancyhead[R]{\thepage} % To: \fancyhead[LE,RO]{\thepage} \fancyhead[LO,RE]{Document Title} \begin{document} Content that now works with two-sided layout... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from convert-to-twoside.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-09/page-1.svg)
### From Twoside to Oneside```latex convert-to-oneside.tex theme=\{null} % Original twoside document % \documentclass[twoside]{book} % Convert to oneside for digital distribution \documentclass[oneside]{report} % Simplify margins \usepackage[margin=1in]{geometry} % Simplify headers \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Change from: % \fancyhead[LE,RO]{\thepage} % \fancyhead[LO,RE]{Title} % To: \fancyhead[L]{Document Title} \fancyhead[R]{\thepage} \begin{document} Content adapted for single-sided digital viewing... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from convert-to-oneside.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-10/page-1.svg)
## Print Considerations### Binding Offset```latex binding-considerations.tex theme=\{null} \documentclass[twoside]{book} \usepackage{geometry} % Account for binding in printed documents \geometry{ paperwidth=8.5in, paperheight=11in, inner=1.5in, % Space for binding outer=1in, % Outer margin top=1in, bottom=1in, bindingoffset=0.25in % Extra space for binding } % Alternative: specify total text area % \geometry{ % textwidth=5.5in, % textheight=8.5in, % hoffset=0.5in, % Adjust horizontal offset % bindingoffset=0.25in % } \begin{document} \chapter{Binding Considerations} This layout accounts for the space lost to binding in printed books. The binding offset ensures text doesn't disappear into the spine. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from binding-considerations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-11/page-1.svg)
### Crop Marks and Bleed```latex print-preparation.tex theme=\{null} \documentclass[twoside]{book} \usepackage[cam,a4,center]{crop} % Add crop marks \usepackage{geometry} % Set up for commercial printing \geometry{ paperwidth=8.5in, paperheight=11in, total={6in,9in}, inner=1.25in, top=1in, includefoot, footskip=0.5in } % Ensure no content in bleed area \setlength{\topmargin}{0pt} \setlength{\headheight}{12pt} \setlength{\headsep}{25pt} \begin{document} \chapter{Print-Ready Layout} This document is prepared for commercial printing with proper margins and crop marks. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from print-preparation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-12/page-1.svg)
## Digital vs Print Optimization### PDF Viewing Optimization```latex digital-optimization.tex theme=\{null} \documentclass[oneside]{article} \usepackage{hyperref} % Optimize for screen viewing \hypersetup{ colorlinks=true, linkcolor=blue, citecolor=green, filecolor=magenta, urlcolor=cyan, pdfpagemode=UseOutlines, bookmarksopen=true } % Use comfortable margins for screen reading \usepackage[margin=1in]{geometry} % Single-column layout works better on screens % Avoid multiple columns for digital documents \begin{document} \section{Digital Document} This layout is optimized for comfortable screen reading. Links are colored and clickable in PDF viewers. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from digital-optimization.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-13/page-1.svg)
### Print Optimization```latex print-optimization.tex theme=\{null} \documentclass[twoside,11pt]{book} \usepackage{microtype} % Better typography for print % Professional print margins \usepackage[inner=1.5in,outer=1in,top=1.25in,bottom=1in]{geometry} % Print-friendly settings \usepackage{hyperref} \hypersetup{ colorlinks=false, % Black links for print pdfborder={0 0 0} % No colored borders } % Optimize line spacing for print \linespread{1.1} \begin{document} \chapter{Print Document} This layout is optimized for high-quality print production. Typography and spacing are tuned for paper reading. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from print-optimization.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-14/page-1.svg)
## Troubleshooting Layout Issues### Common Problems```latex troubleshooting.tex theme=\{null} \documentclass[twoside]{article} \usepackage{fancyhdr} % Problem: Headers not changing for odd/even pages % Solution: Use correct position specifiers \pagestyle{fancy} \fancyhf{} \fancyhead[LE,RO]{\thepage} % Correct % \fancyhead[L,R]{\thepage} % Wrong - same on all pages % Problem: Inconsistent margins % Solution: Use inner/outer instead of left/right \usepackage[inner=1.5in,outer=1in,top=1in,bottom=1in]{geometry} % Not: left=1.5in,right=1in (doesn't flip for even pages) % Problem: Chapters not starting on odd pages % Solution: Use openright option % \documentclass[twoside,openright]{book} % Problem: Text too close to binding % Solution: Add binding offset % \geometry{bindingoffset=0.25in} \begin{document} Properly configured two-sided document... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from troubleshooting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-document-sides-15/page-1.svg)
## Best Practices> [!TIP] > > **Layout decision guidelines:** > > 1. **Choose oneside for:** > * Digital-only documents > * Simple reports and articles > * Documents under 20 pages > * Quick reference materials > 2. **Choose twoside for:** > * Books and long documents > * Academic papers and theses > * Documents intended for binding > * Professional publications > 3. **Consider your audience:** > * Will they print single or double-sided? > * How will they consume the document? > * What are the formatting requirements?### Decision Matrix| Document Type | Recommended Setting | Reason | | - | - | - | | Email/Web article | `oneside` | Digital viewing | | Academic paper | `twoside` | Professional formatting | | Business memo | `oneside` | Simple distribution | | Book/thesis | `twoside` | Binding considerations | | Technical manual | `twoside` | Professional appearance | | Quick reference | `oneside` | Easy single-sided printing |## Quick Reference### Document Class Options| Option | Effect | | - | - | | `oneside` | Single-sided layout, consistent margins | | `twoside` | Double-sided layout, mirrored margins | | `openright` | Chapters start on odd pages (with `twoside`) | | `openany` | Chapters can start on any page |### Geometry Package Options| Option | Purpose | | - | - | | `inner` | Binding side margin | | `outer` | Outer edge margin | | `bindingoffset` | Extra space for binding | | `left`/`right` | Specific left/right margins |### fancyhdr Position Codes| Code | Meaning | | - | - | | `LE` | Left on even pages | | `RO` | Right on odd pages | | `LO` | Left on odd pages | | `RE` | Right on even pages |***> [!NOTE] > > **Next**: Learn about [Multiple columns layout](/learn/latex/formatting/multiple-columns) for advanced page layouts, or explore [Headers and footers](/learn/latex/formatting/headers-footers) for comprehensive layout principles. # Headers and Footers in LaTeX - fancyhdr and Page Styles Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/headers-footers Learn how to customize headers and footers in LaTeX with page styles and fancyhdr. Add page numbers, section titles, dates, and Page X of Y layouts. Headers and footers control the information that appears at the top and bottom of each page. In LaTeX, the usual workflow is simple: keep page numbering separate, then use page styles or `fancyhdr` to place the page number, section title, date, or document title where you want it. \> \[!NOTE] \> \> \*\*Quick answer\*\*:\`\`\`latex example.tex theme=\\\{null} \> \usepackage\{fancyhdr} \> \pagestyle\{fancy} \> \fancyhf\{} \> \fancyhead\[L]\{Section Title} \> \fancyfoot\[C]\{\thepage} \> \`\`\`\\\
\\\Expected effect\\\ \> \ \\> \\\\\\\[!NOTE] \> \\> \> \\> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\\\
Use built-in page styles for simple cases and \`fancyhdr\` when you need custom header and footer content.\*\*Related topics\*\*: \[Page numbering]\(/learn/latex/formatting/page-numbering) | \[Multiple columns]\(/learn/latex/formatting/multiple-columns) | \[Document classes]\(/learn/reference/document-classes) ## When To Use Page Numbering vs Headers and FootersUse [Page numbering](/learn/latex/formatting/page-numbering) when your main question is:- how to switch between roman and arabic numbers - how to restart numbering - how to hide numbers on selected pages - how to show `Page X of Y`Use this page when your main question is:- how to put the page number in a specific place - how to show chapter or section titles in the header - how to create different header/footer styles for different pages - how to control header and footer rules with `fancyhdr`## Understanding Page Styles### Default Page StylesLaTeX provides four built-in page styles:| Style | Description | Header | Footer | | - | - | - | - | | `plain` | Default for chapters | Empty | Page number | | `empty` | Completely blank | Empty | Empty | | `headings` | Automatic headers | Section/chapter names | Page number | | `myheadings` | Manual headers | User-defined content | Page number |```latex basic-styles.tex theme=\{null} \documentclass{article} \begin{document} % Set page style for entire document \pagestyle{headings} % Or change style for current page only \thispagestyle{empty} \section{Introduction} This page will have the style set above. \newpage \section{Methods} This page continues with the document page style. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-styles.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-02/page-1.svg) Open zoomable preview: Compiled PDF page 2 from basic-styles.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-02/page-2.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_headers_footers)## The fancyhdr PackageThe `fancyhdr` package provides complete control over headers and footers.### Basic Setup```latex fancyhdr-basic.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Activate fancy page style \pagestyle{fancy} % Clear default headers and footers \fancyhf{} % Set headers and footers \fancyhead[L]{Left Header} \fancyhead[C]{Center Header} \fancyhead[R]{Right Header} \fancyfoot[L]{Left Footer} \fancyfoot[C]{Page \thepage} \fancyfoot[R]{Right Footer} % Customize the line under header \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \begin{document} \section{Sample Content} This page demonstrates basic header and footer customization. \newpage \section{More Content} Headers and footers appear consistently across pages. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from fancyhdr-basic.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from fancyhdr-basic.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-03/page-2.svg)
### Position Specifiers```latex position-specifiers.tex theme=\{null} \documentclass[twoside]{article} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % For two-sided documents \fancyhead[LE,RO]{\thepage} % Left on Even pages, Right on Odd pages \fancyhead[LO,RE]{\leftmark} % Left on Odd pages, Right on Even pages % Alternative: use combinations \fancyhead[L]{\ifnum\value{page}=1 Title Page \else \leftmark \fi} \fancyfoot[C]{Footer text} % For one-sided documents, use simple positions: % L (Left), C (Center), R (Right) \begin{document} \section{Introduction} Content for testing headers... \newpage \section{Methods} More content to show header changes... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from position-specifiers.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-04/page-1.svg) Open zoomable preview: Compiled PDF page 2 from position-specifiers.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-04/page-2.svg)
## Advanced Header Customization### Dynamic Content```latex dynamic-headers.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \usepackage{lastpage} \pagestyle{fancy} \fancyhf{} % Dynamic page information \fancyhead[L]{\leftmark} \fancyhead[R]{\today} \fancyfoot[L]{Document Title} \fancyfoot[C]{Page \thepage\ of \pageref{LastPage}} \fancyfoot[R]{Author Name} % Custom header rule \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\headrule}{\hbox to\headwidth{\color{blue}\leaders\hrule height \headrulewidth\hfill}} % Different style for first page \fancypagestyle{firststyle}{% \fancyhf{} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0pt} } \begin{document} \thispagestyle{firststyle} \title{Document Title} \author{Author Name} \maketitle \section{Introduction} Regular pages use the main fancy style. \newpage \section{Methods} Headers automatically update with section names. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Conditional Headers```latex conditional-headers.tex theme=\{null} \documentclass{book} \usepackage{fancyhdr} \usepackage{ifthen} \pagestyle{fancy} \fancyhf{} % Different headers for different page types \fancyhead[LE,RO]{\thepage} \fancyhead[LO]{\ifthenelse{\isodd{\value{page}}}{\rightmark}{\leftmark}} \fancyhead[RE]{\ifthenelse{\isodd{\value{page}}}{\leftmark}{\rightmark}} % Chapter-specific footers \fancyfoot[C]{% \ifthenelse{\value{chapter}>3} {Advanced Topics} {Foundation Material} } % Special handling for chapter pages \fancypagestyle{plain}{% \fancyhf{} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0pt} } \begin{document} \chapter{Introduction} Chapter content here... \chapter{Background} More content... \chapter{Methods} Even more content... \chapter{Advanced Topics} Notice the footer changes here... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from conditional-headers.tex Page 1 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-1.svg) Open zoomable preview: Compiled PDF page 2 from conditional-headers.tex Page 2 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-2.svg) Open zoomable preview: Compiled PDF page 3 from conditional-headers.tex Page 3 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-3.svg) Open zoomable preview: Compiled PDF page 4 from conditional-headers.tex Page 4 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-4.svg) Open zoomable preview: Compiled PDF page 5 from conditional-headers.tex Page 5 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-5.svg) Open zoomable preview: Compiled PDF page 6 from conditional-headers.tex Page 6 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-6.svg) Open zoomable preview: Compiled PDF page 7 from conditional-headers.tex Page 7 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-06/page-7.svg)
## Multi-line Headers```latex multiline-headers.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Multi-line header \fancyhead[L]{% \begin{tabular}{l} \textbf{Document Title} \\ \textit{Subtitle} \end{tabular} } \fancyhead[R]{% \begin{tabular}{r} Author Name \\ \today \end{tabular} } % Adjust header height for multi-line content \setlength{\headheight}{28pt} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0.4pt} \begin{document} \section{Sample Section} This demonstrates multi-line headers with proper spacing. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multiline-headers.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-07/page-1.svg)
## Graphics in Headers```latex graphics-headers.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \usepackage{graphicx} \pagestyle{fancy} \fancyhf{} % Logo in header \fancyhead[L]{\includegraphics[height=20pt]{company-logo}} \fancyhead[C]{\textbf{CONFIDENTIAL}} \fancyhead[R]{\thepage} % Watermark-style footer \fancyfoot[C]{% \begin{picture}(0,0) \put(-50,-10){\includegraphics[width=2cm,opacity=0.3]{watermark}} \end{picture} } % Adjust header height for graphics \setlength{\headheight}{25pt} \begin{document} \section{Document with Graphics} Headers can include logos and other graphics elements. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Chapter and Section Information### Automatic Section Headers```latex section-headers.tex theme=\{null} \documentclass{report} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Use LaTeX's automatic sectioning marks \fancyhead[LE,RO]{\thepage} \fancyhead[LO]{\nouppercase{\rightmark}} % Section name \fancyhead[RE]{\nouppercase{\leftmark}} % Chapter name % Customize how marks are created \renewcommand{\chaptermark}[1]{% \markboth{\thechapter.\ #1}{} } \renewcommand{\sectionmark}[1]{% \markright{\thesection.\ #1} } % Remove uppercase from marks \renewcommand{\MakeUppercase}[1]{#1} \begin{document} \chapter{Introduction} \section{Overview} Content here shows chapter and section in headers. \section{Scope} More content to demonstrate header updates. \chapter{Methods} \section{Data Collection} New chapter shows different header content. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from section-headers.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-09/page-1.svg) Open zoomable preview: Compiled PDF page 2 from section-headers.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-09/page-2.svg)
### Custom Section Marking```latex custom-marking.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Custom command to set header content \newcommand{\sectionheader}[1]{% \markright{#1} } \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\rightmark} \fancyhead[R]{\thepage} \fancyfoot[C]{Custom Document Footer} \begin{document} \section{Introduction} \sectionheader{Introduction to LaTeX Headers} This section has a custom header description. \section{Methods} \sectionheader{Research Methodology and Approach} Different custom header for this section. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-marking.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-10/page-1.svg)
## Special Page Styles### Title Page Style```latex title-page-style.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Define special style for title page \fancypagestyle{titlepage}{% \fancyhf{} \fancyfoot[C]{\textit{Draft Version - \today}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0.4pt} } % Define style for table of contents \fancypagestyle{toc}{% \fancyhf{} \fancyhead[C]{\textsc{Contents}} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0.4pt} } % Main document style \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\leftmark} \fancyhead[R]{\thepage} \fancyfoot[C]{Main Document} \begin{document} % Use title page style \thispagestyle{titlepage} \title{Document Title} \author{Author Name} \maketitle \newpage % Use TOC style \pagestyle{toc} \tableofcontents \newpage % Switch to main style \pagestyle{fancy} \section{Introduction} Main content with standard headers... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from title-page-style.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-11/page-1.svg) Open zoomable preview: Compiled PDF page 2 from title-page-style.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-11/page-2.svg) Open zoomable preview: Compiled PDF page 3 from title-page-style.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-11/page-3.svg)
### Bibliography Style```latex bibliography-style.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Style for bibliography pages \fancypagestyle{bibliography}{% \fancyhf{} \fancyhead[L]{\textsc{References}} \fancyhead[R]{\thepage} \fancyfoot[C]{\textit{Bibliography}} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt} } % Main document style \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\leftmark} \fancyhead[R]{\thepage} \begin{document} \section{Introduction} Main content here... % Switch to bibliography style \newpage \pagestyle{bibliography} \begin{thebibliography}{9} \bibitem{ref1} Author, A. (2023). Paper title. \textit{Journal Name}, 10(2), 123-145. \end{thebibliography} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from bibliography-style.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-12/page-1.svg) Open zoomable preview: Compiled PDF page 2 from bibliography-style.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-12/page-2.svg)
## Headers with Boxes and Borders```latex boxed-headers.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \usepackage{xcolor} \usepackage{tikz} \pagestyle{fancy} \fancyhf{} % Boxed header with color \fancyhead[L]{% \colorbox{lightgray}{% \parbox{3cm}{\centering\textbf{Section}\\\leftmark} } } \fancyhead[R]{% \fcolorbox{black}{yellow}{% \parbox{2cm}{\centering Page \thepage} } } % Fancy footer with TikZ \fancyfoot[C]{% \begin{tikzpicture}[remember picture,overlay] \draw[thick,blue] (0,0) -- (2,0); \node at (1,0.2) {\textbf{Document Footer}}; \end{tikzpicture} } \setlength{\headheight}{25pt} \begin{document} \section{Sample Section} This page demonstrates boxed headers and graphic footers. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from boxed-headers.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-13/page-1.svg)
## Troubleshooting Common Issues### Header Height Problems```latex header-height.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Set appropriate header height BEFORE using fancy \setlength{\headheight}{30pt} % Adjust as needed \pagestyle{fancy} \fancyhf{} % Multi-line header that needs more space \fancyhead[L]{% Line 1\\Line 2\\Line 3 } % If you get warnings about headheight, increase it: % \addtolength{\headheight}{5pt} \begin{document} Content here... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from header-height.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-14/page-1.svg)
### Page Break Issues```latex page-break-issues.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Prevent headers from affecting page breaks \fancyhead[L]{\leftmark} \fancyhead[R]{\thepage} % Use phantom content to prevent widow/orphan issues \fancyfoot[C]{% \phantom{Invisible content for spacing} Page \thepage } % Adjust penalties if needed \clubpenalty=10000 \widowpenalty=10000 \begin{document} Content that flows across pages... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from page-break-issues.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-15/page-1.svg)
## Best Practices> [!TIP] > > **Header and footer guidelines:** > > 1. **Keep it simple** - Too much information clutters the page > 2. **Be consistent** - Use the same style throughout similar documents > 3. **Consider your audience** - Academic vs. business documents have different conventions > 4. **Test thoroughly** - Check headers on all page types (first, last, odd, even) > 5. **Mind the margins** - Ensure headers don't overlap with main content > 6. **Use semantic marking** - Let LaTeX generate section names automatically when possible### Professional Formatting```latex professional-example.tex theme=\{null} \documentclass[11pt,letterpaper]{article} \usepackage{fancyhdr} \usepackage{lastpage} % Professional document setup \pagestyle{fancy} \fancyhf{} % Header: document info on left, page on right \fancyhead[L]{\textbf{Project Report} | \leftmark} \fancyhead[R]{Page \thepage\ of \pageref{LastPage}} % Footer: company info and date \fancyfoot[L]{Company Name} \fancyfoot[C]{\textit{Confidential}} \fancyfoot[R]{\today} % Clean lines \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\footrulewidth}{0.3pt} % Adjust spacing \setlength{\headheight}{14pt} \begin{document} \section{Executive Summary} Professional document content... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from professional-example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-headers-footers-16/page-1.svg)
## Quick Reference### Essential fancyhdr Commands| Command | Purpose | Example | | - | - | - | | `\pagestyle{fancy}` | Activate fancy headers | Required for customization | | `\fancyhf{}` | Clear all headers/footers | Start with clean slate | | `\fancyhead[L]{text}` | Set left header | `\fancyhead[L]{\leftmark}` | | `\fancyfoot[C]{text}` | Set center footer | `\fancyfoot[C]{\thepage}` | | `\thispagestyle{style}` | Set style for current page | Override default style |### Position Codes| Code | Meaning | Code | Meaning | | - | - | - | - | | `L` | Left | `E` | Even pages | | `C` | Center | `O` | Odd pages | | `R` | Right | `LE` | Left on even pages |### Common Variables| Variable | Content | | - | - | | `\thepage` | Current page number | | `\leftmark` | Chapter name (book) or section name (article) | | `\rightmark` | Section name (book) or subsection name (article) | | `\today` | Current date |***> [!NOTE] > > **Next**: Learn about [Page numbering](/learn/latex/formatting/page-numbering) for advanced numbering schemes, or explore [Multiple columns](/learn/latex/formatting/multiple-columns) for overall layout principles. # LaTeX Lengths and Units Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/lengths-units Complete guide to LaTeX measurement units, lengths, and spacing. Learn how to use points, ems, centimeters, and other units for precise document formatting. Understanding LaTeX lengths and units is essential for precise document formatting. This guide covers all measurement units, how to use them effectively, and practical examples for common formatting tasks.> [!NOTE] > > **Key concept**: LaTeX uses different units for different purposes. Understanding when to use each unit type will help you create professional, consistent documents. > > **Related topics**: [Single vs double-sided documents](/learn/latex/formatting/document-sides) | [Spacing](/learn/latex/paragraphs-spacing) | [Headers & footers](/learn/latex/formatting/headers-footers)## LaTeX Units Overview### Absolute UnitsFixed measurements that don't change based on font or context.| Unit | Name | Equivalent | Best Used For | | - | - | - | - | | `pt` | Point | 1 pt = 1/72.27 inch | Font sizes, line widths | | `pc` | Pica | 1 pc = 12 pt | Typography measurements | | `in` | Inch | 1 in = 72.27 pt | Page dimensions | | `cm` | Centimeter | 1 cm = 28.45 pt | Metric page layout | | `mm` | Millimeter | 1 mm = 2.845 pt | Precise measurements | | `bp` | Big point | 1 bp = 1/72 inch | PostScript compatibility | | `dd` | Didot point | 1 dd = 1.07 pt | European typography | | `cc` | Cicero | 1 cc = 12 dd | European typography | | `sp` | Scaled point | 1 sp = 1/65536 pt | Internal calculations |### Relative UnitsUnits that scale with font size or document context.| Unit | Name | Relative To | Best Used For | | - | - | - | - | | `em` | Em | Current font size | Font-dependent spacing | | `ex` | Ex | Height of letter 'x' | Vertical spacing | | `en` | En | Half the width of 'M' | Horizontal spacing | | `mu` | Math unit | 1/18 em in math mode | Math spacing |## Basic Length Usage### Setting Lengths```latex basic-lengths.tex theme=\{null} \documentclass{article} \usepackage[margin=1in]{geometry} \begin{document} % Setting margins \newgeometry{left=2cm, right=2cm, top=3cm, bottom=3cm} % Horizontal spacing This text\hspace{2cm}has 2cm space. % Vertical spacing This is the first line. \vspace{1in} This line is 1 inch below. % Paragraph indentation \setlength{\parindent}{0.5in} This paragraph is indented by half an inch. % Line spacing \setlength{\baselineskip}{14pt} This text has 14pt baseline skip. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-lengths.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_lengths_units)### Measuring Existing Elements```latex measuring.tex theme=\{null} \documentclass{article} \begin{document} % Get current values The current font size is \the\fontdimen6\font pt. % Text width measurements Text width: \the\textwidth Line height: \the\baselineskip Paragraph indent: \the\parindent % Using lengths in calculations \newlength{\mywidth} \setlength{\mywidth}{0.5\textwidth} This box is half text width: \fbox{\parbox{\mywidth}{Content here}} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from measuring.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-02/page-1.svg)
## Practical Applications### Page Layout Dimensions```latex page-dimensions.tex theme=\{null} \documentclass{article} \usepackage{geometry} % Absolute measurements \geometry{ paperwidth=210mm, % A4 width paperheight=297mm, % A4 height left=25mm, % Left margin right=25mm, % Right margin top=30mm, % Top margin bottom=30mm % Bottom margin } % Relative to paper size \geometry{ width=0.8\paperwidth, % 80% of paper width height=0.9\paperheight % 90% of paper height } \begin{document} Current page dimensions: \begin{itemize} \item Paper width: \the\paperwidth \item Paper height: \the\paperheight \item Text width: \the\textwidth \item Text height: \the\textheight \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from page-dimensions.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-03/page-1.svg)
### Font-Relative Spacing```latex font-relative.tex theme=\{null} \documentclass{article} \begin{document} % Em-based spacing (scales with font size) {\normalsize Normal text with \hspace{2em} 2em space.} {\large Large text with \hspace{2em} 2em space.} {\huge Huge text with \hspace{2em} 2em space.} % Ex-based spacing (scales with x-height) Baseline text\vspace{2ex} Text with 2ex vertical space above. % Comparison of units \begin{tabular}{ll} 2cm space: & Text\hspace{2cm}continues \\ 2em space: & Text\hspace{2em}continues \\ 2ex space: & Text\hspace{2ex}continues \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-relative.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-04/page-1.svg)
## Advanced Length Operations### Length Arithmetic```latex length-arithmetic.tex theme=\{null} \documentclass{article} \usepackage{calc} \begin{document} % Define custom lengths \newlength{\sidebarwidth} \newlength{\mainwidth} % Calculate widths \setlength{\sidebarwidth}{0.25\textwidth} \setlength{\mainwidth}{\textwidth - \sidebarwidth - 1cm} % Use in layout \noindent \begin{minipage}{\sidebarwidth} \textbf{Sidebar}\\ Content here \end{minipage}% \hspace{1cm}% \begin{minipage}{\mainwidth} \textbf{Main Content}\\ This is the main content area calculated to fit properly. \end{minipage} % Complex calculations \newlength{\complexwidth} \setlength{\complexwidth}{(\textwidth - 3\columnsep) / 2} Width calculation: \the\complexwidth \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from length-arithmetic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-05/page-1.svg)
### Conditional Lengths```latex conditional-lengths.tex theme=\{null} \documentclass{article} \usepackage{ifthen} \begin{document} % Set length based on conditions \newlength{\dynamicspace} \ifthenelse{\lengthtest{\textwidth > 400pt}} {\setlength{\dynamicspace}{2cm}} {\setlength{\dynamicspace}{1cm}} Dynamic spacing: \the\dynamicspace % Responsive margins \newcommand{\responsivemargin}{% \ifthenelse{\lengthtest{\textwidth > 500pt}} {2cm} {1cm} } \newgeometry{margin=\responsivemargin} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Spacing Commands### Horizontal Spacing```latex horizontal-spacing.tex theme=\{null} \documentclass{article} \begin{document} % Fixed horizontal spaces Word\hspace{1cm}space % Flexible spaces Left\hfill Right % Negative space Over\hspace{-2mm}lap % Stretchable space \hspace{1cm plus 1cm minus 0.5cm} % Fill remaining space Text\hfill\hfill More text % Specific spacing commands Thin\,space (3/18 em) Medium\:space (4/18 em) Thick\;space (5/18 em) Quad\quad space (1 em) Double\qquad space (2 em) \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from horizontal-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-07/page-1.svg)
### Vertical Spacing```latex vertical-spacing.tex theme=\{null} \documentclass{article} \begin{document} First paragraph. \vspace{2cm} Paragraph with 2cm space above. \vspace*{1in} Paragraph with 1 inch space that won't disappear at page breaks. % Stretchable vertical space \vspace{1cm plus 2cm minus 0.5cm} Flexible space above this paragraph. % Fill remaining page Content at top. \vfill Content at bottom. % Negative vertical space Line one. \vspace{-\baselineskip} Line that overlaps above. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from vertical-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-08/page-1.svg)
## Length Variables and Customization### Document-Wide Settings```latex document-settings.tex theme=\{null} \documentclass{article} % Customize default lengths \setlength{\parindent}{2em} % Paragraph indentation \setlength{\parskip}{1ex plus 0.5ex} % Space between paragraphs \setlength{\baselineskip}{14pt} % Line spacing \setlength{\columnsep}{2em} % Column separation % Custom length variables \newlength{\sectionspace} \setlength{\sectionspace}{2ex plus 1ex minus 0.5ex} \newlength{\figuremargin} \setlength{\figuremargin}{1cm} \begin{document} % Use custom lengths \section{Introduction} \vspace{\sectionspace} Normal paragraph with custom settings. % Dynamic adjustments \addtolength{\leftskip}{2em} This paragraph is indented by 2em on the left. \addtolength{\leftskip}{-2em} Back to normal margins. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from document-settings.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-09/page-1.svg)
### Creating Length Commands```latex length-commands.tex theme=\{null} \documentclass{article} % Custom spacing commands \newcommand{\smallgap}{\vspace{0.5\baselineskip}} \newcommand{\mediumgap}{\vspace{\baselineskip}} \newcommand{\largegap}{\vspace{2\baselineskip}} % Responsive spacing \newcommand{\smartspace}[1]{% \ifthenelse{\lengthtest{#1 > 2cm}} {\vspace{#1}} {\vspace{2cm}}% } % Context-aware spacing \newcommand{\sectiongap}{% \ifthenelse{\equal{\@currsize}{\large}} {\vspace{1.5ex}} {\vspace{1ex}}% } \begin{document} First section. \smallgap Second section. \mediumgap Third section. \largegap Fourth section with large gap. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from length-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-10/page-1.svg)
## Math Mode Spacing### Math Units```latex math-spacing.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Math mode spacing units \begin{align} f(x) &= x^2 \quad \text{(1 em space)} \\ g(x) &= x^3 \qquad \text{(2 em space)} \\ h(x) &= x^4 \, \text{(thin space)} \\ i(x) &= x^5 \: \text{(medium space)} \\ j(x) &= x^6 \; \text{(thick space)} \\ k(x) &= x^7 \! \text{(negative thin space)} \end{align} % Custom math spacing \begin{equation} \int_0^\infty \! f(x) \, dx = \sum_{n=0}^\infty \, a_n \end{equation} % Math spacing commands \[ \text{Thin: } a\,b \quad \text{Medium: } a\:b \quad \text{Thick: } a\;b \quad \text{Quad: } a\quad b \] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-11/page-1.svg)
## Units in Different Contexts### Tables and Figures```latex table-figure-units.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \usepackage{booktabs} \begin{document} % Table with unit-based sizing \begin{table}[h] \centering \begin{tabular}{p{3cm}p{4cm}p{2cm}} \toprule Fixed 3cm & Fixed 4cm & Fixed 2cm \\ \midrule Content adapts & to specified & column width \\ \bottomrule \end{tabular} \caption{Table with fixed column widths} \end{table} % Figure scaling with units \begin{figure}[h] \centering % Scale by absolute size \includegraphics[width=8cm]{example-image} \caption{Figure scaled to 8cm width} \end{figure} % Relative scaling \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{example-image} \caption{Figure scaled to 80\% of text width} \end{figure} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from table-figure-units.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-12/page-1.svg) Open zoomable preview: Compiled PDF page 2 from table-figure-units.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-12/page-2.svg)
### Custom Environments```latex custom-environments.tex theme=\{null} \documentclass{article} \usepackage{framed} % Define environment with custom spacing \newenvironment{myquote}[1][2em] {% \vspace{1ex}% \begin{quote}% \leftskip=#1% \rightskip=#1% \itshape% } {% \end{quote}% \vspace{1ex}% } \begin{document} Regular paragraph text. \begin{myquote} This is a quote with default 2em indentation. \end{myquote} \begin{myquote}[4em] This quote has 4em indentation on both sides. \end{myquote} Regular text continues. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-environments.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-13/page-1.svg)
## Best Practices> [!TIP] > > **Unit selection guidelines:** > > 1. **Use `em` for font-dependent spacing** - Scales automatically with font changes > 2. **Use `ex` for vertical spacing** - Based on lowercase letter height > 3. **Use `pt` for precise control** - When exact measurements are needed > 4. **Use `cm/mm` for page layout** - Intuitive for physical dimensions > 5. **Use relative units when possible** - Better for responsive designs > 6. **Avoid mixing unit systems** - Stick to metric OR imperial consistently### Common Patterns```latex best-practices.tex theme=\{null} \documentclass{article} % Good: Font-relative spacing \setlength{\parskip}{0.5\baselineskip plus 0.2\baselineskip} % Good: Consistent unit system \geometry{margin=2.5cm, marginparwidth=2cm} % Good: Flexible spacing \newcommand{\flexspace}{\vspace{1ex plus 0.5ex minus 0.2ex}} % Avoid: Mixing systems inconsistently % \geometry{margin=1in, marginparwidth=3cm} % Don't mix % Good: Relative to context \newlength{\myindent} \setlength{\myindent}{2em} % Scales with font \begin{document} Properly spaced content with consistent units. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Debugging Length Issues### Measuring and Displaying```latex debugging-lengths.tex theme=\{null} \documentclass{article} \usepackage{layouts} \begin{document} % Display current settings \begin{itemize} \item Text width: \the\textwidth \item Text height: \the\textheight \item Line height: \the\baselineskip \item Paragraph indent: \the\parindent \item Paragraph skip: \the\parskip \end{itemize} % Show page layout \currentpage \pagediagram % Measure specific elements \newlength{\testlength} \settowidth{\testlength}{Sample text to measure} Width of "Sample text to measure": \the\testlength \settoheight{\testlength}{Sample text} Height of "Sample text": \the\testlength \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from debugging-lengths.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-lengths-units-15/page-1.svg)
## FAQ> [accordion] When should I use em/ex vs pt/cm? > > Use relative units (`em`, `ex`) when spacing should scale with the font (e.g., paragraph spacing, indents). Use absolute units (`pt`, `cm`) for fixed physical dimensions (e.g., margins, figure sizes).> [accordion] Why does spacing look different after changing font size? > > `em` and `ex` scale with the current font, so changes to font size affect spacing. For fixed spacing independent of font, use absolute units like `pt` or `cm`.> [accordion] How do I measure current lengths in my document? > > Use `\the\length` to print a value (e.g., `\the\textwidth`) and packages like `layouts` to visualize page geometry. See the Debugging section for examples.> [accordion] Best way to set margins? > > Use the `geometry` package and specify margins in `cm`/`mm` for clarity. For responsive layouts, consider percentages of `\paperwidth/\paperheight`.## Quick Reference### Essential Length Commands| Command | Purpose | Example | | - | - | - | | `\hspace{length}` | Horizontal space | `\hspace{2cm}` | | `\vspace{length}` | Vertical space | `\vspace{1ex}` | | `\setlength{\variable}{length}` | Set length variable | `\setlength{\parindent}{2em}` | | `\addtolength{\variable}{length}` | Modify length | `\addtolength{\textwidth}{-2cm}` | | `\newlength{\variable}` | Create length variable | `\newlength{\mywidth}` |### Common Length Variables| Variable | Description | | - | - | | `\textwidth` | Width of text area | | `\textheight` | Height of text area | | `\paperwidth` | Paper width | | `\paperheight` | Paper height | | `\baselineskip` | Line spacing | | `\parindent` | Paragraph indentation | | `\parskip` | Space between paragraphs |***> [!NOTE] > > **Next**: Learn about [Headers and footers](/learn/latex/formatting/headers-footers) to customize page headers and footers, or explore [Page numbering](/learn/latex/formatting/page-numbering) for advanced numbering schemes. # Multiple Columns in LaTeX - twocolumn and multicol Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/multiple-columns Learn how to create columns in LaTeX with the twocolumn option and the multicol package. Control column breaks, spacing, rules, and balanced layouts. If you want multiple columns in LaTeX, there are two main options:- use the `twocolumn` document-class option when the whole document should stay in two columns - use the `multicol` package when only part of the document should switch to columnsThis guide shows when to use each approach, how to force a column break, and how to control spacing and separator rules.> [!NOTE] > > **Quick answer**:\`\`\`latex example.tex theme=\{null} > \documentclass\[twocolumn] > > ````\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
for a full two-column document, or:```latex example.tex theme=\{null} > \usepackage{multicol} > > \begin{multicols}{2} > Your text here > \end{multicols} > ```
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-02/page-1.svg) >
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_multiple_columns) > for a section that should use two columns.**Related topics**: [Document classes](/learn/reference/document-classes) | [Headers & footers](/learn/latex/formatting/headers-footers) | [Figure positioning](/learn/latex/figures/positioning) > ````## Which Column Method Should You Use?| Need | Best choice | | - | - | | Whole paper in two columns | `twocolumn` class option | | Only one section in columns | `multicol` | | Manual break to the next column | `\columnbreak` | | Adjust gap between columns | `\columnsep` | | Add a line between columns | `\columnseprule` |## Document Class Columns### Built-in Two-Column Mode```latex twocolumn-class.tex theme=\{null} % Two-column mode in document class \documentclass[twocolumn]{article} \usepackage{lipsum} \begin{document} \title{Two-Column Article} \author{Author Name} \maketitle \section{Introduction} \lipsum[1-2] \section{Methods} \lipsum[3-4] \section{Results} \lipsum[5-6] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from twocolumn-class.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from twocolumn-class.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-03/page-2.svg)
### Column Separation```latex column-separation.tex theme=\{null} \documentclass[twocolumn]{article} \usepackage{lipsum} % Customize column parameters \setlength{\columnsep}{30pt} % Space between columns \setlength{\columnseprule}{0.5pt} % Rule between columns \setlength{\columnwidth}{0.45\textwidth} % Column width % Color the rule \usepackage{xcolor} \renewcommand{\columnseprulecolor}{\color{gray}} \begin{document} \section{Sample Content} \lipsum[1-4] \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## The multicol Package### Basic Multi-Column Setup```latex multicol-basic.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} \section{Introduction} This text appears in single column. % Start multi-column environment \begin{multicols}{3} \lipsum[1-6] This text flows across three columns with automatic balancing. \end{multicols} Back to single column text. \section{Two-Column Section} \begin{multicols}{2} \lipsum[7-10] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicol-basic.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-05/page-1.svg) Open zoomable preview: Compiled PDF page 2 from multicol-basic.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-05/page-2.svg) Open zoomable preview: Compiled PDF page 3 from multicol-basic.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-05/page-3.svg)
### Column Rules and Spacing```latex multicol-styling.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{xcolor} \usepackage{lipsum} % Global column settings \setlength{\columnseprule}{1pt} \renewcommand{\columnseprulecolor}{\color{blue}} \setlength{\columnsep}{25pt} \begin{document} \begin{multicols}{3} [\section{Three Columns with Rules} This section demonstrates styled column rules.] \lipsum[1-4] \end{multicols} % Local column settings \begin{multicols}{2} [\subsection{Custom Spacing}] \setlength{\columnseprule}{0.5pt} \renewcommand{\columnseprulecolor}{\color{red}} \lipsum[5-8] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicol-styling.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-06/page-1.svg) Open zoomable preview: Compiled PDF page 2 from multicol-styling.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-06/page-2.svg)
## Advanced Column Control### Unbalanced Columns```latex unbalanced-columns.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} % Balanced columns (default) \begin{multicols}{2} [\section{Balanced Columns}] \lipsum[1-3] \end{multicols} % Unbalanced columns \begin{multicols*}{2} [\section{Unbalanced Columns}] \lipsum[4-6] Short content here. \columnbreak Much longer content in the second column that continues for many lines and demonstrates unbalanced column layout. \lipsum[7-8] \end{multicols*} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from unbalanced-columns.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-07/page-1.svg) Open zoomable preview: Compiled PDF page 2 from unbalanced-columns.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-07/page-2.svg)
### Manual Column Breaks```latex column-breaks.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} \begin{multicols}{3} [\section{Manual Column Control}] First column content. \lipsum[1] \columnbreak Second column starts here. \lipsum[2] \columnbreak Third column content. \lipsum[3] \end{multicols} % Preventing column breaks \begin{multicols}{2} [\section{Preventing Breaks}] \lipsum[4] \begin{samepage} This paragraph should not be broken across columns. It will stay together as one unit. \end{samepage} \lipsum[5] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from column-breaks.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-08/page-1.svg) Open zoomable preview: Compiled PDF page 2 from column-breaks.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-08/page-2.svg)
## Column Spanning Elements### Spanning Headers and Figures```latex spanning-elements.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{graphicx} \usepackage{lipsum} \begin{document} \begin{multicols}{2} [\section{Document with Spanning Elements} This section header spans both columns and provides context for the content below.] \lipsum[1-2] \end{multicols} % Figure spanning columns \begin{figure*}[t] \centering \includegraphics[width=0.8\textwidth]{example-image} \caption{This figure spans the full page width across multiple columns} \label{fig:spanning} \end{figure*} \begin{multicols}{2} \lipsum[3-4] % Table spanning columns \end{multicols} \begin{table*}[t] \centering \begin{tabular}{|c|c|c|c|c|} \hline Column 1 & Column 2 & Column 3 & Column 4 & Column 5 \\ \hline Data & Data & Data & Data & Data \\ \hline \end{tabular} \caption{Wide table spanning multiple columns} \end{table*} \begin{multicols}{2} \lipsum[5-6] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from spanning-elements.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-09/page-1.svg) Open zoomable preview: Compiled PDF page 2 from spanning-elements.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-09/page-2.svg)
### Inline Spanning Text```latex inline-spanning.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} \begin{multicols}{3} [\section{Mixed Column Content}] \lipsum[1] \end{multicols} % Temporary single column for important note \begin{center} \fbox{\parbox{0.8\textwidth}{ \textbf{Important Note:} This highlighted text spans across the full width to draw attention to critical information. }} \end{center} \begin{multicols}{3} \lipsum[2-4] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from inline-spanning.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-10/page-1.svg)
## Customizing Column Behavior### Column Width and Balance```latex custom-column-behavior.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} % Custom column tolerance \setlength{\multicolsep}{12pt plus 4pt minus 3pt} \setlength{\premulticols}{12pt plus 4pt minus 3pt} \setlength{\postmulticols}{12pt plus 4pt minus 3pt} \begin{multicols}{2} [\section{Customized Column Spacing}] % Custom balance \raggedcolumns \lipsum[1-3] \end{multicols} % Force balanced columns \begin{multicols}{3} [\subsection{Forced Balance}] \flushcolumns This content will be balanced across three columns regardless of natural break points. \lipsum[4-5] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-column-behavior.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-11/page-1.svg) Open zoomable preview: Compiled PDF page 2 from custom-column-behavior.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-11/page-2.svg)
### Column Penalties```latex column-penalties.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} % Adjust penalties for better column breaks \clubpenalty=10000 \widowpenalty=10000 \displaywidowpenalty=10000 \begin{document} \begin{multicols}{2} [\section{Optimized Column Breaks}] % Prevent bad breaks \interlinepenalty=10000 \lipsum[1] % Allow breaks here \penalty-100 \lipsum[2] % Discourage breaks \nopagebreak \lipsum[3] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from column-penalties.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-12/page-1.svg)
## Specialized Column Layouts### Mixed Column Layouts```latex mixed-layouts.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} % Single column introduction \section{Introduction} \lipsum[1] % Two-column main content \begin{multicols}{2} [\subsection{Main Content}] \lipsum[2-4] \end{multicols} % Three-column details \begin{multicols}{3} [\subsection{Detailed Analysis}] \lipsum[5-7] \end{multicols} % Back to single column \section{Conclusion} \lipsum[8] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from mixed-layouts.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-13/page-1.svg) Open zoomable preview: Compiled PDF page 2 from mixed-layouts.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-13/page-2.svg)
### Asymmetric Columns```latex asymmetric-columns.tex theme=\{null} \documentclass{article} \usepackage{paracol} \usepackage{lipsum} \begin{document} \section{Asymmetric Layout} % Different width columns \setlength{\columnseprule}{0.4pt} \columnratio{0.6} \begin{paracol}{2} % Main content (60% width) \lipsum[1-3] \switchcolumn % Sidebar content (40% width) \textbf{Sidebar Notes:} Key points from the main text: \begin{itemize} \item Important observation \item Critical detail \item Summary point \end{itemize} Additional references and supplementary information. \end{paracol} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from asymmetric-columns.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-14/page-1.svg) Open zoomable preview: Compiled PDF page 2 from asymmetric-columns.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-14/page-2.svg)
## Newsletter and Journal Layouts### Newsletter Style```latex newsletter-layout.tex theme=\{null} \documentclass[twocolumn]{article} \usepackage{multicol} \usepackage{graphicx} \usepackage{fancyhdr} \usepackage{xcolor} % Newsletter header \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\textbf{\Large COMPANY NEWSLETTER}} \fancyhead[R]{\textbf{Issue 42 | March 2024}} \renewcommand{\headrulewidth}{2pt} % Column customization \setlength{\columnsep}{20pt} \setlength{\columnseprule}{0.5pt} \begin{document} % Full-width header article \twocolumn[ \begin{@twocolumnfalse} \begin{center} \textbf{\Huge MAJOR ANNOUNCEMENT}\\[10pt] \textit{\large Company achieves significant milestone in Q1 2024} \end{center} \vspace{20pt} \end{@twocolumnfalse} ] \section{Lead Story} This is the main story content that flows in two-column format. \includegraphics[width=\columnwidth]{example-image} \section{Secondary News} Additional news items continue in column format. \section{Quick Updates} \begin{itemize} \item Update 1 \item Update 2 \item Update 3 \end{itemize} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Academic Journal Style```latex journal-layout.tex theme=\{null} \documentclass[twocolumn,10pt]{article} \usepackage{multicol} \usepackage{abstract} \usepackage{lipsum} % Journal formatting \setlength{\columnsep}{15pt} \setlength{\columnseprule}{0.3pt} % Custom abstract \renewcommand{\abstractnamefont}{\normalfont\bfseries} \renewcommand{\abstracttextfont}{\normalfont\small\itshape} \begin{document} % Single column for title and abstract \twocolumn[ \begin{@twocolumnfalse} \title{Research Paper Title: A Comprehensive Study} \author{Author Name$^1$, Co-Author Name$^2$} \date{} \maketitle \begin{abstract} This is the abstract of the research paper that spans the full width before the two-column layout begins. It provides a concise summary of the research methodology, findings, and conclusions. \end{abstract} \vspace{10pt} \textbf{Keywords:} LaTeX, typography, academic writing, columns \vspace{20pt} \end{@twocolumnfalse} ] \section{Introduction} \lipsum[1-2] \section{Literature Review} \lipsum[3-4] \section{Methodology} \lipsum[5-6] \section{Results} \lipsum[7-8] \begin{table}[h] \centering \begin{tabular}{lcc} \hline Method & Accuracy & Time \\ \hline A & 95\% & 10s \\ B & 92\% & 5s \\ \hline \end{tabular} \caption{Results comparison} \end{table} \section{Discussion} \lipsum[9-10] \section{Conclusion} \lipsum[11] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from journal-layout.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-16/page-1.svg) Open zoomable preview: Compiled PDF page 2 from journal-layout.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-16/page-2.svg) Open zoomable preview: Compiled PDF page 3 from journal-layout.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-16/page-3.svg)
## Troubleshooting Column Issues### Common Problems and Solutions```latex troubleshooting-columns.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} % Problem: Uneven column heights % Solution: Use balanced multicols \begin{multicols}{2} [\section{Balanced Columns}] \lipsum[1-3] \end{multicols} % Problem: Figures breaking columns badly % Solution: Use [H] placement or adjust penalties \begin{multicols}{2} [\section{Figure Placement}] \lipsum[4] % Better figure placement \begin{figure}[H] \centering \includegraphics[width=0.8\columnwidth]{example-image} \caption{Properly placed figure} \end{figure} \lipsum[5] \end{multicols} % Problem: Tables too wide for columns % Solution: Use adjustbox or scale \begin{multicols}{2} [\section{Table Fitting}] \lipsum[6] \begin{table}[H] \centering \resizebox{\columnwidth}{!}{% \begin{tabular}{cccc} \hline A & B & C & D \\ \hline Data & Data & Data & Data \\ \hline \end{tabular} } \caption{Resized table} \end{table} \lipsum[7] \end{multicols} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Fine-tuning Column Balance```latex fine-tuning.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{lipsum} \begin{document} % Adjust column parameters \setlength{\multicolsep}{6pt plus 2pt minus 1pt} \setlength{\premulticols}{6pt plus 2pt minus 1pt} \setlength{\postmulticols}{6pt plus 2pt minus 1pt} % Fine-tune balance tolerance \setcounter{collectmore}{-1} % More aggressive balancing \begin{multicols}{3} [\section{Fine-tuned Columns}] % Use penalties to control breaks \lipsum[1] \penalty-100 % Encourage break here \lipsum[2] \penalty10000 % Discourage break here Short paragraph that should stay together. \lipsum[3] \end{multicols} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from fine-tuning.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-multiple-columns-18/page-1.svg)
## Best Practices> [!TIP] > > **Column layout guidelines:** > > 1. **Choose appropriate column count** - 2-3 columns work best for most content > 2. **Consider line length** - Aim for 45-75 characters per line > 3. **Balance content** - Use multicol for automatic balancing > 4. **Mind the gaps** - Adjust `\columnsep` for readability > 5. **Test thoroughly** - Check appearance at different zoom levels > 6. **Use spanning elements wisely** - Don't break flow unnecessarily### Professional Column Setup```latex professional-setup.tex theme=\{null} \documentclass{article} \usepackage{multicol} \usepackage{microtype} % Better typography \usepackage{lipsum} % Professional column settings \setlength{\columnsep}{18pt} \setlength{\columnseprule}{0.3pt} \renewcommand{\columnseprulecolor}{\color{gray!50}} % Improve text flow \tolerance=1000 \hyphenpenalty=1000 \exhyphenpenalty=1000 \begin{document} \begin{multicols}{2} [\section{Professional Layout} Optimized for readability and professional appearance.] \lipsum[1-4] This layout uses professional typography settings to ensure optimal readability across multiple columns. \end{multicols} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Quick Reference### Essential Commands| Command | Purpose | Example | | - | - | - | | `\begin{multicols}{n}` | Start n-column layout | `\begin{multicols}{3}` | | `\columnbreak` | Force column break | Insert between paragraphs | | `\setlength{\columnsep}{length}` | Set column separation | `\setlength{\columnsep}{20pt}` | | `\setlength{\columnseprule}{width}` | Set rule width | `\setlength{\columnseprule}{0.5pt}` |### Column Parameters| Parameter | Description | Typical Value | | - | - | - | | `\columnsep` | Space between columns | 18pt-25pt | | `\columnseprule` | Rule width | 0pt-1pt | | `\multicolsep` | Space before/after multicols | 12pt plus 4pt minus 3pt | | `\premulticols` | Space before multicols | 12pt plus 4pt minus 3pt | | `\postmulticols` | Space after multicols | 12pt plus 4pt minus 3pt |### Document Class Options| Option | Effect | | - | - | | `twocolumn` | Enable two-column mode | | `onecolumn` | Single column (default) | | `landscape` | Landscape orientation |***> [!NOTE] > > **Next**: Learn about [LaTeX counters and numbering](/learn/latex/formatting/counters-numbering) for advanced numbering schemes, or explore [Headers and footers](/learn/latex/formatting/headers-footers) for page design. # Page Numbering in LaTeX - Roman, Arabic, and Custom Styles Source: https://resources.latex-cloud-studio.com/learn/latex/formatting/page-numbering Learn how to add page numbers in LaTeX, switch between roman and arabic numbering, reset counters, and show Page X of Y with copy-paste examples. LaTeX adds page numbers automatically, but you can change the numbering style, restart the counter, hide numbers on selected pages, or show `Page X of Y` when you need a more formal layout.> [!NOTE] > > **Quick answer**:\`\`\`latex example.tex theme=\{null} > \pagenumbering % i, ii, iii > \pagenumbering % 1, 2, 3 > \setcounter1 % restart from page 1 > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
Use `\pagenumbering{...}` to change style and `\setcounter{page}{...}` to restart numbering.**Most common jobs**: switch front matter to roman numerals, restart page 1 for the main document, hide numbers on title pages, and show `Page X of Y` with `fancyhdr` and `lastpage`.**Related topics**: [Headers and footers](/learn/latex/formatting/headers-footers) | [Document classes](/learn/reference/document-classes) | [Cross-referencing](/learn/latex/cross-referencing) > ```## Common Page Numbering TasksMost page-numbering questions fall into one of these patterns:- Start with arabic page numbers like `1, 2, 3` - Use roman numerals like `i, ii, iii` for front matter - Restart numbering after the title page or table of contents - Hide the page number on one page with `\thispagestyle{empty}` - Show `Page X of Y` in the footer - Move the number into a custom header or footer with `fancyhdr`## Basic Page Numbering### Default NumberingLaTeX automatically numbers pages starting from 1. The page number appears in different locations depending on the document class and page style.```latex basic-numbering.tex theme=\{null} \documentclass{article} \begin{document} % Page numbers appear automatically \section{Introduction} This is page 1. \newpage \section{Methods} This is page 2. \newpage \section{Results} This is page 3. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-numbering.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-02/page-1.svg) Open zoomable preview: Compiled PDF page 2 from basic-numbering.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-02/page-2.svg) Open zoomable preview: Compiled PDF page 3 from basic-numbering.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-02/page-3.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_formatting_page_numbering)### Changing Page Number Style```latex number-styles.tex theme=\{null} \documentclass{article} \begin{document} % Arabic numerals (default) \pagenumbering{arabic} Page numbering: 1, 2, 3, 4... \newpage % Roman numerals (lowercase) \pagenumbering{roman} Page numbering: i, ii, iii, iv... \newpage % Roman numerals (uppercase) \pagenumbering{Roman} Page numbering: I, II, III, IV... \newpage % Alphabetic (lowercase) \pagenumbering{alph} Page numbering: a, b, c, d... \newpage % Alphabetic (uppercase) \pagenumbering{Alph} Page numbering: A, B, C, D... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from number-styles.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from number-styles.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-03/page-2.svg) Open zoomable preview: Compiled PDF page 3 from number-styles.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-03/page-3.svg) Open zoomable preview: Compiled PDF page 4 from number-styles.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-03/page-4.svg) Open zoomable preview: Compiled PDF page 5 from number-styles.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-03/page-5.svg)
### Setting Page Number```latex set-page-number.tex theme=\{null} \documentclass{article} \begin{document} % Start numbering from a specific number \setcounter{page}{5} This page is numbered 5. \newpage This page is numbered 6. % Reset counter \setcounter{page}{1} \newpage Back to page 1. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from set-page-number.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-04/page-1.svg) Open zoomable preview: Compiled PDF page 2 from set-page-number.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-04/page-2.svg) Open zoomable preview: Compiled PDF page 3 from set-page-number.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-04/page-3.svg)
## Page Number PositioningIf you only want to move the page number, keep the numbering logic simple here and move to [Headers and footers](/learn/latex/formatting/headers-footers) when you need a custom header/footer layout.### Using Page Styles```latex page-styles.tex theme=\{null} \documentclass{article} \begin{document} % Plain style: number at bottom center \pagestyle{plain} \section{Section with Plain Style} Page number appears at bottom center. \newpage % Empty style: no page numbers \pagestyle{empty} \section{Section with No Numbers} This page has no page number. \newpage % Headings style: number in header \pagestyle{headings} \section{Section with Header Numbers} Page number appears in header with section name. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from page-styles.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-05/page-1.svg) Open zoomable preview: Compiled PDF page 2 from page-styles.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-05/page-2.svg) Open zoomable preview: Compiled PDF page 3 from page-styles.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-05/page-3.svg)
### Custom Positioning with fancyhdr```latex custom-positioning.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Set up custom page numbering \pagestyle{fancy} \fancyhf{} % Clear all headers and footers % Page number in different positions \fancyfoot[L]{Page \thepage} % Bottom left % \fancyfoot[C]{\thepage} % Bottom center % \fancyfoot[R]{\thepage} % Bottom right % \fancyhead[L]{\thepage} % Top left % \fancyhead[C]{\thepage} % Top center % \fancyhead[R]{\thepage} % Top right \begin{document} \section{Custom Page Positioning} Page numbers can appear anywhere you specify. \newpage \section{Continued Content} Consistent positioning across pages. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-positioning.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-06/page-1.svg) Open zoomable preview: Compiled PDF page 2 from custom-positioning.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-06/page-2.svg)
## Advanced Page Numbering### Different Styles for Different Sections```latex different-styles.tex theme=\{null} \documentclass{report} \usepackage{fancyhdr} \begin{document} % Front matter with roman numerals \pagenumbering{roman} \pagestyle{plain} \tableofcontents \newpage \listoffigures \newpage % Main content with arabic numerals \pagenumbering{arabic} \setcounter{page}{1} \pagestyle{fancy} \fancyhf{} \fancyhead[R]{\thepage} \fancyfoot[C]{Main Document} \chapter{Introduction} Main content starts with page 1. \chapter{Methods} Continues with normal numbering. % Appendix with different style \appendix \pagenumbering{Alph} \setcounter{page}{1} \chapter{Additional Data} Appendix uses alphabetic numbering: A, B, C... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from different-styles.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-07/page-1.svg) Open zoomable preview: Compiled PDF page 2 from different-styles.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-07/page-2.svg) Open zoomable preview: Compiled PDF page 3 from different-styles.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-07/page-3.svg) Open zoomable preview: Compiled PDF page 4 from different-styles.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-07/page-4.svg) Open zoomable preview: Compiled PDF page 5 from different-styles.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-07/page-5.svg)
### Page Ranges and Prefixes```latex page-ranges.tex theme=\{null} \documentclass{book} \usepackage{fancyhdr} \begin{document} % Preface with prefix \pagenumbering{roman} \renewcommand{\thepage}{Preface-\roman{page}} \chapter*{Preface} Pages numbered as: Preface-i, Preface-ii, etc. \tableofcontents % Main content \mainmatter \pagenumbering{arabic} \renewcommand{\thepage}{\arabic{page}} \chapter{Introduction} Regular numbering: 1, 2, 3... % Appendix with prefix \appendix \renewcommand{\thepage}{App-\Alph{chapter}-\arabic{page}} \setcounter{page}{1} \chapter{Data Tables} Numbered as: App-A-1, App-A-2, etc. \chapter{Code Listings} Numbered as: App-B-1, App-B-2, etc. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from page-ranges.tex Page 1 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-1.svg) Open zoomable preview: Compiled PDF page 2 from page-ranges.tex Page 2 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-2.svg) Open zoomable preview: Compiled PDF page 3 from page-ranges.tex Page 3 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-3.svg) Open zoomable preview: Compiled PDF page 4 from page-ranges.tex Page 4 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-4.svg) Open zoomable preview: Compiled PDF page 5 from page-ranges.tex Page 5 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-5.svg) Open zoomable preview: Compiled PDF page 6 from page-ranges.tex Page 6 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-6.svg) Open zoomable preview: Compiled PDF page 7 from page-ranges.tex Page 7 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-7.svg) Open zoomable preview: Compiled PDF page 8 from page-ranges.tex Page 8 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-8.svg) Open zoomable preview: Compiled PDF page 9 from page-ranges.tex Page 9 of 9. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-08/page-9.svg)
## Two-Sided Documents### Different Numbering for Odd/Even Pages```latex two-sided-numbering.tex theme=\{null} \documentclass[twoside]{article} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Different positions for odd and even pages \fancyfoot[LE]{\thepage} % Left on even pages \fancyfoot[RO]{\thepage} % Right on odd pages % Alternative: outside corners % \fancyhead[LE,RO]{\thepage} % Content in headers \fancyhead[LE]{\leftmark} % Section name on left of even pages \fancyhead[RO]{\rightmark} % Subsection name on right of odd pages \begin{document} \section{First Section} Content that demonstrates two-sided numbering. \newpage \subsection{Subsection} More content to show header differences. \newpage \section{Second Section} Even more content. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from two-sided-numbering.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-09/page-1.svg) Open zoomable preview: Compiled PDF page 2 from two-sided-numbering.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-09/page-2.svg) Open zoomable preview: Compiled PDF page 3 from two-sided-numbering.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-09/page-3.svg)
### Blank Pages in Two-Sided Documents```latex blank-pages.tex theme=\{null} \documentclass[twoside,openright]{book} \usepackage{fancyhdr} % Define style for blank pages \fancypagestyle{blank}{% \fancyhf{} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } % Command to insert blank page \newcommand{\blankpage}{% \newpage \thispagestyle{blank} \mbox{} \newpage } \begin{document} \chapter{First Chapter} Content here... % Insert blank page before new chapter \blankpage \chapter{Second Chapter} New chapter content... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from blank-pages.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-10/page-1.svg) Open zoomable preview: Compiled PDF page 2 from blank-pages.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-10/page-2.svg) Open zoomable preview: Compiled PDF page 3 from blank-pages.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-10/page-3.svg)
## Special Page Numbering Schemes### Chapter-Based Numbering```latex chapter-numbering.tex theme=\{null} \documentclass{book} % Redefine page numbering to include chapter \renewcommand{\thepage}{\thechapter-\arabic{page}} % Reset page counter at each chapter \usepackage{chngcntr} \counterwithin{page}{chapter} \begin{document} \chapter{Introduction} Pages numbered: 1-1, 1-2, 1-3... \chapter{Methods} Pages numbered: 2-1, 2-2, 2-3... \chapter{Results} Pages numbered: 3-1, 3-2, 3-3... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from chapter-numbering.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-11/page-1.svg) Open zoomable preview: Compiled PDF page 2 from chapter-numbering.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-11/page-2.svg) Open zoomable preview: Compiled PDF page 3 from chapter-numbering.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-11/page-3.svg)
### Section-Based Numbering```latex section-numbering.tex theme=\{null} \documentclass{article} % Include section number in page numbering \renewcommand{\thepage}{\thesection.\arabic{page}} % Reset page counter for each section \usepackage{chngcntr} \counterwithin{page}{section} \begin{document} \section{Introduction} Pages: 1.1, 1.2, 1.3... \section{Literature Review} Pages: 2.1, 2.2, 2.3... \section{Methodology} Pages: 3.1, 3.2, 3.3... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from section-numbering.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-12/page-1.svg)
### Total Page Count```latex total-pages.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \usepackage{lastpage} \pagestyle{fancy} \fancyhf{} % Show current page of total pages \fancyfoot[C]{Page \thepage\ of \pageref{LastPage}} % Alternative with different formatting % \fancyfoot[C]{\thepage\ / \pageref{LastPage}} % \fancyfoot[C]{[\thepage\ | \pageref{LastPage}]} \begin{document} \section{Introduction} This shows page X of Y format. \newpage \section{Content} More content to demonstrate numbering. \newpage \section{Conclusion} Final page shows total count. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from total-pages.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-13/page-1.svg) Open zoomable preview: Compiled PDF page 2 from total-pages.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-13/page-2.svg) Open zoomable preview: Compiled PDF page 3 from total-pages.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-13/page-3.svg)
## Conditional Page Numbering### Hide Numbers on Specific Pages```latex conditional-numbering.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \usepackage{ifthen} \pagestyle{fancy} \fancyhf{} % Conditional page numbering \fancyfoot[C]{% \ifthenelse{\value{page}=1} {} % No number on first page {\thepage} % Number on other pages } % Alternative: hide on chapter pages \fancyfoot[C]{% \ifthenelse{\boolean{@mainmatter}} {\thepage} {} % No numbers in front matter } \begin{document} \title{Document Title} \maketitle \newpage \section{Introduction} This page has a number. \newpage \section{Methods} This page also has a number. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Different Formats by Page Range```latex format-by-range.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Different formatting based on page number \fancyfoot[C]{% \ifnum\value{page}<10 Page 0\thepage % Zero-padded for pages 1-9 \else Page \thepage % Normal for pages 10+ \fi } % Alternative: different styles by range \fancyhead[C]{% \ifnum\value{page}<5 \textit{Introduction Section} \else \ifnum\value{page}<10 \textit{Main Content} \else \textit{Appendices} \fi \fi } \begin{document} \section{Introduction} Pages 1-4 show "Introduction Section" \newpage \newpage \newpage \newpage \section{Main Content} Pages 5-9 show "Main Content" \newpage \newpage \newpage \newpage \newpage \section{Appendices} Pages 10+ show "Appendices" \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from format-by-range.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-15/page-1.svg) Open zoomable preview: Compiled PDF page 2 from format-by-range.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-15/page-2.svg) Open zoomable preview: Compiled PDF page 3 from format-by-range.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-15/page-3.svg)
## Multi-Volume Documents### Volume and Page Numbering```latex multi-volume.tex theme=\{null} \documentclass{book} % Define volume number \newcounter{volume} \setcounter{volume}{1} % Include volume in page numbering \renewcommand{\thepage}{Vol.\Roman{volume}-\arabic{page}} % Alternative format % \renewcommand{\thepage}{\Roman{volume}:\arabic{page}} \begin{document} \frontmatter % Front matter pages: Vol.I-i, Vol.I-ii, etc. \mainmatter % Main content: Vol.I-1, Vol.I-2, etc. \chapter{First Chapter} Content for volume 1... % Start new volume (in practice, this would be a new document) \setcounter{volume}{2} \setcounter{page}{1} \chapter{Volume Two Content} Pages now numbered: Vol.II-1, Vol.II-2, etc. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multi-volume.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-16/page-1.svg) Open zoomable preview: Compiled PDF page 2 from multi-volume.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-16/page-2.svg) Open zoomable preview: Compiled PDF page 3 from multi-volume.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-16/page-3.svg)
## Customizing Number Appearance### Styling Page Numbers```latex styling-numbers.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \usepackage{xcolor} \pagestyle{fancy} \fancyhf{} % Styled page numbers \fancyfoot[C]{% \textcolor{blue}{\textbf{-- \thepage\ --}} } % Alternative styles % \fancyfoot[C]{\fbox{\thepage}} % Boxed % \fancyfoot[C]{\textsc{Page \thepage}} % Small caps % \fancyfoot[C]{\Large\thepage} % Large font % Decorative numbering \fancyhead[C]{% $\cdot$ \thepage\ $\cdot$ } \begin{document} \section{Styled Numbers} Demonstrates various page number styling options. \newpage \section{More Content} Consistent styling across pages. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from styling-numbers.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-17/page-1.svg) Open zoomable preview: Compiled PDF page 2 from styling-numbers.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-17/page-2.svg)
### Custom Number Commands```latex custom-commands.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} % Custom page number formatting \newcommand{\fancypagenumber}{% \textbf{[Page \thepage]} } \newcommand{\circledpagenumber}{% \textcircled{\small\thepage} } \pagestyle{fancy} \fancyhf{} % Use custom commands \fancyfoot[C]{\fancypagenumber} % Alternative: \fancyfoot[C]{\circledpagenumber} \begin{document} \section{Custom Formatting} Page numbers use custom styling commands. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-18/page-1.svg)
## Troubleshooting Page Numbering### Common Issues and Solutions```latex troubleshooting.tex theme=\{null} \documentclass{article} \usepackage{fancyhdr} \begin{document} % Issue: Page numbers not showing % Solution: Make sure page style is set \pagestyle{fancy} \fancyhf{} \fancyfoot[C]{\thepage} % Issue: Numbers in wrong position % Solution: Clear and reset headers/footers \fancyhf{} % Clear everything first \fancyfoot[C]{\thepage} % Then set what you want % Issue: Numbers not updating % Solution: Use \thepage, not literal numbers \fancyfoot[C]{\thepage} % Correct % \fancyfoot[C]{1} % Wrong - always shows 1 % Issue: Numbering resets unexpectedly % Solution: Check for \pagenumbering commands % Remove unwanted \setcounter{page}{1} commands Content to demonstrate solutions... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from troubleshooting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-19/page-1.svg)
## Best Practices> [!TIP] > > **Page numbering guidelines:** > > 1. **Be consistent** - Use the same style throughout similar sections > 2. **Consider your audience** - Academic papers often use different schemes than business documents > 3. **Plan ahead** - Design your numbering scheme before starting > 4. **Test thoroughly** - Check numbering across all document sections > 5. **Use automation** - Let LaTeX handle numbering rather than manual placement > 6. **Follow conventions** - Front matter typically uses roman numerals, main content uses arabic### Professional Examples```latex professional-example.tex theme=\{null} \documentclass[twoside]{book} \usepackage{fancyhdr} % Front matter style \fancypagestyle{frontmatter}{% \fancyhf{} \fancyfoot[C]{\roman{page}} \renewcommand{\headrulewidth}{0pt} } % Main content style \fancypagestyle{mainmatter}{% \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[LO]{\leftmark} \fancyhead[RE]{\rightmark} \renewcommand{\headrulewidth}{0.4pt} } \begin{document} % Front matter \frontmatter \pagestyle{frontmatter} \tableofcontents % Main content \mainmatter \pagestyle{mainmatter} \chapter{Introduction} Professional numbering scheme... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from professional-example.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-20/page-1.svg) Open zoomable preview: Compiled PDF page 2 from professional-example.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-20/page-2.svg) Open zoomable preview: Compiled PDF page 3 from professional-example.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-formatting-page-numbering-20/page-3.svg)
## Quick Reference### Page Numbering Commands| Command | Purpose | Example | | - | - | - | | `\pagenumbering{style}` | Set numbering style | `\pagenumbering{roman}` | | `\setcounter{page}{n}` | Set page number | `\setcounter{page}{1}` | | `\thepage` | Current page number | Use in headers/footers | | `\pageref{label}` | Reference page number | `\pageref{LastPage}` |### Numbering Styles| Style | Output | Typical Use | | - | - | - | | `arabic` | 1, 2, 3, 4... | Main content | | `roman` | i, ii, iii, iv... | Front matter | | `Roman` | I, II, III, IV... | Volume numbers | | `alph` | a, b, c, d... | Appendix sections | | `Alph` | A, B, C, D... | Appendix chapters |### Position Codes (with fancyhdr)| Code | Position | Code | Position | | - | - | - | - | | `L` | Left | `E` | Even pages | | `C` | Center | `O` | Odd pages | | `R` | Right | `LE` | Left on even |***> [!NOTE] > > **Next**: Learn about [Single-sided vs double-sided documents](/learn/latex/formatting/document-sides) for layout considerations, or explore [Headers and footers](/learn/latex/formatting/headers-footers) for complementary page design. # Writing Articles in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/articles Complete guide to writing professional articles in LaTeX. Learn document structure, formatting, citations, and best practices for academic papers. Learn how to create professional articles and papers using LaTeX. This guide covers everything from basic document structure to advanced formatting for publication-ready documents.> [!NOTE] > > **Quick start**: LaTeX Cloud Studio provides ready-to-use article templates. Click "New Project" and select "Article" to get started immediately. > > **Related topics**: [Bibliography management](/learn/latex/bibliography-citations) | [Cross-referencing](/learn/latex/cross-referencing) | [Mathematical typesetting](/learn/latex/mathematics/basics)## Basic Article Structure### Minimal Article Document```latex basic-article.tex theme=\{null} \documentclass[12pt,a4paper]{article} % Packages \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{graphicx} \usepackage{hyperref} % Document information \title{Your Article Title} \author{Your Name} \date{\today} \begin{document} \maketitle \begin{abstract} Your abstract goes here. This should be a brief summary of your article, typically 150-250 words. \end{abstract} \section{Introduction} Your introduction text here. \section{Methodology} Describe your methods. \section{Results} Present your findings. \section{Conclusion} Summarize your work. \bibliographystyle{plain} \bibliography{references} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-article.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_articles)### Document Class Options```latex document-options.tex theme=\{null} % Font sizes \documentclass[10pt]{article} % 10pt, 11pt, 12pt % Paper sizes \documentclass[a4paper]{article} % a4paper, letterpaper, legalpaper \documentclass[letterpaper]{article} % Layout options \documentclass[twocolumn]{article} % Two-column layout \documentclass[landscape]{article} % Landscape orientation \documentclass[draft]{article} % Draft mode % Multiple options \documentclass[11pt,a4paper,twocolumn,draft]{article} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Author and Title Information### Single Author```latex single-author.tex theme=\{null} \title{The Impact of Climate Change on Marine Ecosystems} \author{Jane Smith\\ Department of Marine Biology\\ University of Example\\ \texttt{j.smith@example.edu}} \date{March 2024} \maketitle ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### Multiple Authors```latex multiple-authors.tex theme=\{null} \documentclass{article} \usepackage{authblk} \title{Collaborative Research in Quantum Computing} \author[1]{Alice Johnson} \author[2]{Bob Chen} \author[1,2]{Carol Williams} \affil[1]{Department of Physics, University A} \affil[2]{Computer Science Department, University B} \date{\today} \begin{document} \maketitle % Alternative without authblk package \author{Alice Johnson$^1$, Bob Chen$^2$, and Carol Williams$^{1,2}$\\ $^1$Department of Physics, University A\\ $^2$Computer Science Department, University B\\ \texttt{\{ajohnson,cwilliams\}@unia.edu, bchen@unib.edu}} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Abstract and Keywords```latex abstract-keywords.tex theme=\{null} \documentclass{article} \usepackage{abstract} \begin{document} \title{Machine Learning Applications in Healthcare} \author{Research Team} \date{\today} \maketitle \begin{abstract} \noindent This paper presents a comprehensive review of machine learning applications in modern healthcare systems. We analyze various algorithms and their effectiveness in disease diagnosis, treatment planning, and patient outcome prediction. Our findings suggest that deep learning models achieve 95\% accuracy in early cancer detection. \end{abstract} \textbf{Keywords:} machine learning, healthcare, deep learning, medical diagnosis, artificial intelligence % Alternative abstract style \renewcommand{\abstractname}{Executive Summary} \begin{abstract} Your executive summary here... \end{abstract} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from abstract-keywords.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-05/page-1.svg)
## Sections and Structure### Section Hierarchy```latex section-hierarchy.tex theme=\{null} \documentclass{article} \setcounter{secnumdepth}{3} % Number subsubsections \setcounter{tocdepth}{3} % Include in table of contents \begin{document} \tableofcontents \newpage \section{Introduction} Main section text. \subsection{Background} Subsection text. \subsubsection{Historical Context} Subsubsection text. \paragraph{Important Note} Paragraph-level heading (usually unnumbered). \subparagraph{Detail} Subparagraph-level heading. % Unnumbered sections \section*{Acknowledgments} Thanks to... % Custom numbering \setcounter{section}{0} \renewcommand{\thesection}{\Alph{section}} \section{Appendix A} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from section-hierarchy.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-06/page-1.svg) Open zoomable preview: Compiled PDF page 2 from section-hierarchy.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-06/page-2.svg)
### Cross-References```latex cross-references.tex theme=\{null} \section{Introduction} \label{sec:intro} As we will discuss in Section~\ref{sec:methods}, our approach... \subsection{Problem Statement} \label{subsec:problem} The main equation is shown in Eq.~\eqref{eq:main}. \section{Methods} \label{sec:methods} Building on the problem stated in Section~\ref{subsec:problem}... \begin{equation} E = mc^2 \label{eq:main} \end{equation} % Using cleveref package for better references \usepackage{cleveref} \cref{sec:intro} shows... % Automatically adds "Section" \Cref{eq:main} demonstrates... % Capital version ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Figures and Tables### Figure Placement```latex article-figures.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \usepackage{float} \begin{document} \section{Results} Figure~\ref{fig:results} shows our experimental results. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{results.png} \caption{Experimental results showing the relationship between temperature and reaction rate.} \label{fig:results} \end{figure} % Two figures side by side \begin{figure}[htbp] \centering \begin{minipage}{0.45\textwidth} \centering \includegraphics[width=\textwidth]{fig1.png} \caption{First result} \label{fig:first} \end{minipage} \hfill \begin{minipage}{0.45\textwidth} \centering \includegraphics[width=\textwidth]{fig2.png} \caption{Second result} \label{fig:second} \end{minipage} \end{figure} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Professional Tables```latex article-tables.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \begin{document} \section{Data Analysis} Table~\ref{tab:results} summarizes our findings. \begin{table}[htbp] \centering \caption{Comparison of algorithm performance} \label{tab:results} \begin{tabular}{lS[table-format=2.1]S[table-format=2.1]S[table-format=1.2]} \toprule Algorithm & {Time (s)} & {Memory (MB)} & {Accuracy} \\ \midrule Method A & 12.3 & 45.6 & 0.92 \\ Method B & 8.7 & 67.8 & 0.95 \\ Method C & 15.2 & 23.4 & 0.89 \\ \midrule Baseline & 20.1 & 89.0 & 0.85 \\ \bottomrule \end{tabular} \end{table} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-09/page-1.svg)
## Citations and Bibliography### Using BibTeX```latex bibtex-citations.tex theme=\{null} \documentclass{article} \usepackage{natbib} % or biblatex \begin{document} \section{Literature Review} % Citation styles According to \citet{smith2020}, climate change affects... Recent studies \citep{jones2021,brown2022} show... As demonstrated by \citeauthor{wilson2019}... In \citeyear{taylor2023}, researchers found... % Multiple citations Several works \citep{ref1,ref2,ref3} address this issue. \bibliographystyle{apalike} % or plain, abbrv, unsrt, alpha \bibliography{references} % references.bib file \end{document} ``````bibtex references.bib theme=\{null} @article{smith2020, author = {Smith, John and Doe, Jane}, title = {Climate Change Impacts on Marine Life}, journal = {Nature Climate Change}, year = {2020}, volume = {10}, number = {3}, pages = {234--245}, doi = {10.1038/s41558-020-0734-z} } @book{jones2021, author = {Jones, Alice B.}, title = {Introduction to Environmental Science}, publisher = {Academic Press}, year = {2021}, edition = {3rd}, address = {New York} } @inproceedings{brown2022, author = {Brown, Charlie and Green, David}, title = {Machine Learning for Climate Prediction}, booktitle = {Proceedings of ICML 2022}, year = {2022}, pages = {1234--1245} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
### Using biblatex```latex biblatex-citations.tex theme=\{null} \documentclass{article} \usepackage[backend=biber,style=authoryear]{biblatex} \addbibresource{references.bib} \begin{document} % In-text citations \textcite{smith2020} found that... This was confirmed \parencite{jones2021}. \citeauthor{brown2022} argues... % Footnote citations Some claim this is true.\footcite{wilson2019} \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Mathematical Content### Equations in Articles```latex article-math.tex theme=\{null} \documentclass{article} \usepackage{amsmath,amssymb,amsthm} % Define theorem environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \begin{document} \section{Mathematical Framework} \begin{definition}[Convergence] A sequence $(x_n)$ converges to $x$ if for every $\epsilon > 0$, there exists $N \in \mathbb{N}$ such that $|x_n - x| < \epsilon$ for all $n > N$. \end{definition} \begin{theorem}[Fundamental Theorem] \label{thm:fundamental} Let $f: [a,b] \to \mathbb{R}$ be continuous. Then \begin{equation} \int_a^b f'(x)\,dx = f(b) - f(a) \end{equation} \end{theorem} \begin{proof} The proof follows from... \qed \end{proof} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-math.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-11/page-1.svg)
## Page Layout and Formatting### Custom Page Layout```latex page-layout.tex theme=\{null} \documentclass[12pt,a4paper]{article} \usepackage{geometry} % Adjust margins \geometry{ left=25mm, right=25mm, top=30mm, bottom=30mm, headheight=15pt } % Headers and footers \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Clear all headers/footers \fancyhead[L]{Article Title} \fancyhead[R]{\thepage} \fancyfoot[C]{Journal Name, Vol. X, No. Y, 2024} % Line spacing \usepackage{setspace} \onehalfspacing % or \doublespacing % Paragraph formatting \setlength{\parindent}{0pt} \setlength{\parskip}{1em} \begin{document} % Content here \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Journal-Specific Formatting```latex journal-format.tex theme=\{null} % IEEE format \documentclass[journal]{IEEEtran} % ACM format \documentclass[sigconf]{acmart} % Elsevier format \documentclass[preprint,12pt]{elsarticle} % Springer format \documentclass[smallextended]{svjour3} % Each journal class has specific requirements % Always check the journal's author guidelines ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Advanced Features### Code Listings```latex code-listings.tex theme=\{null} \documentclass{article} \usepackage{listings} \usepackage{xcolor} \lstset{ language=Python, basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green!60!black}, stringstyle=\color{red}, numbers=left, numberstyle=\tiny\color{gray}, breaklines=true, frame=single, captionpos=b } \begin{document} \section{Implementation} \begin{lstlisting}[caption={Python implementation},label={lst:python}] def calculate_mean(data): """Calculate the mean of a dataset.""" return sum(data) / len(data) # Example usage data = [1, 2, 3, 4, 5] mean = calculate_mean(data) print(f"Mean: {mean}") \end{lstlisting} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from code-listings.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-14/page-1.svg)
### Appendices```latex appendices.tex theme=\{null} \documentclass{article} \usepackage{appendix} \begin{document} \section{Introduction} Main content... \section{Results} More content... \appendix \section{Detailed Calculations} \label{app:calculations} Extended mathematical derivations... \section{Additional Data} \label{app:data} Supplementary tables and figures... % Alternative approach \begin{appendices} \section{First Appendix} Content... \section{Second Appendix} More content... \end{appendices} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from appendices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-15/page-1.svg)
## Best Practices> [!TIP] > > **Article writing guidelines:** > > 1. **Structure**: Follow the standard IMRaD format (Introduction, Methods, Results, and Discussion) > 2. **Clarity**: Write clear, concise sentences and paragraphs > 3. **Consistency**: Use consistent notation and terminology throughout > 4. **Citations**: Cite all sources properly and consistently > 5. **Figures**: Ensure all figures are high-quality and properly labeled > 6. **Proofreading**: Always compile and proofread the final PDF > 7. **Templates**: Use journal-specific templates when available## Submission Checklist> [!WARNING] > > **Before submitting your article:** > > * [ ] Check journal formatting requirements > * [ ] Verify all citations are included > * [ ] Ensure figures are high resolution (300+ DPI) > * [ ] Remove all draft/todo comments > * [ ] Check page limits and word count > * [ ] Include all required sections > * [ ] Validate references format > * [ ] Test compile on clean system## Quick Templates### Research Article Template```latex example.tex theme=\{null} \documentclass[twocolumn]{article} \usepackage[margin=1in]{geometry} \usepackage{times} \usepackage{graphicx} \usepackage{amsmath} \usepackage{cite} \title{Your Research Title} \author{Author Name\\Institution} \date{} \begin{document} \maketitle \begin{abstract} Abstract text (150-250 words) \end{abstract} \section{Introduction} \section{Related Work} \section{Methodology} \section{Results} \section{Discussion} \section{Conclusion} \bibliographystyle{plain} \bibliography{refs} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-articles-16/page-1.svg)
***> [!NOTE] > > **Next**: Learn how to create [Professional presentations](/learn/latex/how-to/presentations) using LaTeX and Beamer. # Book Publishing with LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/book-publishing Complete guide to creating professional books with LaTeX. Learn book structure, design, typography, and preparation for print and digital publishing. Master the art of book creation with LaTeX. This comprehensive guide covers everything from initial setup to final publication, including design principles, typography, indexing, and preparation for both print and digital formats.> [!NOTE] > > **Prerequisites**: Intermediate LaTeX knowledge, understanding of document classes\ > **Time to complete**: 45-50 minutes\ > **Difficulty**: Advanced\ > **What you'll learn**: Book classes, design, typography, publishing workflows, and production## Start from a book templateThe book template below is a complete 6 x 9 inch non-fiction book: title and copyright pages, dedication, contents, preface, two parts with chapters, running heads, footnotes, further reading and an about-the-author page. The preview is page 1 of the PDF compiled from its [full source](#book-template-source-code).[![Title page of the book template compiled with pdfLaTeX in a 6 by 9 inch trade format: book title, italic subtitle, author name and publisher name set in TeX Gyre Pagella.](https://mintcdn.com/hirox-6fc9e3ca/Lci0movYyju9_b2-/images/rendered/template-book/page-1.svg?fit=max\&auto=format\&n=Lci0movYyju9_b2-\&q=85\&s=edf636bc38a281817b1a0eafddb9cffd)](#book-template-source-code)BookNon-fiction books, manuals and self-published titles that need front matter, parts, chapters and print-ready trade page size.[Open in editor](https://app.latex-cloud-studio.com/start?template=book\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=book)[View source](#book-template-source-code)## Book Publishing Overview### Why LaTeX for Books?> [card] Professional Typography > > Superior typesetting and font handling> [card] Automated Layout > > Consistent formatting throughout> [card] Version Control > > Track changes and collaborate> [card] Multiple Outputs > > Print, ebook, and web formats### Types of Books> [tab] Fiction > > **Novels and stories** > > * Simple chapter structure > * Minimal front matter > * Focus on readability > * Creative typography> [tab] Non-fiction > > **Academic and technical** > > * Complex structure > * Extensive references > * Figures and tables > * Index and glossary> [tab] Textbooks > > **Educational materials** > > * Pedagogical features > * Exercises and solutions > * Multiple difficulty levels > * Supplementary materials> [tab] Reference > > **Manuals and guides** > > * Heavy cross-referencing > * Detailed index > * Quick navigation > * Consistent formatting## Book Document Classes### Standard Book Class```latex book-basic.tex theme=\{null} \documentclass[11pt, twoside, openright]{book} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1in, bindingoffset=0.5in]{geometry} \usepackage{graphicx} \usepackage{hyperref} % Book metadata \title{Your Book Title} \author{Author Name} \date{2024} \begin{document} % Front matter \frontmatter \maketitle \tableofcontents % Main matter \mainmatter \chapter{First Chapter} Content begins here... % Back matter \backmatter \chapter{Epilogue} Final thoughts... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from book-basic.tex Page 1 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-1.svg) Open zoomable preview: Compiled PDF page 2 from book-basic.tex Page 2 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-2.svg) Open zoomable preview: Compiled PDF page 3 from book-basic.tex Page 3 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-3.svg) Open zoomable preview: Compiled PDF page 4 from book-basic.tex Page 4 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-4.svg) Open zoomable preview: Compiled PDF page 5 from book-basic.tex Page 5 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-5.svg) Open zoomable preview: Compiled PDF page 6 from book-basic.tex Page 6 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-6.svg) Open zoomable preview: Compiled PDF page 7 from book-basic.tex Page 7 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-01/page-7.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_book_publishing)```latex book-structure.tex theme=\{null} \documentclass[ 11pt, % Font size twoside, % Two-sided printing openright, % Chapters start on right pages final % Final version (not draft) ]{book} % Page layout for books \usepackage[ paperwidth=6in, paperheight=9in, top=0.75in, bottom=1in, inner=1in, % Inner margin (binding side) outer=0.75in, % Outer margin bindingoffset=0.25in, headheight=14pt ]{geometry} \begin{document} \frontmatter % Roman numerals for page numbers \title{Professional Book Design} \author{Jane Doe} \maketitle \chapter*{Dedication} \thispagestyle{empty} \vspace*{\fill} \begin{center} \textit{To my family} \end{center} \vspace*{\fill} \tableofcontents \listoffigures \listoftables \chapter{Preface} This book demonstrates... \mainmatter % Arabic numerals start here \part{Foundations} \chapter{Introduction} \section{Background} The journey begins... \part{Advanced Topics} \chapter{Deep Dive} Advanced content... \appendix \chapter{Supplementary Material} Additional resources... \backmatter \bibliographystyle{plain} \bibliography{references} \printindex \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Memoir Class```latex memoir-book.tex theme=\{null} \documentclass[11pt, twoside]{memoir} % Memoir provides extensive customization \usepackage{lipsum} % Page layout \setstocksize{9in}{6in} \settrimmedsize{9in}{6in}{*} \setlrmarginsandblock{1in}{0.75in}{*} \setulmarginsandblock{0.75in}{1in}{*} \setheadfoot{14pt}{28pt} \setheaderspaces{*}{2\onelineskip}{*} \checkandfixthelayout % Chapter style \chapterstyle{bianchi} % Custom chapter style \makechapterstyle{custom}{% \renewcommand{\chapnamefont}{\normalfont\large\scshape} \renewcommand{\chapnumfont}{\normalfont\Huge} \renewcommand{\chaptitlefont}{\normalfont\Huge\bfseries} \setlength{\beforechapskip}{0pt} \setlength{\midchapskip}{20pt} \setlength{\afterchapskip}{40pt} } \begin{document} \frontmatter \title{Advanced Book with Memoir} \author{Author Name} \maketitle \begin{abstract} The memoir class provides professional book design capabilities... \end{abstract} \tableofcontents* \mainmatter \chapterstyle{custom} \chapter{Flexible Design} \epigraph{The details are not the details. They make the design.} {Charles Eames} \lipsum[1-3] \section{Typography Control} \lettrine[lines=3]{M}{emoir} provides extensive control... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex memoir-features.tex theme=\{null} \documentclass[10pt, twoside, openany]{memoir} % Advanced features \usepackage{graphicx} \usepackage{xcolor} % Define custom trim marks \showtrimson \trimLmarks % Side notes setup \setmarginnotes{7pt}{51pt}{\onelineskip} \checkandfixthelayout % Epigraph style \setlength{\epigraphwidth}{0.6\textwidth} \epigraphfontsize{\small\itshape} % Fancy breaks \renewcommand{\plainfancybreak}{% \fancybreak{* * *} } % Custom page styles \makepagestyle{custom} \makeevenhead{custom}{\thepage}{}{\leftmark} \makeoddhead{custom}{\rightmark}{}{\thepage} \makeevenfoot{custom}{}{}{} \makeoddfoot{custom}{}{}{} \makeheadrule{custom}{\textwidth}{\normalrulethickness} \pagestyle{custom} \begin{document} \chapter{Advanced Features} Main text with a margin note.\marginpar{This appears in the margin} \section{Special Breaks} First section of text... \plainfancybreak Second section after decorative break... \section{Epigraphs} \epigraph{Books are a uniquely portable magic.}{Stephen King} Regular text continues here... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from memoir-features.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-04/page-1.svg)
### KOMA-Script Book```latex scrbook-example.tex theme=\{null} \documentclass[ 11pt, twoside=true, open=right, chapterprefix=true, numbers=endperiod, bibliography=totoc, listof=totoc, index=totoc ]{scrbook} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{scrlayer-scrpage} % KOMA options \KOMAoptions{ paper=6in:9in, DIV=12, % Type area calculation BCOR=0.5in, % Binding correction fontsize=11pt, parskip=half } % Headers and footers \pagestyle{scrheadings} \automark[chapter]{chapter} % Chapter formatting \RedeclareSectionCommand[ beforeskip=0pt, afterskip=2\baselineskip, font=\Huge\bfseries ]{chapter} \begin{document} \frontmatter \title{Professional Book} \subtitle{Using KOMA-Script} \author{Your Name} \publishers{Publisher Name} \date{\today} \maketitle \tableofcontents \mainmatter \chapter{Modern Book Design} KOMA-Script provides modern European book design... \minisec{Unnumbered subsection} Special formatting options... \dictum[Oscar Wilde]{We are all in the gutter, but some of us are looking at the stars.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from scrbook-example.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-05/page-1.svg) Open zoomable preview: Compiled PDF page 2 from scrbook-example.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-05/page-2.svg) Open zoomable preview: Compiled PDF page 3 from scrbook-example.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-05/page-3.svg) Open zoomable preview: Compiled PDF page 4 from scrbook-example.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-05/page-4.svg) Open zoomable preview: Compiled PDF page 5 from scrbook-example.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-05/page-5.svg)
## Book Design Principles### Typography```latex book-typography.tex theme=\{null} \documentclass{book} \usepackage{fontspec} % XeLaTeX/LuaLaTeX % Professional book fonts \setmainfont[ Ligatures=TeX, Numbers=OldStyle, Scale=1.0 ]{Minion Pro} \setsansfont[ Scale=MatchLowercase, Numbers=Lining ]{Myriad Pro} \setmonofont[ Scale=MatchLowercase ]{Source Code Pro} % Microtypography \usepackage[ activate={true,nocompatibility}, final, tracking=true, kerning=true, spacing=true, factor=1100, stretch=10, shrink=10 ]{microtype} % Leading (line spacing) \usepackage{setspace} \setstretch{1.15} % Paragraph settings \setlength{\parindent}{1em} \setlength{\parskip}{0pt plus 1pt} \emergencystretch=3em % Prevent overfull boxes % Widow and orphan control \widowpenalty=10000 \clubpenalty=10000 \raggedbottom \begin{document} \chapter{Professional Typography} \lettrine[lines=3, loversize=0.1]{T}{ypography} is the art and technique of arranging type to make written language legible, readable, and appealing when displayed. The arrangement of type involves selecting typefaces, point sizes, line lengths, line-spacing (leading), and letter-spacing (tracking). \section{Type Hierarchy} {\Large\bfseries Display Text for Impact} {\large\itshape Subheadings in Italic} Regular body text maintains readability with appropriate leading and measure. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
```latex font-combinations.tex theme=\{null} \documentclass{book} \usepackage{fontspec} % Classic combination: Garamond + Helvetica \setmainfont{EB Garamond} \setsansfont{TeX Gyre Heros} % Helvetica clone % Alternative: Palatino + Optima % \setmainfont{TeX Gyre Pagella} % \setsansfont{Optima} % Modern: Charter + Fira Sans % \setmainfont{XCharter} % \setsansfont{Fira Sans} % Define font sizes \newfontfamily\displayfont[Scale=1.5]{EB Garamond} \newfontfamily\chapterfont[Scale=1.2]{TeX Gyre Heros} % Chapter number style \usepackage{lettrine} \renewcommand{\LettrineFontHook}{\displayfont} \begin{document} \chapter{Font Harmony} \lettrine[lines=4]{F}{ont selection} significantly impacts the reading experience. Serif fonts like Garamond provide excellent readability for body text, while sans-serif fonts like Helvetica work well for headings and captions. \begin{figure}[h] \centering \fbox{Placeholder} \caption{\sffamily This caption uses the sans-serif font for distinction.} \end{figure} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-combinations.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-07/page-1.svg)
### Page Layout```latex page-design.tex theme=\{null} \documentclass[11pt]{book} \usepackage[ paperwidth=6in, paperheight=9in, top=72pt, bottom=90pt, inner=72pt, outer=54pt, headsep=24pt, footskip=36pt, marginparwidth=36pt, marginparsep=18pt ]{geometry} \usepackage{fancyhdr} \usepackage{eso-pic} \usepackage{xcolor} % Running headers and footers \pagestyle{fancy} \fancyhf{} \fancyhead[LE]{\thepage\quad\textsc{\nouppercase{\leftmark}}} \fancyhead[RO]{\textsc{\nouppercase{\rightmark}}\quad\thepage} \renewcommand{\headrulewidth}{0pt} % Chapter opener style \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\huge\bfseries} {\chaptertitlename\ \thechapter} {20pt} {\Huge} \titlespacing*{\chapter}{0pt}{50pt}{40pt} % Drop caps \usepackage{lettrine} \setlength{\DefaultNindent}{0em} \renewcommand{\LettrineFontHook}{\bfseries} \begin{document} \chapter{Page Architecture} \lettrine[lines=3]{T}{he page} is the fundamental unit of book design. Classical proportions, derived from centuries of bookmaking tradition, create harmonious layouts that enhance readability. \section{The Golden Rectangle} The ratio 1:1.618, known as the golden ratio, has been used in book design since the Renaissance... \newpage \section{Margins and White Space} Generous margins serve multiple purposes: they provide space for the reader's thumbs, create visual breathing room, and establish a refined appearance... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from page-design.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-08/page-1.svg) Open zoomable preview: Compiled PDF page 2 from page-design.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-08/page-2.svg)
```latex grid-system.tex theme=\{null} \documentclass{book} \usepackage{tikz} \usepackage[ paperwidth=6in, paperheight=9in, layoutwidth=6in, layoutheight=9in, layouthoffset=0pt, layoutvoffset=0pt, showcrop, showframe ]{geometry} % Define modular grid \newcommand{\showgrid}{% \begin{tikzpicture}[remember picture, overlay] % Vertical grid lines \foreach \x in {0,0.5,...,6} { \draw[red!20, very thin] (current page.south west) ++(\x in,0) -- (current page.north west) ++(\x in,0); } % Horizontal grid lines \foreach \y in {0,0.5,...,9} { \draw[red!20, very thin] (current page.south west) ++(0,\y in) -- (current page.south east) ++(0,\y in); } % Major grid lines \foreach \x in {0,1,...,6} { \draw[red!40, thin] (current page.south west) ++(\x in,0) -- (current page.north west) ++(\x in,0); } \foreach \y in {0,1,...,9} { \draw[red!40, thin] (current page.south west) ++(0,\y in) -- (current page.south east) ++(0,\y in); } \end{tikzpicture} } \begin{document} % Show grid on this page \showgrid \chapter{Grid-Based Design} Using a modular grid ensures consistent placement of elements throughout the book. This page shows the underlying grid structure. \vspace{2\baselineskip} Elements align to the grid for visual harmony and professional appearance. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from grid-system.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-09/page-1.svg) Open zoomable preview: Compiled PDF page 2 from grid-system.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-09/page-2.svg) Open zoomable preview: Compiled PDF page 3 from grid-system.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-09/page-3.svg)
## Front and Back Matter### Front Matter Components```latex front-matter.tex theme=\{null} \documentclass{book} \usepackage{graphicx} \usepackage{afterpage} \begin{document} \frontmatter % Half title page \thispagestyle{empty} \vspace*{\fill} \begin{center} {\LARGE Your Book Title} \end{center} \vspace*{\fill} \newpage % Blank verso \thispagestyle{empty} \null\newpage % Full title page \thispagestyle{empty} \begin{center} \vspace*{2in} {\Huge\bfseries Your Book Title}\\[1em] {\Large\itshape A Comprehensive Guide}\\[3em] {\Large Author Name}\\[1em] \vfill \includegraphics[width=2in]{publisher-logo}\\[1em] {\large Publisher Name}\\ {\large 2024} \end{center} \newpage % Copyright page \thispagestyle{empty} \vspace*{\fill} \noindent Copyright \copyright\ 2024 by Author Name\\[1em] All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher.\\[1em] ISBN: 978-0-000-00000-0\\[1em] First Edition\\[1em] Printed in the United States of America\\[1em] 10 9 8 7 6 5 4 3 2 1 \newpage % Dedication \thispagestyle{empty} \vspace*{\fill} \begin{center} \textit{For those who dare to dream} \end{center} \vspace*{\fill} \newpage % Epigraph \thispagestyle{empty} \vspace*{\fill} \begin{flushright} \textit{``The only way to do great work\\ is to love what you do.''}\\[1em] ---Steve Jobs \end{flushright} \vspace*{\fill} \newpage % Table of contents \tableofcontents % Foreword \chapter{Foreword} Written by a distinguished colleague... % Preface \chapter{Preface} This book arose from... % Acknowledgments \chapter*{Acknowledgments} \addcontentsline{toc}{chapter}{Acknowledgments} I would like to thank... \mainmatter % Main content begins \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex back-matter.tex theme=\{null} \documentclass{book} \usepackage{makeidx} \usepackage[totoc]{idxlayout} \usepackage{glossaries} \makeindex \makeglossaries \begin{document} \mainmatter % ... main content ... \backmatter % Epilogue \chapter{Epilogue} Final thoughts and reflections... % Appendices \appendix \chapter{Resources} \section{Further Reading} \begin{itemize} \item Essential books on the topic \item Online resources \item Professional organizations \end{itemize} \section{Tools and Software} Recommended tools for practitioners... % Glossary \printglossary[title=Glossary, toctitle=Glossary] % Bibliography \bibliographystyle{plain} \bibliography{references} \addcontentsline{toc}{chapter}{Bibliography} % Index \printindex % About the Author \chapter*{About the Author} \addcontentsline{toc}{chapter}{About the Author} \begin{minipage}{0.3\textwidth} \includegraphics[width=\textwidth]{author-photo} \end{minipage} \hfill \begin{minipage}{0.65\textwidth} \textbf{Author Name} is a distinguished professor... \end{minipage} % Colophon \clearpage \thispagestyle{empty} \vspace*{\fill} \begin{center} \textsc{Colophon}\\[2em] This book was typeset using \LaTeX{} with the Book document class.\\ The main text is set in Minion Pro at 11/15pt.\\ Chapter headings use Myriad Pro.\\[1em] Designed and typeset by Author Name\\ First printing, January 2024 \end{center} \vspace*{\fill} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Advanced Features### Indexing```latex book-indexing.tex theme=\{null} \documentclass{book} \usepackage{makeidx} \usepackage[columns=2]{idxlayout} \makeindex % Custom index commands \newcommand{\boldindex}[1]{\textbf{#1}\index{#1|textbf}} \newcommand{\conceptindex}[2]{#1\index{#2}} \newcommand{\subindex}[2]{#1\index{#1!#2}} \begin{document} \chapter{Content with Index Entries} The \boldindex{index} is a crucial component of any reference book. It allows readers to quickly find specific topics\index{topics!finding}. \section{Creating Entries} Basic index entries\index{index entries!basic} are created with the \verb|\index| command. You can create \subindex{subentries}{nested} and \conceptindex{cross-references}{cross-references|see{references}}. Range of pages\index{page ranges|(} can span multiple pages. Content continues here with more details about the topic. This concludes the discussion\index{page ranges|)}. Special formatting\index{formatting!bold|textbf} can be applied to page numbers\index{page numbers!italic|textit}. \printindex \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from book-indexing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-12/page-1.svg)
```latex advanced-indexing.tex theme=\{null} \documentclass{book} \usepackage{imakeidx} % Multiple indexes \makeindex[name=general, title=General Index] \makeindex[name=authors, title=Author Index] \makeindex[name=subjects, title=Subject Index] % Custom commands for different indexes \newcommand{\authorindex}[1]{#1\index[authors]{#1}} \newcommand{\subjectindex}[1]{#1\index[subjects]{#1}} \begin{document} \chapter{Scholarly Work} According to \authorindex{Smith (2020)}, the theory proposed by \authorindex{Jones (2019)} has significant implications for \subjectindex{quantum mechanics}. The \subjectindex{classical interpretation} differs from the \subjectindex{modern approach} in several key aspects. \backmatter \printindex[general] \printindex[authors] \printindex[subjects] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from advanced-indexing.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-13/page-1.svg) Open zoomable preview: Compiled PDF page 2 from advanced-indexing.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-13/page-2.svg)
### Cross-referencing```latex cross-references.tex theme=\{null} \documentclass{book} \usepackage{hyperref} \usepackage{cleveref} \usepackage{varioref} % Configure cleveref \crefname{chapter}{Chapter}{Chapters} \crefname{section}{Section}{Sections} \crefname{figure}{Figure}{Figures} \crefname{table}{Table}{Tables} \crefname{equation}{Equation}{Equations} \begin{document} \chapter{Introduction} \label{ch:intro} This chapter introduces key concepts that will be explored throughout the book. \Cref{ch:methodology} presents our methodology, while \cref{ch:results} discusses the findings. \section{Background} \label{sec:background} As shown in \vref{fig:example}, the relationship is clear. The data in \cref{tab:summary} on \cpageref{tab:summary} supports this conclusion. \begin{figure}[htbp] \centering \fbox{Placeholder} \caption{Example figure} \label{fig:example} \end{figure} \chapter{Methodology} \label{ch:methodology} Building on \cref{sec:background}, we develop... \begin{table}[htbp] \centering \begin{tabular}{ll} \hline Method & Result \\ \hline A & Good \\ B & Better \\ \hline \end{tabular} \caption{Summary of results} \label{tab:summary} \end{table} \chapter{Results} \label{ch:results} The methodology from \vref{ch:methodology} yielded... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Publishing Workflows### Print Preparation```latex print-ready.tex theme=\{null} \documentclass[11pt]{book} % Print specifications \usepackage[ paperwidth=6in, paperheight=9in, inner=0.875in, outer=0.75in, top=0.75in, bottom=0.875in, bindingoffset=0.125in ]{geometry} % Crop marks for printer \usepackage[ cam, center, width=6.25in, height=9.25in ]{crop} % Color management \usepackage[cmyk]{xcolor} % Ensure black text \usepackage{fixcmyk} % High-quality output \pdfcompresslevel=0 \pdfminorversion=7 \pdfobjcompresslevel=0 % Embed all fonts \pdfinclusionerrorlevel=1 % Resolution settings \pdfimageresolution=300 \pdfpkresolution=600 \begin{document} \chapter{Print-Ready Content} This document is prepared for professional printing with: \begin{itemize} \item Proper bleeds and margins \item CMYK color space \item Embedded fonts \item High-resolution settings \end{itemize} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex preflight-check.tex theme=\{null} % Preflight checklist for print % 1. PDF/X compliance \usepackage[x-1a]{pdfx} % 2. Color profiles \immediate\pdfobj stream attr{/N 4} file{ISOcoated_v2_300_eci.icc} \pdfcatalog{/OutputIntents [<< /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier (ISO Coated v2 300\% \(ECI\)) /DestOutputProfile \the\pdflastobj\space 0 R >>]} % 3. Bleed settings \usepackage[ paperwidth=6in, paperheight=9in, layoutwidth=6.25in, layoutheight=9.25in, layouthoffset=0.125in, layoutvoffset=0.125in, showcrop ]{geometry} % 4. Font embedding verification \pdfmapfile{=pdftex.map} % 5. Image resolution check \newcommand{\checkimage}[1]{% \immediate\pdfximage{#1}% \edef\imagewidth{\the\pdfximagexres}% \ifnum\imagewidth<300 \PackageWarning{Image}{Low resolution image: #1}% \fi% } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Digital Formats```latex ebook-version.tex theme=\{null} \documentclass[oneside, 11pt]{book} % Ebook-friendly settings \usepackage[ paperwidth=6in, paperheight=9in, margin=0.5in, includehead, includefoot ]{geometry} % No page numbers for ebooks \pagestyle{empty} % Hyperlinks for navigation \usepackage[ colorlinks=true, linkcolor=blue, urlcolor=blue, pdfauthor={Author Name}, pdftitle={Book Title}, pdfsubject={Subject}, pdfkeywords={keywords} ]{hyperref} % Responsive images \usepackage{graphicx} \setkeys{Gin}{width=\linewidth, height=\textheight, keepaspectratio} % Flowable text \raggedbottom \usepackage{ragged2e} \setlength{\RaggedRightParindent}{1em} \begin{document} \chapter{Ebook-Optimized Content} This version is optimized for digital readers with: \begin{itemize} \item Reflowable text \item Clickable navigation \item Responsive images \item No fixed page breaks \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from ebook-version.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-book-publishing-17/page-1.svg)
```latex multiple-outputs.tex theme=\{null} % Conditional compilation for different formats \usepackage{ifthen} \newboolean{printversion} \newboolean{ebookversion} \newboolean{webversion} % Set target format \setboolean{printversion}{true} % \setboolean{ebookversion}{true} % \setboolean{webversion}{true} % Format-specific settings \ifthenelse{\boolean{printversion}}{ % Print settings \usepackage[twoside]{geometry} \usepackage[cmyk]{xcolor} \hypersetup{hidelinks} }{ \ifthenelse{\boolean{ebookversion}}{ % Ebook settings \usepackage[oneside]{geometry} \usepackage[rgb]{xcolor} \hypersetup{colorlinks=true} \pagestyle{empty} }{ % Web settings \usepackage[margin=1in]{geometry} \usepackage{lmodern} \hypersetup{colorlinks=true, linkcolor=blue} }} % Content variations \newcommand{\printonly}[1]{% \ifthenelse{\boolean{printversion}}{#1}{}% } \newcommand{\digitalonly}[1]{% \ifthenelse{\boolean{printversion}}{}{#1}% } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Production Checklist### Pre-production> [!TIP] > > ✅ **Book production checklist**: > > * [ ] Finalize manuscript content > * [ ] Professional editing completed > * [ ] Choose trim size and format > * [ ] Select appropriate fonts > * [ ] Design page layout and grid > * [ ] Create style specifications > * [ ] Set up document structure > * [ ] Configure output settings > * [ ] Test sample chapters > * [ ] Review with stakeholders### Quality Assurance> [!WARNING] > > **Common book production issues**: > > 1. **Inconsistent formatting** - Use styles consistently > 2. **Poor image quality** - Minimum 300 DPI for print > 3. **Missing fonts** - Embed all fonts > 4. **Bad breaks** - Check page and line breaks > 5. **Orphans/widows** - Adjust text flow > 6. **Color problems** - Use correct color space > 7. **Binding issues** - Account for gutter## Book template source codeThis is the complete source of the book template in the gallery above. It uses the standard `book` class with `\frontmatter`, `\mainmatter` and `\backmatter`, `geometry` for the 6 x 9 inch page and `fancyhdr` for running heads. Edit the book details block, then replace the sample chapters with your own.```latex book.tex theme=\{null} % Book Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Non-fiction book in a 6 x 9 inch trade format: title and copyright % pages, dedication, contents, preface, parts and chapters, footnotes, % further reading and an about-the-author page. % Compile with pdfLaTeX. \documentclass[11pt,openright]{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tgpagella} \usepackage{microtype} \usepackage[ paperwidth=6in, paperheight=9in, inner=0.85in, outer=0.65in, top=0.8in, bottom=0.85in ]{geometry} \usepackage{fancyhdr} \usepackage[hidelinks]{hyperref} % ============================================ % BOOK DETAILS - edit these % ============================================ \newcommand{\booktitle}{The Patient Garden} \newcommand{\booksubtitle}{Growing Food in Small Spaces Through the Seasons} \newcommand{\bookauthor}{Author Name} \newcommand{\bookpublisher}{Publisher Name} \newcommand{\bookyear}{2026} \hypersetup{pdftitle={\booktitle}, pdfauthor={\bookauthor}} % Running heads: chapter title on even pages, section title on odd pages \pagestyle{fancy} \fancyhf{} \fancyhead[LE]{\small\thepage\quad\textsc{\leftmark}} \fancyhead[RO]{\small\textsc{\rightmark}\quad\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{#1}} \fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\small\thepage}} % A short quotation under a chapter heading \newcommand{\chapterquote}[2]{% \begin{flushright}\small\itshape #1\par\normalfont--- #2\end{flushright}% \vspace{1.5em}} \begin{document} % ============================================ % FRONT MATTER % ============================================ \frontmatter % Title page \thispagestyle{empty} \vspace*{0.18\textheight} \begin{center} {\Huge\bfseries \booktitle\par} \vspace{1em} {\large\itshape \booksubtitle\par} \vspace{3em} {\Large \bookauthor\par} \vfill {\small\scshape \bookpublisher\par} \end{center} \clearpage % Copyright page \thispagestyle{empty} \vspace*{\fill} \begin{flushleft}\small Copyright \copyright\ \bookyear\ \bookauthor. All rights reserved.\par \medskip No part of this book may be reproduced in any form without written permission from the publisher, except for brief quotations in reviews.\par \medskip Published by \bookpublisher\par ISBN 000-0-00-000000-0 (paperback)\par \medskip First edition, \bookyear\par Typeset in TeX Gyre Pagella with \LaTeX. \end{flushleft} \cleardoublepage % Dedication \thispagestyle{empty} \vspace*{0.3\textheight} \begin{center} \itshape For everyone who has grown a tomato on a windowsill. \end{center} \cleardoublepage \tableofcontents \chapter{Preface} This book grew out of six years of notes kept on a fourth-floor balcony that receives direct sun for five hours on a good summer day. It is written for readers with a balcony, a yard the size of a parking space, or a single bright window, who want to grow some of what they eat. The chapters follow the gardening year. Part~I covers what to decide before anything is planted: light, containers and soil. Part~II moves through the seasons, from the first spring sowing to the last autumn harvest. Each chapter ends with a short list of tasks, so you can open the book at the current month and start working. Measurements are given in both metric and imperial units. Plant names use the common name first and the botanical name at first mention. \bigskip \noindent\bookauthor\\ \textit{Spring \bookyear} % ============================================ % MAIN MATTER % ============================================ \mainmatter \part{Before You Plant} \chapter{Reading the Light} \chapterquote{Every plant is a record of the light it was given.}{A gardener's notebook} Light decides more about a small garden than any other factor. Before buying a single seed, spend one sunny day noting when direct sun reaches each part of the space and when it leaves. \section{Measuring Hours of Sun} Check the space every hour from early morning to evening and sketch where the shadows fall. Fruiting crops such as tomatoes, peppers and beans need at least six hours of direct sun. Leafy greens and herbs manage with four.\footnote{% These figures assume a temperate summer. In hot climates, afternoon shade helps leafy crops more than it harms them.} \section{Reflected Light} A pale wall can add a surprising amount of light to a shaded corner. Painting a fence white or placing a light-coloured board behind a container is an inexpensive way to extend the range of crops a space can support. \section{Tasks for This Chapter} \begin{itemize} \item Map the sun in your space on a clear day. \item Mark the areas with six or more hours of direct sun. \item Note any walls or surfaces that reflect light. \end{itemize} \chapter{Containers and Soil} \chapterquote{Feed the soil, not the plant.}{Traditional saying} A container garden is only as good as what the roots grow in. Garden soil compacts in pots and drains poorly, so containers need a lighter mix. \section{Choosing Containers} Depth matters more than width for most vegetables. Tomatoes and squash need at least 30~cm (12~in) of soil; lettuce and radishes manage with 15~cm (6~in). Every container needs drainage holes, whatever material it is made of. \section{A Simple Potting Mix} Combine equal parts of peat-free compost, coir and fine bark, and add a handful of slow-release organic fertiliser for each 10~litres of mix. Replace a third of the mix each spring and top up the rest with fresh compost. \section{Tasks for This Chapter} \begin{itemize} \item Choose containers to match the crops you plan to grow. \item Check that every container drains freely. \item Prepare enough potting mix for the first sowings. \end{itemize} \part{Through the Seasons} \chapter{Spring Sowing} \chapterquote{Sow a little, and sow it often.}{A gardener's notebook} Spring is the busiest season in a small garden. Sow in small batches every two weeks rather than all at once, so that harvests arrive steadily instead of in a single glut. \section{Starting Seeds Indoors} Tomatoes, peppers and basil need warmth to germinate. Sow them on a bright windowsill six to eight weeks before the last expected frost, and move them outside only once night temperatures stay above 10\,\textdegree C (50\,\textdegree F). \section{Sowing Directly Outdoors} Radishes, lettuce, peas and spinach tolerate cool weather and can be sown outside as soon as the soil can be worked. Keep the surface moist until the seedlings appear. \section{Tasks for This Chapter} \begin{itemize} \item Start warm-season crops indoors. \item Sow the first batch of cool-season crops outside. \item Plan follow-on sowings every two weeks. \end{itemize} % ============================================ % BACK MATTER % ============================================ \backmatter \renewcommand{\bibname}{Further Reading} \begin{thebibliography}{9} \bibitem{soil} A. Author, \emph{Soil for Small Spaces}. Example Press, 2021. \bibitem{seasons} B. Author and C. Author, \emph{The Container Year}, 2nd ed. Example Publishing, 2024. \end{thebibliography} \chapter{About the Author} \bookauthor\ has grown vegetables on balconies and rooftops for more than a decade and teaches community workshops on small-space gardening. Replace this paragraph with a short biography. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from book.tex Page 1 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-1.svg) Open zoomable preview: Compiled PDF page 2 from book.tex Page 2 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-2.svg) Open zoomable preview: Compiled PDF page 3 from book.tex Page 3 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-3.svg) Open zoomable preview: Compiled PDF page 4 from book.tex Page 4 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-4.svg) Open zoomable preview: Compiled PDF page 5 from book.tex Page 5 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-5.svg) Open zoomable preview: Compiled PDF page 6 from book.tex Page 6 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-6.svg) Open zoomable preview: Compiled PDF page 7 from book.tex Page 7 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-7.svg) Open zoomable preview: Compiled PDF page 8 from book.tex Page 8 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-8.svg) Open zoomable preview: Compiled PDF page 9 from book.tex Page 9 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-9.svg) Open zoomable preview: Compiled PDF page 10 from book.tex Page 10 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-10.svg) Open zoomable preview: Compiled PDF page 11 from book.tex Page 11 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-11.svg) Open zoomable preview: Compiled PDF page 12 from book.tex Page 12 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-12.svg) Open zoomable preview: Compiled PDF page 13 from book.tex Page 13 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-13.svg) Open zoomable preview: Compiled PDF page 14 from book.tex Page 14 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-14.svg) Open zoomable preview: Compiled PDF page 15 from book.tex Page 15 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-15.svg) Open zoomable preview: Compiled PDF page 16 from book.tex Page 16 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-16.svg) Open zoomable preview: Compiled PDF page 17 from book.tex Page 17 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-17.svg) Open zoomable preview: Compiled PDF page 18 from book.tex Page 18 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-18.svg) Open zoomable preview: Compiled PDF page 19 from book.tex Page 19 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-19.svg) Open zoomable preview: Compiled PDF page 20 from book.tex Page 20 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-20.svg) Open zoomable preview: Compiled PDF page 21 from book.tex Page 21 of 21. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-book/page-21.svg)
## Complete Book Example```latex complete-book.tex theme=\{null} \documentclass[11pt, twoside, openright]{book} % Packages \usepackage{fontspec} % XeLaTeX \usepackage[ paperwidth=6in, paperheight=9in, top=0.75in, bottom=1in, inner=1in, outer=0.75in, bindingoffset=0.25in, footskip=0.5in ]{geometry} \usepackage{graphicx} \usepackage{xcolor} \usepackage{lettrine} \usepackage{fancyhdr} \usepackage{titlesec} \usepackage{tocloft} \usepackage{hyperref} \usepackage{microtype} \usepackage{imakeidx} \usepackage[style=authoryear]{biblatex} % Fonts \setmainfont[ Ligatures=TeX, Numbers=OldStyle ]{Minion Pro} \setsansfont[Scale=MatchLowercase]{Myriad Pro} \setmonofont[Scale=MatchLowercase]{Source Code Pro} % Index \makeindex[intoc] % Bibliography \addbibresource{references.bib} % Page styles \pagestyle{fancy} \fancyhf{} \fancyhead[LE]{\thepage\quad\small\textsc{\leftmark}} \fancyhead[RO]{\small\textsc{\rightmark}\quad\thepage} \renewcommand{\headrulewidth}{0pt} % Chapter style \titleformat{\chapter}[display] {\normalfont\huge\sffamily} {\chaptertitlename\ \thechapter} {20pt} {\Huge\bfseries} \titlespacing*{\chapter}{0pt}{30pt}{40pt} % Section styles \titleformat{\section} {\normalfont\Large\bfseries} {\thesection} {1em} {} \titleformat{\subsection} {\normalfont\large\bfseries} {\thesubsection} {1em} {} % TOC styling \renewcommand{\cfttoctitlefont}{\Large\bfseries\sffamily} \renewcommand{\cftchapfont}{\bfseries} \renewcommand{\cftchappagefont}{\bfseries} \setlength{\cftbeforechapskip}{0.5em} % Document info \title{The Art of Book Design} \author{Master Typographer} \date{2024} \begin{document} % Front matter \frontmatter \pagestyle{empty} % Half title \vspace*{\fill} \begin{center} {\Large The Art of Book Design} \end{center} \vspace*{\fill} \clearpage % Title page \begin{titlepage} \vspace*{2in} \begin{center} {\Huge\bfseries The Art of\\[0.5em] Book Design}\\[2em] {\Large\itshape A Comprehensive Guide to\\Professional Typography}\\[4em] {\Large Master Typographer}\\[4em] \vfill {\large Publisher Name}\\ {\large 2024} \end{center} \end{titlepage} % Copyright \vspace*{\fill} \noindent Copyright \copyright\ 2024 by Master Typographer\\[0.5em] All rights reserved.\\[0.5em] ISBN: 978-0-123-45678-9\\[0.5em] First Edition \clearpage % Dedication \vspace*{\fill} \begin{center} \textit{For all who appreciate\\the beauty of the printed word} \end{center} \vspace*{\fill} \clearpage % Table of contents \pagestyle{plain} \tableofcontents \clearpage % Preface \chapter{Preface} \pagestyle{fancy} This book represents a journey through the art and craft of book design, exploring the principles that have guided typographers for centuries while embracing modern digital tools. \mainmatter % Part One \part{Foundations} \chapter{The History of Book Design} \lettrine[lines=3]{T}{he history} of book design stretches back over five centuries, from Gutenberg's revolutionary printing press to today's digital publishing platforms. Throughout this evolution, certain principles have remained constant: the pursuit of readability, beauty, and effective communication. \section{The Incunabula Period} \index{incunabula} The earliest printed books, known as incunabula\index{incunabula|textbf}, sought to replicate the appearance of manuscripts... \section{Renaissance Innovation} \index{Renaissance} During the Renaissance\index{Renaissance!printing}, printers like Aldus Manutius\index{Manutius, Aldus} revolutionized book design... \chapter{Typography Fundamentals} \lettrine[lines=3]{T}{ypography} forms the foundation of book design. Understanding type anatomy\index{type anatomy}, classification \index{type classification}, and usage enables designers to make informed decisions that enhance both aesthetics and readability. \section{Type Anatomy} The structure of letterforms\index{letterforms} includes several key components: \begin{itemize} \item \textbf{Ascenders}\index{ascenders}: Strokes extending above the x-height \item \textbf{Descenders}\index{descenders}: Strokes extending below the baseline \item \textbf{X-height}\index{x-height}: The height of lowercase letters \item \textbf{Serifs}\index{serifs}: Terminal strokes on letters \end{itemize} \part{Practice} \chapter{Modern Book Production} \lettrine[lines=3]{M}{odern} book production combines traditional craftsmanship with digital precision... \backmatter % Bibliography \printbibliography[heading=bibintoc] % Index \printindex % Colophon \clearpage \thispagestyle{empty} \vspace*{\fill} \begin{center} \rule{2in}{0.5pt}\\[1em] {\small\textsc{Colophon}}\\[1em] {\footnotesize This book was designed and typeset by the author\\ using \XeLaTeX\ and the book document class.\\[0.5em] The text is set in Minion Pro,\\ designed by Robert Slimbach.\\ Display type is set in Myriad Pro,\\ designed by Slimbach and Carol Twombly.\\[0.5em] Typeset in 2024} \end{center} \vspace*{\fill} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Next StepsExplore related topics:> [card] Large Documents > > Managing book projects[Open](/learn/latex/how-to/large-documents)> [card] Typography > > Advanced typography techniques[Open](/learn/latex/fonts)> [card] Templates > > Book templates and themes[Open](/learn/latex/how-to/using-templates)> [card] Multi-language > > Multilingual books[Open](/learn/latex/how-to/multi-language-documents)***> [!NOTE] > > **Pro tip**: Start with a clear vision of your book's purpose and audience. Design decisions should support readability and enhance the reader's experience. Test your design with sample chapters before committing to the full manuscript. Consider hiring a professional book designer for commercial publications. # Collaboration Workflow for LaTeX Projects Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/collaboration-workflow Master team collaboration in LaTeX. Learn version control, cloud platforms, change tracking, commenting systems, and best practices for multi-author documents. Learn professional collaboration techniques for LaTeX projects. This guide covers version control integration, real-time collaboration platforms, change tracking, review workflows, and team coordination strategies.> [!NOTE] > > **Prerequisites**: Basic LaTeX and Git knowledge\ > **Time to complete**: 30-35 minutes\ > **Difficulty**: Intermediate to Advanced\ > **What you'll learn**: Git workflows, cloud collaboration, change tracking, review processes, and team coordination## Collaboration Overview### Collaboration Methods> [card] Version Control > > Git-based workflows for technical teams> [card] Cloud Platforms > > Real-time editing with LaTeX Cloud Studio> [card] Change Tracking > > Built-in LaTeX revision tools> [card] Review Systems > > Comments and annotations for feedback### Choosing the Right Approach> [tab] Technical Teams > > **Best for**: Developers, researchers, technical writers > > * Git/GitHub workflow > * Pull request reviews > * CI/CD automation > * Maximum control> [tab] Academic Teams > > **Best for**: Professors, students, researchers > > * Cloud platforms > * Real-time collaboration > * Built-in commenting > * Easy onboarding> [tab] Mixed Teams > > **Best for**: Cross-functional teams > > * Hybrid approach > * Cloud editing + Git backup > * Multiple review channels > * Flexible workflows## Git-Based Collaboration### Repository Structure```bash project-structure.sh theme=\{null} # Initialize collaborative LaTeX project git init latex-project cd latex-project # Create standard structure mkdir -p {chapters,figures,styles,build} touch .gitignore README.md CONTRIBUTING.md # .gitignore for LaTeX cat > .gitignore << 'EOF' # LaTeX temporary files *.aux *.lof *.log *.lot *.fls *.out *.toc *.fmt *.fot *.cb *.cb2 .*.lb # Bibliography *.bbl *.bcf *.blg *-blx.aux *-blx.bib *.run.xml # Build artifacts build/ *.pdf !figures/*.pdf !templates/*.pdf # Editors .vscode/ *.swp *~ .DS_Store # LaTeX editors *.synctex.gz *.synctex.gz(busy) *.pdfsync EOF # Initial commit git add . git commit -m "Initial project structure" ``````markdown README.md theme=\{null} # Collaborative LaTeX Project ## Project Structure ```. ├── main.tex # Main document ├── chapters/ # Chapter files │ ├── ch1-intro.tex │ ├── ch2-methods.tex │ └── ch3-results.tex ├── figures/ # Images and diagrams ├── styles/ # Custom styles │ └── project.sty ├── references.bib # Bibliography └── Makefile # Build automation``` ## Collaboration Guidelines ### Branch Strategy - `main` - Stable, reviewed content - `develop` - Integration branch - `feature/*` - New content - `fix/*` - Corrections - `review/*` - Under review ### Commit Messages ```type(scope): description* feat: New content * fix: Corrections * style: Formatting * docs: Documentation * refactor: Restructuring```` ### Pull Request Process 1. Create feature branch 2. Make changes 3. Push and create PR 4. Request review 5. Address feedback 6. Merge when approved ## Building ```bash make # Build PDF make clean # Clean artifacts make watch # Auto-rebuild ```````` ### Branching Strategies ```bash git-workflow.sh # Feature branch workflow git checkout -b feature/methodology-chapter # Make changes to chapters/methodology.tex git add chapters/methodology.tex git commit -m "feat(methodology): Add data collection section" git push -u origin feature/methodology-chapter # Create pull request for review gh pr create --title "Add methodology chapter" \ --body "This PR adds the complete methodology chapter including: - Data collection procedures - Analysis methods - Validation approach Closes #15" # Reviewer checks out PR git fetch origin git checkout -b review/methodology origin/feature/methodology-chapter make # Build and review PDF # After approval git checkout main git merge --no-ff feature/methodology-chapter git push origin main ```````bash parallel-development.sh theme=\{null} # Multiple authors working simultaneously # Author A: Introduction git checkout -b feature/introduction # Edit chapters/introduction.tex git add chapters/introduction.tex git commit -m "feat(intro): Add research background" # Author B: Results git checkout -b feature/results # Edit chapters/results.tex git add chapters/results.tex figures/results/* git commit -m "feat(results): Add experimental data" # Integration manager git checkout develop git merge feature/introduction git merge feature/results # Resolve any conflicts make # Test build git push origin develop ```### Merge Conflict Resolution```latex conflict-resolution.tex theme=\{null} % Common conflict scenario <<<<<<< HEAD \section{Results} Our experimental results show a 95\% accuracy rate. ======= \section{Experimental Results} The experiments demonstrate 94.8\% accuracy. >>>>>>> feature/results % Resolution approach \section{Experimental Results} Our experimental results show a 94.8\% accuracy rate. % Best practices: % 1. Communicate about sections % 2. Use semantic line breaks % 3. One sentence per line % 4. Regular integration ``````bash semantic-linebreaks.tex theme=\{null} % Bad: Hard to merge \section{Introduction} This research investigates machine learning applications in healthcare. We propose a novel approach that combines deep learning with traditional statistical methods. Our results show significant improvements. % Good: Easy to merge \section{Introduction} This research investigates machine learning applications in healthcare. We propose a novel approach that combines deep learning with traditional statistical methods. Our results show significant improvements. % Each sentence on its own line % Easier diffs and merges % Clear change history ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
## Cloud Collaboration### LaTeX Cloud Studio Features> [!NOTE] > > **LaTeX Cloud Studio** provides real-time collaboration features: > > * Simultaneous editing > * Live preview updates > * Integrated chat > * Version history > * Comment threads > * Change suggestions### Real-time Collaboration Setup```latex cloud-project-setup.tex theme=\{null} % Project structure for cloud collaboration % main.tex \documentclass{article} % Enable collaboration features \usepackage{changes} % Track changes \usepackage{todonotes} % Comments and todos % Define authors \definechangesauthor[name={Alice}, color=blue]{AA} \definechangesauthor[name={Bob}, color=red]{BB} \definechangesauthor[name={Carol}, color=green]{CC} \begin{document} \title{Collaborative Research Paper} \author{Alice A. \and Bob B. \and Carol C.} \maketitle % Include sections maintained by different authors \input{sections/introduction} % Alice \input{sections/methodology} % Bob \input{sections/results} % Carol \input{sections/conclusion} % All \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex collaborative-editing.tex theme=\{null} % sections/methodology.tex \section{Methodology} % Bob's addition \added[id=BB]{We employed a mixed-methods approach combining quantitative analysis with qualitative interviews.} % Alice's comment \todo[inline, author=Alice]{Should we mention the sample size here?} % Carol's suggestion \replaced[id=CC]{participants}{subjects} % Highlighting changes \deleted[id=AA]{The old methodology was limited.} \added[id=AA]{Our comprehensive methodology addresses previous limitations.} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Managing Permissions> [tab] View Only > > ````latex example.tex theme=\{null} > % For reviewers and readers > % - Can view document > % - Can add comments > % - Cannot edit content > % - Can download PDF > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Can Edit > > ````latex example.tex theme=\{null} > % For co-authors > % - Full editing rights > % - Can add/remove content > % - Can modify structure > % - Can invite others > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Can Comment > > ````latex example.tex theme=\{null} > % For reviewers > % - Can view document > % - Can add comments > % - Can suggest changes > % - Cannot directly edit > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````## Change Tracking### The changes Package```latex changes-package.tex theme=\{null} \documentclass{article} \usepackage{changes} % Setup authors \definechangesauthor[name={John}, color=blue]{JD} \definechangesauthor[name={Jane}, color=red]{JS} % Configure display \setaddedmarkup{\textcolor{#1}{\uline{#2}}} \setdeletedmarkup{\textcolor{#1}{\sout{#2}}} \begin{document} \section{Introduction} % Track additions \added[id=JD]{This new section provides important context.} % Track deletions \deleted[id=JS]{Remove this outdated information.} % Track replacements \replaced[id=JD]{modern approach}{old method} % Comments \comment[id=JS]{Need citation here} % Highlight text \highlight{Important finding that needs review} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex change-management.tex theme=\{null} % Accept/reject changes workflow \usepackage[final]{changes} % Accept all changes % or \usepackage[draft]{changes} % Show all changes % Selective display \setauthormarkup{JD}{\textcolor{blue}{#1}} \setauthormarkup{JS}{\textcolor{red}{#1}} % List all changes \listofchanges % Summary statistics \begin{tabular}{lcc} \toprule Author & Added & Deleted \\ \midrule John & 247 words & 89 words \\ Jane & 192 words & 134 words \\ \bottomrule \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Manual Change Tracking```latex revision-colors.tex theme=\{null} % Simple revision tracking with colors \usepackage{xcolor} \usepackage{soul} % Define revision commands \newcommand{\rev}[1]{\textcolor{blue}{#1}} \newcommand{\del}[1]{\textcolor{red}{\sout{#1}}} \newcommand{\note}[1]{\marginpar{\textcolor{orange}{\footnotesize #1}}} % Usage \rev{This text was added in revision 2.} \del{This text should be removed.} \note{Check this reference} % Version-specific content \newif\ifdraft \drafttrue % or \draftfalse \ifdraft \newcommand{\draftonly}[1]{#1} \else \newcommand{\draftonly}[1]{} \fi ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex diff-visualization.tex theme=\{null} % Showing differences between versions \usepackage{listings} \usepackage{xcolor} \lstdefinestyle{diff}{ basicstyle=\ttfamily\small, morecomment=[f][\color{blue}]{+}, morecomment=[f][\color{red}]{-}, morecomment=[f][\color{gray}]{@} } \begin{lstlisting}[style=diff] @@ -15,7 +15,7 @@ The experiment used the following parameters: -Temperature: 25°C +Temperature: 27°C Pressure: 1 atm -Duration: 60 minutes +Duration: 90 minutes \end{lstlisting} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Review Workflows### Comment Systems```latex todo-notes.tex theme=\{null} \usepackage[colorinlistoftodos]{todonotes} % Configure todo notes \setuptodonotes{ inline, color=yellow!40, size=\footnotesize } % Different comment types \newcommand{\alice}[1]{\todo[color=blue!40, inline]{Alice: #1}} \newcommand{\bob}[1]{\todo[color=red!40, inline]{Bob: #1}} \newcommand{\review}[1]{\todo[color=green!40, inline]{Review: #1}} % Usage in document \section{Results} Our findings indicate significant improvement. \alice{Need to add specific percentages here} The control group showed no change. \bob{Should we include the p-value?} \review{This section needs more detail about methodology} % List all todos \listoftodos[Notes for revision] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from todo-notes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-collaboration-workflow-10/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_collaboration_workflow)```latex margin-comments.tex theme=\{null} % Margin comments for review \usepackage{marginnote} \usepackage{xcolor} % Review commands \newcounter{commentnum} \newcommand{\comment}[2]{% \stepcounter{commentnum}% \marginnote{% \tiny\textcolor{red}{[\thecommentnum] #1: #2}% }% \textsuperscript{\textcolor{red}{\thecommentnum}}% } % Usage The results \comment{Reviewer1}{Clarify which results} demonstrate our hypothesis was correct. % Alternative: pdfcomment package \usepackage{pdfcomment} \pdfcomment[author={Jane Doe}, color=yellow]{ This paragraph needs supporting evidence. } ```
Rendered output Open zoomable preview: Compiled PDF page 1 from margin-comments.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-collaboration-workflow-11/page-1.svg)
### Code Review for LaTeX```yaml latex-review-checklist.yml theme=\{null} # .github/pull_request_template.md ## LaTeX Document Review Checklist ### Content Review - [ ] Content is accurate and complete - [ ] All sections are properly structured - [ ] References are correctly cited - [ ] Figures and tables are referenced ### Technical Review - [ ] Document compiles without errors - [ ] No undefined references - [ ] No overfull/underfull boxes - [ ] Images are optimized ### Style Review - [ ] Consistent formatting throughout - [ ] Proper use of environments - [ ] Correct math notation - [ ] Clear and concise writing ### Bibliography - [ ] All citations have entries - [ ] BibTeX entries are complete - [ ] Citation style is consistent ### Final Checks - [ ] Spell check completed - [ ] Grammar check completed - [ ] PDF output looks correct - [ ] Version number updated ``````yaml github-actions.yml theme=\{null} # .github/workflows/latex-build.yml name: Build LaTeX document on: pull_request: branches: [ main ] push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Compile LaTeX uses: xu-cheng/latex-action@v2 with: root_file: main.tex - name: Check for errors run: | ! grep -E "(Warning|Error|Undefined)" main.log - name: Upload PDF uses: actions/upload-artifact@v2 with: name: document path: main.pdf ```## Communication Tools### Project Documentation````markdown CONTRIBUTING.md theme=\{null} # Contributing Guidelines ## Communication Channels - **Slack**: #latex-project for daily communication - **GitHub Issues**: Bug reports and feature requests - **Weekly Meetings**: Thursdays 2 PM UTC ## Writing Style Guide 1. **Voice**: Active voice preferred 2. **Tense**: Present tense for methods 3. **Terminology**: See glossary.tex 4. **Citations**: Author-year format ## LaTeX Conventions ### File Naming - Chapters: `ch01-introduction.tex` - Figures: `fig-chapter-description.pdf` - Tables: `tab-chapter-description.tex` ### Labels - Sections: `sec:chapter:section` - Figures: `fig:chapter:name` - Tables: `tab:chapter:name` - Equations: `eq:chapter:name` ### Code Style ```latex % Good \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{figure} \caption{Clear description} \label{fig:chapter:example} \end{figure} % Bad \begin{figure}[h] \includegraphics{figure} \caption{Fig} \end{figure} ````## Review Process1) Create feature branch 2) Make changes following guidelines 3) Run `make check` before committing 4) Create PR with description 5) Address reviewer feedback 6) Squash and merge when approved```` ```latex project-glossary.tex % glossary.tex - Shared terminology \usepackage{glossaries} \makeglossaries % Define common terms \newglossaryentry{ml}{ name=machine learning, description={A subset of AI that enables systems to learn from data} } \newglossaryentry{api}{ name=API, description={Application Programming Interface} } % Usage in documents We use \gls{ml} techniques to process the data through our \gls{api}. % Print glossary \printglossary[title=Terminology] ````\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
### Meeting Templates```markdown meeting-template.md theme=\{null} # LaTeX Project Meeting - [Date] ## Attendees - [ ] Alice (Lead Author) - [ ] Bob (Methods) - [ ] Carol (Analysis) - [ ] Dave (Review) ## Agenda 1. Progress updates (10 min) 2. Blockers and issues (10 min) 3. Review assignments (15 min) 4. Next steps (10 min) ## Progress Updates ### Alice - Completed introduction revision - TODO: Address Bob's comments ### Bob - Methodology section 80% complete - Blocked: Need data from Carol ## Action Items | Task | Owner | Due Date | |------|-------|----------| | Revise introduction | Alice | Friday | | Provide data tables | Carol | Wednesday | | Review methodology | Dave | Next Monday | ## Next Meeting Date: [Next week same time] Focus: Results section review ```## Conflict Resolution### Handling Disagreements> [tab] Content Conflicts > > ````latex example.tex theme=\{null} > % Document alternatives > \usepackage{comment} > > % Version A > \begin{comment} > Alice's version: > The results clearly demonstrate... > \end{comment} > > % Version B > Bob's version: > The results suggest... > > % Resolution meeting needed > \todo[inline]{DISCUSS: Strong vs cautious language} > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> ````> [tab] Style Conflicts > > ````latex example.tex theme=\{null} > % Create style guide > % styles/project-style.sty > \ProvidesPackage{project-style} > > % Agreed conventions > \newcommand{\term}[1]{\textit{#1}} > \newcommand{\important}[1]{\textbf{#1}} > \newcommand{\citation}[1]{\citep{#1}} > > % Enforce consistency > \let\it\undefined % Disable \it > \let\bf\undefined % Disable \bf > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
> ````> [tab] Technical Conflicts > > ````latex example.tex theme=\{null} > % Use feature flags > \newif\ifusemethod > \usemethodtrue % or false > > \ifusemethod > % Method A implementation > \input{methods/approach-a} > \else > % Method B implementation > \input{methods/approach-b} > \fi > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> ````## Pick One Source of TruthTeams usually combine two sync models:- **Real-time co-editing**: everyone works in the same live project. This suits drafting sessions, deadline pushes and co-authors who do not use Git. Comments and version history carry the review. - **Git-based flow**: the repository is the source of truth and editors sync to it. This suits papers that sit next to code and co-authors who prefer branches and pull requests. With [GitHub sync, import and export](/product/github-sync-import-export), browser-based authors can push to and pull from the same repository without a local TeX installation.Avoid ad-hoc mixing, such as one person editing in the browser while another force-pushes the repository with no agreed sync direction. Decide which side is authoritative, write it in the project README, and route every change through it.## Pre-Submission ChecklistRun this list before every submission deadline:1) **Freeze**: agree that only one person edits or merges from now on. 2) **Clean compile**: build from scratch, not incrementally, and check the log for undefined citations and references. 3) **Check generated content**: confirm that figures and the bibliography come from the current sources. 4) **Snapshot**: tag the repository or save a named version, for example "submitted to venue X". When reviews arrive months later, you need the exact submitted source.For a revision, [latexdiff](https://ctan.org/pkg/latexdiff) produces a marked-up PDF between the submitted and revised versions, which is what many journals ask for.## Best Practices### Collaboration Guidelines> [!TIP] > > ✅ **Successful collaboration checklist**: > > * [ ] Clear role assignments > * [ ] Regular communication schedule > * [ ] Documented conventions > * [ ] Version control setup > * [ ] Automated builds > * [ ] Review process defined > * [ ] Conflict resolution plan > * [ ] Backup strategy > * [ ] Deadline tracking > * [ ] Progress monitoring### Common Pitfalls> [!WARNING] > > **Avoid these collaboration mistakes**: > > 1. **No clear ownership** - Assign section owners > 2. **Infrequent integration** - Merge daily > 3. **Poor communication** - Regular check-ins > 4. **Inconsistent style** - Document conventions > 5. **Missing reviews** - Mandatory peer review > 6. **No backup plan** - Multiple backups > 7. **Deadline confusion** - Shared calendar## Complete Collaboration Example```bash setup-collaboration.sh theme=\{null} #!/bin/bash # Complete collaboration setup # 1. Initialize repository git init latex-collaborative-paper cd latex-collaborative-paper # 2. Create structure mkdir -p {chapters,figures,reviews,builds} mkdir -p .github/workflows # 3. Setup Git hooks cat > .git/hooks/pre-commit << 'EOF' #!/bin/bash # Check for LaTeX errors before commit make check EOF chmod +x .git/hooks/pre-commit # 4. Create main document cat > main.tex << 'EOF' \documentclass[12pt]{article} \usepackage{changes} \usepackage{todonotes} % Define authors \definechangesauthor[name={Alice}, color=blue]{AA} \definechangesauthor[name={Bob}, color=red]{BB} \title{Collaborative Research Paper} \author{Alice \and Bob} \begin{document} \maketitle \input{chapters/introduction} \input{chapters/methods} \input{chapters/results} \input{chapters/conclusion} \bibliographystyle{plain} \bibliography{references} \end{document} EOF # 5. Create Makefile cat > Makefile << 'EOF' .PHONY: all clean check watch all: main.pdf main.pdf: main.tex chapters/*.tex pdflatex main bibtex main pdflatex main pdflatex main check: @echo "Checking for errors..." @! grep -i "error\|warning\|undefined" main.log clean: rm -f *.aux *.log *.out *.toc *.bbl *.blg watch: latexmk -pvc -pdf main.tex EOF # 6. Setup CI/CD cat > .github/workflows/build.yml << 'EOF' name: Build and Check on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: xu-cheng/latex-action@v2 with: root_file: main.tex - uses: actions/upload-artifact@v2 with: name: PDF path: main.pdf EOF echo "Collaboration environment ready!" ```## Next StepsContinue with advanced LaTeX workflows:> [card] Using Templates > > Create reusable document templates[Open](/learn/latex/how-to/using-templates)> [card] Fixing Errors > > Debug compilation issues[Open](/learn/latex/basics/errors)> [card] Large Documents > > Manage complex projects[Open](/learn/latex/how-to/large-documents)> [card] Research Papers > > Write academic papers[Open](/learn/latex/how-to/writing-research-paper)***> [!NOTE] > > **Remember**: Good collaboration is about communication, consistency, and clear processes. Establish conventions early and document everything. Regular integration and reviews prevent major conflicts. # Creating Academic Posters in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/creating-posters Design conference posters in LaTeX. Learn poster packages, layout techniques, visual hierarchy, and academic presentation best practices. Create stunning academic posters for conferences and presentations using LaTeX. This guide covers poster design principles, LaTeX packages for posters, layout strategies, and tips for effective visual communication.> [!NOTE] > > **Prerequisites**: Basic LaTeX knowledge, understanding of graphics\ > **Time to complete**: 35-40 minutes\ > **Difficulty**: Intermediate to Advanced\ > **What you'll learn**: Poster packages, layout design, typography, color schemes, and presentation tips## Poster Design Fundamentals### Key Design Principles> [card] Visual Hierarchy > > Guide viewers through content with clear organization> [card] White Space > > Use space effectively to avoid cluttered appearance> [card] Readability > > Large fonts and high contrast for distance viewing> [card] Flow > > Logical progression from introduction to conclusions### Poster Specifications> [tab] Common Sizes > > **Standard poster dimensions**: > > * A0: 841mm × 1189mm (33.1" × 46.8") > * A1: 594mm × 841mm (23.4" × 33.1") > * Custom: 36" × 48", 42" × 56" > * Check conference requirements!> [tab] Orientation > > **Portrait vs Landscape**: > > * Portrait: Traditional, good for linear flow > * Landscape: Modern, better for side-by-side comparison > * Consider viewing distance and venue> [tab] Resolution > > **Print specifications**: > > * 150-300 DPI for final print > * Vector graphics when possible > * High-resolution images (>1MB) > * Test print on A4/Letter first## Poster Packages### beamerposter Package```latex beamerposter-basic.tex theme=\{null} \documentclass[final, 12pt]{beamer} \usepackage[size=a0, orientation=portrait, scale=1.4]{beamerposter} \usepackage{graphicx} \usepackage{booktabs} \usepackage{tikz} \usepackage{amsmath} \usepackage{lipsum} % For dummy text % Theme settings \usetheme{Berlin} \usecolortheme{beaver} % Custom colors \definecolor{myblue}{RGB}{0, 51, 102} \definecolor{myorange}{RGB}{255, 128, 0} \setbeamercolor{block title}{fg=white, bg=myblue} \setbeamercolor{block body}{fg=black, bg=myblue!10} % Title information \title{Your Research Title: A Comprehensive Study} \author{Jane Doe\inst{1} \and John Smith\inst{2}} \institute[Short Inst.]{ \inst{1}Department of Computer Science, University Name\\ \inst{2}Research Lab, Institution } \date{Conference Name 2024} \begin{document} \begin{frame}[t] \begin{columns}[t] % Left column \begin{column}{0.32\textwidth} \begin{block}{Introduction} \large \lipsum[1][1-5] \begin{itemize} \item Key point one with explanation \item Key point two with details \item Key point three \end{itemize} \end{block} \begin{block}{Objectives} \large Our main objectives are: \begin{enumerate} \item First objective \item Second objective \item Third objective \end{enumerate} \end{block} \begin{block}{Methodology} \large \begin{figure} \centering \includegraphics[width=0.9\textwidth]{method-diagram} \caption{Proposed methodology overview} \end{figure} \end{block} \end{column} % Middle column \begin{column}{0.32\textwidth} \begin{block}{Experiments} \large \begin{figure} \centering \includegraphics[width=0.9\textwidth]{results-plot} \caption{Performance comparison} \end{figure} \begin{table} \centering \caption{Quantitative results} \begin{tabular}{lcc} \toprule Method & Accuracy & Speed \\ \midrule Baseline & 85.2\% & 1.0x \\ Our Method & \textbf{92.7\%} & 0.8x \\ \bottomrule \end{tabular} \end{table} \end{block} \begin{block}{Results} \large Key findings: \begin{itemize} \item Result one with 15\% improvement \item Result two showing significance \item Result three validating hypothesis \end{itemize} \end{block} \end{column} % Right column \begin{column}{0.32\textwidth} \begin{block}{Discussion} \large \lipsum[2][1-4] \begin{alertblock}{Key Insight} Our method achieves state-of-the-art performance while maintaining computational efficiency. \end{alertblock} \end{block} \begin{block}{Conclusions} \large \begin{itemize} \item Conclusion one \item Conclusion two \item Future work direction \end{itemize} \end{block} \begin{block}{References} \footnotesize \bibliographystyle{abbrv} \bibliography{poster} \end{block} \begin{block}{Acknowledgments} \large This work was supported by Grant \#12345. \end{block} \begin{center} \includegraphics[width=0.5\textwidth]{qr-code}\\ \small Scan for paper and supplementary materials \end{center} \end{column} \end{columns} \end{frame} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex beamerposter-custom-theme.tex theme=\{null} % Custom beamerposter theme \documentclass[final]{beamer} \usepackage[size=a0, orientation=portrait, scale=1.24]{beamerposter} % Remove navigation symbols \setbeamertemplate{navigation symbols}{} % Custom color theme \definecolor{primaryColor}{RGB}{0, 102, 204} \definecolor{secondaryColor}{RGB}{255, 153, 0} \definecolor{accentColor}{RGB}{51, 153, 102} \definecolor{textColor}{RGB}{51, 51, 51} \definecolor{bgColor}{RGB}{245, 245, 245} % Color settings \setbeamercolor{block title}{fg=white, bg=primaryColor} \setbeamercolor{block body}{fg=textColor, bg=bgColor} \setbeamercolor{headline}{fg=white, bg=primaryColor} \setbeamercolor{footline}{fg=white, bg=primaryColor} \setbeamercolor{title in headline}{fg=white} \setbeamercolor{author in headline}{fg=white} % Font settings \setbeamerfont{block title}{size=\Large, series=\bfseries} \setbeamerfont{title in headline}{size=\VeryHuge, series=\bfseries} \setbeamerfont{author in headline}{size=\Large} % Custom headline \setbeamertemplate{headline}{ \leavevmode \begin{beamercolorbox}[wd=\paperwidth]{headline} \vskip2cm \centering \usebeamercolor{title in headline}{ \color{fg}\usebeamerfont{title in headline} \inserttitle\\[0.5ex] } \vskip1cm \usebeamercolor{author in headline}{ \color{fg}\usebeamerfont{author in headline} \insertauthor\\[1ex] } \vskip1cm \end{beamercolorbox} } % Custom block \setbeamertemplate{block begin}{ \begin{beamercolorbox}[ht=3.5ex, dp=0.5ex, center, leftskip=-1em, colsep*=.75ex]{block title}% \usebeamerfont*{block title}\insertblocktitle \end{beamercolorbox}% {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}% \usebeamerfont{block body}% \begin{beamercolorbox}[leftskip=1em, colsep*=.75ex, sep=0.5ex, vmode]{block body}% } \setbeamertemplate{block end}{ \end{beamercolorbox} \vskip1cm } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### tikzposter Package```latex tikzposter-example.tex theme=\{null} \documentclass[25pt, a0paper, portrait]{tikzposter} \usepackage{graphicx} \usepackage{booktabs} \usepackage{amsmath} % Theme \usetheme{Autumn} \usecolorstyle{Australia} % Title matter \title{Research Title Using TikZposter} \author{Jane Doe$^1$, John Smith$^2$} \institute{$^1$University Name, $^2$Research Institute} \titlegraphic{\includegraphics[width=0.15\textwidth]{logo}} % Custom colors \definecolorstyle{myStyle}{ \colorlet{colorOne}{blue!80!black} \colorlet{colorTwo}{orange!80!black} \colorlet{colorThree}{green!80!black} }{ % Background color \colorlet{backgroundcolor}{white} \colorlet{framecolor}{colorOne} % Title colors \colorlet{titlefgcolor}{white} \colorlet{titlebgcolor}{colorOne} % Block colors \colorlet{blocktitlebgcolor}{colorOne} \colorlet{blocktitlefgcolor}{white} \colorlet{blockbodybgcolor}{colorOne!10} \colorlet{blockbodyfgcolor}{black} % Note colors \colorlet{notefgcolor}{black} \colorlet{notebgcolor}{colorTwo!30} } \usecolorstyle{myStyle} \begin{document} \maketitle \begin{columns} % First column \column{0.33} \block{Introduction}{ \large Research context and motivation. This work addresses the important problem of... \begin{tikzfigure}[A workflow diagram] \includegraphics[width=0.9\linewidth]{workflow} \end{tikzfigure} } \block{Objectives}{ \large \begin{enumerate} \item Primary objective with details \item Secondary objective explained \item Tertiary goal description \end{enumerate} } % Second column \column{0.33} \block{Methodology}{ \large Our approach consists of three main components: \begin{tikzfigure}[Methodology overview] \begin{tikzpicture}[scale=2] % Custom TikZ diagram \node[draw, rectangle, fill=colorOne!20] (A) at (0,0) {Input}; \node[draw, rectangle, fill=colorTwo!20] (B) at (3,0) {Process}; \node[draw, rectangle, fill=colorThree!20] (C) at (6,0) {Output}; \draw[thick, ->] (A) -- (B); \draw[thick, ->] (B) -- (C); \end{tikzpicture} \end{tikzfigure} } \block{Results}{ \large \begin{tikzfigure}[Performance comparison] \includegraphics[width=0.9\linewidth]{results} \end{tikzfigure} Key findings demonstrate significant improvements... } % Third column \column{0.33} \block{Evaluation}{ \large \begin{table} \centering \begin{tabular}{lcc} \toprule \textbf{Metric} & \textbf{Baseline} & \textbf{Ours} \\ \midrule Accuracy & 82.3\% & \textbf{91.7\%} \\ Speed & 1.0x & 2.3x \\ Memory & 4.2GB & \textbf{2.1GB} \\ \bottomrule \end{tabular} \end{table} } \note[targetoffsetx=2cm, targetoffsety=-4cm, width=0.3\linewidth]{ \textbf{Contact:} jane.doe@university.edu \textbf{Website:} www.project-page.com } \block{Conclusions}{ \large \begin{itemize} \item Main conclusion from the work \item Secondary finding importance \item Future research directions \end{itemize} } \block{References}{ \small \bibliographystyle{plain} \bibliography{references} } \end{columns} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex tikzposter-advanced.tex theme=\{null} % Advanced tikzposter features \documentclass[25pt, a0paper, portrait, margin=0mm, innermargin=15mm]{tikzposter} \usepackage{graphicx} \usepackage{lipsum} \usepackage{multicol} % Grid for layout planning \tikzposterlatexaffectionproofon % Shows layout grid % Custom block styles \defineblockstyle{MyBlock}{ titlewidthscale=1, bodywidthscale=1, titlecenter, titleoffsetx=0pt, titleoffsety=0pt, bodyoffsetx=0pt, bodyoffsety=0pt, bodyverticalshift=0pt, roundedcorners=20, linewidth=0pt, titleinnersep=10mm, bodyinnersep=10mm }{ \begin{scope}[line width=\blocklinewidth, rounded corners=\blockroundedcorners] \ifBlockHasTitle \draw[fill=blocktitlebgcolor] (blocktitle.south west) rectangle (blocktitle.north east); \fi \draw[fill=blockbodybgcolor] (blockbody.south west) rectangle (blockbody.north east); \end{scope} } \useblockstyle{MyBlock} % Multi-column content \newcommand{\mycolumn}[1]{ \begin{minipage}[t]{0.48\linewidth} #1 \end{minipage} } \begin{document} \maketitle \begin{columns} \column{0.5} \block{Complex Layout Example}{ \begin{multicols}{2} \lipsum[1][1-3] \columnbreak \lipsum[2][1-3] \end{multicols} } \column{0.5} \block{Advanced Graphics}{ \begin{tikzfigure} \begin{tikzpicture}[scale=1.5] % Radar chart example \foreach \a/\v in {0/85, 60/92, 120/78, 180/88, 240/95, 300/81} { \draw[fill=blue!30, opacity=0.5] (0,0) -- (\a:\v/20) -- (\a+60:\v/20) -- cycle; } \foreach \a in {0, 60, 120, 180, 240, 300} { \draw[gray] (0,0) -- (\a:5); } \foreach \r in {1,2,3,4,5} { \draw[gray!50] (0,0) circle (\r); } \end{tikzpicture} \end{tikzfigure} } \end{columns} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tikzposter-advanced.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-creating-posters-04/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_creating_posters)### a0poster Package```latex a0poster-template.tex theme=\{null} \documentclass[a0, portrait]{a0poster} \usepackage{graphicx} \usepackage{color} \usepackage{multicol} \usepackage{enumitem} % Colors \definecolor{headercolor}{RGB}{0, 51, 102} \definecolor{boxcolor}{RGB}{200, 200, 200} % Font sizes \renewcommand{\normalsize}{\fontsize{24}{30}\selectfont} \renewcommand{\large}{\fontsize{28}{35}\selectfont} \renewcommand{\Large}{\fontsize{32}{40}\selectfont} \renewcommand{\LARGE}{\fontsize{36}{45}\selectfont} \renewcommand{\huge}{\fontsize{48}{60}\selectfont} \renewcommand{\Huge}{\fontsize{64}{80}\selectfont} % Custom section command \newcommand{\mysection}[1]{ \vspace{1cm} {\color{headercolor}\LARGE\bfseries #1} \vspace{0.5cm} } \begin{document} % Header \begin{center} \color{headercolor} {\Huge\bfseries Research Title Goes Here}\\[1cm] {\Large Author Name$^1$, Coauthor Name$^2$}\\[0.5cm] {\large $^1$Department, University \quad $^2$Institution} \end{center} \vspace{2cm} % Content in columns \begin{multicols}{3} \mysection{Introduction} \normalsize Your introduction text here. This template uses the a0poster class for simple poster creation. \columnbreak \mysection{Methods} \normalsize Methodology description with figures and equations. \begin{center} \includegraphics[width=0.8\linewidth]{method} \end{center} \columnbreak \mysection{Results} \normalsize Results and discussion with tables and graphs. \end{multicols} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Design Elements### Color Schemes```latex color-schemes.tex theme=\{null} % Professional color palettes for posters % Academic Blue Theme \definecolor{primaryBlue}{RGB}{0, 51, 102} \definecolor{secondaryBlue}{RGB}{102, 153, 204} \definecolor{accentOrange}{RGB}{255, 153, 0} \definecolor{backgroundGray}{RGB}{240, 240, 240} % Nature Green Theme \definecolor{primaryGreen}{RGB}{34, 139, 34} \definecolor{secondaryGreen}{RGB}{144, 238, 144} \definecolor{accentBrown}{RGB}{139, 69, 19} \definecolor{backgroundCream}{RGB}{255, 250, 240} % Modern Tech Theme \definecolor{primaryPurple}{RGB}{106, 27, 154} \definecolor{secondaryPink}{RGB}{239, 83, 155} \definecolor{accentTeal}{RGB}{0, 188, 212} \definecolor{backgroundLight}{RGB}{250, 250, 250} % High Contrast Theme \definecolor{primaryBlack}{RGB}{33, 33, 33} \definecolor{secondaryGray}{RGB}{117, 117, 117} \definecolor{accentRed}{RGB}{229, 57, 53} \definecolor{backgroundWhite}{RGB}{255, 255, 255} % Usage in tikzposter \definecolorstyle{AcademicBlue}{ \colorlet{colorOne}{primaryBlue} \colorlet{colorTwo}{secondaryBlue} \colorlet{colorThree}{accentOrange} }{ \colorlet{backgroundcolor}{backgroundGray} \colorlet{blocktitlebgcolor}{colorOne} \colorlet{blocktitlefgcolor}{white} \colorlet{blockbodybgcolor}{white} \colorlet{blockbodyfgcolor}{black} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex visual-elements.tex theme=\{null} % Visual design elements % Gradient backgrounds \usepackage{tikz} \usetikzlibrary{fadings} % Title with gradient \newcommand{\gradienttitle}[1]{ \begin{tikzpicture} \node[ text width=\textwidth, align=center, font=\Huge\bfseries, text=white ] (title) {#1}; \begin{scope}[on background layer] \shade[ left color=primaryColor, right color=secondaryColor, middle color=primaryColor!70!secondaryColor ] ([xshift=-1cm, yshift=-0.5cm]title.south west) rectangle ([xshift=1cm, yshift=0.5cm]title.north east); \end{scope} \end{tikzpicture} } % Decorative frames \newcommand{\fancybox}[2]{ \begin{tikzpicture} \node[ draw=colorOne, fill=colorOne!10, rounded corners=10pt, inner sep=15pt, text width=0.9\linewidth, drop shadow={ shadow xshift=3pt, shadow yshift=-3pt, fill=gray!50!white } ] { \textbf{\large #1}\\[0.5em] #2 }; \end{tikzpicture} } % Icon integration \usepackage{fontawesome5} \newcommand{\iconitem}[2]{ \faIcon{#1} \hspace{0.5em} #2 } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Typography```latex poster-typography.tex theme=\{null} % Typography for posters % Minimum font sizes for readability % Title: 72-90pt % Section headers: 48-60pt % Body text: 24-32pt % Captions: 20-24pt % Font selection \usepackage{libertine} % Clear serif font \usepackage[libertine]{newtxmath} % Matching math \usepackage{inconsolata} % Monospace for code % Or modern sans-serif \usepackage{roboto} \usepackage[sfdefault]{roboto} % Custom title formatting \newcommand{\postertitle}[1]{ {\fontsize{90}{108}\selectfont\bfseries #1} } \newcommand{\postersubtitle}[1]{ {\fontsize{48}{58}\selectfont\color{gray} #1} } \newcommand{\sectionheader}[1]{ {\fontsize{54}{65}\selectfont\bfseries\color{primaryColor} #1} } % Emphasis styles \newcommand{\highlight}[1]{ \colorbox{yellow!30}{#1} } \newcommand{\important}[1]{ {\Large\bfseries\color{accentColor} #1} } % Line spacing for posters \renewcommand{\baselinestretch}{1.2} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex readability-tips.tex theme=\{null} % Ensuring readability % High contrast text boxes \newcommand{\readablebox}[2]{ \begin{tcolorbox}[ colback=white, colframe=black, boxrule=2pt, arc=0pt, left=10pt, right=10pt, top=10pt, bottom=10pt, title=#1, coltitle=white, fonttitle=\Large\bfseries, colbacktitle=black ] \large #2 \end{tcolorbox} } % Clear bullet points \setlist[itemize]{ label=\textcolor{primaryColor}{\textbullet}, itemsep=0.5em, parsep=0.5em, font=\large } % Numbered lists with circles \setlist[enumerate]{ label=\protect\circled{\arabic*}, itemsep=0.5em, parsep=0.5em, font=\large } \newcommand{\circled}[1]{ \tikz[baseline=(char.base)]{ \node[ shape=circle, draw=primaryColor, fill=primaryColor!20, inner sep=2pt, minimum size=1.5em ] (char) {#1}; } } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Layout Strategies### Grid-based Layout```latex grid-layout.tex theme=\{null} % Grid system for poster layout \usepackage{tikz} \usetikzlibrary{positioning, calc} % Define grid \newcommand{\setupgrid}[2]{ % #1 = columns, #2 = rows \pgfmathsetmacro{\gridwidth}{\textwidth/#1} \pgfmathsetmacro{\gridheight}{\textheight/#2} } % Place content in grid \newenvironment{gridposter}[2]{ \setupgrid{#1}{#2} \begin{tikzpicture}[ remember picture, overlay, shift={(current page.north west)}, gridbox/.style={ anchor=north west, text width=\gridwidth-2cm, inner sep=1cm } ] }{ \end{tikzpicture} } % Usage example \begin{gridposter}{3}{4} % Title spans all columns \node[gridbox, text width=3*\gridwidth-2cm] at (0, -0) { \postertitle{Title} }; % Content blocks \node[gridbox] at (0, -\gridheight) { \sectionheader{Introduction} Content here... }; \node[gridbox] at (\gridwidth, -\gridheight) { \sectionheader{Methods} Content here... }; \node[gridbox] at (2*\gridwidth, -\gridheight) { \sectionheader{Results} Content here... }; \end{gridposter} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex flexible-layout.tex theme=\{null} % Flexible layout system \newcommand{\postercolumn}[3]{ % #1 = width fraction, #2 = title, #3 = content \begin{minipage}[t]{#1\textwidth} \begin{center} \sectionheader{#2} \end{center} \vspace{0.5cm} #3 \end{minipage} } % Three-column layout with different widths \begin{center} \postercolumn{0.3}{Introduction}{ Brief introduction text that sets the context... } \hfill \postercolumn{0.4}{Main Results}{ \begin{center} \includegraphics[width=0.9\linewidth]{main-figure} \end{center} Key findings explained... } \hfill \postercolumn{0.25}{Conclusions}{ \begin{itemize} \item Point 1 \item Point 2 \item Point 3 \end{itemize} } \end{center} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Visual Flow```latex visual-flow\.tex theme=\{null} % Creating visual flow through the poster % Numbered sections with arrows \newcounter{flowstep} \newcommand{\flowsection}[2]{ \stepcounter{flowstep} \begin{tikzpicture}[remember picture, overlay] \node[ circle, fill=primaryColor, text=white, font=\Large\bfseries, minimum size=2cm ] (step\theflowstep) {\theflowstep}; \node[ anchor=west, font=\Large\bfseries, text=primaryColor ] at (step\theflowstep.east) {\quad #1}; \end{tikzpicture} #2 % Draw arrow to next section \ifnum\value{flowstep}<5 \begin{tikzpicture}[remember picture, overlay] \draw[ ->, line width=3pt, primaryColor ] (step\theflowstep.south) -- ++(0, -2cm); \end{tikzpicture} \fi } % Color-coded sections \definecolor{intro}{RGB}{66, 146, 198} \definecolor{methods}{RGB}{239, 126, 30} \definecolor{results}{RGB}{120, 184, 72} \definecolor{conclusion}{RGB}{180, 95, 172} \newcommand{\colorblock}[3]{ % #1 = color, #2 = title, #3 = content \begin{tcolorbox}[ colback=#1!10, colframe=#1, title=#2, fonttitle=\Large\bfseries ] #3 \end{tcolorbox} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code performs setup or defines reusable behavior without producing visible page content on its own. It must be used inside a complete document to have a rendered result.\
## Content Organization### Effective Abstracts```latex poster-abstract.tex theme=\{null} % Concise poster abstract \newcommand{\posterabstract}[1]{ \begin{tcolorbox}[ colback=gray!10, colframe=gray!50, boxrule=1pt, arc=5pt, title={\Large\bfseries Abstract}, coltitle=black, left=15pt, right=15pt, top=10pt, bottom=10pt ] \large #1 \end{tcolorbox} } % Usage \posterabstract{ \textbf{Background:} Brief context (1-2 sentences). \textbf{Objective:} Clear research goal. \textbf{Methods:} Key methodology. \textbf{Results:} Main findings with numbers. \textbf{Conclusion:} Impact and significance. } % Alternative: Graphical abstract \newcommand{\graphicalabstract}[2]{ \begin{center} \begin{tikzpicture} \node[ draw=primaryColor, line width=2pt, inner sep=0pt ] {\includegraphics[width=0.8\linewidth]{#1}}; \node[ below, text width=0.8\linewidth, align=center, font=\large ] {#2}; \end{tikzpicture} \end{center} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex key-messages.tex theme=\{null} % Highlighting key messages % Take-home message box \newcommand{\takeaway}[1]{ \begin{tcolorbox}[ enhanced, colback=yellow!20, colframe=orange, boxrule=2pt, drop shadow, title={\Large\bfseries\faIcon{lightbulb} Key Message}, coltitle=black, attach boxed title to top center={ yshift=-3mm, yshifttext=-1mm }, boxed title style={ colback=yellow!50, colframe=orange } ] \Large\centering #1 \end{tcolorbox} } % Bullet points for quick scanning \newcommand{\keypoints}[1]{ \begin{tcolorbox}[ colback=primaryColor!5, colframe=primaryColor, title={\large\bfseries Quick Facts} ] \begin{itemize}[ label=\faIcon{check-circle}, font=\large, itemsep=0.5em ] #1 \end{itemize} \end{tcolorbox} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Visual Elements```latex poster-figures.tex theme=\{null} % Effective figure presentation % Figure with highlighted caption \newcommand{\posterfigure}[3]{ % #1 = width, #2 = image, #3 = caption \begin{center} \begin{tikzpicture} \node[ draw=gray, line width=1pt, inner sep=5pt ] (img) {\includegraphics[width=#1]{#2}}; \node[ below=5pt of img, text width=#1, align=center, fill=primaryColor!10, draw=primaryColor, rounded corners=5pt, inner sep=8pt, font=\large ] {#3}; \end{tikzpicture} \end{center} } % Multi-panel figure \newcommand{\multipanel}[1]{ \begin{center} \begin{tikzpicture}[ panel/.style={ draw=gray, inner sep=2pt }, label/.style={ fill=white, draw=black, circle, inner sep=2pt, font=\large\bfseries } ] #1 \end{tikzpicture} \end{center} } % Usage \multipanel{ \node[panel] (a) {\includegraphics[width=0.4\linewidth]{fig1}}; \node[panel, right=1cm of a] (b) {\includegraphics[width=0.4\linewidth]{fig2}}; \node[label] at (a.north west) {A}; \node[label] at (b.north west) {B}; } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex data-visualization.tex theme=\{null} % Effective data presentation % Infographic-style statistics \newcommand{\statistic}[3]{ % #1 = number, #2 = unit, #3 = description \begin{tikzpicture} \node[ font=\Huge\bfseries, text=primaryColor ] (num) {#1}; \node[ right=0pt of num, font=\Large, text=gray ] {#2}; \node[ below=5pt of num, font=\large, text width=5cm, align=center ] {#3}; \end{tikzpicture} } % Progress indicators \newcommand{\progress}[3]{ % #1 = percentage, #2 = label, #3 = color \begin{tikzpicture} \draw[gray!30, line width=20pt] (0,0) -- (10,0); \draw[#3, line width=20pt] (0,0) -- (#1/10,0); \node[above=5pt, font=\large\bfseries] at (5,0) {#2}; \node[right=5pt, font=\large] at (10,0) {#1\%}; \end{tikzpicture} } % Comparison chart \newcommand{\comparison}[4]{ \begin{tikzpicture}[scale=0.8] \draw[->] (0,0) -- (0,6); \draw[->] (0,0) -- (8,0); \node[rotate=90, above] at (0,3) {Performance}; \node[below] at (4,0) {Methods}; % Bars \draw[fill=gray!50] (1,0) rectangle (2,#1); \draw[fill=gray!50] (3,0) rectangle (4,#2); \draw[fill=primaryColor] (5,0) rectangle (6,#3); \node[below] at (1.5,0) {Baseline}; \node[below] at (3.5,0) {Previous}; \node[below] at (5.5,0) {\textbf{Ours}}; \node[above] at (1.5,#1) {#1}; \node[above] at (3.5,#2) {#2}; \node[above] at (5.5,#3) {\textbf{#4}}; \end{tikzpicture} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Production Tips### Pre-print Checklist> [!TIP] > > ✅ **Poster production checklist**: > > * [ ] Check conference size requirements > * [ ] Verify resolution (150-300 DPI) > * [ ] Test readability from 6 feet away > * [ ] Ensure color contrast for accessibility > * [ ] Export as PDF with embedded fonts > * [ ] Create backup in PowerPoint format > * [ ] Test print on small scale first > * [ ] Bring business cards/handouts > * [ ] Prepare 2-minute elevator pitch > * [ ] Have digital version on phone/tablet### Common Mistakes> [!WARNING] > > **Avoid these poster pitfalls**: > > 1. **Too much text** - Use bullet points > 2. **Small fonts** - Minimum 24pt for body > 3. **Poor contrast** - Test in grayscale > 4. **Cluttered layout** - Use white space > 5. **Missing contact info** - Add QR code > 6. **Low-res images** - Use vector/300DPI > 7. **Inconsistent style** - Use templates## Complete Poster Example```latex complete-poster.tex theme=\{null} \documentclass[25pt, a0paper, portrait]{tikzposter} \usepackage{graphicx} \usepackage{booktabs} \usepackage{amsmath} \usepackage{fontawesome5} \usepackage{qrcode} \usepackage{lipsum} % Theme setup \usetheme{Desert} % Custom colors \definecolorstyle{UniversityStyle}{ \colorlet{colorOne}{blue!80!black} \colorlet{colorTwo}{orange!80!black} \colorlet{colorThree}{green!80!black} }{ \colorlet{backgroundcolor}{white} \colorlet{blocktitlebgcolor}{colorOne} \colorlet{blocktitlefgcolor}{white} \colorlet{blockbodybgcolor}{colorOne!10!white} \colorlet{blockbodyfgcolor}{black} } \usecolorstyle{UniversityStyle} % Title information \title{\parbox{\linewidth}{\centering Machine Learning for Climate Change Prediction:\\A Deep Learning Approach}} \author{Jane Doe$^{1,2}$, John Smith$^1$, Alice Johnson$^2$} \institute{$^1$Department of Computer Science, University Name\\ $^2$Climate Research Institute} \titlegraphic{ \includegraphics[height=4cm]{university-logo} \hspace{2cm} \includegraphics[height=4cm]{institute-logo} } \begin{document} \maketitle \begin{columns} \column{0.33} \block{Introduction}{ \large Climate change poses one of the greatest challenges of our time. Accurate prediction models are essential for: \begin{itemize} \item Policy making and resource allocation \item Risk assessment and mitigation strategies \item Understanding complex climate dynamics \end{itemize} \vspace{0.5cm} \textbf{Research Question:} Can deep learning models improve long-term climate predictions compared to traditional methods? } \block{Objectives}{ \large \begin{enumerate} \item Develop a novel deep learning architecture for climate modeling \item Integrate multiple data sources (satellite, ground stations, ocean buoys) \item Validate predictions against 50-year historical data \item Provide uncertainty quantification for predictions \end{enumerate} } \block{Related Work}{ \large \begin{itemize} \item \textbf{Traditional Models:} GCMs, RCMs - computationally expensive \item \textbf{ML Approaches:} Random Forests, SVMs - limited by feature engineering \item \textbf{Recent DL:} CNNs for weather - short-term focus only \end{itemize} \coloredbox{colorTwo!30}{ \textbf{Our Contribution:} First transformer-based architecture specifically designed for long-term climate prediction with uncertainty estimation } } \column{0.33} \block{Methodology}{ \begin{tikzfigure}[Network Architecture] \includegraphics[width=0.9\linewidth]{architecture-diagram} \end{tikzfigure} \large \textbf{Key Components:} \begin{itemize} \item \faIcon{network-wired} Multi-scale temporal attention \item \faIcon{layer-group} Hierarchical feature extraction \item \faIcon{random} Uncertainty quantification layers \item \faIcon{database} Multi-modal data fusion \end{itemize} \vspace{0.5cm} \textbf{Training Details:} \begin{itemize} \item Dataset: 150TB of climate data (1970-2020) \item Hardware: 8×A100 GPUs \item Training time: 2 weeks \item Validation: 5-fold cross-validation \end{itemize} } \block{Implementation}{ \large \begin{center} \begin{tikzpicture}[scale=0.9] \node[draw, rectangle, fill=colorOne!20] (data) at (0,0) {Data Sources}; \node[draw, rectangle, fill=colorTwo!20] (preprocess) at (4,0) {Preprocessing}; \node[draw, rectangle, fill=colorThree!20] (model) at (8,0) {ClimateNet}; \node[draw, rectangle, fill=colorOne!20] (predict) at (12,0) {Predictions}; \draw[->, thick] (data) -- (preprocess); \draw[->, thick] (preprocess) -- (model); \draw[->, thick] (model) -- (predict); \end{tikzpicture} \end{center} } \column{0.33} \block{Results}{ \begin{tikzfigure}[Temperature Prediction Accuracy] \includegraphics[width=0.9\linewidth]{results-main} \end{tikzfigure} \large \begin{table} \centering \begin{tabular}{lcc} \toprule \textbf{Model} & \textbf{RMSE} & \textbf{R²} \\ \midrule GCM Baseline & 2.34°C & 0.72 \\ RF Ensemble & 1.89°C & 0.81 \\ Previous SOTA & 1.56°C & 0.86 \\ \textbf{ClimateNet} & \textbf{1.12°C} & \textbf{0.93} \\ \bottomrule \end{tabular} \end{table} \vspace{0.5cm} \coloredbox{colorThree!30}{ \textbf{Key Finding:} 28\% improvement in prediction accuracy with 95\% confidence intervals } } \block{Conclusions \& Future Work}{ \large \textbf{Conclusions:} \begin{itemize} \item Deep learning significantly improves climate predictions \item Uncertainty quantification enables risk assessment \item Multi-modal fusion captures complex interactions \end{itemize} \textbf{Future Directions:} \begin{itemize} \item Extend to extreme weather events \item Incorporate socioeconomic factors \item Real-time prediction system \end{itemize} } \block{References \& Contact}{ \small [1] Smith et al. (2023) \textit{Nature Climate Change}\\ [2] Doe \& Johnson (2023) \textit{ICML Proceedings}\\ [3] Climate Data Repository. \textit{www.climatedata.org} \vspace{0.5cm} \begin{center} \begin{minipage}{0.4\textwidth} \centering \qrcode[height=3cm]{https://project-website.com}\\ \small Project Website \end{minipage} \begin{minipage}{0.4\textwidth} \centering \faIcon{envelope} jane.doe@university.edu\\ \faIcon{twitter} @janedoe\\ \faIcon{github} github.com/climatenet \end{minipage} \end{center} } \end{columns} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Next StepsContinue with visualization and advanced topics:> [card] TikZ Diagrams > > Create complex diagrams[Open](/learn/latex/how-to/tikz-diagrams)> [card] Presentations > > Design slide presentations[Open](/learn/latex/how-to/presentations)> [card] TikZ Diagrams > > Advanced diagram techniques[Open](/learn/latex/how-to/tikz-diagrams)> [card] Templates > > Reusable poster templates[Open](/learn/latex/how-to/using-templates)***> [!NOTE] > > **Pro tip**: Design your poster with the viewer's journey in mind. They should be able to understand your main message in 30 seconds, get the key details in 2 minutes, and find complete information if they spend 5 minutes. Always include contact information and a QR code linking to your paper or additional resources. # LaTeX CV & Resume Templates - Professional Guide Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/cv-resume Create stunning CVs and resumes with LaTeX. Free templates, ATS-friendly designs, and step-by-step tutorials for academic and professional CVs. Build stunning, ATS-friendly CVs and resumes using LaTeX. This comprehensive guide covers everything from simple resumes to detailed academic CVs with publication lists.> [!NOTE] > > **Quick start**: Browse the [LaTeX CV and resume templates](/templates/cv) to compare eight compiled designs (modern, classic, two-column, tech, academic, minimal, executive and creative) and open one in the editor. > > **Why LaTeX for CVs?** Perfect typography, consistent formatting, version control friendly, and easily customizable once set up.## LaTeX vs Word for CVs: Why Choose LaTeX?### Advantages of LaTeX CVs> [card] Professional Typography > > Superior font rendering and spacing that stands out to recruiters> [card] Version Control > > Track changes, maintain multiple versions, collaborate easily> [card] Consistent Formatting > > Automatic alignment and spacing - no manual adjustments needed> [card] Multi-Format Output > > Generate PDF, HTML, or even plain text from same source### When to Use LaTeX for Your CV✅ __Perfect for:__- Academic CVs with publications - Technical/STEM positions - International applications - Long-term career documentation - When you need multiple CV versions❌ __Consider alternatives for:__- Quick one-time applications - Non-technical roles requiring creative designs - When applying through systems requiring Word docs## Quick Start Templates### Modern Professional Resume```latex modern-resume.tex theme=\{null} \documentclass[11pt,a4paper,sans]{moderncv} \moderncvstyle{banking} % Style options: casual, classic, banking, oldstyle, fancy \moderncvcolor{blue} % Color options: blue, orange, green, red, purple, grey, black % Personal data \name{John}{Smith} \title{Senior Software Engineer} \phone[mobile]{+1 (555) 123-4567} \email{john.smith@email.com} \homepage{github.com/johnsmith} \social[linkedin]{johnsmith} \social[github]{johnsmith} % Adjust margins \usepackage[scale=0.85]{geometry} \recomputelengths \begin{document} \makecvtitle \section{Professional Summary} Experienced software engineer with 8+ years developing scalable web applications. Expert in Python, JavaScript, and cloud technologies. Proven track record of leading teams and delivering complex projects on time. \section{Experience} \cventry{2020--Present}{Senior Software Engineer}{Tech Corp}{San Francisco, CA}{}{ \begin{itemize} \item Led team of 5 developers in redesigning core platform, improving performance by 40\% \item Architected microservices solution handling 1M+ daily requests \item Mentored junior developers and established coding standards \end{itemize}} \cventry{2017--2020}{Software Engineer}{StartupXYZ}{San Francisco, CA}{}{ \begin{itemize} \item Developed RESTful APIs serving 100k+ users \item Implemented CI/CD pipeline reducing deployment time by 60\% \item Collaborated with product team to design new features \end{itemize}} \cventry{2015--2017}{Junior Developer}{Web Solutions Inc}{San Jose, CA}{}{ \begin{itemize} \item Built responsive web applications using React and Node.js \item Participated in Agile development process \item Maintained and optimized legacy systems \end{itemize}} \section{Education} \cventry{2011--2015}{Bachelor of Science in Computer Science}{Stanford University}{Stanford, CA}{GPA: 3.8/4.0}{ \begin{itemize} \item Dean's List: Fall 2013, Spring 2014 \item Relevant Coursework: Algorithms, Data Structures, Machine Learning, Databases \end{itemize}} \section{Technical Skills} \cvitem{Languages}{Python, JavaScript, Java, Go, SQL} \cvitem{Frameworks}{React, Node.js, Django, Express, Spring Boot} \cvitem{Tools}{Git, Docker, Kubernetes, AWS, Jenkins, PostgreSQL} \cvitem{Practices}{Agile, TDD, CI/CD, Microservices, REST APIs} \section{Projects} \cvitem{OpenAPI Tool}{\url{github.com/johnsmith/openapi-tool} - Open-source API documentation generator with 500+ stars} \cvitem{ML Platform}{Built machine learning platform for real-time predictions, processing 50k requests/day} \section{Certifications} \cvitem{2022}{AWS Certified Solutions Architect - Professional} \cvitem{2021}{Google Cloud Professional Cloud Developer} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > A professionally formatted resume with a clean banking-style layout featuring the name "John Smith" prominently centered at the top with the title "Senior Software Engineer" below it. Contact information including phone, email, GitHub, and LinkedIn links appears in a subtle header bar. The body displays well-organized sections for Professional Summary, Experience (with dated entries showing company, location, and bulleted achievements), Education, Technical Skills (in a clean key-value format), Projects, and Certifications - all with consistent blue accent colors and professional typography.### Academic CV Template```latex academic-cv.tex theme=\{null} \documentclass[11pt,a4paper]{article} \usepackage{academicpreamble} % Custom package for formatting \usepackage[margin=1in]{geometry} \usepackage{hyperref} \usepackage{enumitem} % Custom commands \newcommand{\cvheading}[1]{\section*{\sc #1}\vspace{-0.5em}\hrule\vspace{0.5em}} \newcommand{\cvsubheading}[1]{\subsection*{#1}} \begin{document} % Header \begin{center} \textbf{\LARGE Dr. Jane Doe}\\[0.5em] Department of Computer Science | University Name\\ 123 Academic Street, City, State 12345\\ \href{mailto:jane.doe@university.edu}{jane.doe@university.edu} | \href{https://janedoe.com}{janedoe.com} | ORCID: 0000-0000-0000-0000 \end{center} \cvheading{Education} \begin{itemize}[leftmargin=0em, label={}] \item \textbf{Ph.D. in Computer Science}, Massachusetts Institute of Technology, 2018\\ \textit{Dissertation}: ``Machine Learning Approaches to Natural Language Understanding''\\ \textit{Advisor}: Prof. John Smith \item \textbf{M.S. in Computer Science}, Stanford University, 2014\\ \textit{Thesis}: ``Neural Networks for Text Classification'' \item \textbf{B.S. in Computer Science}, \textit{Summa Cum Laude}, Harvard University, 2012\\ \textit{GPA}: 3.95/4.00, Phi Beta Kappa \end{itemize} \cvheading{Academic Appointments} \begin{itemize}[leftmargin=0em, label={}] \item \textbf{Assistant Professor}, Department of Computer Science, University Name, 2020--Present \item \textbf{Postdoctoral Researcher}, AI Research Lab, Tech University, 2018--2020 \end{itemize} \cvheading{Research Interests} Machine Learning, Natural Language Processing, Deep Learning, Information Retrieval, Computational Linguistics, Human-Computer Interaction \cvheading{Publications} \cvsubheading{Peer-Reviewed Journal Articles} \begin{enumerate}[leftmargin=2em] \item \textbf{Doe, J.}, Smith, A., \& Johnson, B. (2023). ``Advanced transformer architectures for multilingual NLP.'' \textit{Journal of Machine Learning Research}, 24(1), 123--145. \item Johnson, B., \textbf{Doe, J.}, \& Williams, C. (2022). ``Efficient attention mechanisms for long documents.'' \textit{Computational Linguistics}, 48(3), 567--592. \item \textbf{Doe, J.} \& Smith, A. (2021). ``Zero-shot learning for low-resource languages.'' \textit{Artificial Intelligence}, 295, 103--120. \end{enumerate} \cvsubheading{Conference Proceedings} \begin{enumerate}[leftmargin=2em, resume] \item \textbf{Doe, J.}, et al. (2023). ``Scaling language models efficiently.'' In \textit{Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (ACL)}, pp. 234--245. \item Smith, A., \textbf{Doe, J.}, \& Brown, D. (2022). ``Cross-lingual transfer learning.'' In \textit{Proceedings of NeurIPS 2022}, pp. 1234--1245. \end{enumerate} \cvheading{Grants and Funding} \begin{itemize}[leftmargin=0em, label={}] \item \textbf{NSF CAREER Award}, ``Interpretable AI for Healthcare,'' \$500,000, 2022--2027 (PI) \item \textbf{Google Research Award}, ``Efficient NLP Models,'' \$75,000, 2021--2022 (PI) \item \textbf{NIH R01}, ``AI for Clinical Decision Support,'' \$2.1M, 2021--2026 (Co-PI) \end{itemize} \cvheading{Teaching Experience} \cvsubheading{Courses Taught} \begin{itemize}[leftmargin=0em, label={}] \item CS 231: Machine Learning (Fall 2020, 2021, 2022) - Enrollment: 150 students \item CS 450: Advanced NLP (Spring 2021, 2022, 2023) - Graduate course \item CS 101: Introduction to Programming (Fall 2019) - Enrollment: 300 students \end{itemize} \cvheading{Selected Presentations} \begin{itemize}[leftmargin=0em, label={}] \item ``Future of Language Models,'' Keynote, International Conference on ML, June 2023 \item ``Efficient NLP at Scale,'' Invited Talk, Google Research, March 2023 \item ``Transformers Tutorial,'' ACL 2022, Dublin, Ireland, May 2022 \end{itemize} \cvheading{Professional Service} \cvsubheading{Editorial Positions} \begin{itemize}[leftmargin=0em, label={}] \item Associate Editor, \textit{Computational Linguistics}, 2022--Present \item Editorial Board, \textit{Journal of AI Research}, 2021--Present \end{itemize} \cvsubheading{Conference Organization} \begin{itemize}[leftmargin=0em, label={}] \item Program Chair, EMNLP 2024 \item Area Chair, ACL 2023, NeurIPS 2022 \item Reviewer: ICML, ICLR, AAAI, ACL, EMNLP, NAACL (50+ papers annually) \end{itemize} \cvheading{Awards and Honors} \begin{itemize}[leftmargin=0em, label={}] \item Best Paper Award, ACL 2023 \item Rising Star in AI, MIT Technology Review, 2022 \item Outstanding Dissertation Award, MIT, 2018 \item Google PhD Fellowship, 2016--2018 \end{itemize} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Essential CV Packages### 1. ModernCV - Most Popular CV Package```latex moderncv-styles.tex theme=\{null} % Different ModernCV styles \moderncvstyle{casual} % Casual style with photo \moderncvstyle{classic} % Traditional layout \moderncvstyle{banking} % Clean professional look \moderncvstyle{oldstyle} % Classic typography \moderncvstyle{fancy} % Decorative elements % Color schemes \moderncvcolor{blue} % Default blue theme \moderncvcolor{orange} % Warm orange theme \moderncvcolor{green} % Nature green theme \moderncvcolor{red} % Bold red theme \moderncvcolor{purple} % Royal purple theme \moderncvcolor{grey} % Subtle grey theme \moderncvcolor{black} % Classic black theme % Custom colors \definecolor{color0}{rgb}{0,0,0} % Black \definecolor{color1}{rgb}{0.22,0.45,0.70} % Blue \definecolor{color2}{rgb}{0.45,0.45,0.45} % Grey ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### 2. EuropassCV - EU Standard Format```latex europass-cv.tex theme=\{null} \documentclass[english,a4paper]{europasscv} \ecvname{John Smith} \ecvaddress{123 Main Street, City, Country} \ecvtelephone{+1 555 123 4567} \ecvemail{john.smith@email.com} \ecvnationality{American} \ecvdateofbirth{01/01/1990} \ecvgender{Male} \begin{document} \begin{europasscv} \ecvpersonalinfo \ecvsection{Work Experience} \ecvtitle{September 2020 -- Present}{Senior Developer} \ecvitem{Employer}{Tech Company Inc.} \ecvitem{Responsibilities}{Leading development team, architecting solutions} \ecvsection{Education and Training} \ecvtitle{2008 -- 2012}{Bachelor of Science in Computer Science} \ecvitem{Institution}{University Name} \end{europasscv} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### 3. AltaCV - Modern Single Column```latex altacv-example.tex theme=\{null} \documentclass[10pt,a4paper,ragged2e,withhyper]{altacv} \geometry{left=1.25cm,right=1.25cm,top=1.5cm,bottom=1.5cm,columnsep=1.2cm} \usepackage{paracol} \usepackage[default]{lato} \definecolor{SlateGrey}{HTML}{2E2E2E} \definecolor{LightGrey}{HTML}{666666} \definecolor{DarkPastelRed}{HTML}{450808} \definecolor{PastelRed}{HTML}{8F0D0D} \definecolor{GoldenEarth}{HTML}{E7D192} \colorlet{name}{black} \colorlet{tagline}{PastelRed} \colorlet{heading}{DarkPastelRed} \colorlet{headingrule}{GoldenEarth} \colorlet{subheading}{PastelRed} \colorlet{accent}{PastelRed} \colorlet{emphasis}{SlateGrey} \colorlet{body}{LightGrey} \begin{document} \name{Your Name} \tagline{Your Position} \photoR{2.8cm}{photo} \personalinfo{ \email{your.email@example.com} \phone{+1-234-567-890} \location{City, Country} \linkedin{yourlinkedin} \github{yourgithub} } \makecvheader % Content continues... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## ATS-Friendly CV Best Practices### Making Your LaTeX CV ATS-Compatible> [!WARNING] > > **Critical for Online Applications**: Many companies use Applicant Tracking Systems (ATS) that scan resumes. Follow these guidelines to ensure your LaTeX CV passes ATS screening.```latex ats-friendly.tex theme=\{null} % ATS-Friendly LaTeX CV Template \documentclass[11pt,letterpaper]{article} \usepackage[margin=1in]{geometry} \usepackage{enumitem} \usepackage[hidelinks]{hyperref} % Avoid fancy fonts - use standard fonts \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} % No columns, graphics, or special characters in main content \setlist[itemize]{leftmargin=*, label={\textbullet}} \begin{document} % Simple header - no tables or columns \begin{center} \textbf{\Large JOHN SMITH}\\ Senior Software Engineer\\ Email: john.smith@email.com | Phone: (555) 123-4567\\ LinkedIn: linkedin.com/in/johnsmith | Location: San Francisco, CA \end{center} \section*{PROFESSIONAL SUMMARY} Experienced software engineer with 8+ years developing scalable applications. Expert in Python, JavaScript, React, Node.js, and AWS cloud services. \section*{PROFESSIONAL EXPERIENCE} \textbf{Senior Software Engineer} \hfill January 2020 - Present\\ \textit{Tech Corp, San Francisco, CA} \begin{itemize}[nosep] \item Led team of 5 developers to redesign core platform, improving performance by 40 percent \item Architected microservices handling 1 million plus daily API requests \item Implemented CI/CD pipeline using Jenkins and Docker \item Mentored 3 junior developers on best practices and code reviews \end{itemize} \textbf{Software Engineer} \hfill June 2017 - December 2019\\ \textit{StartupXYZ, San Francisco, CA} \begin{itemize}[nosep] \item Developed RESTful APIs in Python Django serving 100,000 plus users \item Built responsive React components for customer dashboard \item Reduced deployment time by 60 percent through automation \item Collaborated with product team using Agile methodology \end{itemize} \section*{EDUCATION} \textbf{Bachelor of Science in Computer Science} \hfill 2011 - 2015\\ Stanford University, Stanford, CA\\ GPA: 3.8/4.0 | Dean's List: Fall 2013, Spring 2014 \section*{TECHNICAL SKILLS} \textbf{Programming Languages:} Python, JavaScript, Java, Go, SQL, HTML, CSS\\ \textbf{Frameworks:} React, Node.js, Express, Django, Spring Boot, Flask\\ \textbf{Tools and Technologies:} Git, Docker, Kubernetes, AWS, Jenkins, PostgreSQL, MongoDB\\ \textbf{Practices:} Agile, Scrum, Test-Driven Development, CI/CD, Microservices \section*{CERTIFICATIONS} AWS Certified Solutions Architect - Professional (2022)\\ Google Cloud Professional Cloud Developer (2021) \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### ATS Optimization Checklist✅ __Do:__- Use standard section headings (Experience, Education, Skills) - Include keywords from job description - Use standard fonts (Arial, Helvetica, Times) - Save as PDF (unless .docx requested) - Use bullet points with simple markers - Spell out acronyms first time - Use both acronyms and full terms❌ __Avoid:__- Tables, columns, or text boxes - Headers and footers - Images, logos, or graphics - Unusual fonts or characters - Complex formatting - Colored text (except hyperlinks) - Special LaTeX symbols in text## Advanced CV Features### Publication Lists and Citations```latex cv-publications.tex theme=\{null} % Using biblatex for publication management \usepackage[style=authoryear,sorting=ydnt,maxbibnames=99]{biblatex} \addbibresource{publications.bib} % Custom bibliography sections \defbibnote{myprenote}{* indicates equal contribution, † indicates corresponding author} \section{Publications} \subsection{Peer-Reviewed Journal Articles} \newrefsection \nocite{doe2023nature, doe2022science, doe2021cell} \printbibliography[ heading=none, type=article, resetnumbers=true, prenote=myprenote ] \subsection{Conference Proceedings} \newrefsection \nocite{doe2023neurips, doe2023icml, doe2022iclr} \printbibliography[ heading=none, type=inproceedings, resetnumbers=true ] \subsection{Preprints} \newrefsection \nocite{doe2023arxiv1, doe2023arxiv2} \printbibliography[ heading=none, type=unpublished, resetnumbers=true ] % Alternative: Manual formatting with custom counters \newcounter{pubcounter} \newcommand{\pub}[1]{\stepcounter{pubcounter}[\thepubcounter] #1} \subsection{Selected Publications (h-index: 25, Citations: 1,234)} \begin{enumerate}[leftmargin=2em] \item \textbf{Doe, J.*}, Smith, A.*, et al. (2023). ``Major discovery in field.'' \textit{Nature}, 601, 123--128. [Impact Factor: 49.9] \item Johnson, B., \textbf{Doe, J.†}, et al. (2022). ``Important findings.'' \textit{Science}, 375, 456--461. [135 citations] \end{enumerate} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Multi-Language CVs```latex multilingual-cv.tex theme=\{null} \documentclass{article} \usepackage[english,spanish,french]{babel} \usepackage[utf8]{inputenc} \usepackage{iflang} % Language-specific content \newcommand{\sectionname}[1]{% \IfLanguageName{english}{#1}{}% \IfLanguageName{spanish}{\translateSpanish{#1}}{}% \IfLanguageName{french}{\translateFrench{#1}}{}% } % Usage \section{\sectionname{Experience}} % Or use separate files \IfLanguageName{english}{\input{cv-content-en}}{} \IfLanguageName{spanish}{\input{cv-content-es}}{} \IfLanguageName{french}{\input{cv-content-fr}}{} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Interactive CV Elements```latex interactive-cv.tex theme=\{null} % QR code for digital portfolio \usepackage{qrcode} \section{Digital Portfolio} \begin{minipage}{0.7\textwidth} Scan the QR code to view my interactive portfolio with live project demos, code samples, and detailed case studies. \end{minipage} \begin{minipage}{0.3\textwidth} \raggedleft \qrcode[height=1in]{https://yourportfolio.com} \end{minipage} % Clickable elements \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, urlcolor=blue, pdftitle={John Smith - CV}, pdfauthor={John Smith}, pdfsubject={Curriculum Vitae}, pdfkeywords={software engineer, python, javascript} } % Skills with proficiency bars \usepackage{tikz} \newcommand{\skillbar}[2]{% \begin{tikzpicture} \fill[gray!30] (0,0) rectangle (4,0.2); \fill[blue!60] (0,0) rectangle (#2*0.04,0.2); \node[right] at (4.1,0.1) {\small #1}; \end{tikzpicture} } \section{Technical Skills} \skillbar{Python}{95}\\[0.5em] \skillbar{JavaScript}{90}\\[0.5em] \skillbar{Machine Learning}{85}\\[0.5em] \skillbar{DevOps}{80} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from interactive-cv.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-cv-resume-09/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_cv_resume)## CV Design Principles### Typography and Spacing```latex cv-typography.tex theme=\{null} % Professional typography settings \usepackage{microtype} % Better text appearance \usepackage[tracking=true]{microtype} % Font combinations % Option 1: Modern sans-serif \usepackage[sfdefault]{roboto} \usepackage[T1]{fontenc} % Option 2: Classic serif \usepackage{palatino} \usepackage[T1]{fontenc} % Option 3: Mixed fonts \usepackage{libertine} % Serif for body \usepackage[scaled=0.85]{beramono} % Monospace \usepackage[libertine]{newtxmath} % Math % Spacing adjustments \setlength{\parskip}{0pt} \setlength{\parindent}{0pt} \renewcommand{\baselinestretch}{1.1} % Section spacing \usepackage{titlesec} \titlespacing*{\section}{0pt}{12pt plus 4pt minus 2pt}{6pt plus 2pt minus 2pt} \titlespacing*{\subsection}{0pt}{10pt plus 3pt minus 2pt}{4pt plus 2pt minus 2pt} % Custom section formatting \titleformat{\section}{\large\bfseries\color{darkblue}}{\thesection}{0pt}{}[\titlerule] \titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{0pt}{} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Color Schemes```latex cv-colors.tex theme=\{null} % Professional color palettes % Blue theme (most common) \definecolor{headerblue}{RGB}{41,128,185} \definecolor{textblue}{RGB}{52,73,94} \definecolor{lightblue}{RGB}{174,214,241} % Green theme (eco/sustainability) \definecolor{headergreen}{RGB}{27,94,32} \definecolor{textgreen}{RGB}{46,125,50} \definecolor{lightgreen}{RGB}{200,230,201} % Burgundy theme (academic) \definecolor{headerburg}{RGB}{136,14,79} \definecolor{textburg}{RGB}{123,31,75} \definecolor{lightburg}{RGB}{248,187,208} % Usage example \newcommand{\cvheader}[1]{% \color{headerblue}\section*{#1}\color{black} } % Accent colors for highlights \newcommand{\highlight}[1]{\textcolor{headerblue}{\textbf{#1}}} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Industry-Specific Templates### Tech/Software Engineering CVKey sections:- Technical skills (languages, frameworks, tools) - GitHub/Portfolio links - Open source contributions - Technical projects with metrics - Certifications### Academic CVEssential elements:- Education (including thesis titles) - Publications (peer-reviewed, preprints) - Grants and funding - Teaching experience - Conference presentations - Professional service - Awards and honors### Business/MBA CVFocus areas:- Leadership experience - Quantifiable achievements (ROI, revenue) - Strategic initiatives - Team management - Business development - Industry expertise## Maintenance and Version Control```latex cv-versioning.tex theme=\{null} % Version control in LaTeX \usepackage{datetime2} \usepackage{gitinfo2} % Add version info to footer \fancyfoot[L]{\scriptsize Last updated: \today} \fancyfoot[R]{\scriptsize Version: \gitAbbrevHash} % Conditional content for different versions \newif\ifacademic \newif\ifindustry \academictrue % or \industryfalse \ifacademic \input{academic-content} \else \input{industry-content} \fi % Track changes \usepackage{changes} \definechangesauthor[color=blue]{JS}{John Smith} \added[id=JS]{New certification added} \deleted[id=JS]{Outdated skill removed} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Common CV Mistakes to Avoid> [!WARNING] > > **Top LaTeX CV Pitfalls:** > > 1. **Over-designing**: Keep it professional and readable > 2. **Font chaos**: Stick to 2 fonts maximum > 3. **Margin crimes**: Maintain proper whitespace > 4. **Length issues**: 1-2 pages for industry, longer for academia > 5. **PDF problems**: Always check PDF output on different devices > 6. **Missing keywords**: Include relevant terms from job posting > 7. **Complex layouts**: Avoid multi-column formats for ATS > 8. **Outdated information**: Review and update regularly## Quick Reference### Essential Packages for CVs| Package | Purpose | Best For | | - | - | - | | `moderncv` | Full CV framework | Quick professional CVs | | `europasscv` | EU standard format | European applications | | `altacv` | Modern single column | Creative fields | | `biblatex` | Publication management | Academic CVs | | `fontawesome5` | Icons and symbols | Modern designs | | `progressbar` | Skill visualizations | Tech resumes | | `timeline` | Career progression | Executive CVs |### Compilation Tips```bash theme=\{null} # Standard compilation pdflatex cv.tex pdflatex cv.tex # Run twice for references # With bibliography pdflatex cv.tex biber cv pdflatex cv.tex pdflatex cv.tex # Check for ATS compatibility pdftotext cv.pdf - | less # View as plain text ```## Next Steps> [card] CV Templates > > Download ready-to-use CV templates[Open](/templates/cv)> [card] Articles > > Create professional documents[Open](/learn/latex/how-to/articles)> [card] Academic Writing > > Write your thesis or dissertation[Open](/templates/thesis)> [card] Typography Guide > > Master LaTeX typography[Open](/learn/latex/fonts)> [!TIP] > > **Pro tip**: Keep a master CV in LaTeX with all your accomplishments, then create tailored versions by commenting out sections. Use Git to track changes and maintain different versions for different industries or positions.***Ready to create your CV? Try our [CV templates](/templates/cv) in LaTeX Cloud Studio - no installation needed! # Export LaTeX to Word (.docx) and HTML Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/export-to-word-and-html Convert a LaTeX document to Word or HTML with Pandoc, make4ht, and LaTeXML, including bibliographies, images, and the parts that never convert cleanly. Sooner or later something outside your control needs a different format: a journal that only accepts `.docx`, a co-author who will not install a TeX distribution, or a university portal that wants HTML.There is no lossless conversion, and any tool that promises one is overselling. What follows is what actually works, and what you should expect to fix by hand afterwards.## Set expectations first| Converts reliably | Converts with effort | Does not convert | | - | - | - | | Headings, paragraphs, lists | Bibliographies and citations | TikZ and PGFPlots diagrams | | Bold, italic, basic formatting | Tables with simple structure | Custom macros you defined | | Inline and display maths | Cross-references | Fine typographic control | | Figures (as raster images) | Footnotes | Complex multi-column layouts |Plan for a manual pass after conversion. For a short paper that is minutes; for a thesis with custom commands it can be substantial.## Export to Word with Pandoc[Pandoc](https://pandoc.org) is the practical choice. It reads LaTeX and writes a native `.docx`, converting maths into Word's own equation format rather than images, which means your equations stay editable in Word.```bash pandoc-basic.sh theme=\{null} pandoc paper.tex -o paper.docx ```### Include the bibliographyCitations need Pandoc's own citation processor and your `.bib` file. Without `--citeproc` your `\cite` commands are dropped.```bash pandoc-bibliography.sh theme=\{null} pandoc paper.tex \ --citeproc \ --bibliography=references.bib \ --csl=apa.csl \ -o paper.docx ```The `--csl` option takes a Citation Style Language file and controls the output style. Styles for most journals are available from the [CSL style repository](https://github.com/citation-style-language/styles). Omit it and you get Pandoc's default author-date style.### Fix images that disappearThis catches almost everyone. **Word cannot embed PDF figures.** If your LaTeX uses PDF images — which is the norm, because they are vector and scale cleanly — they will be missing or broken in the `.docx`.Convert them to a raster format first:```bash convert-figures.sh theme=\{null} # Convert every PDF figure to 300 dpi PNG for f in figures/*.pdf; do pdftoppm -r 300 -png "$f" "${f%.pdf}" done ```Then either point your `\includegraphics` calls at the PNG files, or leave the extensions off and let the converter pick them up:```latex extensionless-graphics.tex theme=\{null} % Works with both pdflatex and Pandoc: no extension given \includegraphics[width=0.8\textwidth]{figures/results} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Match a required templateJournals that ask for `.docx` usually supply a template. Pandoc can adopt its styles:```bash pandoc-reference-doc.sh theme=\{null} pandoc paper.tex --reference-doc=journal-template.docx -o paper.docx ```Pandoc copies the styles — fonts, heading levels, margins — from the reference document. It does not copy its content.### Simplify custom macros before convertingPandoc understands standard LaTeX. Commands you defined yourself are usually dropped along with their content, which is how sections silently go missing.```latex custom-macro.tex theme=\{null} % Pandoc will not expand this \newcommand{\keyterm}[1]{\textbf{\textit{#1}}} % Replace with the standard commands before exporting \textbf{\textit{term}} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-macro.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-export-to-word-and-html-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_export_to_word_and_html)If your document has many such macros, expanding them in a copy of the source is faster than fixing the output.## Export to HTMLThree tools, with genuinely different results.### make4htPart of TeX Live, so it is probably already installed. It runs your document through TeX itself, which means custom macros and packages behave as they do in your PDF — the main advantage over Pandoc.```bash make4ht.sh theme=\{null} # HTML with Unicode maths make4ht -u paper.tex # HTML with MathML, better for accessibility and search engines make4ht -u paper.tex "mathml" ```### LaTeXMLProduces the cleanest semantic HTML with proper MathML. It is what arXiv uses for its HTML papers, and it is the best choice if the output needs to be accessible or indexed well.```bash latexml.sh theme=\{null} latexmlc paper.tex --dest=paper.html ```### PandocFastest, and fine for simple documents. Maths is rendered by MathJax in the browser rather than converted:```bash pandoc-html.sh theme=\{null} pandoc paper.tex --mathjax --standalone -o paper.html ```Choose LaTeXML for archival or accessible output, make4ht when the document leans on custom TeX, and Pandoc when you want something readable quickly.## Getting your source out of a cloud editorConversion runs on your own machine, so you need the project files locally. In LaTeX Cloud Studio, export the project as a ZIP or push it to GitHub, then run Pandoc on the extracted source — see [GitHub sync, import and export](/product/github-sync-import-export).Make sure the export includes your `.bib` file and figure directory. Pandoc resolves paths relative to the file it is converting, so run it from the project root:```bash from-project-root.sh theme=\{null} cd my-paper/ pandoc main.tex --citeproc --bibliography=references.bib -o main.docx ```## Check the output before sending itConversion failures are quiet. Open the result and confirm:- Every figure is present and legible. - Equations render as equations, not as raw `$...$`. - Citations show as formatted references, not `[?]` or empty brackets. - The bibliography exists at the end. - Tables kept their structure. - No section is missing — the usual sign of an unexpanded custom macro.## Related Pages- [Working with images](/learn/latex/figures/inserting-images) - [Bibliography management](/learn/latex/bibliography) - [Writing a research paper](/learn/latex/how-to/writing-research-paper) - [Collaboration workflow](/learn/latex/how-to/collaboration-workflow)## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write and compile in the browser, then export the project when you need it locally.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=export_word_html_open_app)> [card] Import and export options > > Move projects in and out via GitHub or ZIP.[Open](/product/github-sync-import-export) # Creating Your First LaTeX Project Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/first-project Complete step-by-step guide to creating your first LaTeX project. Learn project setup, document structure, compilation, and best practices for beginners. This guide walks you through the fastest reliable way to create your first LaTeX project. It covers project setup, package choices, document structure, and the minimum workflow needed to get a clean PDF without guesswork.> [!NOTE] > > **Time to complete**: 15-20 minutes\ > **Prerequisites**: Access to LaTeX Cloud Studio or a LaTeX installation\ > **Outcome**: A complete, well-structured LaTeX document## Fastest Path If You Just Want a Working Project1) Start with `article` unless you already know you need `report`, `book`, or `beamer`. 2) Keep the first file small: title, abstract, two sections, and one list. 3) Add only the packages you actually need. 4) Compile early, then add images, references, and bibliography after the base file works. 5) Use a template once the minimal project is stable.## Project Planning### Before You StartBefore creating your LaTeX project, consider:1) **Document type** - Article, report, book, or presentation? 2) **Required features** - Math equations, images, tables, bibliography? 3) **Output format** - PDF for print or digital distribution? 4) **Collaboration needs** - Working alone or with others?### Choosing the Right Document Class> [card] article > > Best for papers, essays, and short documents > > * Sections start at top level > * No chapters > * Compact layout> [card] report > > Ideal for longer documents with chapters > > * Title page by default > * Abstract support > * Chapter organization> [card] book > > Full-length books and manuals > > * Front/back matter > * Two-sided printing > * Professional typography> [card] beamer > > Presentations and slides > > * Frame-based content > * Themes and transitions > * Speaker notes## Step 1: Create Project Structure### Basic Project Setup```latex main.tex theme=\{null} \documentclass[12pt, a4paper]{article} % Preamble - Package imports and settings \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{amsmath, amssymb, amsthm} \usepackage{graphicx} \usepackage[margin=1in]{geometry} \usepackage{hyperref} % Document metadata \title{My First LaTeX Document} \author{Your Name} \date{\today} % Document content \begin{document} \maketitle \begin{abstract} This is my first LaTeX document, demonstrating the basic structure and common elements used in academic writing. \end{abstract} \tableofcontents \newpage \section{Introduction} Welcome to LaTeX! This document will help you understand the basics of document creation and formatting. \section{Getting Started} Let's explore the fundamental concepts and features of LaTeX. \subsection{Why Use LaTeX?} LaTeX offers several advantages: \begin{itemize} \item Professional typesetting \item Excellent mathematical notation \item Automatic numbering and references \item Consistent formatting \end{itemize} \section{Conclusion} You've successfully created your first LaTeX document! \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from main.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-first-project-01/page-1.svg) Open zoomable preview: Compiled PDF page 2 from main.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-first-project-01/page-2.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_first_project)### Understanding the Structure#### Preamble SectionThe preamble (before `\begin{document}`) contains:- **Document class**: Defines overall layout - **Packages**: Add functionality - **Settings**: Configure appearance - **Metadata**: Title, author, date#### Document BodyThe main content (between `\begin{document}` and `\end{document}`) contains:- **Front matter**: Title, abstract, table of contents - **Main content**: Sections, paragraphs, lists - **Back matter**: Bibliography, appendices## Step 2: Add Essential Packages### Core Package Set```latex essential-packages.tex theme=\{null} % Essential packages for any document \usepackage[utf8]{inputenc} % Input encoding \usepackage[T1]{fontenc} % Font encoding \usepackage[english]{babel} % Language support \usepackage{geometry} % Page layout \usepackage{graphicx} % Images \usepackage{hyperref} % Clickable links % Math and science \usepackage{amsmath, amssymb} % Math symbols and environments \usepackage{siunitx} % SI units % Tables and lists \usepackage{booktabs} % Professional tables \usepackage{enumitem} % List customization % References and citations \usepackage{biblatex} % Bibliography \addbibresource{references.bib} % Bibliography file ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Package Categories> [tab] Typography > > ````latex example.tex theme=\{null} > \usepackage{microtype} % Subtle typography improvements > \usepackage{fontspec} % Custom fonts (XeLaTeX/LuaLaTeX) > \usepackage{lmodern} % Latin Modern fonts > \usepackage{setspace} % Line spacing control > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Graphics > > ````latex example.tex theme=\{null} > \usepackage{tikz} % Drawings and diagrams > \usepackage{pgfplots} % Plots and charts > \usepackage{subcaption} % Subfigures > \usepackage{wrapfig} % Text wrapping > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Code > > ````latex example.tex theme=\{null} > \usepackage{listings} % Code listings > \usepackage{minted} % Syntax highlighting > \usepackage{algorithm2e} % Algorithms > \usepackage{verbatim} % Verbatim text > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Layout > > ````latex example.tex theme=\{null} > \usepackage{multicol} % Multiple columns > \usepackage{fancyhdr} % Headers and footers > \usepackage{titlesec} % Section formatting > \usepackage{tocloft} % TOC customization > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````## Step 3: Write Content### Text Formatting```latex text-formatting.tex theme=\{null} \section{Text Formatting Examples} % Basic formatting This is \textbf{bold text}, \textit{italic text}, and \underline{underlined text}. You can also combine them: \textbf{\textit{bold italic}}. % Font sizes {\tiny tiny} {\small small} {\normalsize normal} {\large large} {\huge huge} % Emphasis and quotes \emph{Emphasized text} adapts to context. Use ``double quotes'' for quotations. % Paragraph formatting \paragraph{Named paragraph} This creates a named paragraph with special formatting. % Line breaks and spacing First line\\ Second line with forced break First paragraph. Second paragraph with extra spacing. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from text-formatting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-first-project-07/page-1.svg)
### Lists and Enumerations```latex lists.tex theme=\{null} % Bullet points \begin{itemize} \item First item \item Second item \begin{itemize} \item Nested item \item Another nested item \end{itemize} \item Third item \end{itemize} % Numbered lists \begin{enumerate} \item First step \item Second step \item Third step \end{enumerate} % Description lists \begin{description} \item[LaTeX] A document preparation system \item[PDF] Portable Document Format \item[BibTeX] Bibliography management tool \end{description} % Custom lists with enumitem \usepackage{enumitem} \begin{enumerate}[label=(\alph*)] \item First item with (a) \item Second item with (b) \end{enumerate} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from lists.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-first-project-08/page-1.svg)
## Step 4: Add Visual Elements### Including Images```latex images.tex theme=\{null} \section{Working with Images} % Simple image inclusion \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{example-image} \caption{A sample image with descriptive caption} \label{fig:example} \end{figure} % Multiple images side by side \begin{figure}[htbp] \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{image1} \caption{First image} \end{subfigure} \hfill \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{image2} \caption{Second image} \end{subfigure} \caption{Two images side by side} \label{fig:comparison} \end{figure} As shown in Figure~\ref{fig:example}, images can be easily referenced. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Creating Tables```latex tables.tex theme=\{null} \section{Tables} % Simple table \begin{table}[htbp] \centering \caption{Sample data table} \label{tab:sample} \begin{tabular}{lcc} \toprule Item & Quantity & Price \\ \midrule Apples & 5 & \$2.50 \\ Oranges & 3 & \$1.80 \\ Bananas & 6 & \$3.00 \\ \bottomrule \end{tabular} \end{table} Table~\ref{tab:sample} shows a professional table using booktabs. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-first-project-10/page-1.svg)
## Step 5: Mathematical Content### Equations and Formulas```latex mathematics.tex theme=\{null} \section{Mathematical Expressions} % Inline math The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. % Display equation with number \begin{equation} E = mc^2 \label{eq:einstein} \end{equation} % Multiple aligned equations \begin{align} f(x) &= x^2 + 2x + 1 \\ &= (x + 1)^2 \end{align} % Matrices \begin{equation} A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix} \end{equation} As shown in Equation~\ref{eq:einstein}, mass and energy are related. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from mathematics.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-first-project-11/page-1.svg)
## Step 6: Compile Your Document### Compilation Process1) **Save your file** with `.tex` extension 2) **Choose compiler**: * **pdfLaTeX**: Standard choice, fast compilation * **XeLaTeX**: Unicode and system fonts * **LuaLaTeX**: Advanced features 3) **Run compilation** (may need 2-3 passes) 4) **Check output** for errors and warnings### Common Compilation Issues> [!WARNING] > > **Fix these common errors**: > > * **Missing `$`**: Math mode not properly closed > * **Undefined control sequence**: Typo in command or missing package > * **Missing `\end{}`**: Environment not closed > * **File not found**: Check image paths and filenames### Compilation Workflow```mermaid theme=\{null} graph LR A[Write .tex file] --> B[Run pdfLaTeX] B --> C{Errors?} C -->|Yes| D[Fix errors] D --> B C -->|No| E[Check references] E --> F{References OK?} F -->|No| B F -->|Yes| G[Final PDF] ```## Step 7: Add References### Bibliography Management```latex bibliography.tex theme=\{null} % In preamble \usepackage{biblatex} \addbibresource{references.bib} % In document \section{Literature Review} According to \textcite{knuth1984}, TeX is a typesetting system. The LaTeX system \parencite{lamport1994} builds upon TeX. Recent developments are discussed in \cite{modern2023}. % At document end \printbibliography ``````bibtex references.bib theme=\{null} @book{knuth1984, author = {Knuth, Donald E.}, title = {The {\TeX}book}, year = {1984}, publisher = {Addison-Wesley} } @book{lamport1994, author = {Lamport, Leslie}, title = {\LaTeX: A Document Preparation System}, year = {1994}, publisher = {Addison-Wesley} } @article{modern2023, author = {Smith, John and Doe, Jane}, title = {Modern \LaTeX{} Techniques}, journal = {Journal of Typesetting}, year = {2023}, volume = {15}, pages = {123--145} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
## Project Organization### File Structure``` my-project/ ├── main.tex # Main document ├── chapters/ # Chapter files │ ├── intro.tex │ ├── methods.tex │ └── results.tex ├── figures/ # Images and diagrams │ ├── plot1.pdf │ └── diagram.png ├── references.bib # Bibliography └── style.sty # Custom styles ```### Multi-file Projects```latex main-multi.tex theme=\{null} \documentclass{report} % ... preamble ... \begin{document} \include{chapters/intro} \include{chapters/methods} \include{chapters/results} \printbibliography \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex example.tex theme=\{null} \chapter{Introduction} \label{ch:intro} This chapter introduces the research topic... \section{Background} The background of this research... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Best Practices> [!TIP] > > **Follow these guidelines for professional documents**: > > 1. **Consistent style** - Use the same formatting throughout > 2. **Meaningful labels** - `\label{fig:data-analysis}` not `\label{fig1}` > 3. **Regular compilation** - Catch errors early > 4. **Version control** - Track changes with Git > 5. **Modular structure** - Split large documents into files > 6. **Comments** - Document complex code with `%` comments## Complete Example Project```latex complete-project.tex theme=\{null} \documentclass[12pt, a4paper]{article} % ================== % PREAMBLE % ================== % Encoding and fonts \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} % Language \usepackage[english]{babel} % Page layout \usepackage[margin=1in]{geometry} \usepackage{setspace} \onehalfspacing % Graphics and color \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} % Math packages \usepackage{amsmath, amssymb, amsthm} % Tables \usepackage{booktabs} \usepackage{array} % References \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, citecolor=green, urlcolor=red } % Bibliography \usepackage{biblatex} \addbibresource{references.bib} % Custom commands \newcommand{\R}{\mathbb{R}} \newcommand{\important}[1]{\textcolor{red}{\textbf{#1}}} % Theorem environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} % Document info \title{A Complete LaTeX Project Example} \author{Your Name\\ \small Department of Computer Science\\ \small University Name} \date{\today} % ================== % DOCUMENT BODY % ================== \begin{document} \maketitle \begin{abstract} This document demonstrates a complete LaTeX project structure, including all common elements used in academic writing. It serves as a template for creating professional documents. \end{abstract} \tableofcontents \newpage \section{Introduction} \label{sec:intro} LaTeX is a powerful typesetting system particularly suited for technical and scientific documentation. This document demonstrates its capabilities through practical examples. \subsection{Motivation} The motivation for using LaTeX includes: \begin{itemize} \item Superior mathematical typesetting \item Consistent document formatting \item Excellent bibliography management \item Cross-platform compatibility \end{itemize} \section{Mathematical Content} \label{sec:math} \subsection{Equations} The quadratic equation \cite{mathbook2020} is given by: \begin{equation} ax^2 + bx + c = 0 \label{eq:quadratic} \end{equation} The solutions to Equation~\eqref{eq:quadratic} are: \begin{equation} x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \end{equation} \subsection{Theorems} \begin{theorem}[Pythagorean Theorem] \label{thm:pythagoras} In a right triangle with legs $a$ and $b$ and hypotenuse $c$: \begin{equation} a^2 + b^2 = c^2 \end{equation} \end{theorem} \begin{proof} The proof follows from geometric considerations... \end{proof} \section{Tables and Figures} \label{sec:visual} \subsection{Tables} Table~\ref{tab:results} shows experimental results. \begin{table}[htbp] \centering \caption{Experimental results} \label{tab:results} \begin{tabular}{lccc} \toprule Method & Accuracy & Precision & Recall \\ \midrule Baseline & 0.85 & 0.82 & 0.88 \\ Improved & 0.92 & 0.90 & 0.94 \\ \important{Proposed} & \important{0.96} & \important{0.95} & \important{0.97} \\ \bottomrule \end{tabular} \end{table} \subsection{Figures} Figure~\ref{fig:example} shows an example image. \begin{figure}[htbp] \centering \includegraphics[width=0.6\textwidth]{example-image} \caption{Example figure with caption} \label{fig:example} \end{figure} \section{Code Listings} \label{sec:code} Here's an example algorithm: \begin{verbatim} def fibonacci(n): if n <= 1: return n return fibonacci(n-1) + fibonacci(n-2) \end{verbatim} \section{Conclusion} \label{sec:conclusion} This document has demonstrated the essential elements of a LaTeX project. For more information, see \cite{latex2023}. \printbibliography \appendix \section{Additional Resources} \begin{itemize} \item Official LaTeX documentation \item TeX Stack Exchange \item LaTeX Wikibook \end{itemize} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Next StepsNow that you've created your first project:1. **Experiment with packages** - Try TikZ for diagrams or minted for code 2. **Create templates** - Save time on future projects 3. **Learn advanced features** - Master bibliographies and cross-references 4. **Join the community** - Get help on forums and Stack Exchange> [card] Working with Images > > Learn image inclusion, positioning, and formatting[Open](/learn/latex/figures/inserting-images)> [card] Creating Tables > > Master professional table creation and formatting[Open](/learn/latex/tables/creating-tables)> [card] Managing Large Documents > > Organize multi-file projects effectively[Open](/learn/latex/how-to/large-documents)> [card] Fix Errors > > Troubleshoot common compilation problems[Open](/learn/latex/basics/errors)## Quick Reference### Essential Commands| Command | Purpose | Example | | - | - | - | | `\documentclass{}` | Set document type | `\documentclass{article}` | | `\usepackage{}` | Load package | `\usepackage{graphicx}` | | `\section{}` | Create section | `\section{Introduction}` | | `\label{}` | Create reference | `\label{sec:intro}` | | `\ref{}` | Reference label | `\ref{sec:intro}` | | `\cite{}` | Cite reference | `\cite{knuth1984}` |***> [!NOTE] > > **Congratulations!** You've successfully created your first LaTeX project. Continue exploring our guides to master advanced features and create professional documents.## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=first_project_open_app)> [card] Start from Article Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/article) # Managing Large Documents in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/large-documents Master multi-file LaTeX projects. Learn document structuring, file organization, cross-referencing, and compilation strategies for books, theses, and reports. Learn professional techniques for managing large LaTeX documents like books, theses, and technical reports. This guide covers file organization, modular document structure, efficient compilation, and team collaboration strategies.> [!NOTE] > > **Prerequisites**: Basic LaTeX knowledge, understanding of document classes\ > **Time to complete**: 35-40 minutes\ > **Difficulty**: Advanced\ > **What you'll learn**: Project structure, input/include commands, subfiles, cross-referencing, and build optimization## Why Split Large Documents?### Benefits of Modular Structure> [card] Faster Compilation > > Compile only changed sections during development> [card] Better Organization > > Logical file structure mirrors document structure> [card] Team Collaboration > > Multiple authors can work on different sections> [card] Version Control > > Track changes at the chapter/section level### When to Split Documents> [!TIP] > > **Consider splitting when**: > > * Document exceeds 50 pages > * Multiple authors collaborate > * Chapters have distinct topics > * Compilation takes over 30 seconds > * You need different formatting per section > * Managing bibliography becomes complex## Project Structure### Standard Directory Layout``` my-thesis/ ├── main.tex # Master document ├── preamble/ │ ├── packages.tex # Package imports │ ├── settings.tex # Document settings │ ├── commands.tex # Custom commands │ └── environments.tex # Custom environments ├── frontmatter/ │ ├── titlepage.tex # Title page │ ├── abstract.tex # Abstract │ ├── dedication.tex # Dedication │ └── acknowledgments.tex # Acknowledgments ├── chapters/ │ ├── introduction.tex # Chapter 1 │ ├── literature.tex # Chapter 2 │ ├── methodology.tex # Chapter 3 │ ├── results.tex # Chapter 4 │ └── conclusion.tex # Chapter 5 ├── appendices/ │ ├── appendix-a.tex # Appendix A │ └── appendix-b.tex # Appendix B ├── backmatter/ │ ├── bibliography.bib # References │ └── index.tex # Index entries ├── figures/ # All images │ ├── chapter1/ │ ├── chapter2/ │ └── shared/ ├── tables/ # Complex tables └── build/ # Build artifacts ```### Master Document Setup```latex main.tex theme=\{null} \documentclass[12pt, twoside, openright]{book} % Load preamble components \input{preamble/packages} \input{preamble/settings} \input{preamble/commands} \input{preamble/environments} % Document metadata \title{Your Document Title} \author{Your Name} \date{\today} \begin{document} % Front matter \frontmatter \input{frontmatter/titlepage} \input{frontmatter/dedication} \input{frontmatter/acknowledgments} \input{frontmatter/abstract} \tableofcontents \listoffigures \listoftables % Main matter \mainmatter \input{chapters/introduction} \input{chapters/literature} \input{chapters/methodology} \input{chapters/results} \input{chapters/conclusion} % Appendices \appendix \input{appendices/appendix-a} \input{appendices/appendix-b} % Back matter \backmatter \printbibliography[heading=bibintoc] \printindex \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex example.tex theme=\{null} % Essential packages for large documents \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} % Page layout \usepackage[ top=1in, bottom=1in, left=1.5in, right=1in, headheight=14pt ]{geometry} % Graphics and colors \usepackage{graphicx} \usepackage{xcolor} \usepackage{tikz} % Tables and lists \usepackage{booktabs} \usepackage{longtable} \usepackage{array} \usepackage{enumitem} % Mathematics \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} % References and links \usepackage{hyperref} \usepackage{cleveref} \usepackage[nameinlink]{cleveref} % Bibliography \usepackage[ backend=biber, style=authoryear, sorting=nyt ]{biblatex} \addbibresource{backmatter/bibliography.bib} % Index \usepackage{imakeidx} \makeindex[intoc] % Headers and footers \usepackage{fancyhdr} \usepackage{emptypage} % Code listings \usepackage{listings} \usepackage{minted} % Subfigures \usepackage{subcaption} % Todo notes \usepackage[disable]{todonotes} % Enable during writing ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Input vs Include### Understanding the Differences> [tab] \input > > ````latex example.tex theme=\{null} > % Direct text insertion > \input{filename} % No .tex extension needed > > % Characteristics: > % - No page break before/after > % - Can be nested > % - Good for preamble files > % - Compiles every time > > % Example usage: > \input{preamble/packages} > \input{chapters/section1} > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> ````> [tab] \include > > ````latex example.tex theme=\{null} > % Chapter-level inclusion > \include{filename} % No .tex extension > > % Characteristics: > % - Starts new page before > % - Clears page after > % - Cannot be nested > % - Works with \includeonly > % - Creates .aux file > > % Example usage: > \include{chapters/introduction} > \include{chapters/methodology} > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> ````> [tab] \includeonly > > ````latex example.tex theme=\{null} > % Selective compilation > \includeonly{ > chapters/introduction, > chapters/results > } > > % Only compiles listed files > % Preserves numbering/references > % Massive time savings > % Perfect for focused editing > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
> ````### Practical Examples```latex efficient-workflow\.tex theme=\{null} % During writing - compile only current chapter \includeonly{chapters/methodology} \begin{document} % ... front matter ... \include{chapters/introduction} % Skipped \include{chapters/literature} % Skipped \include{chapters/methodology} % Compiled \include{chapters/results} % Skipped \include{chapters/conclusion} % Skipped ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is structurally incomplete and cannot be compiled honestly as a standalone document. It shows document-boundary syntax rather than a visible page result.\
```latex nested-structure.tex theme=\{null} % chapters/methodology.tex \chapter{Methodology} \label{ch:methodology} \section{Overview} This chapter describes our research methodology. % Include section files \input{chapters/methodology/data-collection} \input{chapters/methodology/analysis} \input{chapters/methodology/validation} \section{Summary} The methodology ensures reliable results... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## The Subfiles Package### Independent Compilation```latex main-subfiles.tex theme=\{null} \documentclass{book} \usepackage{subfiles} % ... other packages ... \begin{document} \subfile{chapters/introduction} \subfile{chapters/literature} \subfile{chapters/methodology} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex example.tex theme=\{null} \documentclass[../main.tex]{subfiles} \begin{document} \chapter{Introduction} \label{ch:intro} This thesis investigates... % Can be compiled independently! % Run: pdflatex introduction.tex \section{Background} The research background... \section{Objectives} Our main objectives are... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex standalone-chapter.tex theme=\{null} % Alternative: standalone package \documentclass{standalone} \usepackage{import} % Stand-alone compilable \begin{document} \import{../}{preamble} \chapter{Standalone Chapter} Content here... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Subfiles Best Practices> [!TIP] > > **Subfiles workflow tips**: > > 1. Each chapter can be compiled separately > 2. Graphics paths are relative to main file > 3. Bibliography works in both modes > 4. Perfect for author collaboration > 5. Faster development cycles## Cross-referencing### Managing References Across Files```latex smart-referencing.tex theme=\{null} % Enable smart referencing \usepackage{xr} % Cross-references to external documents \usepackage{xr-hyper} % With hyperref support \usepackage{cleveref} % Reference another document \externaldocument[ext:]{external-doc} % In chapters/introduction.tex \chapter{Introduction} \label{ch:intro} \section{Motivation} \label{sec:intro:motivation} As discussed in \cref{ch:methodology}, our approach... % In chapters/methodology.tex \chapter{Methodology} \label{ch:methodology} Building on \cref{sec:intro:motivation}, we develop... % Cleveref automatically handles: % "Chapter 3" vs "Section 1.2" vs "Figure 4.5" ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex reference-organization.tex theme=\{null} % Systematic labeling convention \label{type:chapter:section:subsection} % Examples: \label{ch:intro} % Chapter \label{sec:intro:background} % Section \label{subsec:intro:background:history} % Subsection \label{fig:results:accuracy} % Figure \label{tab:data:summary} % Table \label{eq:methodology:formula} % Equation \label{alg:analysis:process} % Algorithm \label{thm:theory:main} % Theorem \label{def:terms:important} % Definition % Easy to find and maintain % Avoids naming conflicts % Self-documenting ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Advanced Cross-referencing```latex multi-file-refs.tex theme=\{null} % Create a references file % refs/labels.tex \newcommand{\introduction}{\cref{ch:intro}} \newcommand{\methodology}{\cref{ch:methodology}} \newcommand{\maintheorem}{\cref{thm:main}} \newcommand{\resultsfigure}{\cref{fig:results:main}} % Use semantic references As shown in \resultsfigure, our method outperforms... The proof follows from \maintheorem... % Benefits: % - Central management % - Easy to update % - Semantic naming % - Find/replace friendly ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex reference-checking.tex theme=\{null} % Check for undefined references \usepackage{refcheck} % Shows unused labels \usepackage{showlabels} % During development only: \usepackage[notref,notcite]{showkeys} % Custom warning for missing refs \makeatletter \def\@refundefined#1{% \textbf{[REF: #1??]}% \@latex@warning{Reference `#1' undefined}% } \makeatother ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Compilation Strategies### Build Systems> [tab] Makefile > > ```makefile theme=\{null} > # Makefile for large LaTeX projects > MAIN = main > CHAPTERS = $(wildcard chapters/*.tex) > FIGURES = $(wildcard figures/**/*.pdf) > BIBTEX = biber > > # Default target > all: $(MAIN).pdf > > # Main compilation > $(MAIN).pdf: $(MAIN).tex $(CHAPTERS) $(FIGURES) > pdflatex $(MAIN) > $(BIBTEX) $(MAIN) > pdflatex $(MAIN) > pdflatex $(MAIN) > > # Quick build (no bibliography) > quick: > pdflatex $(MAIN) > > # Clean auxiliary files > clean: > rm -f *.aux *.log *.out *.toc *.lof *.lot > rm -f *.bbl *.blg *.bcf *.run.xml > rm -f chapters/*.aux > > # Clean everything > distclean: clean > rm -f $(MAIN).pdf > > # Watch for changes > watch: > latexmk -pdf -pvc $(MAIN) > > .PHONY: all quick clean distclean watch > ```> [tab] latexmk > > ```perl theme=\{null} > # .latexmkrc configuration > $pdf_mode = 1; # Use pdflatex > $bibtex_use = 2; # Use biber > $out_dir = 'build'; # Output directory > > # Custom dependencies > add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); > add_cus_dep('acn', 'acr', 0, 'run_makeglossaries'); > > sub run_makeglossaries { > if ( $silent ) { > system "makeglossaries -q '$_[0]'"; > } else { > system "makeglossaries '$_[0]'"; > }; > } > > # Continuous preview > $preview_continuous_mode = 1; > $pdf_previewer = 'open -a Skim'; > > # Clean extensions > $clean_ext = 'synctex.gz acn acr alg aux bbl bcf blg brf fdb_latexmk glg glo gls idx ilg ind ist lof log lot out run.xml toc'; > ```> [tab] VS Code Tasks > > ```json theme=\{null} > // .vscode/tasks.json > { > "version": "2.0.0", > "tasks": [ > { > "label": "Build LaTeX", > "type": "shell", > "command": "latexmk", > "args": [ > "-pdf", > "-synctex=1", > "-interaction=nonstopmode", > "-file-line-error", > "main.tex" > ], > "group": { > "kind": "build", > "isDefault": true > } > }, > { > "label": "Quick Compile", > "type": "shell", > "command": "pdflatex", > "args": ["main.tex"], > "problemMatcher": [] > }, > { > "label": "Clean Auxiliary", > "type": "shell", > "command": "latexmk", > "args": ["-c"], > "problemMatcher": [] > } > ] > } > ```### Compilation Optimization```latex draft-mode.tex theme=\{null} % Fast draft compilation \documentclass[draft]{book} % Images shown as boxes % Overfull boxes marked % Much faster compilation % Conditional draft mode \usepackage{ifdraft} \ifdraft{ \usepackage[disable]{todonotes} \overfullrule=5pt }{ \usepackage{todonotes} \overfullrule=0pt } % Skip expensive operations \ifdraft{ \renewcommand{\includegraphics}[2][]{% \fbox{#2}% Just show filename } }{} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex externalization.tex theme=\{null} % Externalize TikZ pictures \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize[prefix=tikz/] % Compile once, reuse many times \begin{tikzpicture} % Complex diagram % Only recompiled if changed \end{tikzpicture} % Externalize other content \usepackage{standalone} \usepackage{docmute} % In main.tex: \input{figures/complex-diagram} % Can also compile standalone ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Version Control### Git Best Practices```bash .gitignore theme=\{null} # LaTeX auxiliary files *.aux *.lof *.log *.lot *.fls *.out *.toc *.fmt *.fot *.cb *.cb2 .*.lb # Bibliography auxiliary *.bbl *.bcf *.blg *-blx.aux *-blx.bib *.run.xml # Build artifacts build/ *.pdf !figures/*.pdf !templates/*.pdf # Editor files .vscode/ *.swp *.swo *~ .DS_Store # Temporary files *.tmp *.bak *.backup ``````bash git-workflow\.sh theme=\{null} # Meaningful commits for documents git add chapters/methodology.tex git commit -m "Add data analysis section to methodology" git add figures/chapter3/*.pdf git commit -m "Add experimental results figures" git add preamble/commands.tex git commit -m "Define custom theorem environments" # Tag milestones git tag -a v1.0-draft -m "First complete draft" git tag -a v2.0-submission -m "Journal submission version" # Branch for major revisions git checkout -b revision-reviewer-1 git checkout -b conference-version ```### Collaboration Strategies> [!TIP] > > **Team collaboration tips**: > > 1. **One sentence per line** - Easier diffs > 2. **Semantic linebreaks** - Break at clauses > 3. **Chapter ownership** - Assign primary authors > 4. **Regular integration** - Daily merges > 5. **Automated builds** - CI/CD for PDFs## Managing Bibliography### Modular Bibliography```latex bibliography-setup.tex theme=\{null} % Split bibliography by chapter \usepackage[refsection=chapter]{biblatex} \addbibresource{references/intro.bib} \addbibresource{references/theory.bib} \addbibresource{references/experiments.bib} % Print chapter bibliographies \printbibliography[heading=subbibintoc] % Or global bibliography \printbibliography[heading=bibintoc] % Bibliography categories \DeclareBibliographyCategory{own} \addtocategory{own}{myarticle2020,mybook2021} \printbibliography[ category=own, title={Own Publications} ] ``````bibtex references/management.bib theme=\{null} % Organize by topic % references/machine-learning.bib @article{lecun2015deep, title={Deep learning}, author={LeCun, Yann and Bengio, Yoshua and Hinton, Geoffrey}, journal={Nature}, volume={521}, number={7553}, pages={436--444}, year={2015} } % references/statistics.bib @book{hastie2009elements, title={The elements of statistical learning}, author={Hastie, Trevor and Tibshirani, Robert and Friedman, Jerome}, year={2009}, publisher={Springer} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
## Multi-format Output### Conditional Formatting```latex conditional-output.tex theme=\{null} % Different formats from same source \usepackage{ifthen} \newboolean{printversion} \setboolean{printversion}{true} % or false % Conditional content \ifthenelse{\boolean{printversion}}{ % Print version \usepackage[colorlinks=false]{hyperref} \geometry{twoside} }{ % Digital version \usepackage[colorlinks=true]{hyperref} \geometry{oneside} } % Format-specific content \newcommand{\printonly}[1]{% \ifthenelse{\boolean{printversion}}{#1}{}% } \newcommand{\digitalonly}[1]{% \ifthenelse{\boolean{printversion}}{}{#1}% } % Usage \digitalonly{\href{https://example.com}{Click here for details}} \printonly{See \url{https://example.com} for details} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Troubleshooting Large Documents### Common Issues> [!WARNING] > > **Large document problems and solutions**: > > 1. **Undefined references** > ```latex theme=\{null} > % Run LaTeX multiple times > pdflatex main && pdflatex main && pdflatex main > ``` > > 2. **Memory errors** > ```bash theme=\{null} > # Increase memory limits > export extra_mem_top=2000000 > export extra_mem_bot=2000000 > ``` > > 3. **Slow compilation** > * Use `\includeonly` during writing > * Enable draft mode > * Externalize graphics > > 4. **File not found** > ```latex theme=\{null} > % Check paths > \input{./chapters/intro} % Explicit path > \graphicspath{{./figures/}{./images/}} > ``` > > 5. **Conflicting packages** > * Load hyperref last > * Check package documentation > * Use compatibility options## Complete Example Project```latex complete-thesis-structure.tex theme=\{null} % main.tex - Complete thesis example \documentclass[ 12pt, a4paper, twoside, openright, english, bibliography=totoc, listof=totoc ]{scrbook} % ====== PREAMBLE SETUP ====== \input{preamble/packages} \input{preamble/settings} \input{preamble/commands} % Conditional compilation \includeonly{ chapters/introduction, chapters/methodology, chapters/results } % ====== DOCUMENT INFO ====== \title{Advanced Research in LaTeX Document Management} \author{Your Name} \date{\today} \begin{document} % ====== FRONT MATTER ====== \frontmatter \input{frontmatter/titlepage} \input{frontmatter/declaration} \input{frontmatter/abstract} \input{frontmatter/acknowledgments} \tableofcontents \listoffigures \listoftables \input{frontmatter/abbreviations} % ====== MAIN MATTER ====== \mainmatter \include{chapters/introduction} \include{chapters/literature} \include{chapters/theory} \include{chapters/methodology} \include{chapters/implementation} \include{chapters/results} \include{chapters/discussion} \include{chapters/conclusion} % ====== APPENDICES ====== \appendix \include{appendices/code} \include{appendices/data} \include{appendices/proofs} % ====== BACK MATTER ====== \backmatter \printbibliography[heading=bibintoc] \include{backmatter/glossary} \printindex \end{document} ``````bash project-setup.sh theme=\{null} #!/bin/bash # Setup script for large LaTeX project # Create directory structure mkdir -p {preamble,frontmatter,chapters,appendices,backmatter} mkdir -p {figures,tables,build} mkdir -p figures/{chapter1,chapter2,shared} # Create preamble files touch preamble/{packages,settings,commands,environments}.tex # Create chapter files for i in {1..8}; do touch chapters/chapter$i.tex done # Create front/back matter touch frontmatter/{titlepage,abstract,acknowledgments}.tex touch backmatter/bibliography.bib # Create Makefile cat > Makefile << 'EOF' MAIN = main LATEX = pdflatex BIBTEX = biber BUILDDIR = build all: $(MAIN).pdf $(MAIN).pdf: $(MAIN).tex $(LATEX) -output-directory=$(BUILDDIR) $(MAIN) cd $(BUILDDIR) && $(BIBTEX) $(MAIN) $(LATEX) -output-directory=$(BUILDDIR) $(MAIN) $(LATEX) -output-directory=$(BUILDDIR) $(MAIN) cp $(BUILDDIR)/$(MAIN).pdf . clean: rm -rf $(BUILDDIR)/* .PHONY: all clean EOF echo "Project structure created!" ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
## Best Practices Summary> [!TIP] > > ✅ **Large document checklist**: > > * [ ] Logical file structure > * [ ] Consistent naming convention > * [ ] Modular preamble > * [ ] Smart cross-referencing > * [ ] Version control setup > * [ ] Build automation > * [ ] Backup strategy > * [ ] Collaboration guidelines > * [ ] Documentation/README > * [ ] Regular integration builds## Next StepsContinue mastering advanced LaTeX:> [card] Collaboration Workflow > > Team collaboration strategies[Open](/learn/latex/how-to/collaboration-workflow)> [card] Using Templates > > Create and use document templates[Open](/learn/latex/how-to/using-templates)> [card] Fixing Errors > > Troubleshoot compilation issues[Open](/learn/latex/basics/errors)> [card] Book Publishing > > Professional book creation[Open](/learn/latex/how-to/book-publishing)> [card] Knowledge Base Docs > > Keep the core papers and source PDFs for a large project inside the same workspace as the document tree.[Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=large_documents)> [card] AI Research Agent Docs > > Use accepted-source expansion and literature follow-up work when a chapter needs stronger evidence.[Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=large_documents)### Large Document Structure Toolkit- [Sections and chapters](/learn/latex/document-structure/sections-and-chapters) - [Table of contents](/learn/latex/document-structure/table-of-contents) - [Glossaries and acronyms](/learn/latex/document-structure/glossaries) - [Indexes](/learn/latex/document-structure/indexes) - [Hyperlinks](/learn/latex/document-structure/hyperlinks) - [Multi-file projects](/learn/latex/document-structure/multi-file-projects) - [filecontents package](/learn/latex/document-structure/filecontents-package) - [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide)***> [!NOTE] > > **Pro tip**: Start with a well-organized structure from the beginning. It's much harder to reorganize a monolithic document later. Use version control from day one and establish clear naming conventions for your team. # Multi-language Documents in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/multi-language-documents Create documents in multiple languages with LaTeX. Learn babel, polyglossia, font selection, and internationalization best practices for global documents. Master the creation of multi-language documents in LaTeX. This guide covers language packages, font configuration, bidirectional text, special characters, and internationalization strategies for professional multilingual publications.> [!NOTE] > > **Prerequisites**: Basic LaTeX knowledge\ > **Time to complete**: 30-35 minutes\ > **Difficulty**: Intermediate to Advanced\ > **What you'll learn**: Language packages, fonts, encoding, hyphenation, and localization## Multi-language Overview### Why Multi-language Support Matters> [card] Global Reach > > Create documents for international audiences> [card] Academic Requirements > > Citations and quotes in original languages> [card] Business Documents > > Multilingual reports and presentations> [card] Cultural Accuracy > > Proper typography and formatting rules### Language Support Methods> [tab] babel > > **Traditional package** > > * Wide language support > * Works with pdfLaTeX > * Extensive documentation > * Active development> [tab] polyglossia > > **Modern alternative** > > * Designed for XeLaTeX/LuaLaTeX > * Better Unicode support > * Advanced font features > * Modern languages> [tab] CJK > > **Asian languages** > > * Chinese, Japanese, Korean > * Special considerations > * Font requirements > * Input methods## Babel Package### Basic Setup```latex babel-basic.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} % Load languages (last one is default) \usepackage[spanish, french, english]{babel} \begin{document} % English (default) \section{Introduction} This document demonstrates multi-language support. % Switch to French \selectlanguage{french} \section{Introduction} Ce document démontre le support multilingue. % Switch to Spanish \selectlanguage{spanish} \section{Introducción} Este documento demuestra el soporte multilingüe. % Back to English \selectlanguage{english} % Inline language switching This is English text with some \foreignlanguage{french}{mots français} and \foreignlanguage{spanish}{palabras españolas}. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from babel-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_multi_language_documents)```latex babel-advanced.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[german, greek, english]{babel} % Language-specific commands \addto\captionsenglish{ \renewcommand{\contentsname}{Table of Contents} } \addto\captionsgerman{ \renewcommand{\contentsname}{Inhaltsverzeichnis} } \begin{document} \tableofcontents \section{Multilingual Document} % Environment for language switching \begin{otherlanguage}{german} \subsection{Deutscher Abschnitt} Dies ist ein deutscher Text mit korrekter Silbentrennung und Typografie. Beachten Sie die Anführungszeichen: "`deutsche Anführungszeichen"'. \end{otherlanguage} % Greek text \begin{otherlanguage}{greek} \subsection{Ελληνική ενότητα} Αυτό είναι ελληνικό κείμενο με σωστή υφενοποίηση. \end{otherlanguage} % Babel shorthands \selectlanguage{german} Das ist ein "Beispiel" mit deutschen Anführungszeichen. Der Bindestrich"=Trick funktioniert auch. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from babel-advanced.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-02/page-1.svg)
### Language-specific Features```latex babel-features.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french, spanish, english]{babel} \begin{document} % Date formatting \selectlanguage{english} Today's date: \today \selectlanguage{french} Date d'aujourd'hui: \today \selectlanguage{spanish} Fecha de hoy: \today % Hyphenation patterns \selectlanguage{english} \hyphenation{hy-phen-a-tion ex-am-ple} This is a hyphenation example with very long words. % Language-specific typography \selectlanguage{french} \frenchspacing % French spacing rules Voici un exemple : avec les espaces françaises ! % Quotes \selectlanguage{english} English ``quotes'' are different from \selectlanguage{french}\og guillemets français\fg{} and \selectlanguage{spanish}<>. % Language attributes \selectlanguage{english} \languageattribute{english}{american} % American English Color, organize, analyze. \languageattribute{english}{british} % British English Colour, organise, analyse. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex babel-environments.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian, german, english]{babel} % Define language environments \newenvironment{english} {\begin{otherlanguage}{english}} {\end{otherlanguage}} \newenvironment{german} {\begin{otherlanguage}{german}} {\end{otherlanguage}} \newenvironment{russian} {\begin{otherlanguage}{russian}} {\end{otherlanguage}} \begin{document} \section{Mixed Language Document} \begin{english} This is an English paragraph with proper hyphenation and formatting. \end{english} \begin{german} Dies ist ein deutscher Absatz mit korrekter Silbentrennung und Formatierung. \end{german} \begin{russian} Это русский абзац с правильным переносом и форматированием. \end{russian} % Mixed paragraph \begin{english} The German word \foreignlanguage{german}{Schadenfreude} has no direct English translation, while the Russian \foreignlanguage{russian}{тоска} expresses a deep spiritual anguish. \end{english} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from babel-environments.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-04/page-1.svg)
## Polyglossia Package### XeLaTeX/LuaLaTeX Setup```latex polyglossia-basic.tex theme=\{null} \documentclass{article} \usepackage{polyglossia} % Set main language \setdefaultlanguage{english} % Set other languages \setotherlanguages{french, spanish, arabic, chinese} % Font configuration \usepackage{fontspec} \setmainfont{Linux Libertine O} \setsansfont{Linux Biolinum O} \setmonofont{Inconsolata} % Language-specific fonts \newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Amiri} \newfontfamily\chinesefont[Scale=0.9]{Noto Sans CJK SC} \begin{document} \section{Multilingual with Polyglossia} This is English text. \begin{french} Ceci est un texte français avec les bonnes règles typographiques. \end{french} \begin{spanish} Este es un texto español con la tipografía correcta. \end{spanish} \begin{arabic} هذا نص عربي مع الاتجاه الصحيح من اليمين إلى اليسار. \end{arabic} \begin{chinese} 这是中文文本,使用正确的字体。 \end{chinese} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
```latex polyglossia-advanced.tex theme=\{null} \documentclass{article} \usepackage{polyglossia} % Language setup with options \setdefaultlanguage[variant=american]{english} \setotherlanguage[variant=medieval,spelling=new,babelshorthands=true]{german} \setotherlanguage[numerals=arabic]{farsi} \setotherlanguage{japanese} % Fonts \usepackage{fontspec} \setmainfont{TeX Gyre Termes} % Language-specific fonts \newfontfamily\germanfont{UnifrakturMaguntia} \newfontfamily\farsifont[Script=Arabic,Numbers=Farsi]{Vazir} \newfontfamily\japanesefont{Noto Sans CJK JP} \begin{document} \section{Advanced Polyglossia Features} % Date in different languages English date: \today \begin{german} Deutsches Datum: \today % Medieval German with special font {\germanfont Hier ist mittelalterlicher deutscher Text in Fraktur.} \end{german} \begin{farsi} تاریخ فارسی: \today این متن فارسی با اعداد فارسی است: ۱۲۳۴۵۶۷۸۹۰ \end{farsi} \begin{japanese} 日本語のテキスト。今日の日付:\today \end{japanese} % Language-specific numbering \begin{english} \begin{enumerate} \item First item \item Second item \end{enumerate} \end{english} \begin{farsi} \begin{enumerate} \item مورد اول \item مورد دوم \end{enumerate} \end{farsi} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
### Bidirectional Text```latex bidi-text.tex theme=\{null} \documentclass{article} \usepackage{polyglossia} \usepackage{bidi} % For older systems \setdefaultlanguage{english} \setotherlanguage{arabic} \setotherlanguage{hebrew} \usepackage{fontspec} \newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Scheherazade} \newfontfamily\hebrewfont[Script=Hebrew,Scale=1.1]{David CLM} \begin{document} \section{Bidirectional Text Support} This is left-to-right English text. \begin{arabic} \subsection{النص العربي} هذا نص من اليمين إلى اليسار. يمكن مزج \textLR{English words} في النص العربي. \begin{itemize} \item البند الأول \item البند الثاني مع \textLR{LTR text} \item البند الثالث \end{itemize} \end{arabic} Mixed paragraph: The Arabic phrase \textarabic{السلام عليكم} means "peace be upon you" and the Hebrew \texthebrew{שלום} means "peace/hello". \begin{hebrew} \subsection{טקסט עברי} זהו טקסט מימין לשמאל בעברית. אפשר לשלב \textLR{English} בתוך העברית. \end{hebrew} % Tables with RTL text \begin{table}[h] \centering \begin{tabular}{|c|c|c|} \hline English & \textarabic{عربي} & \texthebrew{עברית} \\ \hline Hello & \textarabic{مرحبا} & \texthebrew{שלום} \\ Goodbye & \textarabic{وداعا} & \texthebrew{להתראות} \\ Thank you & \textarabic{شكرا} & \texthebrew{תודה} \\ \hline \end{tabular} \caption{Multilingual greetings} \end{table} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
```latex mixed-directions.tex theme=\{null} \documentclass{article} \usepackage{polyglossia} \setdefaultlanguage{english} \setotherlanguage{arabic} \setotherlanguage{french} \usepackage{fontspec} \newfontfamily\arabicfont[Script=Arabic]{Amiri} % Environments for direction control \newenvironment{RTL} {\begin{arabic}\begin{flushright}} {\end{flushright}\end{arabic}} \newenvironment{LTR} {\begin{flushleft}} {\end{flushleft}} \begin{document} \section{Complex Directional Layouts} \begin{RTL} هذه فقرة عربية مع اتجاه من اليمين إلى اليسار. يمكن إدراج \textLR{English text} و\textfrench{texte français} داخل النص العربي. \end{RTL} \begin{LTR} This is an English paragraph with embedded Arabic: \textarabic{مثال عربي} and continuing in English. \end{LTR} % Two-column layout with different directions \begin{minipage}[t]{0.45\textwidth} \begin{english} \subsection{Left Column} This is the English column with left-to-right text flow. \end{english} \end{minipage} \hfill \begin{minipage}[t]{0.45\textwidth} \begin{RTL} \subsection{العمود الأيمن} هذا هو العمود العربي مع تدفق النص من اليمين إلى اليسار. \end{RTL} \end{minipage} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Font Configuration### Selecting Appropriate Fonts```latex font-selection.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % XeLaTeX/LuaLaTeX \usepackage{polyglossia} \setdefaultlanguage{english} \setotherlanguages{russian, greek, japanese, arabic} % Main document fonts \setmainfont[ Ligatures=TeX, BoldFont={* Bold}, ItalicFont={* Italic}, BoldItalicFont={* Bold Italic} ]{TeX Gyre Termes} \setsansfont[ Ligatures=TeX, Scale=0.9 ]{TeX Gyre Heros} \setmonofont[ Scale=0.9 ]{Inconsolata} % Language-specific fonts \newfontfamily\russianfont[ Script=Cyrillic, Ligatures=TeX ]{PT Serif} \newfontfamily\greekfont[ Script=Greek, Ligatures=TeX ]{GFS Artemisia} \newfontfamily\japanesefont[ Script=CJK, Scale=0.9 ]{Noto Sans CJK JP} \newfontfamily\arabicfont[ Script=Arabic, Scale=1.2, RightToLeft=true ]{Scheherazade} \begin{document} \section{Font Configuration for Multiple Languages} Default English text uses TeX Gyre Termes. \begin{russian} Русский текст использует шрифт PT Serif, который хорошо поддерживает кириллицу. \end{russian} \begin{greek} Το ελληνικό κείμενο χρησιμοποιεί τη γραμματοσειρά GFS Artemisia. \end{greek} \begin{japanese} 日本語のテキストはNoto Sans CJK JPフォントを使用します。 \end{japanese} \begin{arabic} النص العربي يستخدم خط Scheherazade مع دعم كامل للغة العربية. \end{arabic} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
```latex fallback-fonts.tex theme=\{null} \documentclass{article} \usepackage{fontspec} \usepackage[fallback]{polyglossia} % Define font with fallbacks \setmainfont[ Ligatures=TeX, FallbackFont={ {Noto Sans CJK SC}[Scale=0.9], {Noto Sans Arabic}[Scale=1.1], {Noto Sans Devanagari}, {Symbola} } ]{Linux Libertine O} \begin{document} \section{Font Fallback System} This system allows mixing scripts seamlessly: - English text (default font) - 中文文字 (Chinese fallback) - العربية (Arabic fallback) - हिन्दी (Devanagari fallback) - Symbols: 🌍 ✓ ♠ (Symbola fallback) All in one paragraph without manual font switching! \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### OpenType Features```latex opentype-features.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % Font with various OpenType features \setmainfont[ Numbers={OldStyle,Proportional}, Ligatures={Common,Contextual,Historic}, Letters=SmallCaps, Style=Alternate ]{EB Garamond} % Define font variations \newfontfamily\liningfont[Numbers={Lining,Monospaced}]{EB Garamond} \newfontfamily\swashfont[Style=Swash,Contextuals=Swash]{EB Garamond} \newfontfamily\historicfont[Style=Historic,Ligatures=Historic]{EB Garamond} \begin{document} \section{OpenType Features} % Number styles Default oldstyle figures: 0123456789 {\liningfont Lining figures: 0123456789} % Ligatures Standard ligatures: ff fi fl ffi ffl {\addfontfeature{Ligatures=NoCommon}No ligatures: ff fi fl ffi ffl} % Small caps \textsc{Small Capitals for Emphasis} % Swash characters {\swashfont Swash variants for Q and &} % Historic forms {\historicfont Historic long s: distinction} % Fractions \addfontfeature{Fractions=On} Automatic fractions: 1/2 3/4 5/8 \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Special Characters and Symbols### Input Methods```latex special-chars.tex theme=\{null} \documentclass{article} \usepackage[utf8]{inputenc} % For pdfLaTeX \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage[english, french, german]{babel} \begin{document} \section{Special Characters} % Direct Unicode input (with utf8) Café, naïve, Zürich, señor, Москва % LaTeX commands for special characters Caf\'e, na\"{\i}ve, Z\"urich, se\~nor % French special characters \selectlanguage{french} \oe uvre, c\oe ur, <<~guillemets~>> % German special characters \selectlanguage{german} "Anf"uhrungszeichen", "=, "~, "`German quotes"' % Text symbols \texttrademark{} \textregistered{} \textcopyright{} \texteuro{} \textyen{} % Accented characters \`{a} \'{e} \^{o} \~{n} \"{u} \={a} \.{c} \u{g} \v{s} \H{o} % Special ligatures \AE{} \ae{} \OE{} \oe{} \AA{} \aa{} \O{} \o{} \L{} \l{} \SS{} \ss{} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex unicode-symbols.tex theme=\{null} \documentclass{article} \usepackage{fontspec} % XeLaTeX/LuaLaTeX \usepackage{unicode-math} \setmainfont{TeX Gyre Termes} \setmathfont{TeX Gyre Termes Math} \begin{document} \section{Unicode Symbols and Characters} % Direct Unicode input Arrows: → ← ↑ ↓ ⇒ ⇐ ⇔ ↔ Mathematical: ∀ ∃ ∈ ∉ ⊂ ⊃ ∪ ∩ ∅ Greek: α β γ δ ε ζ η θ Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω Cyrillic: А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Currency: € £ ¥ ₹ ₽ ¢ ¤ Fractions: ½ ⅓ ¼ ⅕ ⅙ ⅐ ⅛ ⅑ ⅒ Miscellaneous: © ® ™ ° § ¶ † ‡ • … ‰ ′ ″ Box drawing: ┌─┬─┐ │ │ │ ├─┼─┤ └─┴─┘ % Emoji (requires appropriate font) Emoji: 😀 🌍 ✓ ✗ ⚠ ℹ 🔍 📧 \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from unicode-symbols.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-13/page-1.svg)
## Hyphenation and Line Breaking### Language-specific Hyphenation```latex hyphenation-rules.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english, german, french]{babel} \begin{document} \section{Hyphenation Examples} % English hyphenation \selectlanguage{english} \hyphenation{hy-phen-a-tion ex-am-ple spe-cial-word} This is a demonstration of hyphenation in English with some extraordinarily long words that need proper hyphenation patterns to break correctly at line endings. % German hyphenation \selectlanguage{german} \hyphenation{Sil-ben-tren-nung Bei-spiel-wör-ter} Dies ist eine Demonstration der Silbentrennung im Deutschen mit außergewöhnlich langen Wörtern, die ordnungsgemäße Trennmuster benötigen. % French hyphenation \selectlanguage{french} \hyphenation{hy-phe-na-tion ex-em-ple} Ceci est une démonstration de la césure en français avec des mots extraordinairement longs qui nécessitent des modèles de césure appropriés. % Prevent hyphenation \selectlanguage{english} \mbox{Unhyphenatable} word or \hbox{compound expression}. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from hyphenation-rules.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-14/page-1.svg)
```latex custom-hyphenation.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} % Global hyphenation exceptions \hyphenation{ ana-lysis analy-ses bio-log-i-cal com-put-er data-base para-digm } % Language-specific patterns \makeatletter \addto\extrasenglish{ \def\englishhyphenmins{2 3} % min left/right } \makeatother \begin{document} \section{Custom Hyphenation Patterns} % Inline hyphenation hints The word analysis\-is can be hyphenated manually. % Discretionary hyphens Com\-pu\-ter\-ized data\-base man\-age\-ment sys\-tems. % Prevent hyphenation in specific text \begin{sloppypar} This paragraph will have looser spacing to avoid hyphenation of extraordinarily long technical terminology. \end{sloppypar} % Hyphenation with penalties \hyphenpenalty=10000 % Prevent hyphenation \exhyphenpenalty=10000 % Prevent hyphenation after explicit hyphen No hyphenation in this paragraph with very long words. \hyphenpenalty=50 % Allow hyphenation \exhyphenpenalty=50 Normal hyphenation restored for this paragraph. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-hyphenation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-15/page-1.svg)
## Document Structure### Multilingual Documents```latex multilingual-report.tex theme=\{null} \documentclass{report} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english, spanish, french, german]{babel} \usepackage{csquotes} % Context-sensitive quotes % Chapter names in different languages \addto\captionsenglish{\renewcommand{\chaptername}{Chapter}} \addto\captionsspanish{\renewcommand{\chaptername}{Capítulo}} \addto\captionsfrench{\renewcommand{\chaptername}{Chapitre}} \addto\captionsgerman{\renewcommand{\chaptername}{Kapitel}} \begin{document} % Title page in multiple languages \begin{titlepage} \centering \vspace*{2cm} {\Huge\bfseries Multilingual Report\\ Rapport Multilingue\\ Informe Multilingüe\\ Mehrsprachiger Bericht\par} \vspace{2cm} {\Large\itshape International Organization\\ Organisation Internationale\\ Organización Internacional\\ Internationale Organisation\par} \vfill {\large\today\par} \end{titlepage} \tableofcontents \selectlanguage{english} \chapter{Introduction} This report is written in multiple languages... \selectlanguage{french} \chapter{Introduction} Ce rapport est rédigé en plusieurs langues... \selectlanguage{spanish} \chapter{Introducción} Este informe está escrito en varios idiomas... \selectlanguage{german} \chapter{Einleitung} Dieser Bericht ist in mehreren Sprachen verfasst... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multilingual-report.tex Page 1 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-16/page-1.svg) Open zoomable preview: Compiled PDF page 2 from multilingual-report.tex Page 2 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-16/page-2.svg) Open zoomable preview: Compiled PDF page 3 from multilingual-report.tex Page 3 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-16/page-3.svg) Open zoomable preview: Compiled PDF page 4 from multilingual-report.tex Page 4 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-16/page-4.svg) Open zoomable preview: Compiled PDF page 5 from multilingual-report.tex Page 5 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-16/page-5.svg) Open zoomable preview: Compiled PDF page 6 from multilingual-report.tex Page 6 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-16/page-6.svg)
```latex parallel-text.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english, latin]{babel} \usepackage{parallel} \usepackage{lipsum} \begin{document} \section{Parallel Texts} % Two-column parallel text \begin{Parallel}{0.48\textwidth}{0.48\textwidth} \ParallelLText{ \selectlanguage{english} \subsection{English Version} This is the English version of the text. It appears on the left side and maintains proper hyphenation and justification for English. } \ParallelRText{ \selectlanguage{latin} \subsection{Versio Latina} Haec est versio Latina textus. In dextra parte apparet et propriam hyphenationem iustificationemque Latinam servat. } \end{Parallel} % Side-by-side with different fonts \begin{minipage}[t]{0.48\textwidth} \selectlanguage{english} \subsubsection{Modern English} Contemporary text with modern spelling and grammar conventions. \end{minipage} \hfill \begin{minipage}[t]{0.48\textwidth} \selectlanguage{english} \subsubsection{Middle English} \fontfamily{uncl}\selectfont Whan that Aprille with his shoures soote... \end{minipage} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from parallel-text.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-17/page-1.svg)
## Localization### Dates and Numbers```latex localization.tex theme=\{null} \documentclass{article} \usepackage{polyglossia} \usepackage{datetime2} \setdefaultlanguage{english} \setotherlanguages{french, german, spanish, russian} \begin{document} \section{Localized Dates and Numbers} % Dates in different languages \begin{tabular}{ll} English: & \today \\ \French French: & \today \\ \German German: & \today \\ \Spanish Spanish: & \today \\ \Russian Russian: & \today \\ \end{tabular} % Number formatting \begin{english} English: 1,234,567.89 \end{english} \begin{french} French: 1 234 567,89 \end{french} \begin{german} German: 1.234.567,89 \end{german} % Ordinal numbers \begin{english} 1st, 2nd, 3rd, 4th, 21st \end{english} \begin{french} 1\textsuperscript{er}, 2\textsuperscript{e}, 3\textsuperscript{e}, 21\textsuperscript{e} \end{french} \begin{spanish} 1\textsuperscript{o}, 2\textsuperscript{o}, 3\textsuperscript{o}, 21\textsuperscript{o} \end{spanish} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex currency-units.tex theme=\{null} \documentclass{article} \usepackage{siunitx} \usepackage[english, german, french]{babel} % SI unit localization \sisetup{ locale = US, per-mode = symbol } \begin{document} \section{Units and Currency} % Currency in different locales \selectlanguage{english} Price: \$1,234.56 or \pounds 987.65 \selectlanguage{german} Preis: 1.234,56\,€ oder 987,65\,£ \selectlanguage{french} Prix: 1 234,56\,€ ou 987,65\,£ % Units with localization \selectlanguage{english} \SI{123.456}{\kilo\meter\per\hour} \selectlanguage{german} \sisetup{locale = DE} \SI{123.456}{\kilo\meter\per\hour} \selectlanguage{french} \sisetup{locale = FR} \SI{123.456}{\kilo\meter\per\hour} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from currency-units.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-multi-language-documents-19/page-1.svg)
## Best Practices### Multilingual Tips> [!TIP] > > ✅ **Best practices checklist**: > > * [ ] Choose appropriate engine (pdfLaTeX vs XeLaTeX/LuaLaTeX) > * [ ] Select suitable fonts for all languages > * [ ] Test hyphenation patterns > * [ ] Configure proper encoding > * [ ] Set language-specific typography rules > * [ ] Handle bidirectional text correctly > * [ ] Use semantic markup for language switches > * [ ] Maintain consistent style across languages > * [ ] Test PDF searchability and copying > * [ ] Consider accessibility requirements### Common Issues> [!WARNING] > > **Avoid these multilingual pitfalls**: > > 1. **Wrong encoding** - Use UTF-8 consistently > 2. **Missing fonts** - Verify font support for all scripts > 3. **Hardcoded strings** - Use babel/polyglossia captions > 4. **Mixed directions** - Test RTL/LTR thoroughly > 5. **Hyphenation errors** - Load patterns for all languages > 6. **Quote styles** - Use csquotes for consistency > 7. **Number formats** - Respect locale conventions## Complete Example```latex complete-multilingual.tex theme=\{null} \documentclass{book} \usepackage{fontspec} % XeLaTeX \usepackage{polyglossia} \usepackage{csquotes} \usepackage{datetime2} \usepackage{siunitx} \usepackage{lipsum} % Language setup \setdefaultlanguage[variant=american]{english} \setotherlanguages{french, german, spanish, russian, arabic, japanese} % Font configuration \setmainfont{TeX Gyre Termes} \setsansfont{TeX Gyre Heros} \setmonofont{Inconsolata} % Language-specific fonts \newfontfamily\russianfont{PT Serif} \newfontfamily\arabicfont[Script=Arabic]{Amiri} \newfontfamily\japanesefont{Noto Sans CJK JP} % Metadata \title{Multilingual Document Example\\ \large Exemple de Document Multilingue\\ Mehrsprachiges Dokumentbeispiel} \author{International Author} \date{\today} \begin{document} \frontmatter \maketitle \begin{abstract} This document demonstrates comprehensive multilingual support in LaTeX, including various scripts, bidirectional text, and localization features. \end{abstract} \tableofcontents \mainmatter \chapter{Introduction} \section{English Section} This document showcases LaTeX's capabilities for handling multiple languages and scripts within a single document. We'll explore various features including: \begin{itemize} \item Font selection and configuration \item Bidirectional text support \item Proper hyphenation and line breaking \item Localized formatting \item Special characters and symbols \end{itemize} \section{Section Française} \begin{french} Cette section démontre le support du français avec : \begin{itemize} \item Les guillemets français : \enquote{exemple} \item Les espaces insécables : voici ! \item La date : \today \item Les nombres : \num{1234567.89} \end{itemize} \end{french} \section{Deutscher Abschnitt} \begin{german} Dieser Abschnitt zeigt die deutsche Unterstützung mit: \begin{itemize} \item Deutsche Anführungszeichen: \enquote{Beispiel} \item Datum: \today \item Zahlen: \num{1234567.89} \item Silbentrennung für lange Wörter \end{itemize} \end{german} \chapter{Advanced Features} \section{Bidirectional Text} \begin{english} This chapter includes Arabic text: \textarabic{مرحبا بالعالم} (Hello World) embedded within English paragraphs. \end{english} \begin{arabic} هذا قسم كامل باللغة العربية. يُظهر الدعم الكامل للنص من اليمين إلى اليسار مع الخطوط والتنسيق المناسبين. يمكن تضمين \textLR{English text} داخل العربية. \end{arabic} \section{Asian Languages} \begin{japanese} 日本語のサポートも含まれています。これは日本語のテキストの例です。 LaTeXは複雑な文字体系も処理できます。 \end{japanese} \chapter{Reference Section} \section{Common Phrases} \begin{tabular}{llll} \textbf{English} & \textbf{Français} & \textbf{Deutsch} & \textbf{Español} \\ Hello & Bonjour & Hallo & Hola \\ Thank you & Merci & Danke & Gracias \\ Goodbye & Au revoir & Auf Wiedersehen & Adiós \\ \end{tabular} \backmatter \appendix \chapter{Technical Notes} This document was compiled with XeLaTeX to support Unicode and advanced font features. All languages are properly configured with appropriate hyphenation patterns and typography rules. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
## Next StepsExplore more advanced topics:> [card] Book Publishing > > Create multilingual books[Open](/learn/latex/how-to/book-publishing)> [card] Collaboration > > International team workflows[Open](/learn/latex/how-to/collaboration-workflow)> [card] Templates > > Multilingual templates[Open](/learn/latex/how-to/using-templates)> [card] Typography > > Advanced typography[Open](/learn/latex/fonts)***> [!NOTE] > > **Pro tip**: Always test your multilingual documents thoroughly. Check that text is searchable and copyable in the PDF, verify that hyphenation works correctly, and ensure that all special characters display properly. Consider creating language-specific style files for frequently used configurations. # Creating Presentations with Beamer - Complete Guide Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/presentations Create LaTeX presentations with Beamer. Learn slides, themes, animations, overlays, and professional techniques with examples. Create stunning, professional presentations using LaTeX with the Beamer class. This comprehensive guide covers everything from basic slides to advanced animations, custom themes, and conference-ready presentations.> [!NOTE] > > **Quick start**: LaTeX Cloud Studio includes Beamer presentation templates. Select "Presentation" when creating a new project to start with a ready-to-use template. > > **Prerequisites**: Basic LaTeX knowledge. See [Creating Your First Document](/learn/latex/basics/creating-first-document) for LaTeX basics.## Why Use Beamer for Presentations?### Advantages of LaTeX Presentations> [card] Consistent Design > > Professional themes with automatic formatting and consistent typography> [card] Mathematical Excellence > > Perfect rendering of equations, formulas, and scientific notation> [card] Version Control > > Plain text format works seamlessly with Git and collaboration tools> [card] Cross-Platform > > PDF output works everywhere, no compatibility issues### When to Use Beamer✅ __Perfect for:__- Academic conferences and seminars - Technical presentations with equations - Reproducible research presentations - Presentations requiring precise formatting - Multi-author collaborative presentations❌ __Consider alternatives for:__- Quick informal presentations - Heavily design-focused slideshows - Presentations requiring live editing - Non-technical audiences expecting flashy animations## Getting Started with Beamer### Basic Presentation Structure```latex basic-presentation.tex theme=\{null} \documentclass{beamer} % Theme selection \usetheme{Madrid} \usecolortheme{default} % Packages \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{amsmath} \usepackage{hyperref} % Presentation metadata \title{Your Presentation Title} \subtitle{Optional Subtitle} \author{Your Name} \institute{Your Institution} \date{\today} % Logo (optional) \logo{\includegraphics[height=1cm]{logo.png}} \begin{document} % Title slide \frame{\titlepage} % Table of contents \begin{frame} \frametitle{Outline} \tableofcontents \end{frame} % Section 1 \section{Introduction} \begin{frame} \frametitle{Introduction} \begin{itemize} \item First point \item Second point \item Third point \end{itemize} \end{frame} % Section 2 \section{Main Content} \begin{frame} \frametitle{Key Concepts} \begin{block}{Definition} A block environment for definitions \end{block} \begin{alertblock}{Important} An alert block for warnings \end{alertblock} \begin{exampleblock}{Example} An example block \end{exampleblock} \end{frame} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Understanding Frame StructureEach slide in Beamer is called a "frame":```latex example.tex theme=\{null} \begin{frame}[options] \frametitle{Slide Title} \framesubtitle{Optional Subtitle} % Slide content goes here \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Common frame options:**- `[fragile]` - Required for verbatim content or code - `[allowframebreaks]` - Allows automatic slide splitting - `[plain]` - No header/footer (useful for images) - `[noframenumbering]` - Excludes from slide count - `[c]` - Center content vertically - `[t]` - Top-align content (default)## Beamer Themes and Customization### Built-in Themes Gallery> [tab] Presentation Themes > > ````latex example.tex theme=\{null} > % Professional themes > \usetheme{Berlin} % Sections in header > \usetheme{Madrid} % Clean and professional > \usetheme{AnnArbor} % Section navigation > \usetheme{CambridgeUS} % Red accent > \usetheme{Warsaw} % Blue with navigation > > % Minimalist themes > \usetheme{default} % Basic, clean > \usetheme{Bergen} % Simple sidebar > \usetheme{Boadilla} % Minimal decoration > > % Conference themes > \usetheme{Pittsburgh} % Very minimal > \usetheme{Rochester} % Simple top bar > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> ````> [tab] Color Themes > > ````latex example.tex theme=\{null} > % Color theme options > \usecolortheme{default} % Standard colors > \usecolortheme{beaver} % Red accent > \usecolortheme{beetle} % Blue/gray > \usecolortheme{crane} % Orange accent > \usecolortheme{dolphin} % Blue theme > \usecolortheme{dove} % Grayscale > \usecolortheme{fly} % Gray theme > \usecolortheme{lily} % Light blue > \usecolortheme{orchid} % Purple accent > \usecolortheme{rose} % Green accent > \usecolortheme{seagull} % Gray/blue > \usecolortheme{seahorse} % Purple/pink > \usecolortheme{whale} % Dark blue > \usecolortheme{wolverine} % Yellow/blue > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> ````> [tab] Font Themes > > ````latex example.tex theme=\{null} > % Font customization > \usefonttheme{default} % Standard fonts > \usefonttheme{serif} % Serif fonts > \usefonttheme{structurebold} % Bold structure > \usefonttheme{structureitalicserif} % Italic serif > \usefonttheme{structuresmallcapsserif} % Small caps > > % Professional math fonts > \usefonttheme{professionalfonts} > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> ````### Custom Theme Configuration```latex custom-theme.tex theme=\{null} % Define custom colors \definecolor{customblue}{RGB}{0, 102, 204} \definecolor{customgray}{RGB}{102, 102, 102} \definecolor{customorange}{RGB}{255, 102, 0} % Apply custom colors \setbeamercolor{title}{fg=white, bg=customblue} \setbeamercolor{frametitle}{fg=white, bg=customblue} \setbeamercolor{structure}{fg=customblue} \setbeamercolor{normal text}{fg=black, bg=white} \setbeamercolor{alerted text}{fg=customorange} \setbeamercolor{example text}{fg=customgray} % Custom fonts \setbeamerfont{title}{series=\bfseries, size=\Large} \setbeamerfont{frametitle}{series=\bfseries} \setbeamerfont{footnote}{size=\tiny} % Remove navigation symbols \setbeamertemplate{navigation symbols}{} % Custom footer \setbeamertemplate{footline}{ \leavevmode \hbox{ \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot} \usebeamerfont{author in head/foot}\insertshortauthor \end{beamercolorbox} \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot} \usebeamerfont{title in head/foot}\insertshorttitle \end{beamercolorbox} \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot} \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em} \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} \end{beamercolorbox} } \vskip0pt } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Content Elements and Formatting### Lists and Enumerations```latex lists-formatting.tex theme=\{null} \begin{frame} \frametitle{Types of Lists} % Bullet points \begin{itemize} \item First level item \begin{itemize} \item Second level item \begin{itemize} \item Third level item \end{itemize} \end{itemize} \item<2-> Appears on second click \item<3-> Appears on third click \end{itemize} % Numbered lists \begin{enumerate} \item First numbered item \item Second numbered item \begin{enumerate} \item Nested enumeration \item Another nested item \end{enumerate} \end{enumerate} % Description lists \begin{description} \item[Term 1] Description of first term \item[Term 2] Description of second term \end{description} \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from lists-formatting.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-07/page-1.svg) Open zoomable preview: Compiled PDF page 2 from lists-formatting.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-07/page-2.svg) Open zoomable preview: Compiled PDF page 3 from lists-formatting.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-07/page-3.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_presentations)### Blocks and Highlighting```latex blocks-alerts.tex theme=\{null} \begin{frame} \frametitle{Block Environments} % Standard block \begin{block}{Standard Block Title} Used for definitions, theorems, or general content that needs emphasis. \end{block} % Alert block \begin{alertblock}{Warning or Important Information} Use this for critical information, warnings, or important notes. \end{alertblock} % Example block \begin{exampleblock}{Example or Case Study} Perfect for examples, case studies, or practical applications. \end{exampleblock} % Custom theorem environment \begin{theorem}[Pythagorean Theorem] For a right triangle: $a^2 + b^2 = c^2$ \end{theorem} % Highlighted text \alert{This text is highlighted} \structure{This text uses structure color} \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Columns and Layout```latex columns-layout.tex theme=\{null} \begin{frame} \frametitle{Two-Column Layout} \begin{columns}[T] % [T] for top alignment \begin{column}{0.5\textwidth} \textbf{Left Column} \begin{itemize} \item Point 1 \item Point 2 \item Point 3 \end{itemize} \end{column} \begin{column}{0.5\textwidth} \textbf{Right Column} \begin{center} \includegraphics[width=0.8\textwidth]{image.png} \end{center} \end{column} \end{columns} \vspace{1em} % Three columns \begin{columns} \begin{column}{0.3\textwidth} \centering \textbf{Column 1} \end{column} \begin{column}{0.3\textwidth} \centering \textbf{Column 2} \end{column} \begin{column}{0.3\textwidth} \centering \textbf{Column 3} \end{column} \end{columns} \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Animations and Overlays### Basic Overlay Specifications```latex overlays-basic.tex theme=\{null} \begin{frame} \frametitle{Overlay Basics} % Simple overlays \begin{itemize} \item<1-> Visible from slide 1 onward \item<2-> Visible from slide 2 onward \item<3-> Visible from slide 3 onward \item<2-3> Visible only on slides 2 and 3 \item<4> Visible only on slide 4 \end{itemize} % Using \only, \uncover, \visible \only<1>{This text appears only on slide 1} \uncover<2->{This text is uncovered from slide 2} \visible<3->{This text is visible from slide 3} % Alert on specific slides \alert<2>{This text is highlighted on slide 2} % Dynamic content \only<1>{\includegraphics[width=5cm]{img1.png}} \only<2>{\includegraphics[width=5cm]{img2.png}} \only<3>{\includegraphics[width=5cm]{img3.png}} \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Advanced Animation Techniques```latex advanced-animations.tex theme=\{null} \begin{frame} \frametitle{Progressive Reveal} % Incremental reveals \begin{itemize}[<+->] \item First item (appears on click 1) \item Second item (appears on click 2) \item Third item (appears on click 3) \end{itemize} % Replacing content \only<1>{ \begin{block}{Step 1} Initial state of the system \end{block} } \only<2>{ \begin{block}{Step 2} Intermediate transformation \end{block} } \only<3>{ \begin{block}{Step 3} Final result \end{block} } % Highlighting changes \begin{equation} f(x) = \alert<2>{a}x^2 + \alert<3>{b}x + \alert<4>{c} \end{equation} \begin{itemize} \item<2> \alert<2>{$a$} controls the curvature \item<3> \alert<3>{$b$} affects the slope \item<4> \alert<4>{$c$} sets the y-intercept \end{itemize} \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from advanced-animations.tex Page 1 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-11/page-1.svg) Open zoomable preview: Compiled PDF page 2 from advanced-animations.tex Page 2 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-11/page-2.svg) Open zoomable preview: Compiled PDF page 3 from advanced-animations.tex Page 3 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-11/page-3.svg) Open zoomable preview: Compiled PDF page 4 from advanced-animations.tex Page 4 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-11/page-4.svg)
### Transition Effects```latex transitions.tex theme=\{null} % Frame transitions \begin{frame}[t] \frametitle{Transition Types} \transdissolve<2> % Dissolve transition \transblindshorizontal<3> % Horizontal blinds \transblindsvertical<4> % Vertical blinds \transboxin<5> % Box in \transboxout<6> % Box out \transdissolve<7> % Return to dissolve \begin{itemize} \item<2-> Dissolve effect \item<3-> Horizontal blinds \item<4-> Vertical blinds \item<5-> Box in effect \item<6-> Box out effect \item<7-> Back to dissolve \end{itemize} \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from transitions.tex Page 1 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-1.svg) Open zoomable preview: Compiled PDF page 2 from transitions.tex Page 2 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-2.svg) Open zoomable preview: Compiled PDF page 3 from transitions.tex Page 3 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-3.svg) Open zoomable preview: Compiled PDF page 4 from transitions.tex Page 4 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-4.svg) Open zoomable preview: Compiled PDF page 5 from transitions.tex Page 5 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-5.svg) Open zoomable preview: Compiled PDF page 6 from transitions.tex Page 6 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-6.svg) Open zoomable preview: Compiled PDF page 7 from transitions.tex Page 7 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-12/page-7.svg)
## Graphics and Multimedia### Including Images```latex images-graphics.tex theme=\{null} % Full-frame image \begin{frame}[plain] \begin{center} \includegraphics[height=\paperheight]{full-image.jpg} \end{center} \end{frame} % Image with caption \begin{frame} \frametitle{Figure Example} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{diagram.png} \caption{System architecture diagram} \end{figure} \end{frame} % Side-by-side images \begin{frame} \frametitle{Comparison} \begin{columns} \begin{column}{0.5\textwidth} \begin{figure} \centering \includegraphics[width=\textwidth]{before.png} \caption{Before} \end{figure} \end{column} \begin{column}{0.5\textwidth} \begin{figure} \centering \includegraphics[width=\textwidth]{after.png} \caption{After} \end{figure} \end{column} \end{columns} \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### TikZ Diagrams in Presentations```latex tikz-diagrams.tex theme=\{null} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \begin{frame} \frametitle{Process Flow Diagram} \begin{center} \begin{tikzpicture}[node distance=2cm] \tikzstyle{process} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30] \tikzstyle{arrow} = [thick,->,>=stealth] % Nodes \node (input) [process] {Input}; \node (process) [process, below of=input] {Process}; \node (output) [process, below of=process] {Output}; % Arrows with overlays \draw<2-> [arrow] (input) -- (process); \draw<3-> [arrow] (process) -- (output); % Annotations \node<4-> [right of=process, xshift=2cm] {\alert{Critical Step}}; \end{tikzpicture} \end{center} \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tikz-diagrams.tex Page 1 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-14/page-1.svg) Open zoomable preview: Compiled PDF page 2 from tikz-diagrams.tex Page 2 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-14/page-2.svg) Open zoomable preview: Compiled PDF page 3 from tikz-diagrams.tex Page 3 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-14/page-3.svg) Open zoomable preview: Compiled PDF page 4 from tikz-diagrams.tex Page 4 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-14/page-4.svg)
### Tables and Data```latex tables-data.tex theme=\{null} \begin{frame} \frametitle{Experimental Results} \begin{table} \centering \begin{tabular}{l|rrr} \hline \textbf{Method} & \textbf{Accuracy} & \textbf{Speed} & \textbf{Memory} \\ \hline Baseline & 82.3\% & 1.0x & 100 MB \\ \alert<2>{Our Method} & \alert<2>{91.7\%} & \alert<2>{0.8x} & \alert<2>{95 MB} \\ State-of-art & 90.1\% & 0.5x & 150 MB \\ \hline \end{tabular} \caption{Performance comparison} \end{table} \only<2>{ \begin{alertblock}{Key Achievement} Our method achieves better accuracy with lower memory usage! \end{alertblock} } \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tables-data.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-15/page-1.svg) Open zoomable preview: Compiled PDF page 2 from tables-data.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-15/page-2.svg)
## Mathematical Content### Equations and Formulas```latex math-content.tex theme=\{null} \begin{frame} \frametitle{Mathematical Equations} % Simple equation \begin{equation} E = mc^2 \end{equation} % Aligned equations with overlays \begin{align} f(x) &= ax^2 + bx + c \\ \uncover<2->{f'(x) &= 2ax + b} \\ \uncover<3->{f''(x) &= 2a} \end{align} % Highlighting parts \begin{equation} \sum_{i=1}^{n} \alert<2>{x_i^2} = \uncover<3->{\frac{n(n+1)(2n+1)}{6}} \end{equation} % Theorem with proof \begin{theorem}[Fundamental Theorem of Calculus] If $f$ is continuous on $[a,b]$, then \[\int_a^b f(x)\,dx = F(b) - F(a)\] where $F'(x) = f(x)$. \end{theorem} \begin{proof}<2-> By the mean value theorem... \end{proof} \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Matrix Animations```latex matrix-animations.tex theme=\{null} \begin{frame} \frametitle{Matrix Operations} % Progressive matrix reveal \[ \begin{pmatrix} a_{11} & \uncover<2->{a_{12}} & \uncover<3->{a_{13}} \\ \uncover<2->{a_{21}} & \uncover<2->{a_{22}} & \uncover<3->{a_{23}} \\ \uncover<3->{a_{31}} & \uncover<3->{a_{32}} & \uncover<3->{a_{33}} \end{pmatrix} \] % Matrix multiplication steps \only<4>{ \[ \begin{pmatrix} \alert{1} & \alert{2} \\ 3 & 4 \end{pmatrix} \begin{pmatrix} \alert{5} \\ \alert{6} \end{pmatrix} = \begin{pmatrix} \alert{17} \\ 39 \end{pmatrix} \] Calculating first element: $1 \times 5 + 2 \times 6 = 17$ } \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrix-animations.tex Page 1 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-17/page-1.svg) Open zoomable preview: Compiled PDF page 2 from matrix-animations.tex Page 2 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-17/page-2.svg) Open zoomable preview: Compiled PDF page 3 from matrix-animations.tex Page 3 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-17/page-3.svg) Open zoomable preview: Compiled PDF page 4 from matrix-animations.tex Page 4 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-17/page-4.svg)
## Advanced Features### Handout Mode and Notes```latex handouts-notes.tex theme=\{null} % In preamble for handout mode \documentclass[handout]{beamer} % This removes all overlays and animations % Speaker notes \begin{frame} \frametitle{Main Slide Content} \begin{itemize} \item Point 1 \item Point 2 \item Point 3 \end{itemize} \note{ % These notes appear in presenter mode \begin{itemize} \item Expand on point 1 \item Remember to mention example \item Time check: 5 minutes \end{itemize} } \end{frame} % Notes on separate slide \begin{frame} \frametitle{Complex Topic} Content for audience... \end{frame} \note{ \begin{itemize} \item Detailed explanation for speaker \item Key points to emphasize \item Possible questions from audience \end{itemize} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### Creating Handouts```latex handout-layout.tex theme=\{null} % Multiple slides per page \usepackage{pgfpages} % 2 slides per page \pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] % 4 slides per page \pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape] % With notes on the side \setbeameroption{show notes on second screen=right} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Bibliography and Citations```latex bibliography-beamer.tex theme=\{null} % In preamble \usepackage[backend=biber,style=authoryear]{biblatex} \addbibresource{references.bib} \begin{frame} \frametitle{Literature Review} Key findings from \textcite{smith2023} show that... \begin{itemize} \item Result 1 \parencite{jones2022} \item Result 2 \parencite{brown2023} \end{itemize} \vfill \tiny \printbibliography[heading=none] \end{frame} % Or traditional approach \begin{frame}[allowframebreaks] \frametitle{References} \bibliographystyle{apalike} \bibliography{references} \end{frame} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Multimedia Integration```latex multimedia.tex theme=\{null} % Including videos (requires multimedia package) \usepackage{multimedia} \begin{frame} \frametitle{Video Demonstration} \movie[width=8cm,height=6cm,poster,showcontrols]{ \includegraphics[width=8cm]{video-poster.png} }{video.mp4} % Alternative: hyperlink to video \href{run:./videos/demo.mp4}{ \includegraphics[width=0.8\textwidth]{video-thumbnail.png} } \end{frame} % Sound effects \sound[automute,inlinesound]{ \includegraphics[width=2cm]{speaker-icon.png} }{sound.wav} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Best Practices and Tips### Presentation Design Guidelines> [!WARNING] > > **Common Pitfalls to Avoid:** > > * Too much text on slides (use notes instead) > * Overusing animations (keep it professional) > * Inconsistent formatting between slides > * Small fonts (minimum 20pt for body text) > * Complex diagrams without buildup### Effective Slide Design> [tab] Content Guidelines > > **The 6×6 Rule:** > > * Maximum 6 bullet points per slide > * Maximum 6 words per bullet point > * Use speaker notes for details > > **Visual Hierarchy:** > > 1. Title: 28-32pt > 2. Main text: 20-24pt > 3. Footnotes: 14-16pt > 4. Captions: 16-18pt> [tab] Color Usage > > **Color Best Practices:**- Use high contrast (dark on light or light on dark) > > * Limit to 3-4 colors maximum > * Test on projector (colors may appear different) > * Consider colorblind-friendly palettes**Professional Color Schemes:**\`\`\`latex example.tex theme=\{null} > % Blue theme > \definecolor > \definecolor > > % Green theme > \definecolor > \definecolor > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ```> [tab] Typography > > **Font Selection:** > > * Sans-serif for slides (better readability) > * Serif for handouts (if needed) > * Consistent font throughout > * Avoid decorative fonts > > **Text Formatting:** > > * Bold for emphasis (not underline) > * Italics sparingly > * Consistent bullet styles > * Proper spacing between elements### Performance Optimization```latex optimization.tex theme=\{null} % Compile faster during development \includeonlyframes{current} % Tag frames with label={current} % Reduce file size \pdfcompresslevel=9 \pdfobjcompresslevel=3 % Optimize images % Convert images to PDF beforehand % Use appropriate resolution (150-300 dpi for projection) % Disable navigation symbols for cleaner look \setbeamertemplate{navigation symbols}{} % Preload frequently used images \pgfdeclareimage[height=1cm]{logo}{university-logo} \logo{\pgfuseimage{logo}} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Accessibility Considerations> [!NOTE] > > **Making Presentations Accessible:** > > * Use high contrast themes > * Provide alternative text for images > * Ensure logical reading order > * Include slide numbers > * Distribute handouts with full content > * Use clear, simple language## Troubleshooting Common Issues### Compilation Errors> [accordion] Frame too large for slide > > **Problem**: Content exceeds slide dimensions > > **Solutions**: > > * Use `[allowframebreaks]` option > * Split into multiple frames > * Reduce font size (last resort) > * Use `\small` or `\footnotesize` environments> [accordion] Overlays not working > > **Problem**: Overlay specifications ignored > > **Solutions**: > > * Check for conflicting packages > * Ensure correct syntax: `<2->` not `<2-` > * Use `\only` instead of `\uncover` for images > * Verify frame is not in handout mode> [accordion] Missing figures or logos > > **Problem**: Images not appearing > > **Solutions**: > > * Check file paths (relative vs absolute) > * Verify image format compatibility > * Include graphics package > * Set graphics path: `\graphicspath{{./images/}}`### Platform-Specific Issues> [tab] PDF Viewer Issues > > **Adobe Reader**: > > * Best compatibility with animations > * Supports multimedia content > * Full-screen mode: Ctrl+L > > **Other Viewers**: > > * Preview (Mac): Limited animation support > * Evince (Linux): Good basic support > * Browser PDFs: May not show transitions> [tab] Projector Setup > > **Resolution**: > > * Design for 4:3 or 16:9 aspect ratio > * Test beforehand when possible > * Have backup: handouts or static PDF > > **Display**: > > * Mirror vs extended display > * Presenter view setup > * Test animations and colors## Conference Presentation Template### Complete Academic Conference Template```latex conference-template.tex theme=\{null} \documentclass[aspectratio=169]{beamer} % Use aspectratio=43 for 4:3 displays % Packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{amsmath,amssymb,amsthm} \usepackage{graphicx} \usepackage{tikz} \usepackage{booktabs} \usepackage[backend=biber,style=authoryear-comp]{biblatex} \addbibresource{references.bib} % Theme \usetheme{Madrid} \usecolortheme{seahorse} \usefonttheme{professionalfonts} % Custom colors \definecolor{myblue}{RGB}{0,102,204} \definecolor{myred}{RGB}{204,0,0} \definecolor{mygreen}{RGB}{0,153,0} % Settings \setbeamertemplate{navigation symbols}{} \setbeamertemplate{footline}[frame number] \setbeamersize{text margin left=1em,text margin right=1em} % Metadata \title[Short Title]{Full Conference Presentation Title} \subtitle{Conference Name 2024} \author[A. Author]{Alice Author\inst{1} \and Bob Coauthor\inst{2}} \institute[Inst.]{ \inst{1}Department of Computer Science\\ University Name \and \inst{2}Research Institute\\ Another University } \date{\today} \AtBeginSection[]{ \begin{frame} \vfill \centering \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title} \usebeamerfont{title}\insertsectionhead\par \end{beamercolorbox} \vfill \end{frame} } \begin{document} % Title page \frame{\titlepage} % Outline \begin{frame} \frametitle{Outline} \tableofcontents \end{frame} % Section 1: Introduction \section{Introduction} \begin{frame} \frametitle{Motivation} \begin{columns} \begin{column}{0.6\textwidth} \begin{itemize} \item<1-> Current challenges in the field \item<2-> Limitations of existing approaches \item<3-> Our novel contribution \end{itemize} \vspace{1em} \uncover<4->{ \begin{block}{Research Question} How can we improve performance while maintaining efficiency? \end{block} } \end{column} \begin{column}{0.4\textwidth} \begin{center} \includegraphics[width=\textwidth]{problem-diagram.png} \end{center} \end{column} \end{columns} \end{frame} % Continue with more sections... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Advanced Presentation Techniques### Working with Overlays in Complex Scenarios```latex complex-overlays.tex theme=\{null} \begin{frame} \frametitle{Advanced Overlay Techniques} % Conditional content based on slide number \alt<2>{% \textcolor{red}{This appears in red on slide 2}% }{% \textcolor{blue}{This appears in blue on other slides}% } % Temporal specifications \temporal<3>{Before}{On slide 3}{After} % Complex overlay with multiple conditions \begin{itemize} \item<1-> Always visible \item<2-4> Visible on slides 2-4 \item<3,5> Visible on slides 3 and 5 only \item<-3,5-> Visible on slides 1-3 and from 5 onward \end{itemize} % Overlay-aware environments \begin{onlyenv}<2-4> \begin{block}{Temporary Block} This entire block only exists on slides 2-4 \end{block} \end{onlyenv} \end{frame} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from complex-overlays.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-25/page-1.svg) Open zoomable preview: Compiled PDF page 2 from complex-overlays.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-25/page-2.svg) Open zoomable preview: Compiled PDF page 3 from complex-overlays.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-25/page-3.svg) Open zoomable preview: Compiled PDF page 4 from complex-overlays.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-25/page-4.svg) Open zoomable preview: Compiled PDF page 5 from complex-overlays.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-presentations-25/page-5.svg)
### Creating Poster PresentationsBeamer also supports academic poster creation with special themes:```latex beamer-poster.tex theme=\{null} \documentclass[final,hyperref={pdfpagelabels=false}]{beamer} \usepackage[orientation=portrait,size=a0,scale=1.4]{beamerposter} \usetheme{confposter} \setbeamercolor{block title}{fg=white,bg=blue!70!black} \setbeamercolor{block body}{fg=black,bg=white} \setbeamercolor{block alerted title}{fg=white,bg=orange!70!black} \setbeamercolor{block alerted body}{fg=black,bg=orange!10} \begin{document} \begin{frame}[t] \begin{columns}[t] % Left column \begin{column}{.32\linewidth} \begin{block}{Introduction} Content for introduction section... \end{block} \begin{block}{Methods} Methodology description... \end{block} \end{column} % Middle column \begin{column}{.32\linewidth} \begin{block}{Results} \begin{figure} \includegraphics[width=\linewidth]{results.png} \caption{Main findings} \end{figure} \end{block} \begin{alertblock}{Key Finding} Highlight your most important result \end{alertblock} \end{column} % Right column \begin{column}{.32\linewidth} \begin{block}{Discussion} Interpretation of results... \end{block} \begin{block}{References} \tiny \bibliographystyle{abbrv} \bibliography{poster} \end{block} \end{column} \end{columns} \end{frame} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Integration with External Tools#### Using Matplotlib Figures```python generate-figures.py theme=\{null} import matplotlib.pyplot as plt import numpy as np # Set LaTeX-compatible settings plt.rcParams['text.usetex'] = True plt.rcParams['font.family'] = 'serif' plt.rcParams['font.size'] = 12 # Create figure fig, ax = plt.subplots(figsize=(6, 4)) x = np.linspace(0, 2*np.pi, 100) y = np.sin(x) ax.plot(x, y, 'b-', linewidth=2) ax.set_xlabel(r'$x$') ax.set_ylabel(r'$\sin(x)$') ax.set_title(r'Sine Wave: $y = \sin(x)$') ax.grid(True, alpha=0.3) # Save for Beamer fig.savefig('sine_wave.pdf', bbox_inches='tight', dpi=300) ```#### Integrating Videos and GIFs```latex video-integration.tex theme=\{null} % Method 1: Using media9 package (modern approach) \usepackage{media9} \begin{frame} \frametitle{Video Demonstration} \includemedia[ width=0.8\linewidth, height=0.6\linewidth, activate=pageopen, flashvars={ source=demo.mp4 &autoPlay=true } ]{\includegraphics[width=0.8\linewidth]{video-poster.png}}{VPlayer.swf} \end{frame} % Method 2: External viewer launch \href{run:./videos/demo.mp4}{ \includegraphics[width=0.8\linewidth]{video-preview.png} } % Method 3: Animated GIF alternative \animategraphics[loop,controls,width=\linewidth]{12}{animation-}{0}{23} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Resources and Further Learning### Essential Packages for Presentations> [card] beamer > > Core presentation class with themes and layouts> [card] pgfpages > > Create handouts with multiple slides per page> [card] multimedia > > Include videos and sound in presentations> [card] animate > > Create animations from image sequences> [card] tikz > > Create professional diagrams and animations> [card] pdfpc > > PDF presenter console with notes and timer### Quick Reference Commands| Command | Purpose | Example | | - | - | - | | `\pause` | Simple pause between content | `Text \pause more text` | | `\only{content}` | Show content only on slide n | `\only<2>{Slide 2 only}` | | `\uncover{content}` | Reveal content from slide n | `\uncover<3->{From slide 3}` | | `\alert{text}` | Highlight text on slide n | `\alert<2>{Important!}` | | `\item` | Reveal list item from slide n | `\item<2-> Second point` |### Presentation Workflow1) **Planning Phase** * Outline your talk structure * Allocate time per section * Plan visual elements 2) **Design Phase** * Choose appropriate theme * Create consistent style * Design animations purposefully 3) **Content Creation** * Write concise bullet points * Create supporting graphics * Add speaker notes 4) **Practice Phase** * Test all animations * Check timing * Verify on target equipment 5) **Delivery** * Have backup formats ready * Test equipment beforehand * Keep handouts available### Converting Between Formats#### From PowerPoint to BeamerWhile there's no perfect conversion tool, here's a workflow:1) **Export content**: Save PowerPoint as RTF or plain text 2) **Extract images**: Save all images separately as PNG/PDF 3) **Rebuild in Beamer**: Use the content and images in Beamer structure 4) **Recreate animations**: Map PowerPoint animations to Beamer overlays#### From Beamer to Other Formats```bash conversion-commands.sh theme=\{null} # Convert to PowerPoint (via LibreOffice) pdf2odp presentation.pdf presentation.odp libreoffice --convert-to pptx presentation.odp # Extract slides as images convert -density 300 presentation.pdf slide-%03d.png # Create handout version pdfnup --nup 2x3 --frame true presentation.pdf -o handout.pdf ```### Accessibility Best Practices```latex accessible-presentation.tex theme=\{null} % Provide alternative text \pdfcompresslevel=9 \usepackage{accsupp} \newcommand{\AltText}[2]{% \BeginAccSupp{Alt={#2}}#1\EndAccSupp{}% } % Use in presentation \begin{frame} \frametitle{Data Visualization} \AltText{ \includegraphics[width=0.8\textwidth]{chart.png} }{Bar chart showing 40% increase in performance from 2022 to 2023} \end{frame} % Ensure reading order \setbeamertemplate{navigation symbols}{} \usepackage{bookmark} \bookmarksetup{open,numbered} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Performance Tips for Large Presentations1) **Optimize images before including**: ```bash theme=\{null} # Reduce PDF size gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \ -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf input.pdf ``` 2) **Use external figures**: ```latex theme=\{null} \pgfdeclareimage[width=5cm]{myimage}{figure.pdf} \pgfuseimage{myimage} ``` 3) **Compile sections separately during development**: ```latex theme=\{null} \includeonly{section2} % Only compile section 2 ```## Related Resources> [card] Article Writing > > Learn to write research papers in LaTeX[Open](/learn/latex/how-to/writing-research-paper)> [card] Graphics & Figures > > Master image handling in LaTeX[Open](/learn/latex/figures/inserting-images)> [card] TikZ Graphics > > Create professional diagrams[Open](/learn/latex/how-to/tikz-diagrams)> [card] Templates > > Ready-to-use presentation templates[Open](/templates/presentation)> [!TIP] > > **Pro tip**: Start with a simple theme and gradually add complexity. Focus on content first, then enhance with animations and graphics. Remember: the best presentations support your talk, not overshadow it.Ready to create your presentation? Check out our [presentation templates](/templates/presentation) or start with the basic template above!## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=presentations_open_app)> [card] Start from Presentation Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/presentation) # Creating Diagrams with TikZ Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/tikz-diagrams Master TikZ for creating professional diagrams in LaTeX. Learn drawing commands, libraries, flowcharts, graphs, and advanced visualization techniques. Create publication-quality diagrams directly in LaTeX using TikZ. This comprehensive guide covers basic shapes to complex technical illustrations, including flowcharts, graphs, circuits, and scientific diagrams.> [!NOTE] > > **Prerequisites**: Basic LaTeX knowledge\ > **Time to complete**: 40-45 minutes\ > **Difficulty**: Intermediate to Advanced\ > **What you'll learn**: TikZ syntax, libraries, drawing techniques, and practical examples## Introduction to TikZ### What is TikZ?TikZ (TikZ ist kein Zeichenprogramm - TikZ is not a drawing program) is a powerful package for creating graphics programmatically in LaTeX. It provides:> [card] Precise Control > > Exact positioning and measurements> [card] Consistency > > Matching document fonts and styles> [card] Programmable > > Loops, variables, and calculations> [card] Integration > > Seamless LaTeX integration### Basic Setup```latex tikz-setup.tex theme=\{null} \documentclass{article} \usepackage{tikz} % Load common libraries \usetikzlibrary{ arrows.meta, % Arrow styles positioning, % Relative positioning shapes.geometric, % Additional shapes calc, % Coordinate calculations patterns, % Fill patterns decorations.pathmorphing, % Path decorations backgrounds, % Background layers fit, % Fitting nodes chains, % Chain positioning shadows % Drop shadows } \begin{document} % Inline TikZ \begin{tikzpicture} \draw (0,0) -- (2,1); \end{tikzpicture} % Centered figure \begin{figure}[htbp] \centering \begin{tikzpicture} % Drawing commands here \end{tikzpicture} \caption{TikZ diagram} \end{figure} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tikz-setup.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_tikz_diagrams)```latex basic-shapes.tex theme=\{null} % Basic shapes and lines \begin{tikzpicture} % Grid for reference (remove in final) \draw[help lines, gray] (0,0) grid (6,4); % Lines \draw (0,0) -- (2,1); % Straight line \draw[thick] (3,0) -- (5,1); % Thick line \draw[dashed] (0,2) -- (2,3); % Dashed line \draw[->] (3,2) -- (5,3); % Arrow \draw[<->, red] (0,3.5) -- (2,3.5); % Double arrow % Basic shapes \draw (1,1) circle (0.5); % Circle \draw[fill=blue!20] (4,1) circle (0.5); % Filled circle \draw (0,0) rectangle (1,0.8); % Rectangle \draw[rounded corners] (3,0) rectangle (4,0.8); % Rounded % Nodes (shapes with text) \node[circle, draw] at (1,3) {A}; \node[rectangle, draw, fill=green!20] at (4,3) {Box}; \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-shapes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-02/page-1.svg)
## Basic Drawing### Coordinates and Paths```latex coordinates.tex theme=\{null} \begin{tikzpicture}[scale=1.5] % Cartesian coordinates \draw[->] (-0.5,0) -- (4,0) node[right] {$x$}; \draw[->] (0,-0.5) -- (0,3) node[above] {$y$}; % Points \fill (1,1) circle (2pt) node[below] {$(1,1)$}; \fill (3,2) circle (2pt) node[right] {$(3,2)$}; % Path with multiple segments \draw[thick, blue] (0,0) -- (1,1) -- (2,0.5) -- (3,2); % Curved path \draw[thick, red] (0,2) .. controls (1,3) and (2,1) .. (3,2.5); % Closed path \draw[thick, green, fill=green!20] (0.5,0.5) -- (1.5,0.5) -- (1,1.5) -- cycle; % Polar coordinates \draw[purple] (0,0) -- (45:2) node[midway, above] {$(45:2)$}; % Relative coordinates \draw[orange, thick] (2,1) -- ++(1,0.5) -- ++(0.5,-0.5); \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from coordinates.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-03/page-1.svg)
```latex path-operations.tex theme=\{null} \begin{tikzpicture}[scale=1.2] % Different path operations % Straight lines with corners \draw[blue] (0,0) -| (2,1); % Horizontal then vertical \draw[red] (3,0) |- (5,1); % Vertical then horizontal % Bezier curves \draw[thick] (0,2) .. controls (1,3) .. (2,2); \draw[thick, green] (3,2) .. controls (3.5,3) and (4.5,3) .. (5,2); % Arcs \draw[thick, orange] (1,3) arc (0:90:1); \draw[thick, purple] (4,3) arc (180:45:1.5); % Smooth curves through points \draw[thick, brown] plot[smooth] coordinates { (0,4) (0.5,4.5) (1,4.2) (1.5,4.8) (2,4.3) }; % Cycle back to start \draw[thick, cyan, fill=cyan!20] (3,4) -- (4,4.5) -- (5,4) -- (4,3.5) -- cycle; \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from path-operations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-04/page-1.svg)
### Nodes and Labels```latex nodes-basics.tex theme=\{null} \begin{tikzpicture}[ every node/.style={font=\sffamily}, main node/.style={circle, draw, minimum size=1cm} ] % Basic nodes \node (A) at (0,0) {Simple text}; \node[draw] (B) at (3,0) {Boxed text}; \node[circle, draw] (C) at (6,0) {Circle}; % Styled nodes \node[main node, fill=blue!20] (D) at (0,2) {D}; \node[rectangle, draw, rounded corners, fill=red!20] (E) at (3,2) {Rect}; \node[ellipse, draw, fill=green!20] (F) at (6,2) {Ellipse}; % Node connections \draw[->] (A) -- (B); \draw[->] (B) -- (C); \draw[<->, thick] (D) -- (E); \draw[->, dashed] (E) -- (F); % Labels on edges \draw[->] (D) -- (A) node[midway, left] {edge}; \draw[->] (F) -- (C) node[near start, right] {label}; \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex node-positioning.tex theme=\{null} \begin{tikzpicture}[ node distance=2cm, box/.style={rectangle, draw, minimum width=2cm, minimum height=1cm} ] % Central node \node[box, fill=yellow!30] (center) {Center}; % Relative positioning \node[box, above=of center] (top) {Above}; \node[box, below=of center] (bottom) {Below}; \node[box, left=of center] (left) {Left}; \node[box, right=of center] (right) {Right}; % Diagonal positioning \node[box, above right=of center] (tr) {Top Right}; \node[box, below left=of center] (bl) {Bottom Left}; % Custom distances \node[box, above=3cm of center] (far) {Far Above}; \node[box, right=1cm of center] (near) {Near Right}; % Connect all to center \foreach \n in {top, bottom, left, right, tr, bl, far, near} \draw[->] (center) -- (\n); \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Flowcharts and Diagrams### Basic Flowcharts```latex simple-flowchart.tex theme=\{null} \begin{tikzpicture}[ node distance=2cm, startstop/.style={rectangle, rounded corners, draw, fill=red!30, minimum width=3cm, minimum height=1cm}, process/.style={rectangle, draw, fill=blue!30, minimum width=3cm, minimum height=1cm}, decision/.style={diamond, draw, fill=green!30, minimum width=3cm, minimum height=1cm, aspect=2}, io/.style={trapezium, trapezium left angle=70, trapezium right angle=110, draw, fill=yellow!30, minimum width=3cm, minimum height=1cm}, arrow/.style={thick, ->, >=stealth} ] % Nodes \node[startstop] (start) {Start}; \node[io, below=of start] (input) {Input data}; \node[process, below=of input] (process1) {Process data}; \node[decision, below=of process1] (decision) {Valid?}; \node[process, below=of decision] (process2) {Generate output}; \node[startstop, below=of process2] (stop) {End}; % Alternative path \node[process, right=3cm of decision] (error) {Handle error}; % Connections \draw[arrow] (start) -- (input); \draw[arrow] (input) -- (process1); \draw[arrow] (process1) -- (decision); \draw[arrow] (decision) -- node[left] {Yes} (process2); \draw[arrow] (decision) -- node[above] {No} (error); \draw[arrow] (error) |- (input); \draw[arrow] (process2) -- (stop); \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex complex-flowchart.tex theme=\{null} \begin{tikzpicture}[ node distance=1.5cm and 2cm, box/.style={rectangle, draw, fill=#1, minimum width=2.5cm, minimum height=0.8cm, font=\small}, decision/.style={diamond, draw, fill=orange!30, aspect=1.5, font=\small}, cloud/.style={cloud, draw, fill=gray!20, minimum width=2cm, minimum height=1cm}, database/.style={cylinder, draw, fill=purple!30, minimum width=2cm, minimum height=1cm, shape border rotate=90}, arr/.style={->, >=latex, thick} ] % System architecture flowchart \node[cloud] (user) {User}; \node[box=blue!30, below=of user] (ui) {UI Layer}; \node[box=green!30, below=of ui] (api) {API Gateway}; \node[decision, below=of api] (auth) {Authenticated?}; \node[box=yellow!30, below left=of auth] (login) {Login Service}; \node[box=cyan!30, below right=of auth] (service) {Business Logic}; \node[database, below=of service] (db) {Database}; \node[box=red!30, right=of service] (cache) {Cache}; % Connections with labels \draw[arr] (user) -- (ui); \draw[arr] (ui) -- (api) node[midway, right] {HTTP}; \draw[arr] (api) -- (auth); \draw[arr] (auth) -- node[left] {No} (login); \draw[arr] (auth) -- node[right] {Yes} (service); \draw[arr] (login) -| (api); \draw[arr] (service) -- (db) node[midway, right] {Query}; \draw[arr, <->] (service) -- (cache) node[midway, above] {Read/Write}; \draw[arr] (db) -| (cache) node[near start, left] {Update}; \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### State Diagrams```latex state-diagram.tex theme=\{null} \begin{tikzpicture}[ >=stealth, node distance=3cm, state/.style={circle, draw, minimum size=1.5cm, font=\small}, initial/.style={state, fill=green!30}, final/.style={state, double, fill=red!30}, transition/.style={->, thick} ] % States \node[initial] (idle) {Idle}; \node[state, right=of idle] (loading) {Loading}; \node[state, right=of loading] (active) {Active}; \node[state, below=of active] (error) {Error}; \node[final, below=of idle] (terminated) {Done}; % Transitions \draw[transition] (idle) -- node[above] {start} (loading); \draw[transition] (loading) -- node[above] {success} (active); \draw[transition] (loading) -- node[right] {fail} (error); \draw[transition] (active) -- node[right] {complete} (terminated); \draw[transition] (error) -- node[below] {retry} (loading); \draw[transition] (error) -- node[left] {abort} (terminated); \draw[transition, bend left=30] (active) to node[above] {reset} (idle); % Self loop \draw[transition] (active) to[loop above] node {update} (active); \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex automaton.tex theme=\{null} \begin{tikzpicture}[ shorten >=1pt, node distance=2.5cm, on grid, auto, state/.style={circle, draw, minimum size=1.2cm}, accepting/.style={state, double} ] % Finite automaton \node[state, initial] (q0) {$q_0$}; \node[state] (q1) [right=of q0] {$q_1$}; \node[state] (q2) [right=of q1] {$q_2$}; \node[accepting] (q3) [right=of q2] {$q_3$}; % Transitions \path[->] (q0) edge node {0} (q1) (q0) edge[loop above] node {1} (q0) (q1) edge node {1} (q2) (q1) edge[bend left] node {0} (q0) (q2) edge node {0} (q3) (q2) edge[bend left] node[below] {1} (q1) (q3) edge[loop above] node {0,1} (q3); % Label \node[below=2cm of q1, text width=6cm, align=center] { Finite automaton accepting strings with exactly three 0s }; \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Graphs and Trees### Graph Structures```latex simple-graph.tex theme=\{null} \begin{tikzpicture}[ node distance=2cm, vertex/.style={circle, draw, fill=blue!20, minimum size=8mm}, edge/.style={thick} ] % Vertices \node[vertex] (A) {A}; \node[vertex, right=of A] (B) {B}; \node[vertex, below right=of A] (C) {C}; \node[vertex, below left=of A] (D) {D}; \node[vertex, below=of C] (E) {E}; % Edges \draw[edge] (A) -- (B); \draw[edge] (A) -- (C); \draw[edge] (A) -- (D); \draw[edge] (B) -- (C); \draw[edge] (C) -- (D); \draw[edge] (C) -- (E); \draw[edge] (D) -- (E); % Edge labels \draw[edge] (B) -- node[above right] {5} (E); \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex directed-graph.tex theme=\{null} \begin{tikzpicture}[ scale=1.5, vertex/.style={circle, draw, fill=orange!30, minimum size=10mm, font=\footnotesize}, edge/.style={->, >=stealth, thick}, weight/.style={midway, font=\scriptsize, fill=white, inner sep=1pt} ] % Weighted directed graph \node[vertex] (1) at (0,2) {1}; \node[vertex] (2) at (2,3) {2}; \node[vertex] (3) at (4,2) {3}; \node[vertex] (4) at (3,0) {4}; \node[vertex] (5) at (1,0) {5}; % Weighted edges \draw[edge] (1) -- node[weight] {3} (2); \draw[edge] (2) -- node[weight] {1} (3); \draw[edge] (3) -- node[weight] {4} (4); \draw[edge] (4) -- node[weight] {2} (5); \draw[edge] (5) -- node[weight] {6} (1); \draw[edge] (1) -- node[weight] {5} (3); \draw[edge] (2) -- node[weight] {2} (4); % Self loop \draw[edge] (3) to[loop right] node[weight] {1} (3); \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from directed-graph.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-12/page-1.svg)
### Tree Structures```latex binary-tree.tex theme=\{null} \begin{tikzpicture}[ level distance=1.5cm, level 1/.style={sibling distance=4cm}, level 2/.style={sibling distance=2cm}, level 3/.style={sibling distance=1cm}, treenode/.style={circle, draw, fill=green!30, minimum size=8mm}, edge from parent/.style={draw, ->, >=stealth} ] % Binary tree \node[treenode] {8} child { node[treenode] {3} child { node[treenode] {1} } child { node[treenode] {6} child { node[treenode] {4} } child { node[treenode] {7} } } } child { node[treenode] {10} child[missing] {} child { node[treenode] {14} child { node[treenode] {13} } child[missing] {} } }; \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from binary-tree.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-13/page-1.svg)
```latex tree-layouts.tex theme=\{null} \begin{tikzpicture}[ grow=down, level 1/.style={sibling distance=5cm}, level 2/.style={sibling distance=2.5cm}, level 3/.style={sibling distance=1.5cm}, edge from parent/.style={draw, thick}, nodeStyle/.style={rectangle, draw, fill=cyan!20, minimum width=2cm, minimum height=0.8cm, font=\small}, leafStyle/.style={nodeStyle, fill=yellow!30} ] % Organizational chart style tree \node[nodeStyle] {CEO} child { node[nodeStyle] {CTO} child { node[nodeStyle] {Dev Team} child { node[leafStyle] {Frontend} } child { node[leafStyle] {Backend} } } child { node[nodeStyle] {DevOps} child { node[leafStyle] {Cloud} } child { node[leafStyle] {Security} } } } child { node[nodeStyle] {CFO} child { node[leafStyle] {Accounting} } child { node[leafStyle] {Finance} } } child { node[nodeStyle] {CMO} child { node[leafStyle] {Marketing} } child { node[leafStyle] {Sales} } }; % Alternative: horizontal tree \begin{scope}[xshift=10cm] \tikzset{ grow=right, level 1/.style={sibling distance=2cm, level distance=2.5cm}, level 2/.style={sibling distance=1cm, level distance=2.5cm} } \node[nodeStyle] {Root} child { node[nodeStyle] {A} child { node[leafStyle] {A1} } child { node[leafStyle] {A2} } } child { node[nodeStyle] {B} child { node[leafStyle] {B1} } }; \end{scope} \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tree-layouts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-14/page-1.svg)
## Scientific Diagrams### Mathematical Diagrams```latex function-plot.tex theme=\{null} \begin{tikzpicture}[scale=1.5] % Axes \draw[->] (-0.5,0) -- (4,0) node[right] {$x$}; \draw[->] (0,-0.5) -- (0,3) node[above] {$y$}; % Grid \draw[gray, very thin] (0,0) grid (3.5,2.5); % Function plots \draw[blue, thick, domain=0:3.5, samples=100] plot (\x, {0.5*\x*\x - \x + 1}); \draw[red, thick, domain=0:3.5, samples=100] plot (\x, {sin(\x r) + 1}); \draw[green, thick, domain=0.1:3.5, samples=100] plot (\x, {ln(\x) + 1}); % Labels \node[blue] at (3,2.2) {$f(x) = \frac{1}{2}x^2 - x + 1$}; \node[red] at (2,0.3) {$g(x) = \sin(x) + 1$}; \node[green] at (3.2,1.3) {$h(x) = \ln(x) + 1$}; % Points of interest \fill[blue] (2,1) circle (2pt) node[above right] {$(2,1)$}; \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from function-plot.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-15/page-1.svg)
```latex geometric-diagram.tex theme=\{null} \begin{tikzpicture}[scale=2] % Triangle with labels \coordinate[label=left:$A$] (A) at (0,0); \coordinate[label=right:$B$] (B) at (3,0); \coordinate[label=above:$C$] (C) at (1.5,2); % Draw triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Angles \draw[fill=red!20] (A) -- (0.5,0) arc (0:53.13:0.5) -- cycle; \draw[fill=blue!20] (B) -- (2.5,0) arc (180:126.87:0.5) -- cycle; \draw[fill=green!20] (C) -- (1.5,1.5) arc (270:270-73.74:0.5) -- cycle; % Angle labels \node at (0.7,0.2) {$\alpha$}; \node at (2.3,0.2) {$\beta$}; \node at (1.5,1.6) {$\gamma$}; % Side labels \node[below] at (1.5,0) {$c$}; \node[above right] at (2.25,1) {$a$}; \node[above left] at (0.75,1) {$b$}; % Height \draw[dashed] (C) -- (1.5,0) node[midway, right] {$h$}; \fill (1.5,0) circle (1pt); \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from geometric-diagram.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-16/page-1.svg)
### Physics Diagrams```latex physics-diagram.tex theme=\{null} \begin{tikzpicture}[ force/.style={->, thick, blue}, mass/.style={rectangle, draw, fill=gray!30, minimum width=1.5cm, minimum height=1.5cm} ] % Free body diagram \node[mass] (m) {$m$}; % Forces \draw[force] (m.north) -- ++(0,2) node[above] {$N$}; \draw[force] (m.south) -- ++(0,-2) node[below] {$mg$}; \draw[force] (m.east) -- ++(1.5,0) node[right] {$F$}; \draw[force] (m.west) -- ++(-1,0) node[left] {$f$}; % Surface \draw[thick] (-3,-0.75) -- (3,-0.75); \foreach \x in {-3,-2.5,...,3} { \draw (\x,-0.75) -- (\x-0.25,-1); } % Angle for inclined plane \begin{scope}[xshift=6cm] \draw[thick] (0,0) -- (4,0) -- (4,2) -- cycle; \node[mass, rotate=26.57] at (2.5,1.25) {$m$}; \draw[force] (2.5,1.25) -- ++(0,-2) node[below] {$mg$}; \draw[force, rotate=26.57] (2.5,1.25) -- ++(0,1.5) node[above] {$N$}; \node at (0.5,0.15) {$\theta$}; \end{scope} \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from physics-diagram.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-17/page-1.svg)
```latex circuit-diagram.tex theme=\{null} \begin{tikzpicture}[circuit ee IEC] % Simple circuit \draw (0,0) to[battery] (0,3) to[ammeter] (3,3) to[resistor={info=$R_1$}] (3,1.5) to[resistor={info=$R_2$}] (3,0) -- (0,0); % Parallel circuit \begin{scope}[xshift=5cm] \draw (0,0) to[voltage source] (0,3) -- (1,3) to[resistor={info=$R_1$}] (3,3) -- (4,3) -- (4,0) -- (0,0); \draw (1,3) -- (1,2) to[resistor={info=$R_2$}] (3,2) -- (3,3); \draw (1,2) -- (1,1) to[capacitor={info=$C$}] (3,1) -- (3,2); \end{scope} \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Advanced Techniques### Loops and Automation```latex foreach-loops.tex theme=\{null} \begin{tikzpicture} % Grid of nodes using foreach \foreach \x in {0,1,2,3,4} { \foreach \y in {0,1,2,3} { \node[circle, draw, fill=blue!\x0!green!\y0] at (\x,\y) {\tiny \x,\y}; } } % Radial pattern \begin{scope}[xshift=7cm, yshift=2cm] \foreach \angle in {0,30,...,330} { \draw[thick, color=red!\angle!blue] (0,0) -- (\angle:2); \fill[color=red!\angle!blue] (\angle:2) circle (2pt); } \end{scope} % Connected graph \begin{scope}[yshift=-5cm] \foreach \i in {1,...,6} { \node[circle, draw, fill=orange!30] (n\i) at ({360/6 * (\i-1)}:2) {\i}; } \foreach \i in {1,...,6} { \foreach \j in {\i,...,6} { \draw[gray] (n\i) -- (n\j); } } \end{scope} \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from foreach-loops.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-19/page-1.svg)
```latex calculations.tex theme=\{null} \begin{tikzpicture} % Using calculations \coordinate (A) at (0,0); \coordinate (B) at (4,0); \coordinate (C) at (2,3); % Midpoints \coordinate (MAB) at ($(A)!0.5!(B)$); \coordinate (MBC) at ($(B)!0.5!(C)$); \coordinate (MCA) at ($(C)!0.5!(A)$); % Draw triangle and medians \draw[thick] (A) -- (B) -- (C) -- cycle; \draw[dashed, red] (A) -- (MBC); \draw[dashed, red] (B) -- (MCA); \draw[dashed, red] (C) -- (MAB); % Centroid (intersection of medians) \coordinate (G) at (barycentric cs:A=1,B=1,C=1); \fill[red] (G) circle (2pt) node[below] {$G$}; % Perpendicular lines \draw[blue, thick] (A) -- ($(B)!(A)!(C)$); % Circle through three points \node[draw, circle through=(A)(B)(C)] {}; \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Styles and Scopes```latex custom-styles.tex theme=\{null} \begin{tikzpicture}[ % Define custom styles my node/.style={ circle, draw=#1, fill=#1!20, minimum size=1cm, font=\bfseries }, my edge/.style={ thick, ->, >=stealth, #1 }, important/.style={ my node=red, drop shadow }, normal/.style={ my node=blue } ] % Use custom styles \node[important] (A) at (0,0) {A}; \node[normal] (B) at (3,0) {B}; \node[normal] (C) at (3,3) {C}; \node[important] (D) at (0,3) {D}; % Styled edges \draw[my edge={red, dashed}] (A) -- (B); \draw[my edge={blue}] (B) -- (C); \draw[my edge={green, bend left}] (C) -- (D); \draw[my edge={orange, bend right}] (D) -- (A); % Scope with different settings \begin{scope}[xshift=6cm, scale=0.8, opacity=0.7] \node[my node=purple] (E) at (0,0) {E}; \node[my node=cyan] (F) at (2,2) {F}; \draw[my edge={thick}] (E) -- (F); \end{scope} \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex layers.tex theme=\{null} \begin{tikzpicture} % Background layer \begin{pgfonlayer}{background} \fill[yellow!20] (-1,-1) rectangle (5,4); \fill[blue!20] (1,0.5) circle (2); \end{pgfonlayer} % Main layer \draw[thick] (0,0) grid (4,3); \node[circle, draw, fill=white] at (2,1.5) {Main}; % Foreground layer \begin{pgfonlayer}{foreground} \node[rectangle, draw, fill=red!70, opacity=0.8] at (3,2) {Front}; \end{pgfonlayer} \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Decorations and Patterns```latex decorations.tex theme=\{null} \begin{tikzpicture}[ decoration={ snake, amplitude=.5mm, segment length=3mm } ] % Different decorations \draw[decorate, thick] (0,0) -- (3,0) node[right] {snake}; \draw[ decoration={coil, segment length=4mm}, decorate, thick ] (0,1) -- (3,1) node[right] {coil}; \draw[ decoration={zigzag, segment length=4mm}, decorate, thick ] (0,2) -- (3,2) node[right] {zigzag}; \draw[ decoration={random steps, segment length=3mm}, decorate, thick ] (0,3) -- (3,3) node[right] {random}; % Text along path \draw[ decoration={ text along path, text={This text follows the curve!} }, decorate ] (5,0) .. controls (6,2) and (7,2) .. (8,0); % Arrow decorations \draw[ thick, decoration={ markings, mark=at position 0.25 with {\arrow{>}}, mark=at position 0.5 with {\arrow{>}}, mark=at position 0.75 with {\arrow{>}} }, postaction={decorate} ] (5,3) circle (1); \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex patterns-fills.tex theme=\{null} \begin{tikzpicture} % Pattern fills \fill[pattern=horizontal lines] (0,0) rectangle (2,1); \fill[pattern=vertical lines] (2.5,0) rectangle (4.5,1); \fill[pattern=north east lines] (5,0) rectangle (7,1); \fill[pattern=grid] (7.5,0) rectangle (9.5,1); % Custom patterns \fill[pattern=dots] (0,2) rectangle (2,3); \fill[pattern=crosshatch] (2.5,2) rectangle (4.5,3); \fill[pattern=fivepointed stars] (5,2) rectangle (7,3); \fill[pattern=bricks] (7.5,2) rectangle (9.5,3); % Combining patterns and colors \fill[pattern=north west lines, pattern color=blue] (0,4) rectangle (2,5); \fill[pattern=checkerboard, pattern color=red] (2.5,4) rectangle (4.5,5); % Gradient fills \shade[left color=red, right color=blue] (5,4) rectangle (7,5); \shade[inner color=yellow, outer color=orange] (7.5,4) circle (0.5); \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Annotation Layers: Braces and Labels over FiguresTikZ also works as an annotation layer: braces, callouts and arrows drawn over a schematic or over an included image.```latex annotated-figure.tex theme=\{null} \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing,calc,arrows.meta} \pagestyle{empty} \begin{document} \begin{tikzpicture} \draw[thick] (0,0) rectangle (6,3); \fill[blue!15] (0.4,0.4) rectangle (3.4,2.6); \fill[orange!20] (3.8,0.4) rectangle (5.6,2.6); \node at (1.9,1.5) {Editor}; \node at (4.7,1.5) {PDF}; \draw[decorate, decoration={brace, amplitude=6pt}] (0,3.15) -- (6,3.15) node[midway, above=6pt] {One browser window}; \draw[{Latex}-, thick] (3.4,1.5) -- (3.8,1.5); \end{tikzpicture} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from annotated-figure.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-tikz-advanced-03/page-1.svg)
The `decorations.pathreplacing` library supplies the brace. `amplitude` sets its depth, and `node[midway, above=6pt]` places the label at its center.To annotate a photo or plot instead of drawn shapes, put the image in a node and switch to coordinates relative to that node. `(0,0)` becomes the lower-left corner of the image and `(1,1)` the upper-right corner, so the annotations stay in place when you change the image width:```latex annotate-image.tex theme=\{null} \begin{tikzpicture} \node[anchor=south west, inner sep=0] (img) {\includegraphics[width=8cm]{setup-photo}}; \begin{scope}[x={(img.south east)}, y={(img.north west)}] % (0,0) is now the lower-left of the image, (1,1) upper-right \draw[red, thick, ->] (0.62,0.30) -- (0.80,0.52) node[above right] {sample holder}; \end{scope} \end{tikzpicture} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Best Practices### Optimization Tips> [!TIP] > > **TikZ best practices**: > > 1. **Use styles** - Define reusable styles for consistency > 2. **Name nodes** - Makes connections easier > 3. **Use calculations** - Let TikZ compute positions > 4. **Layer wisely** - Background, main, foreground > 5. **Externalize** - Compile complex diagrams separately > 6. **One file per figure** - Keep large pictures in files such as `figures/phase-diagram.tikz` and pull them in with `\input`, so the same figure works in a paper, a thesis and slides > 7. **Comment code** - Especially for complex diagrams > 8. **Use libraries** - Don't reinvent the wheel > 9. **Test incrementally** - Build diagrams step by step### Common Pitfalls> [!WARNING] > > **Avoid these TikZ mistakes**: > > 1. **Hardcoded positions** - Use relative positioning > 2. **Repeated code** - Use loops and styles > 3. **Complex paths** - Break into smaller parts > 4. **Missing libraries** - Load required libraries > 5. **Scale issues** - Test at final size > 6. **Memory problems** - Externalize large diagrams > 7. **Forgotten semicolons** - Every command needs one## Complete Examples### Network Diagram```latex network-diagram.tex theme=\{null} \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning, shapes.geometric, shadows, backgrounds} \begin{document} \begin{tikzpicture}[ node distance=2cm, server/.style={ rectangle, draw, fill=blue!20, minimum width=2cm, minimum height=1.5cm, drop shadow, font=\small }, client/.style={ rectangle, draw, fill=green!20, minimum width=1.5cm, minimum height=1cm, drop shadow, font=\small }, database/.style={ cylinder, draw, fill=orange!20, minimum width=2cm, minimum height=1.5cm, shape border rotate=90, drop shadow, font=\small }, cloud/.style={ cloud, draw, fill=gray!20, minimum width=3cm, minimum height=2cm, drop shadow, font=\small }, connection/.style={thick, ->, >=stealth}, label/.style={font=\footnotesize, fill=white, inner sep=2pt} ] % Core components \node[cloud] (internet) {Internet}; \node[server, below=3cm of internet] (loadbalancer) {Load Balancer}; % Web servers \node[server, below left=2cm and 1cm of loadbalancer] (web1) {Web Server 1}; \node[server, below right=2cm and 1cm of loadbalancer] (web2) {Web Server 2}; % Application servers \node[server, below=of web1] (app1) {App Server 1}; \node[server, below=of web2] (app2) {App Server 2}; % Databases \node[database, below right=2cm and 0cm of app1] (db1) {Primary DB}; \node[database, right=1cm of db1] (db2) {Replica DB}; % Clients \node[client, left=3cm of internet] (client1) {Client 1}; \node[client, above left=1cm and 2cm of internet] (client2) {Client 2}; \node[client, above right=1cm and 2cm of internet] (client3) {Client 3}; % Connections \draw[connection] (client1) -- (internet); \draw[connection] (client2) -- (internet); \draw[connection] (client3) -- (internet); \draw[connection, <->] (internet) -- node[label] {HTTPS} (loadbalancer); \draw[connection] (loadbalancer) -- (web1); \draw[connection] (loadbalancer) -- (web2); \draw[connection] (web1) -- (app1); \draw[connection] (web2) -- (app2); \draw[connection] (app1) -- (db1); \draw[connection] (app2) -- (db1); \draw[connection, <->] (db1) -- node[label] {Sync} (db2); % Background regions \begin{pgfonlayer}{background} \fill[yellow!20, rounded corners] ([shift={(-0.5,0.5)}]loadbalancer.north west) rectangle ([shift={(0.5,-0.5)}]db2.south east); \node[above] at (loadbalancer.north) {Data Center}; \end{pgfonlayer} \end{tikzpicture} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Data Flow Diagram```latex data-flow-diagram.tex theme=\{null} \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, shapes, decorations.pathmorphing} \begin{document} \begin{tikzpicture}[ >=latex, node distance=2.5cm, process/.style={ rectangle, draw, fill=blue!30, minimum width=3cm, minimum height=1cm, rounded corners, font=\small\sffamily }, data/.style={ trapezium, draw, fill=green!30, trapezium left angle=70, trapezium right angle=110, minimum width=2.5cm, minimum height=0.8cm, font=\small\sffamily }, storage/.style={ rectangle, draw, fill=orange!30, minimum width=2.5cm, minimum height=0.8cm, path picture={ \draw ([xshift=0.1cm]path picture bounding box.north west) -- ([xshift=-0.1cm]path picture bounding box.north east); }, font=\small\sffamily }, flow/.style={thick, ->, >=stealth}, label/.style={font=\footnotesize, above, sloped} ] % Input layer \node[data] (input) {Raw Data}; % Processing pipeline \node[process, below=of input] (validate) {Validate}; \node[process, below=of validate] (transform) {Transform}; \node[process, below=of transform] (analyze) {Analyze}; % Storage \node[storage, right=3cm of validate] (raw) {Raw Storage}; \node[storage, right=3cm of transform] (processed) {Processed DB}; \node[storage, right=3cm of analyze] (results) {Results Cache}; % Output \node[data, below=of analyze] (output) {Reports}; \node[process, right=of output] (visualize) {Visualize}; \node[data, right=of visualize] (dashboard) {Dashboard}; % Main flow \draw[flow] (input) -- node[label] {Stream} (validate); \draw[flow] (validate) -- node[label] {Valid} (transform); \draw[flow] (transform) -- node[label] {Clean} (analyze); \draw[flow] (analyze) -- node[label] {Insights} (output); % Storage connections \draw[flow, dashed] (validate) -- node[label] {Archive} (raw); \draw[flow, dashed] (transform) -- node[label] {Store} (processed); \draw[flow, dashed] (analyze) -- node[label] {Cache} (results); % Visualization flow \draw[flow] (output) -- (visualize); \draw[flow] (visualize) -- (dashboard); \draw[flow, bend right] (results) to node[label, below] {Query} (visualize); % Error handling \node[process, left=2cm of transform, fill=red!30] (error) {Error Handler}; \draw[flow, red, bend right] (validate) to node[label, below] {Invalid} (error); \draw[flow, red, bend right] (transform) to node[label, below] {Failed} (error); \draw[flow, red] (error) |- (input); % Decorations \node[above=0.5cm of input, font=\large\bfseries] {Data Processing Pipeline}; % Legend \begin{scope}[xshift=8cm, yshift=-3cm] \node[process, minimum width=2cm] (l1) at (0,0) {Process}; \node[data, minimum width=2cm] (l2) at (0,-1) {Data}; \node[storage, minimum width=2cm] (l3) at (0,-2) {Storage}; \draw[flow] (3,0) -- node[above] {Flow} (4.5,0); \draw[flow, dashed] (3,-1) -- node[above] {Store} (4.5,-1); \node[above=0.3cm of l1, font=\bfseries] {Legend}; \end{scope} \end{tikzpicture} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from data-flow-diagram.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-tikz-diagrams-26/page-1.svg)
## Next StepsExplore more LaTeX visualization:> [card] Mathematics > > Mathematical equations and graphs[Open](/learn/latex/mathematics/basics)> [card] Circuit Diagrams > > Electronic circuit drawings[Open](/learn/latex/specialized-notation/circuits)> [card] Chemical Structures > > Molecular diagrams[Open](/learn/latex/specialized-notation/chemistry)> [card] Physics Notation > > Physics diagrams and notation[Open](/learn/latex/specialized-notation/physics)***> [!NOTE] > > **Pro tip**: Start simple and build complexity gradually. Use the TikZ manual (texdoc tikz) as your reference - it's comprehensive with excellent examples. Consider externalizing complex diagrams to speed up compilation of your main document. # Using LaTeX Templates Effectively Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/using-templates Master LaTeX templates for efficient document creation. Learn to find, customize, create, and share templates for various document types. Save time and ensure consistency by mastering LaTeX templates. This guide covers finding quality templates, customization techniques, creating your own templates, and sharing them with others.> [!NOTE] > > **Prerequisites**: Basic LaTeX knowledge\ > **Time to complete**: 25-30 minutes\ > **Difficulty**: Intermediate\ > **What you'll learn**: Template sources, customization, creation, package development, and distribution## Understanding LaTeX Templates### What Makes a Good Template?> [card] Well-Structured > > Clear organization with logical sections and includes> [card] Documented > > Comments explaining usage and customization options> [card] Flexible > > Easy to adapt for different use cases> [card] Complete > > Includes all necessary packages and settings### Template Components``` template/ ├── main.tex # Main template file ├── template.cls # Custom class (optional) ├── template.sty # Style package (optional) ├── README.md # Documentation ├── example/ # Example usage │ ├── example.tex │ ├── example.pdf │ └── figures/ ├── lib/ # Supporting files │ ├── commands.tex # Custom commands │ ├── environments.tex # Custom environments │ └── packages.tex # Package imports └── assets/ # Logos, images ```## Finding Templates### Quality Template Sources> [tab] LaTeX Cloud Studio > > Built-in template gallery with: > > * Academic papers > * Presentations > * CVs and resumes > * Books and reports > * Posters > * Letters> [tab] CTAN > > **Comprehensive TeX Archive Network** > > * Official packages > * Document classes > * Quality assured > * Well documented > > Browse: [ctan.org](https://ctan.org)> [tab] University Templates > > Many universities provide: > > * Thesis templates > * Dissertation formats > * Department styles > * Branding guidelines> [tab] Community > > **GitHub/GitLab** > > * Open source templates > * Version controlled > * Community maintained > * Issue tracking### Evaluating Templates```latex template-evaluation.tex theme=\{null} % Check these aspects before using a template % 1. License - Can you use/modify it? % Look for LICENSE file or header comments % 2. Dependencies - What packages are required? \usepackage{required-package} % Is this available? % 3. Compatibility - Does it work with your setup? \documentclass{template-class} % Does this compile? % 4. Customization - How flexible is it? \settemplateoption{key}{value} % Are options documented? % 5. Maintenance - Is it actively maintained? % Check last update date and issue tracker ``````bash template-testing.sh theme=\{null} #!/bin/bash # Test template before adopting # 1. Clone/download template git clone https://github.com/user/latex-template cd latex-template # 2. Check structure find . -name "*.tex" -o -name "*.cls" -o -name "*.sty" | head -20 # 3. Test compilation pdflatex example/example.tex if [ $? -eq 0 ]; then echo "Template compiles successfully" else echo "Compilation failed - check dependencies" fi # 4. Review output open example/example.pdf # macOS # xdg-open example/example.pdf # Linux ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
## Customizing Templates### Basic Customization```latex customize-basics.tex theme=\{null} % Most templates provide customization options % 1. Document metadata \title{Your Document Title} \author{Your Name} \date{\today} \institution{Your University} % 2. Style options \documentclass[ 12pt, % Font size letterpaper, % Paper size twoside, % Two-sided printing draft % Draft mode ]{template-class} % 3. Color schemes \definecolor{primary}{RGB}{0, 51, 102} \definecolor{secondary}{RGB}{255, 128, 0} \setbeamercolor{title}{fg=primary} % 4. Fonts \usepackage{libertine} % Change main font \usepackage[libertine]{newtxmath} % Matching math font % 5. Layout adjustments \geometry{ margin=1in, headheight=15pt } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex advanced-customization.tex theme=\{null} % Deeper customization techniques % Override template commands \let\oldtitle\title \renewcommand{\title}[1]{% \oldtitle{\MakeUppercase{#1}}% } % Modify environments \let\oldabstract\abstract \let\endoldabstract\endabstract \renewenvironment{abstract}{% \begin{center} \textbf{ABSTRACT} \end{center} \oldabstract }{% \endoldabstract } % Hook into template internals \makeatletter \renewcommand{\@maketitle}{% % Custom title page layout \begin{center} {\LARGE \@title \par} \vskip 2em {\large \@author \par} \vskip 1em {\@date \par} \end{center} } \makeatother ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Package-based Templates```latex using-class-options.tex theme=\{null} % Article class with custom options \documentclass[journal]{IEEEtran} % Options: conference, journal, technote, peerreview % Beamer with themes \documentclass{beamer} \usetheme{Madrid} \usecolortheme{beaver} \usefonttheme{professionalfonts} % Memoir class flexibility \documentclass[ 11pt, oneside, article, % Article mode extrafontsizes ]{memoir} % KOMA-Script customization \documentclass[ paper=a4, fontsize=11pt, DIV=12, % Type area calculation BCOR=10mm, % Binding correction parskip=half % Paragraph spacing ]{scrartcl} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex template-packages.tex theme=\{null} % Common template packages % Academic papers \usepackage{acmart} % ACM articles \usepackage{IEEEtran} % IEEE transactions \usepackage{elsarticle} % Elsevier journals \usepackage{revtex4-2} % Physics journals % Presentations \usepackage{beamer} % Presentations \usepackage{beamerposter} % Posters % Books/Reports \usepackage{memoir} % Flexible book class \usepackage{scrbook} % KOMA-Script book \usepackage{tufte-latex} % Tufte-style layouts % CVs/Resumes \usepackage{moderncv} % Modern CV \usepackage{europecv} % European CV format \usepackage{curve} % Another CV class ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Creating Your Own Templates### Template Structure```latex basic-template.tex theme=\{null} % my-template.tex - Basic article template \documentclass[11pt, a4paper]{article} % ==================================== % PACKAGES % ==================================== \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1in]{geometry} \usepackage{graphicx} \usepackage{hyperref} % ==================================== % CUSTOM COMMANDS % ==================================== \newcommand{\projectname}[1]{\def\@projectname{#1}} \newcommand{\supervisor}[1]{\def\@supervisor{#1}} % ==================================== % DOCUMENT SETTINGS % ==================================== \hypersetup{ colorlinks=true, linkcolor=blue, citecolor=green, urlcolor=red } % ==================================== % TITLE PAGE REDEFINITION % ==================================== \makeatletter \renewcommand{\maketitle}{% \begin{titlepage} \centering \vspace*{2cm} {\Huge\bfseries \@title \par} \vspace{1cm} {\Large Project: \@projectname \par} \vspace{2cm} {\Large\itshape \@author \par} \vspace{0.5cm} {\large Supervisor: \@supervisor \par} \vfill {\large \@date \par} \end{titlepage} } \makeatother % ==================================== % BEGIN DOCUMENT % ==================================== \begin{document} % User fills these \title{Your Title Here} \author{Your Name} \projectname{Project Name} \supervisor{Dr. Supervisor} \date{\today} \maketitle \begin{abstract} Your abstract here... \end{abstract} \tableofcontents \newpage \section{Introduction} Start writing here... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex modular-template.tex theme=\{null} % main-template.tex - Modular approach \documentclass{article} % Load template components \input{template-config/packages} \input{template-config/settings} \input{template-config/commands} \input{template-config/environments} \begin{document} \input{template-parts/titlepage} \input{template-parts/abstract} \tableofcontents \listoffigures \listoftables % User content sections \input{sections/introduction} \input{sections/methodology} \input{sections/results} \input{sections/conclusion} \bibliographystyle{plain} \bibliography{references} \appendix \input{appendices/appendix-a} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Custom Document Class```latex myclass.cls theme=\{null} % myclass.cls - Custom document class \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myclass}[2024/01/01 My Custom Class] % Base class \LoadClass[11pt, a4paper]{article} % Required packages \RequirePackage[margin=1in]{geometry} \RequirePackage{graphicx} \RequirePackage{hyperref} \RequirePackage{fancyhdr} % Class options \DeclareOption{draft}{ \PassOptionsToClass{draft}{article} \AtEndOfClass{\usepackage[disable]{todonotes}} } \DeclareOption{final}{ \PassOptionsToClass{final}{article} } \ProcessOptions\relax % Custom commands \newcommand{\institution}[1]{\gdef\@institution{#1}} \newcommand{\department}[1]{\gdef\@department{#1}} % Headers and footers \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\@title} \fancyhead[R]{\@author} \fancyfoot[C]{\thepage} % Title page \renewcommand{\maketitle}{% \begin{titlepage} \centering \vspace*{1cm} \includegraphics[width=0.3\textwidth]{logo}\par \vspace{1cm} {\scshape\LARGE \@institution \par} \vspace{0.5cm} {\scshape\Large \@department \par} \vspace{2cm} {\huge\bfseries \@title \par} \vspace{2cm} {\Large\itshape \@author \par} \vfill {\large \@date \par} \end{titlepage} } % Theorem environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \endinput ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex myclass-usage.tex theme=\{null} % Using the custom class \documentclass[draft]{myclass} \title{Research Paper} \author{Jane Doe} \institution{University Name} \department{Computer Science} \date{\today} \begin{document} \maketitle \begin{abstract} This paper presents... \end{abstract} \section{Introduction} Our custom class provides... \begin{theorem} Let $X$ be a... \end{theorem} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Style Package Creation```latex mystyle.sty theme=\{null} % mystyle.sty - Reusable style package \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mystyle}[2024/01/01 My Style Package] % Package options \newif\if@colorful \DeclareOption{colorful}{\@colorfultrue} \DeclareOption{plain}{\@colorfulfalse} \ProcessOptions\relax % Dependencies \RequirePackage{xcolor} \RequirePackage{tikz} \RequirePackage{tcolorbox} % Color definitions \if@colorful \definecolor{primary}{RGB}{0, 102, 204} \definecolor{secondary}{RGB}{255, 128, 0} \definecolor{accent}{RGB}{0, 153, 0} \else \definecolor{primary}{gray}{0.2} \definecolor{secondary}{gray}{0.4} \definecolor{accent}{gray}{0.6} \fi % Custom box environment \newtcolorbox{mybox}[2][]{ colback=primary!5!white, colframe=primary!75!black, title=#2, #1 } % Section formatting \RequirePackage{titlesec} \titleformat{\section} {\normalfont\Large\bfseries\color{primary}} {\thesection}{1em}{} % Custom commands \newcommand{\highlight}[1]{% \textcolor{accent}{\textbf{#1}}% } \newcommand{\keyword}[1]{% \textcolor{secondary}{\textit{#1}}% } % Custom list environment \newenvironment{mylist}{% \begin{itemize} \setlength{\itemsep}{0.5em} \renewcommand{\labelitemi}{% \textcolor{primary}{\textbullet}% } }{% \end{itemize} } \endinput ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex using-mystyle.tex theme=\{null} % Using the custom style \documentclass{article} \usepackage[colorful]{mystyle} \begin{document} \section{Introduction} This document uses our \highlight{custom style}. \begin{mybox}{Important Note} This is a custom colored box environment. \end{mybox} Key concepts: \begin{mylist} \item First \keyword{concept} \item Second \keyword{idea} \item Third \keyword{principle} \end{mylist} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Template Distribution### Packaging Templates````bash create-template-package.sh theme=\{null} #!/bin/bash # Package template for distribution PROJECT="my-latex-template" VERSION="1.0.0" # Create directory structure mkdir -p $PROJECT/{doc,examples,src} # Copy template files cp template.cls $PROJECT/src/ cp template.sty $PROJECT/src/ cp -r examples/* $PROJECT/examples/ # Create documentation cat > $PROJECT/README.md << 'EOF' # My LaTeX Template ## Installation ### Method 1: Local Installation Place files in your LaTeX project directory. ### Method 2: System Installation ```bash mkdir -p ~/texmf/tex/latex/my-template cp src/* ~/texmf/tex/latex/my-template/ texhash ~/texmf ````### Method 3: Using LaTeX Cloud StudioUpload as custom template in your workspace.## Usage```latex theme=\{null} \documentclass{my-template} \begin{document} Your content here \end{document} ```## Options* `draft` - Enable draft mode * `final` - Final version (default) * `twoside` - Two-sided printing## ExamplesSee the `examples/` directory for complete examples.## LicenseThis template is released under the MIT License. EOF# Create ZIP archivezip -r $PROJECT-$VERSION.zip \$PROJECT/echo "Template package created: $PROJECT-$VERSION.zip"```` ```latex template-documentation.tex % template-doc.tex - User documentation \documentclass{ltxdoc} \usepackage{hyperref} \title{The \textsf{my-template} Package} \author{Your Name} \date{Version 1.0.0 \\ \today} \begin{document} \maketitle \begin{abstract} This package provides a customizable template for academic documents with support for multiple layouts and styles. \end{abstract} \tableofcontents \section{Introduction} The \textsf{my-template} package simplifies document creation... \section{Installation} \subsection{Requirements} \begin{itemize} \item \LaTeX{} distribution (TeX Live 2020+) \item Required packages: \texttt{geometry}, \texttt{graphicx} \end{itemize} \subsection{Installation Methods} \begin{enumerate} \item Local installation... \item System-wide installation... \end{enumerate} \section{Usage} \subsection{Basic Usage} \begin{verbatim} \documentclass{my-template} \title{Your Title} \author{Your Name} \begin{document} \maketitle Your content... \end{document} \end{verbatim} \subsection{Options} \begin{description} \item[\texttt{draft}] Enable draft mode \item[\texttt{twoside}] Two-sided layout \end{description} \section{Customization} \subsection{Colors} Define custom colors: \begin{verbatim} \definecolor{mycolor}{RGB}{100,150,200} \setmaincolor{mycolor} \end{verbatim} \section{Examples} Complete examples are provided in the \texttt{examples/} directory. \end{document} ````\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
### Sharing Templates> [tab] GitHub > > ```yaml theme=\{null} > # .github/workflows/release.yml > name: Release Template > > on: > push: > tags: > - 'v*' > > jobs: > release: > runs-on: ubuntu-latest > steps: > - uses: actions/checkout@v2 > > - name: Build documentation > run: | > pdflatex template-doc.tex > pdflatex template-doc.tex > > - name: Create release package > run: | > ./create-package.sh > > - name: Create Release > uses: actions/create-release@v1 > with: > tag_name: ${{ github.ref }} > release_name: Release ${{ github.ref }} > files: | > template-*.zip > template-doc.pdf > ```> [tab] CTAN > > ```bash theme=\{null} > # Prepare for CTAN submission > # 1. Follow CTAN guidelines > # 2. Create proper directory structure > # 3. Include comprehensive documentation > # 4. Test on multiple systems > # 5. Submit via https://ctan.org/upload > ```> [tab] Institutional > > ````latex example.tex theme=\{null} > % Share within organization > % 1. Internal Git repository > % 2. Shared network drive > % 3. Template gallery > % 4. Documentation wiki > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````## Template Best Practices### Design Principles> [!TIP] > > **Template design checklist**: > > * [ ] Clear documentation with examples > * [ ] Sensible defaults > * [ ] Minimal dependencies > * [ ] Error handling > * [ ] Backward compatibility > * [ ] Semantic commands > * [ ] Consistent naming > * [ ] Modular structure > * [ ] Version tracking > * [ ] License included### Common Mistakes> [!WARNING] > > **Avoid these template pitfalls**: > > 1. **Hard-coded values** - Use commands/options > 2. **Absolute paths** - Always relative > 3. **Missing dependencies** - Document requirements > 4. **No examples** - Include working examples > 5. **Poor documentation** - Explain everything > 6. **Breaking changes** - Maintain compatibility > 7. **Complex setup** - Keep it simple## Complete Template Example```latex professional-template.cls theme=\{null} % professional-template.cls \NeedsTeXFormat{LaTeX2e} \ProvidesClass{professional-template}[2024/01/01 v1.0] % Class options \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions\relax \LoadClass{article} % Essential packages \RequirePackage[utf8]{inputenc} \RequirePackage[T1]{fontenc} \RequirePackage{geometry} \RequirePackage{fancyhdr} \RequirePackage{graphicx} \RequirePackage{hyperref} \RequirePackage{xcolor} % Layout \geometry{ paper=a4paper, margin=1in, headheight=14pt } % Colors \definecolor{themecolor}{RGB}{0, 102, 204} \definecolor{lightgray}{gray}{0.95} % Headers and footers \pagestyle{fancy} \fancyhf{} \fancyhead[L]{\small\@title} \fancyhead[R]{\small\@author} \fancyfoot[C]{\small Page \thepage} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} % Custom commands \newcommand{\subtitle}[1]{\gdef\@subtitle{#1}} \newcommand{\institution}[1]{\gdef\@institution{#1}} \newcommand{\email}[1]{\gdef\@email{#1}} % Title page \renewcommand{\maketitle}{% \thispagestyle{empty} \begin{center} \vspace*{2cm} {\Huge\bfseries\color{themecolor} \@title \par} \ifdef{\@subtitle}{ \vspace{0.5cm} {\Large \@subtitle \par} }{} \vspace{2cm} {\Large \@author \par} \ifdef{\@email}{ \vspace{0.3cm} {\normalsize \href{mailto:\@email}{\@email} \par} }{} \ifdef{\@institution}{ \vspace{0.5cm} {\large \@institution \par} }{} \vfill {\large \@date \par} \end{center} \newpage \setcounter{page}{1} } % Abstract formatting \renewenvironment{abstract}{% \begin{center} \begin{minipage}{0.9\textwidth} \rule{\textwidth}{0.4pt} \vspace{0.2cm} {\large\bfseries Abstract} \vspace{0.3cm} }{% \vspace{0.2cm} \rule{\textwidth}{0.4pt} \end{minipage} \end{center} \vspace{1cm} } % Section formatting \RequirePackage{titlesec} \titleformat{\section} {\normalfont\Large\bfseries\color{themecolor}} {\thesection}{1em}{} \titleformat{\subsection} {\normalfont\large\bfseries} {\thesubsection}{1em}{} % Custom environments \RequirePackage{tcolorbox} \newtcolorbox{highlight}{ colback=lightgray, colframe=themecolor, boxrule=1pt, arc=2mm, left=5mm, right=5mm, top=3mm, bottom=3mm } \endinput ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex template-example.tex theme=\{null} % Example using professional-template \documentclass{professional-template} \title{Professional Document Template} \subtitle{A Complete Example} \author{John Doe} \email{john.doe@example.com} \institution{Example University} \date{\today} \begin{document} \maketitle \begin{abstract} This document demonstrates the features of our professional template, including custom title pages, formatted sections, and special environments. The template is designed for academic and professional documents. \end{abstract} \tableofcontents \newpage \section{Introduction} This template provides a clean, professional layout suitable for various document types. \begin{highlight} Key features include automatic formatting, custom environments, and consistent styling throughout the document. \end{highlight} \section{Usage} Simply use the document class and fill in your content: \begin{verbatim} \documentclass{professional-template} \title{Your Title} \author{Your Name} \begin{document} \maketitle Your content here... \end{document} \end{verbatim} \section{Conclusion} This template streamlines document creation while maintaining professional appearance. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Next StepsContinue improving your LaTeX workflow:> [card] Fixing Errors > > Debug template issues[Open](/learn/latex/basics/errors)> [card] Large Documents > > Templates for books/theses[Open](/learn/latex/how-to/large-documents)> [card] Collaboration > > Share templates with teams[Open](/learn/latex/how-to/collaboration-workflow)> [card] Research Papers > > Academic paper templates[Open](/learn/latex/how-to/writing-research-paper)***> [!NOTE] > > **Pro tip**: Start with existing templates and gradually customize them to your needs. Once you have a working template you like, version control it and document any customizations for future reference. # Writing a Research Paper in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/writing-research-paper Write academic research papers in LaTeX. Learn structure, citations, formatting, and submission preparation for journals and conferences. Master the complete workflow for writing professional research papers in LaTeX. This guide covers paper structure, academic writing conventions, bibliography management, journal requirements, and submission preparation.> [!NOTE] > > **Prerequisites**: Basic LaTeX knowledge, understanding of academic writing\ > **Time to complete**: 40-45 minutes\ > **Difficulty**: Intermediate to Advanced\ > **What you'll learn**: Paper structure, citations, formatting, journal templates, and submission process## Keep Sources And Writing In One ProjectIf you use LaTeX Cloud Studio for paper writing, keep the source workflow close to the manuscript instead of splitting it across disconnected tools.> [card] Knowledge Base > > Keep project papers and reference PDFs inside the same project so they can become reusable source context.[Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=writing_research_paper)> [card] AI Research Agent > > Find external literature, expand from accepted sources, and move strong evidence toward citation handoff.[Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=writing_research_paper)Typical workflow:1. Upload the core papers for the project into the knowledge base. 2. Draft the section that needs support or related-work coverage. 3. Use the research workspace to find stronger evidence, newer follow-up work, or counterarguments. 4. Accept the sources worth keeping in project memory. 5. Move accepted evidence toward bibliography and citation workflows in the manuscript.> [!WARNING] > > The current public knowledge-base upload flow is documented for PDF documents. Keep the public workflow description narrow unless the product UI changes.## Research Paper Overview### Standard Paper Structure> [card] Front Matter > > Title, authors, abstract, keywords> [card] Main Content > > Introduction, methods, results, discussion> [card] Back Matter > > Conclusions, references, appendices> [card] Supplementary > > Data, code, additional figures### Planning Your Paper> [tab] Journal Article > > ````latex example.tex theme=\{null} > % Typical structure: > % - Title page > % - Abstract (150-250 words) > % - Keywords (3-7 terms) > % - Introduction > % - Related Work > % - Methodology > % - Results > % - Discussion > % - Conclusion > % - References > % - Appendices (optional) > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Conference Paper > > ````latex example.tex theme=\{null} > % Common structure: > % - Title and authors > % - Abstract (100-200 words) > % - Introduction > % - Background > % - Approach/Method > % - Evaluation > % - Related Work > % - Conclusion > % - References > % Page limit: 6-10 pages > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Technical Report > > ````latex example.tex theme=\{null} > % Extended structure: > % - Cover page > % - Executive summary > % - Table of contents > % - Introduction > % - Literature review > % - Methodology > % - Results > % - Analysis > % - Recommendations > % - Conclusion > % - References > % - Appendices > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````## Document Setup### Basic Research Paper Template```latex research-paper-template.tex theme=\{null} \documentclass[11pt, a4paper]{article} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1in]{geometry} \usepackage{amsmath, amssymb, amsthm} \usepackage{graphicx} \usepackage{booktabs} \usepackage{algorithm2e} \usepackage{listings} \usepackage{hyperref} \usepackage{cleveref} % Bibliography \usepackage[ backend=biber, style=authoryear-comp, sorting=nyt, natbib=true ]{biblatex} \addbibresource{references.bib} % Custom commands \newcommand{\keywords}[1]{\par\noindent\textbf{Keywords:} #1} \newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}} % Theorem environments \theoremstyle{definition} \newtheorem{definition}{Definition}[section] \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} % Document metadata \title{Your Research Paper Title: A Comprehensive Study of Important Topics} \author{ First Author\thanks{Corresponding author}\textsuperscript{1} \and Second Author\textsuperscript{2} \and Third Author\textsuperscript{1,2} } \date{} \begin{document} \maketitle % Author affiliations \begin{center} \textsuperscript{1}Department of Computer Science, University Name\\ \textsuperscript{2}Research Institute, City, Country\\ \email{first.author@university.edu} \end{center} \begin{abstract} The abstract should be a self-contained summary of your paper, typically 150-250 words. It should include: (1) motivation and problem statement, (2) approach/methodology, (3) main results, and (4) conclusions. Avoid citations in the abstract. \end{abstract} \keywords{keyword1, keyword2, keyword3, keyword4, keyword5} \section{Introduction} \label{sec:introduction} The introduction should provide context and motivate your research. Start with the broad context, narrow down to your specific problem, state your contributions clearly, and outline the paper structure. \subsection{Motivation} Explain why this research is important... \subsection{Contributions} Our main contributions are: \begin{itemize} \item First contribution with brief description \item Second contribution with impact \item Third contribution and its novelty \end{itemize} \subsection{Paper Organization} The remainder of this paper is organized as follows. \Cref{sec:related} reviews related work. \Cref{sec:methodology} presents our methodology. \Cref{sec:results} shows experimental results. \Cref{sec:discussion} discusses implications. \Cref{sec:conclusion} concludes the paper. \section{Related Work} \label{sec:related} Review relevant literature, grouping by themes or approaches. Show how your work differs from and builds upon existing research. \section{Methodology} \label{sec:methodology} Describe your approach in detail, allowing others to reproduce your work. \section{Results} \label{sec:results} Present your findings objectively with appropriate visualizations. \section{Discussion} \label{sec:discussion} Interpret results, discuss limitations, and suggest future work. \section{Conclusion} \label{sec:conclusion} Summarize key findings and contributions. \printbibliography \appendix \section{Supplementary Material} Additional details, proofs, or data. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex journal-specific-template.tex theme=\{null} % IEEE Transactions format \documentclass[journal]{IEEEtran} \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \begin{document} \title{Paper Title for IEEE Journal} \author{\IEEEauthorblockN{First Author} \IEEEauthorblockA{\textit{Department Name} \\ \textit{University Name}\\ City, Country \\ email@address.edu} \and \IEEEauthorblockN{Second Author} \IEEEauthorblockA{\textit{Company Name} \\ City, Country \\ email@address.com}} \maketitle \begin{abstract} Abstract text here... \end{abstract} \begin{IEEEkeywords} component, formatting, style, styling, insert \end{IEEEkeywords} \section{Introduction} \IEEEPARstart{T}{his} is the first paragraph... \section{Conclusion} The conclusion goes here. \bibliographystyle{IEEEtran} \bibliography{IEEEabrv,references} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Writing Best Practices### Academic Writing Style```latex academic-writing.tex theme=\{null} % Professional academic writing conventions % Clear, concise sentences We present a novel algorithm for graph analysis. % Good In this paper, we are going to present and discuss a new and novel algorithm that we developed for the purpose of analyzing graphs. % Too verbose % Active voice for clarity We conducted experiments... % Clear Experiments were conducted... % Passive, less clear % Precise language Our method achieves 95\% accuracy. % Specific Our method works well. % Vague % Consistent terminology \newcommand{\ourmethod}{GraphNet} % Define once We propose \ourmethod{}, a neural network... \ourmethod{} processes graphs efficiently... % Professional tone The results demonstrate... % Professional The results clearly prove that we were right... % Unprofessional ```
Rendered output Open zoomable preview: Compiled PDF page 1 from academic-writing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-writing-research-paper-06/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_writing_research_paper)```latex technical-writing.tex theme=\{null} % Technical writing elements % Definitions \begin{definition}[Graph Neural Network] \label{def:gnn} A Graph Neural Network (GNN) is a neural network architecture designed to work directly on graph-structured data, where $G = (V, E)$ represents a graph with vertices $V$ and edges $E$. \end{definition} % Algorithms \begin{algorithm}[htbp] \caption{Our Proposed Method} \label{alg:method} \KwData{Input graph $G = (V, E)$} \KwResult{Processed output $Y$} \ForEach{node $v \in V$}{ $h_v \leftarrow \text{Initialize}(v)$\; } \For{$t = 1$ \KwTo $T$}{ \ForEach{node $v \in V$}{ $h_v \leftarrow \text{Update}(h_v, \{h_u : u \in \mathcal{N}(v)\})$\; } } \Return{$Y = \text{Readout}(\{h_v : v \in V\})$}\; \end{algorithm} % Mathematical notation We define the loss function as: \begin{equation} \mathcal{L} = \sum_{i=1}^{N} \ell(y_i, \hat{y}_i) + \lambda \|\theta\|_2^2 \label{eq:loss} \end{equation} where $\ell$ is the individual loss, $\lambda$ is the regularization parameter, and $\theta$ represents model parameters. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Figures and Tables```latex research-figures.tex theme=\{null} % Professional figure presentation \begin{figure}[tbp] \centering \includegraphics[width=0.8\columnwidth]{results-plot} \caption{Performance comparison of different methods. Our approach (red) consistently outperforms baselines across all datasets. Error bars indicate 95\% confidence intervals over 5 runs.} \label{fig:results} \end{figure} % Subfigures for comparison \begin{figure}[tbp] \centering \begin{subfigure}{0.48\columnwidth} \includegraphics[width=\textwidth]{method-a} \caption{Baseline method} \label{fig:baseline} \end{subfigure} \hfill \begin{subfigure}{0.48\columnwidth} \includegraphics[width=\textwidth]{method-b} \caption{Our method} \label{fig:ourmethod} \end{subfigure} \caption{Visual comparison of processing pipelines. (a) shows the traditional approach while (b) illustrates our streamlined method.} \label{fig:comparison} \end{figure} % Reference in text As shown in \cref{fig:results}, our method achieves superior performance. The visual comparison in \cref{fig:comparison} highlights the efficiency gains. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
```latex research-tables.tex theme=\{null} % Professional tables for research \begin{table}[tbp] \centering \caption{Comparison of state-of-the-art methods on benchmark datasets} \label{tab:comparison} \begin{tabular}{lcccc} \toprule Method & Dataset A & Dataset B & Dataset C & Avg. Rank \\ \midrule Baseline-1 \citep{author2020} & 82.3±1.2 & 76.5±2.1 & 69.8±1.8 & 3.7 \\ Baseline-2 \citep{author2021} & 84.1±0.9 & 78.2±1.5 & 71.2±1.6 & 2.7 \\ Recent-Work \citep{author2023} & 85.7±0.8 & 79.8±1.2 & 73.5±1.4 & 2.0 \\ \midrule \textbf{Our Method} & \textbf{87.4±0.6} & \textbf{81.3±1.0} & \textbf{75.9±1.1} & \textbf{1.0} \\ \bottomrule \end{tabular} \begin{tablenotes} \small \item Values show accuracy ± standard deviation. Best results in bold. \end{tablenotes} \end{table} % Ablation study table \begin{table}[tbp] \centering \caption{Ablation study of proposed components} \label{tab:ablation} \begin{tabular}{lccc} \toprule Configuration & Accuracy & F1-Score & Time (ms) \\ \midrule Full model & \textbf{87.4} & \textbf{0.862} & 142 \\ w/o component A & 85.1 & 0.831 & 128 \\ w/o component B & 84.8 & 0.825 & \textbf{95} \\ w/o both A\&B & 82.3 & 0.798 & 87 \\ \bottomrule \end{tabular} \end{table} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Citations and References### Bibliography Management```bibtex references.bib theme=\{null} % Well-formatted bibliography entries @article{smith2023deep, title={Deep Learning for Graph Analysis: A Comprehensive Survey}, author={Smith, John and Doe, Jane and Johnson, Alice}, journal={IEEE Transactions on Neural Networks and Learning Systems}, volume={34}, number={5}, pages={2145--2168}, year={2023}, publisher={IEEE}, doi={10.1109/TNNLS.2023.1234567} } @inproceedings{doe2022efficient, title={Efficient Graph Neural Networks for Large-Scale Applications}, author={Doe, Jane and Smith, John}, booktitle={Proceedings of the 39th International Conference on Machine Learning}, pages={3421--3430}, year={2022}, organization={PMLR}, url={https://proceedings.mlr.press/v162/doe22a.html} } @book{johnson2021graph, title={Graph Theory and Machine Learning}, author={Johnson, Alice and Brown, Bob}, year={2021}, publisher={MIT Press}, address={Cambridge, MA}, edition={2nd}, isbn={978-0-262-04567-8} } @misc{brown2023preprint, title={Scalable Graph Processing with Neural Networks}, author={Brown, Bob and Wilson, Carol}, year={2023}, eprint={2301.12345}, archivePrefix={arXiv}, primaryClass={cs.LG} } @phdthesis{wilson2022thesis, title={Advanced Methods in Graph Neural Networks}, author={Wilson, Carol}, year={2022}, school={Stanford University}, address={Stanford, CA}, type={{Ph.D.} dissertation} } ``````latex citation-styles.tex theme=\{null} % Different citation styles and usage % Parenthetical citations Recent work has shown significant improvements \citep{smith2023deep}. Multiple studies confirm this \citep{doe2022efficient, johnson2021graph}. % Textual citations \citet{smith2023deep} demonstrated that graph neural networks... As shown by \citet{doe2022efficient}, the efficiency gains... % Specific page/section citations The theoretical foundation \citep[Chapter~3]{johnson2021graph}... This contradicts earlier findings \citep[pp.~123--125]{wilson2022thesis}. % Multiple author handling \citet{brown2023preprint} extend the work of \citet{smith2023deep}... % Citation commands for different styles % natbib: \citep, \citet, \citealp, \citealt % biblatex: \cite, \parencite, \textcite, \autocite % Formatting citations \citeauthor{smith2023deep} (\citeyear{smith2023deep}) showed... In \citeyear{doe2022efficient}, \citeauthor{doe2022efficient} proposed... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
### Managing Citations```latex citation-management.tex theme=\{null} % Best practices for citations % Group related work \subsection{Graph Neural Networks} Early work on graph neural networks \citep{early2018, another2018} focused on simple architectures. Recent advances \citep{smith2023deep, doe2022efficient} have dramatically improved performance. % Cite primary sources % Bad: GNNs were introduced [survey paper] % Good: GNNs were introduced by \citet{original2009} % Balance citations Our work builds on three main areas: \begin{itemize} \item Graph theory \citep{graph1, graph2, graph3} \item Neural networks \citep{nn1, nn2, nn3} \item Optimization \citep{opt1, opt2, opt3} \end{itemize} % Recent and relevant % Aim for recent papers (last 5 years) unless citing foundational work % Include relevant conference and journal papers ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
```latex bibliography-formatting.tex theme=\{null} % Bibliography formatting options % Sort by appearance \usepackage[style=unsrt]{biblatex} % Sort alphabetically \usepackage[style=alphabetic]{biblatex} % Compressed numeric citations [1-3] instead of [1,2,3] \usepackage[style=numeric-comp]{biblatex} % Custom bibliography sections \printbibliography[heading=bibintoc, title={References}] % Separate bibliographies \printbibliography[type=article, title={Journal Articles}] \printbibliography[type=inproceedings, title={Conference Papers}] \printbibliography[type=book, title={Books}] % Filter by keywords \printbibliography[keyword=experiment, title={Experimental Studies}] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Equations and Theorems### Mathematical Content```latex mathematical-content.tex theme=\{null} % Professional mathematical presentation % Numbered equations for important results \begin{equation} f(x) = \sum_{i=1}^{n} w_i \phi_i(x) + b \label{eq:model} \end{equation} % Unnumbered for intermediate steps \begin{equation*} \frac{\partial f}{\partial w_i} = \phi_i(x) \end{equation*} % Multi-line equations \begin{align} \mathcal{L}(\theta) &= \frac{1}{N} \sum_{i=1}^{N} \ell(f_\theta(x_i), y_i) \label{eq:loss1}\\ &= \frac{1}{N} \sum_{i=1}^{N} (f_\theta(x_i) - y_i)^2 \label{eq:loss2}\\ &\quad + \lambda \|\theta\|_2^2 \label{eq:loss3} \end{align} % Equation arrays for cases \begin{equation} \text{ReLU}(x) = \begin{cases} x & \text{if } x > 0 \\ 0 & \text{otherwise} \end{cases} \label{eq:relu} \end{equation} % Inline math The complexity is $\mathcal{O}(n \log n)$ where $n$ is the input size. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from mathematical-content.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-writing-research-paper-12/page-1.svg)
```latex theorems-proofs.tex theme=\{null} % Theorems and formal statements \begin{theorem}[Convergence Guarantee] \label{thm:convergence} Let $f: \mathbb{R}^n \to \mathbb{R}$ be a $\beta$-smooth convex function. Then gradient descent with step size $\alpha \leq 1/\beta$ satisfies: \begin{equation} f(x_k) - f(x^*) \leq \frac{\|x_0 - x^*\|^2}{2\alpha k} \end{equation} \end{theorem} \begin{proof} By the smoothness condition, we have... [detailed proof steps] Therefore, the bound holds. \end{proof} \begin{lemma} \label{lem:helper} Under the conditions of \cref{thm:convergence}, the iterates satisfy $\|x_{k+1} - x^*\| \leq \|x_k - x^*\|$. \end{lemma} \begin{proposition} The algorithm terminates in $\mathcal{O}(1/\epsilon)$ iterations. \end{proposition} \begin{corollary} For strongly convex functions, the convergence rate improves to linear. \end{corollary} % Reference theorems As proven in \cref{thm:convergence}, our method converges. Using \cref{lem:helper}, we can show... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Journal Submission### Preparing for Submission```latex submission-checklist.tex theme=\{null} % Pre-submission checklist % 1. Check journal requirements % - Page limit % - Format (single/double column) % - Reference style % - Figure resolution (usually 300 DPI) % 2. Anonymous submission \usepackage{xifthen} \newboolean{anonymous} \setboolean{anonymous}{true} % for review \ifthenelse{\boolean{anonymous}}{ \author{Anonymous Authors} \thanks{Details hidden for review} }{ \author{Real Names} \thanks{Actual affiliations} } % 3. Supplementary material % Create separate PDF with: % - Additional experiments % - Detailed proofs % - Extended results % - Code listings % 4. Cover letter template % Dear Editor, % We submit our manuscript titled "..." for consideration... % The main contributions are: % 1. ... % 2. ... % This work has not been published elsewhere... ```
Rendered output Open zoomable preview: Compiled PDF page 1 from submission-checklist.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-writing-research-paper-14/page-1.svg)
```latex journal-formatting.tex theme=\{null} % Common journal formatting requirements % Double spacing for review \usepackage{setspace} \doublespacing % Line numbers for review \usepackage{lineno} \linenumbers % Wide margins for reviewer comments \geometry{margin=1.5in} % Figure placement at end \usepackage[nomarkers,figuresonly]{endfloat} % Word count \usepackage{wordcount} \newcommand{\wordcount}{\detokenize{bash wc -w main.tex}} % Page limits \usepackage{pageslts} \pagenumbering{arabic} \pagestyle{plain} % Embedded fonts \pdfminorversion=4 \pdfobjcompresslevel=0 % PDF metadata \hypersetup{ pdfauthor={Your Name}, pdftitle={Paper Title}, pdfsubject={Subject Area}, pdfkeywords={keyword1, keyword2} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Journal Templates> [tab] Elsevier > > ```latex example.tex theme=\{null} > \documentclass[review]{elsarticle} > \usepackage{natbib} > \usepackage{graphicx} > \journal{Journal Name} > > \begin{document} > \begin{frontmatter} > \title{Title} > \author[inst1]{First Author} > \author[inst2]{Second Author} > \address[inst1]{University One} > \address[inst2]{University Two} > > \begin{abstract} > Abstract text... > \end{abstract} > > \begin{keyword} > keyword1 \sep keyword2 > \end{keyword} > \end{frontmatter} > > \section{Introduction} > Main text... > > \bibliography{refs} > \end{document} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. > > [Open SVG](/images/rendered/learn-latex-how-to-writing-research-paper-16/page-1.svg) >
> [tab] Springer > > ````latex example.tex theme=\{null} > \documentclass[twocolumn]{svjour3} > \usepackage{graphicx} > > \begin{document} > \title{Your Title} > \author{First Author \and Second Author} > \institute{F. Author \at University} > \date{Received: date / Accepted: date} > > \maketitle > > \begin{abstract} > Abstract text... > \keywords{First \and Second} > \end{abstract} > > \section{Introduction} > \label{intro} > Your text... > > \bibliography{refs} > \end{document} > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> ````> [tab] ACM > > ````latex example.tex theme=\{null} > \documentclass[sigconf]{acmart} > \usepackage{graphicx} > > \title{Title} > \author{First Author} > \affiliation{% > \institution{University} > \city{City} > \country{Country} > } > \email{email@inst.edu} > > \begin{abstract} > Abstract... > \end{abstract} > > \keywords{keyword1, keyword2} > > \maketitle > > \section{Introduction} > Text... > > \bibliographystyle{ACM-Reference-Format} > \bibliography{refs} > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
> ````## Responding to Reviews### Revision Management```latex tracking-changes.tex theme=\{null} % Track changes for revision \usepackage{changes} \definechangesauthor[name={Rev1}, color=blue]{R1} \definechangesauthor[name={Rev2}, color=red]{R2} \definechangesauthor[name={Rev3}, color=green]{R3} % Address reviewer comments \section{Introduction} \added[id=R1]{We added this sentence to address Reviewer 1's concern about motivation.} \deleted[id=R2]{This sentence was removed.} \replaced[id=R2]{new text}{old text} % Highlight changes \usepackage{soul} \newcommand{\revision}[1]{\hl{#1}} % Alternative: latexdiff % latexdiff original.tex revised.tex > diff.tex ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tracking-changes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-writing-research-paper-19/page-1.svg)
```latex response-letter.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \usepackage{framed} % Response formatting \newcommand{\reviewer}[1]{\subsection*{Reviewer #1}} \newcommand{\comment}[1]{% \begin{framed} \noindent\textbf{Comment:} #1 \end{framed} } \newcommand{\response}[1]{% \noindent\textbf{Response:} #1\par\medskip } \title{Response to Reviewers} \date{\today} \begin{document} \maketitle We thank the reviewers for their valuable feedback. We have carefully addressed all comments as detailed below. Changes in the manuscript are highlighted in \textcolor{blue}{blue}. \reviewer{1} \comment{The motivation is not clear in the introduction.} \response{We have expanded the introduction (pages 1-2) to better explain the motivation. Specifically, we added a new paragraph discussing the practical applications and importance of our work.} \comment{The experimental setup needs more detail.} \response{We have added Section 4.1 (page 8) with comprehensive details about our experimental setup, including hardware specifications, dataset preprocessing, and hyperparameter settings.} \reviewer{2} \comment{How does this work compare to [Smith et al., 2023]?} \response{We have added a detailed comparison with Smith et al. in Section 2.3 (page 5). Our method differs in three key aspects: (1)..., (2)..., (3)...} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from response-letter.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-how-to-writing-research-paper-20/page-1.svg)
## Best Practices Summary> [!TIP] > > ✅ **Research paper checklist**: > > * [ ] Clear, descriptive title > * [ ] Structured abstract with all components > * [ ] Well-defined contributions > * [ ] Comprehensive literature review > * [ ] Reproducible methodology > * [ ] Objective results presentation > * [ ] Thoughtful discussion > * [ ] Strong conclusions > * [ ] Complete, formatted references > * [ ] Professional figures and tables > * [ ] Proofread thoroughly > * [ ] Check journal requirements > * [ ] Prepare supplementary materials## Complete Example```latex complete-paper-example.tex theme=\{null} \documentclass[10pt, conference]{IEEEtran} \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{hyperref} \usepackage{cleveref} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \title{Deep Graph Neural Networks for\\Large-Scale Network Analysis} \author{\IEEEauthorblockN{Jane Doe\textsuperscript{1}, John Smith\textsuperscript{2}, Alice Johnson\textsuperscript{1}} \IEEEauthorblockA{\textsuperscript{1}Department of Computer Science, University Name\\ \textsuperscript{2}AI Research Lab, Tech Company\\ \{jdoe, ajohnson\}@university.edu, jsmith@company.com}} \maketitle \begin{abstract} Graph Neural Networks (GNNs) have emerged as powerful tools for analyzing graph-structured data. However, scaling GNNs to large networks remains challenging due to computational and memory constraints. In this paper, we propose ScaleGNN, a novel architecture that efficiently processes graphs with millions of nodes. Our key contributions are: (1) a hierarchical sampling strategy that preserves graph structure while reducing computational cost, (2) an adaptive aggregation mechanism that dynamically adjusts to local graph topology, and (3) a distributed training framework that enables processing of web-scale graphs. Extensive experiments on five large-scale datasets demonstrate that ScaleGNN achieves state-of-the-art performance while reducing training time by 73\% compared to existing methods. Our code is available at \url{https://github.com/example/scalegnn}. \end{abstract} \begin{IEEEkeywords} graph neural networks, large-scale graphs, distributed learning, network analysis \end{IEEEkeywords} \section{Introduction} \label{sec:intro} \IEEEPARstart{G}{raph}-structured data is ubiquitous in modern applications, from social networks and recommendation systems to biological networks and knowledge graphs. The ability to effectively analyze these complex structures has become crucial for many domains. Traditional machine learning approaches struggle with graph data due to its irregular structure and complex dependencies. Graph Neural Networks (GNNs) \cite{kipf2017semi} have revolutionized graph analysis by providing a principled framework for learning on graph-structured data. However, real-world graphs often contain millions or billions of nodes, presenting significant scalability challenges for existing GNN architectures. \subsection{Motivation} Consider a social network with a billion users, where we want to predict user interests for personalized recommendations. Existing GNN methods either: \begin{itemize} \item Require the entire graph to fit in memory, which is infeasible \item Use sampling techniques that lose important structural information \item Sacrifice model expressiveness for computational efficiency \end{itemize} These limitations motivate our work on ScaleGNN, which addresses all three challenges simultaneously. \subsection{Contributions} Our main contributions are: \begin{enumerate} \item \textbf{Hierarchical Importance Sampling}: We propose a novel sampling strategy that maintains critical graph structures while reducing the computational graph size by orders of magnitude. \item \textbf{Adaptive Aggregation}: Our dynamic aggregation mechanism adjusts to local graph topology, allocating more capacity to complex neighborhoods. \item \textbf{Distributed Framework}: We design a distributed training system that efficiently partitions and processes web-scale graphs across multiple machines. \item \textbf{Comprehensive Evaluation}: We conduct extensive experiments showing that ScaleGNN outperforms state-of-the-art methods on five large-scale benchmarks while significantly reducing computational requirements. \end{enumerate} \section{Related Work} \label{sec:related} \subsection{Graph Neural Networks} The concept of neural networks on graphs was first introduced by \cite{gori2005new}. Modern GNNs can be broadly categorized into spectral approaches \cite{bruna2014spectral, defferrard2016convolutional} and spatial approaches \cite{hamilton2017inductive, velivckovic2018graph}. \subsection{Scalable GNN Training} Recent work has focused on scaling GNNs through various techniques: \textbf{Sampling-based methods}: GraphSAINT \cite{zeng2019graphsaint} uses subgraph sampling, while FastGCN \cite{chen2018fastgcn} employs layer-wise sampling. However, these methods often suffer from variance issues. \textbf{Simplified architectures}: SGC \cite{wu2019simplifying} removes nonlinearities between layers, achieving linear complexity but with reduced expressiveness. Our work differs by maintaining model expressiveness while achieving superior scalability through hierarchical sampling and distributed processing. \section{Methodology} \label{sec:method} \subsection{Problem Formulation} Let $G = (V, E, X)$ denote a graph with nodes $V$, edges $E$, and node features $X \in \mathbb{R}^{|V| \times d}$. Our goal is to learn node representations $Z \in \mathbb{R}^{|V| \times d'}$ that capture both local structure and global context. \subsection{ScaleGNN Architecture} The core innovation of ScaleGNN lies in its three-component design: \begin{equation} Z = \text{Distributed}(\text{Adaptive}(\text{HierSample}(G, X))) \label{eq:scalegnn} \end{equation} \subsubsection{Hierarchical Importance Sampling} We construct a hierarchy of graph abstractions: \begin{equation} G_0 \rightarrow G_1 \rightarrow \ldots \rightarrow G_L \label{eq:hierarchy} \end{equation} where $G_l = (V_l, E_l)$ and $|V_{l+1}| < |V_l|$. \begin{algorithm} \caption{Hierarchical Importance Sampling} \label{alg:sampling} \begin{algorithmic}[1] \REQUIRE Graph $G = (V, E)$, importance scores $s$ \ENSURE Hierarchy $\{G_0, G_1, \ldots, G_L\}$ \STATE $G_0 \leftarrow G$ \FOR{$l = 0$ to $L-1$} \STATE $s_l \leftarrow$ ComputeImportance($G_l$) \STATE $V_{l+1} \leftarrow$ SelectTopK($V_l, s_l, k_l$) \STATE $E_{l+1} \leftarrow$ InducedEdges($V_{l+1}, E_l$) \STATE $G_{l+1} \leftarrow (V_{l+1}, E_{l+1})$ \ENDFOR \RETURN $\{G_0, G_1, \ldots, G_L\}$ \end{algorithmic} \end{algorithm} \section{Experiments} \label{sec:experiments} \subsection{Datasets} We evaluate on five large-scale datasets: \begin{table}[t] \centering \caption{Dataset Statistics} \label{tab:datasets} \begin{tabular}{lrrr} \toprule Dataset & Nodes & Edges & Classes \\ \midrule ogbn-products & 2.4M & 61.9M & 47 \\ ogbn-papers100M & 111.1M & 1.6B & 172 \\ Reddit & 232.9K & 11.6M & 41 \\ Yelp & 716.8K & 6.9M & 100 \\ Amazon & 1.6M & 132.2M & 107 \\ \bottomrule \end{tabular} \end{table} \subsection{Results} \begin{figure}[t] \centering \includegraphics[width=0.48\textwidth]{scalability-plot} \caption{Training time comparison on ogbn-papers100M dataset. ScaleGNN achieves 73\% reduction in training time while maintaining accuracy.} \label{fig:scalability} \end{figure} \begin{table}[t] \centering \caption{Node Classification Accuracy (\%)} \label{tab:accuracy} \begin{tabular}{lccccc} \toprule Method & Products & Papers & Reddit & Yelp & Amazon \\ \midrule GraphSAGE & 78.5 & OOM & 95.4 & 63.2 & 82.1 \\ FastGCN & 76.2 & OOM & 93.7 & 61.8 & 79.4 \\ GraphSAINT & 79.1 & 65.3 & 96.2 & 64.5 & 83.6 \\ ClusterGCN & 78.9 & 67.1 & 96.6 & 64.9 & 84.2 \\ \midrule \textbf{ScaleGNN} & \textbf{81.4} & \textbf{71.2} & \textbf{97.1} & \textbf{66.3} & \textbf{85.8} \\ \bottomrule \end{tabular} \end{table} As shown in \cref{tab:accuracy}, ScaleGNN consistently outperforms baselines across all datasets. Notably, it is the only method that successfully processes the ogbn-papers100M dataset without running out of memory (OOM). \section{Discussion} \label{sec:discussion} \subsection{Ablation Study} We analyze the contribution of each component: \begin{table}[t] \centering \caption{Ablation Study on Reddit Dataset} \label{tab:ablation} \begin{tabular}{lcc} \toprule Configuration & Accuracy & Time (min) \\ \midrule Full ScaleGNN & 97.1 & 12.3 \\ w/o Hierarchical Sampling & 95.8 & 28.7 \\ w/o Adaptive Aggregation & 96.2 & 14.1 \\ w/o Distributed Training & 97.0 & 45.6 \\ \bottomrule \end{tabular} \end{table} \subsection{Limitations} While ScaleGNN achieves impressive results, it has some limitations: \begin{itemize} \item The hierarchical sampling may lose fine-grained local patterns in extremely sparse graphs \item The distributed framework requires careful hyperparameter tuning for optimal partitioning \end{itemize} \section{Conclusion} \label{sec:conclusion} We presented ScaleGNN, a novel architecture for processing large-scale graphs. Through hierarchical importance sampling, adaptive aggregation, and distributed training, ScaleGNN achieves state-of-the-art performance while significantly reducing computational requirements. Our extensive experiments demonstrate its effectiveness across diverse datasets. Future work includes extending ScaleGNN to dynamic graphs and exploring its application to even larger networks with trillions of edges. \section*{Acknowledgment} We thank the anonymous reviewers for their valuable feedback. This work was supported by NSF Grant \#1234567. \bibliographystyle{IEEEtran} \bibliography{references} \appendix \section{Implementation Details} \label{app:implementation} Our implementation uses PyTorch Geometric and PyTorch Distributed. The complete training pipeline... \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Next StepsContinue with academic writing:> [card] Creating Posters > > Conference poster design[Open](/learn/latex/how-to/creating-posters)> [card] Presentations > > Academic presentations[Open](/learn/latex/how-to/presentations)> [card] Thesis Writing > > Dissertation and thesis[Open](/templates/thesis)> [card] Book Publishing > > Academic book creation[Open](/learn/latex/how-to/book-publishing)### Research Paper Toolkit- [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) - [Natbib guide](/learn/latex/bibliography/natbib-guide) - [Choosing citation styles](/learn/latex/bibliography/choosing-citation-styles) - [Sections and chapters](/learn/latex/document-structure/sections-and-chapters) - [Footnotes and margin notes](/learn/latex/document-structure/footnotes-and-margin-notes) - [Table of contents](/learn/latex/document-structure/table-of-contents) - [Operators and spacing](/learn/latex/mathematics/operators-and-spacing) - [Plotting with pgfplots](/learn/latex/figures/plotting-with-pgfplots)***> [!NOTE] > > **Pro tip**: Start writing your paper early and iterate frequently. Use version control to track changes, and always keep your bibliography updated as you write. Consider using reference management software like Zotero or Mendeley that can export to BibTeX format.## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=cta\&utm_campaign=research_workflow\&utm_content=writing_research_paper_open_app)> [card] Start from Article Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/article) # Draw Commutative Diagrams with XY-pic Source: https://resources.latex-cloud-studio.com/learn/latex/how-to/xy-pic-diagrams Create commutative diagrams in LaTeX using XY-pic syntax for category theory and algebra notes. XY-pic is commonly used for commutative diagrams in algebra and category theory.## Basic Setup```latex xypic-basic.tex theme=\{null} \usepackage[all]{xy} \[ \xymatrix{ A \ar[r]^f \ar[d]_g & B \ar[d]^h \\ C \ar[r]_k & D } \] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xypic-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-how-to-xy-pic-diagrams-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_how_to_xy_pic_diagrams)## Arrow Labels and Curves```latex xypic-arrows.tex theme=\{null} \[ \xymatrix{ X \ar@/^/[r]^{\alpha} \ar@/_/[r]_{\beta} & Y } \] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Related Pages- [TikZ diagrams](/learn/latex/how-to/tikz-diagrams) - [Circuits notation](/learn/latex/specialized-notation/circuits) # LaTeX in Arabic Source: https://resources.latex-cloud-studio.com/learn/latex/languages/arabic Write right-to-left Arabic documents in LaTeX using polyglossia and proper RTL support. Use this setup to typeset documents in arabic with stable language rules and typography. ## Compiler Recommendation Use XeLaTeX or LuaLaTeX for this language to ensure robust Unicode and font support. ## XeLaTeX / LuaLaTeX Setup ```latex xelatex-arabic.tex theme={null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{arabic} \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic]{Amiri} \begin{document} \textarabic{hatha mithal li nass bi alarabiyya.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xelatex-arabic.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-arabic-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_arabic) ## Practical Notes * Keep one compiler across the entire project. * Verify fonts are available in local or cloud environments. * For multilingual bibliographies, use Unicode-safe workflows. ## Related Pages * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in Chinese Source: https://resources.latex-cloud-studio.com/learn/latex/languages/chinese Create Chinese LaTeX documents with XeLaTeX or LuaLaTeX and correct CJK font configuration. Use this setup to typeset documents in chinese with stable language rules and typography. ## Compiler Recommendation Use XeLaTeX or LuaLaTeX for this language to ensure robust Unicode and font support. ## XeLaTeX / LuaLaTeX Setup ```latex xelatex-chinese.tex theme={null} \documentclass{article} \usepackage{fontspec} \usepackage{xeCJK} \setCJKmainfont{Noto Serif CJK SC} \setmainfont{TeX Gyre Termes} \begin{document} \section{Introduction} Use XeLaTeX or LuaLaTeX for Chinese typesetting. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xelatex-chinese.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-chinese-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_chinese) ## Practical Notes * Keep one compiler across the entire project. * If pdfLaTeX stops with `Font unisong30 at 632 not found`, the document uses ctex and needs XeLaTeX. See [Chinese font not found with ctex](/learn/latex/troubleshooting/ctex-font-unisong-not-found). * Verify fonts are available in local or cloud environments. * For multilingual bibliographies, use Unicode-safe workflows. ## Related Pages * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in French Source: https://resources.latex-cloud-studio.com/learn/latex/languages/french Write French-language LaTeX documents with correct hyphenation, typography, and punctuation. Use this setup to typeset documents in french with stable language rules and typography. ## pdfLaTeX Setup ```latex pdflatex-french.tex theme={null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \begin{document} \selectlanguage{french} Ceci est un document scientifique en francais. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-french.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-french-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_french) ## XeLaTeX / LuaLaTeX Setup ```latex xelatex-french.tex theme={null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{french} \setmainfont{TeX Gyre Termes} \begin{document} \selectlanguage{french} Ceci est un document scientifique en francais. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xelatex-french.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-french-02/page-1.svg)
## Practical Notes * Keep one compiler across the entire project. * Verify fonts are available in local or cloud environments. * For multilingual bibliographies, use Unicode-safe workflows. ## Related Pages * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in German Source: https://resources.latex-cloud-studio.com/learn/latex/languages/german Configure LaTeX for German documents with correct hyphenation and language-aware labels. Use this setup to typeset documents in german with stable language rules and typography.## pdfLaTeX Setup```latex pdflatex-german.tex theme=\{null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \begin{document} \selectlanguage{ngerman} Dies ist ein wissenschaftlicher Bericht auf Deutsch. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-german.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-german-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_german)## XeLaTeX / LuaLaTeX Setup```latex xelatex-german.tex theme=\{null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage[german=swiss]{german} \setmainfont{TeX Gyre Heros} \begin{document} \selectlanguage{ngerman} Dies ist ein wissenschaftlicher Bericht auf Deutsch. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Practical Notes- Keep one compiler across the entire project. - Verify fonts are available in local or cloud environments. - For multilingual bibliographies, use Unicode-safe workflows.## Related Pages- [Multi-language documents](/learn/latex/how-to/multi-language-documents) - [Choosing a compiler](/learn/latex/basics/choosing-compiler) - [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in Greek Source: https://resources.latex-cloud-studio.com/learn/latex/languages/greek Configure LaTeX for Greek documents and mixed-language manuscripts with reliable language switching. Use this setup to typeset documents in greek with stable language rules and typography.## pdfLaTeX Setup```latex pdflatex-greek.tex theme=\{null} \documentclass{article} \usepackage[LGR,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[greek,english]{babel} \begin{document} \selectlanguage{greek} \textit{Paradeigma keimenou sta ellinika.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-greek.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-greek-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_greek)## XeLaTeX / LuaLaTeX Setup```latex xelatex-greek.tex theme=\{null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{greek} \setotherlanguage{english} \setmainfont{TeX Gyre Termes} \begin{document} \selectlanguage{greek} \textit{Paradeigma keimenou sta ellinika.} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Practical Notes- Keep one compiler across the entire project. - Verify fonts are available in local or cloud environments. - For multilingual bibliographies, use Unicode-safe workflows.## Related Pages- [Multi-language documents](/learn/latex/how-to/multi-language-documents) - [Choosing a compiler](/learn/latex/basics/choosing-compiler) - [Bibliography and citations](/learn/latex/bibliography-citations) # Languages in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/languages/index Language-specific LaTeX setup guides for European, CJK, RTL, and multilingual workflows. Use these guides to configure language-aware LaTeX documents correctly. ## European Languages * [French](/learn/latex/languages/french) * [German](/learn/latex/languages/german) * [Spanish](/learn/latex/languages/spanish) * [Portuguese](/learn/latex/languages/portuguese) * [Russian](/learn/latex/languages/russian) * [Greek](/learn/latex/languages/greek) ## CJK and RTL * [Chinese](/learn/latex/languages/chinese) * [Japanese](/learn/latex/languages/japanese) * [Arabic](/learn/latex/languages/arabic) ## Related Guides * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) # LaTeX in Japanese Source: https://resources.latex-cloud-studio.com/learn/latex/languages/japanese Set up Japanese LaTeX workflows with XeLaTeX/LuaLaTeX and CJK font support. Use this setup to typeset documents in japanese with stable language rules and typography. ## Compiler Recommendation Use XeLaTeX or LuaLaTeX for this language to ensure robust Unicode and font support. ## XeLaTeX / LuaLaTeX Setup ```latex xelatex-japanese.tex theme={null} \documentclass{article} \usepackage{fontspec} \usepackage{xeCJK} \setCJKmainfont{Noto Serif CJK JP} \setmainfont{TeX Gyre Termes} \begin{document} \section{Overview} Compile with XeLaTeX or LuaLaTeX for Japanese documents. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xelatex-japanese.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-japanese-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_japanese) ## Practical Notes * Keep one compiler across the entire project. * Verify fonts are available in local or cloud environments. * For multilingual bibliographies, use Unicode-safe workflows. ## Related Pages * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in Portuguese Source: https://resources.latex-cloud-studio.com/learn/latex/languages/portuguese Set up Portuguese-language LaTeX projects with robust typography and language settings. Use this setup to typeset documents in portuguese with stable language rules and typography. ## pdfLaTeX Setup ```latex pdflatex-portuguese.tex theme={null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[portuguese]{babel} \begin{document} \selectlanguage{portuguese} Este projeto apresenta um exemplo em portugues. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-portuguese.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-portuguese-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_portuguese) ## XeLaTeX / LuaLaTeX Setup ```latex xelatex-portuguese.tex theme={null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{portuguese} \setmainfont{TeX Gyre Termes} \begin{document} \selectlanguage{portuguese} Este projeto apresenta um exemplo em portugues. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xelatex-portuguese.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-portuguese-02/page-1.svg)
## Practical Notes * Keep one compiler across the entire project. * Verify fonts are available in local or cloud environments. * For multilingual bibliographies, use Unicode-safe workflows. ## Related Pages * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in Russian Source: https://resources.latex-cloud-studio.com/learn/latex/languages/russian Prepare Russian LaTeX documents with Cyrillic support and language-specific hyphenation. Use this setup to typeset documents in russian with stable language rules and typography.## pdfLaTeX Setup```latex pdflatex-russian.tex theme=\{null} \documentclass{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \begin{document} \selectlanguage{russian} \textit{Primer teksta na russkom yazyke.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-russian.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-russian-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_russian)## XeLaTeX / LuaLaTeX Setup```latex xelatex-russian.tex theme=\{null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{russian} \setmainfont{Times New Roman} \begin{document} \selectlanguage{russian} \textit{Primer teksta na russkom yazyke.} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Practical Notes- Keep one compiler across the entire project. - Verify fonts are available in local or cloud environments. - For multilingual bibliographies, use Unicode-safe workflows.## Related Pages- [Multi-language documents](/learn/latex/how-to/multi-language-documents) - [Choosing a compiler](/learn/latex/basics/choosing-compiler) - [Bibliography and citations](/learn/latex/bibliography-citations) # LaTeX in Spanish Source: https://resources.latex-cloud-studio.com/learn/latex/languages/spanish Write Spanish LaTeX documents with proper punctuation, captions, and hyphenation. Use this setup to typeset documents in spanish with stable language rules and typography. ## pdfLaTeX Setup ```latex pdflatex-spanish.tex theme={null} \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \begin{document} \selectlanguage{spanish} Este documento muestra una configuracion basica en espanol. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pdflatex-spanish.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-spanish-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_languages_spanish) ## XeLaTeX / LuaLaTeX Setup ```latex xelatex-spanish.tex theme={null} \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{spanish} \setmainfont{TeX Gyre Pagella} \begin{document} \selectlanguage{spanish} Este documento muestra una configuracion basica en espanol. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from xelatex-spanish.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-languages-spanish-02/page-1.svg)
## Practical Notes * Keep one compiler across the entire project. * Verify fonts are available in local or cloud environments. * For multilingual bibliographies, use Unicode-safe workflows. ## Related Pages * [Multi-language documents](/learn/latex/how-to/multi-language-documents) * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Bibliography and citations](/learn/latex/bibliography-citations) # Advanced Mathematics Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/advanced-math Explore advanced mathematical typesetting in LaTeX. Master complex analysis, abstract algebra, topology, and professional theorem environments. Take your mathematical typesetting to the next level with advanced LaTeX techniques for complex mathematics.## Advanced Mathematical Packages```latex example.tex theme=\{null} \usepackage{amsmath} % Essential math enhancements \usepackage{amssymb} % Additional symbols \usepackage{amsthm} % Theorem environments \usepackage{mathtools} % Extensions to amsmath \usepackage{tensor} % Tensor notation \usepackage{mathrsfs} % Script letters \usepackage{bbm} % Blackboard bold \usepackage{dsfont} % Double stroke fonts ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Abstract Algebra### Groups and Rings```latex example.tex theme=\{null} % Group theory G = \langle a, b \mid a^2 = b^3 = (ab)^2 = e \rangle % Quotient groups G/H \cong \mathbb{Z}_n % Ring homomorphism \phi: R \to S, \quad \phi(xy) = \phi(x)\phi(y) % Ideals \mathfrak{p} \triangleleft R % Galois groups \text{Gal}(K/F) = \text{Aut}(K/F) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Field Extensions```latex example.tex theme=\{null} % Field extension degree [K : F] = \dim_F K % Algebraic closure \overline{\mathbb{Q}} % Splitting field K = F(\alpha_1, \ldots, \alpha_n) % Minimal polynomial m_{\alpha,F}(x) = \text{irr}(\alpha, F) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Complex Analysis### Complex Functions```latex example.tex theme=\{null} % Holomorphic function f: \mathbb{C} \to \mathbb{C} \text{ holomorphic} % Cauchy-Riemann equations \frac{\partial u}{\partial x} = \frac{\partial v}{\partial y}, \quad \frac{\partial u}{\partial y} = -\frac{\partial v}{\partial x} % Residue theorem \oint_{\gamma} f(z) \, dz = 2\pi i \sum_{k} \text{Res}(f, z_k) % Laurent series f(z) = \sum_{n=-\infty}^{\infty} a_n (z - z_0)^n ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Contour Integration```latex example.tex theme=\{null} % Complex integral \int_{\gamma} f(z) \, dz = \int_a^b f(\gamma(t)) \gamma'(t) \, dt % Winding number n(\gamma, z_0) = \frac{1}{2\pi i} \oint_{\gamma} \frac{dz}{z - z_0} % Branch cuts \log z = \ln|z| + i\arg(z), \quad -\pi < \arg(z) \leq \pi ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Topology### Topological Spaces```latex example.tex theme=\{null} % Open sets \tau = \{U \subseteq X : U \text{ is open}\} % Closure and interior \overline{A} = \bigcap\{F : A \subseteq F, F \text{ closed}\} A^{\circ} = \bigcup\{U : U \subseteq A, U \text{ open}\} % Continuity f^{-1}(V) \in \tau_X \text{ for all } V \in \tau_Y % Compactness X = \bigcup_{i \in I} U_i \implies X = \bigcup_{j=1}^n U_{i_j} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Algebraic Topology```latex example.tex theme=\{null} % Fundamental group \pi_1(X, x_0) = \{[\gamma] : \gamma \text{ loop at } x_0\} % Homology groups H_n(X) = \ker(\partial_n) / \text{im}(\partial_{n+1}) % Euler characteristic \chi(X) = \sum_{i=0}^{\infty} (-1)^i \text{rank}(H_i(X)) % Covering spaces p: \tilde{X} \to X \text{ covering map} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Category Theory### Categories and Functors```latex example.tex theme=\{null} % Category \mathcal{C} = (\text{Ob}(\mathcal{C}), \text{Mor}(\mathcal{C})) % Morphisms f: A \to B \in \text{Hom}_{\mathcal{C}}(A, B) % Functors F: \mathcal{C} \to \mathcal{D} % Natural transformation \eta: F \Rightarrow G % Commutative diagram \begin{tikzcd} A \arrow[r, "f"] \arrow[d, "g"'] & B \arrow[d, "h"] \\ C \arrow[r, "k"'] & D \end{tikzcd} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Number Theory### Algebraic Number Theory```latex example.tex theme=\{null} % Ring of integers \mathcal{O}_K = \{x \in K : x \text{ integral over } \mathbb{Z}\} % Norm and trace N_{K/\mathbb{Q}}(\alpha) = \prod_{i=1}^n \sigma_i(\alpha) \text{Tr}_{K/\mathbb{Q}}(\alpha) = \sum_{i=1}^n \sigma_i(\alpha) % Class number h_K = |\text{Cl}(K)| % Dedekind zeta function \zeta_K(s) = \sum_{\mathfrak{a}} \frac{1}{N(\mathfrak{a})^s} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Analytic Number Theory```latex example.tex theme=\{null} % Riemann zeta function \zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} = \prod_p \frac{1}{1 - p^{-s}} % Dirichlet L-functions L(s, \chi) = \sum_{n=1}^{\infty} \frac{\chi(n)}{n^s} % Prime number theorem \pi(x) \sim \frac{x}{\ln x} % Möbius function \mu(n) = \begin{cases} 1 & n = 1 \\ (-1)^k & n = p_1 \cdots p_k \\ 0 & \text{otherwise} \end{cases} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Differential Geometry### Manifolds```latex example.tex theme=\{null} % Tangent space T_p M = \{v : C^{\infty}(M) \to \mathbb{R} \mid v \text{ derivation at } p\} % Differential forms \omega \in \Omega^k(M) % Exterior derivative d\omega = \sum_{i_0 < \cdots < i_k} \sum_{j} \frac{\partial f_{i_0\ldots i_k}}{\partial x^j} dx^j \wedge dx^{i_0} \wedge \cdots \wedge dx^{i_k} % Lie derivative \mathcal{L}_X \omega = d(i_X \omega) + i_X(d\omega) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Riemannian Geometry```latex example.tex theme=\{null} % Metric tensor g_{ij} = \langle \frac{\partial}{\partial x^i}, \frac{\partial}{\partial x^j} \rangle % Christoffel symbols \Gamma^k_{ij} = \frac{1}{2} g^{kl} \left(\frac{\partial g_{jl}}{\partial x^i} + \frac{\partial g_{il}}{\partial x^j} - \frac{\partial g_{ij}}{\partial x^l}\right) % Riemann curvature tensor R^l_{ijk} = \frac{\partial \Gamma^l_{jk}}{\partial x^i} - \frac{\partial \Gamma^l_{ik}}{\partial x^j} + \Gamma^l_{im}\Gamma^m_{jk} - \Gamma^l_{jm}\Gamma^m_{ik} % Geodesic equation \frac{d^2 x^i}{dt^2} + \Gamma^i_{jk} \frac{dx^j}{dt} \frac{dx^k}{dt} = 0 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Theorem Environments### Setting Up Theorems```latex example.tex theme=\{null} % In preamble \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newtheorem{note}[theorem]{Note} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Using Theorem Environments```latex example.tex theme=\{null} \begin{theorem}[Fermat's Last Theorem] \label{thm:fermat} For $n > 2$, there are no three positive integers $a$, $b$, and $c$ that satisfy the equation $a^n + b^n = c^n$. \end{theorem} \begin{proof} The proof is beyond the scope of this document. See Wiles (1995) for details. \end{proof} \begin{lemma} \label{lem:helper} Every finite integral domain is a field. \end{lemma} By Theorem~\ref{thm:fermat} and Lemma~\ref{lem:helper}, we conclude... ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-advanced-math-14/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_advanced_math)## Advanced Symbols and Notation### Special Alphabets| Style | Command | Example | | :- | :- | :- | | Blackboard | `\mathbb{R}` | $\mathbb{R}$ | | Calligraphic | `\mathcal{L}` | $\mathcal{L}$ | | Fraktur | `\mathfrak{g}` | $\mathfrak{g}$ | | Script | `\mathscr{F}` | $\mathscr{F}$ | | Bold | `\mathbf{v}` | $\mathbf{v}$ | | Bold symbol | `\boldsymbol{\alpha}` | $\boldsymbol{\alpha}$ |### Advanced Operators```latex example.tex theme=\{null} % Tensor products V \otimes W, \quad \bigotimes_{i=1}^n V_i % Direct sums V \oplus W, \quad \bigoplus_{i=1}^n V_i % Wedge products \alpha \wedge \beta % Cup and cap products \alpha \cup \beta, \quad \alpha \cap \beta % Hom and End \text{Hom}(V, W), \quad \text{End}(V) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Tips for Advanced Mathematics> [card] Use Semantic Commands > > Define `\newcommand{\R}{\mathbb{R}}` for frequently used symbols> [card] Organize Theorems > > Use consistent numbering across theorem-like environments> [card] Clear Notation > > Define all notation clearly when first introduced> [card] Proper Spacing > > Use `\,` and `\:` for fine-tuning mathematical spacing## Further Reading> [card] Mathematical Expressions > > Basic mathematical typesetting[Open](/learn/latex/mathematics/mathematical-expressions)> [card] Symbol Reference > > Complete symbol reference[Open](/learn/reference/symbols)> [card] Physics Mathematics > > Physics-specific notation[Open](/learn/latex/specialized-notation/physics)> [card] Matrices Guide > > Matrix typesetting[Open](/learn/latex/mathematics/matrices) # Multline and Align in LaTeX: Multi-line Equation Guide Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/align-and-multline-environments Use align for equations that share alignment points and multline for one long equation. Compare aligned, split, numbering, and common amsmath errors. Use `align` when multiple equation lines should line up at `=` or another relation. Use `multline` when one long equation needs to wrap but has no shared alignment point. Both environments come from the `amsmath` package. > [!NOTE] > > **Quick answer**: put `&` before the relation you want to align and end each line with `\\`. Choose `align*` when you do not want equation numbers. Choose `split` when several aligned lines should share one equation number. ## Which Multi-line Environment Should You Use? | Environment | Best for | Alignment | Numbering | | - | - | - | - | | `align` | Several related equations or derivation steps | At each `&` | One number per line | | `align*` | The same layout without numbers | At each `&` | None | | `multline` | One long equation split across lines | First line left, last line right | One number | | `split` | One equation with aligned steps | At each `&` | One shared number through `equation` | | `aligned` | A compact aligned block inside another math environment | At each `&` | Controlled by the outer environment | ## Align Equations at the Equals Sign Place `&` immediately before each equals sign and use `\\` to start the next equation line. The fragment below assumes `amsmath` is loaded in the preamble. ```latex align.tex theme={null} \usepackage{amsmath} \begin{align} f(x) &= x^2 + 2x + 1 \\ g(x) &= \sin x + \cos x \end{align} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from align.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-align-and-multline-environments-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_align_and_multline_environments) Use `align*` instead of `align` when the equations should not be numbered. Avoid wrapping `align` inside `equation`; `align` is already a display-math environment. ## Break One Long Equation with multline `multline` is for a single expression that is too wide for one line. It does not align at `=`. LaTeX places the first line toward the left, the final line toward the right, and any middle lines in the center. ```latex multline.tex theme={null} \begin{multline} A = a_1 + a_2 + a_3 + a_4 + a_5 + a_6 + a_7 \\ + a_8 + a_9 + a_{10} \end{multline} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multline.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-align-and-multline-environments-02/page-1.svg)
Use `multline*` for the same layout without an equation number. ## Give Several Aligned Lines One Equation Number Put `split` inside `equation` when a derivation needs alignment but should be referenced as one equation. Unlike `align`, `split` cannot stand on its own. ```latex split.tex theme={null} \begin{equation} \begin{split} y &= (x+1)^2 \\ &= x^2 + 2x + 1 \end{split} \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from split.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-align-and-multline-environments-03/page-1.svg)
## `aligned` vs `split` Both environments create an aligned block and rely on an outer math environment. Use `split` for a full-width multi-line equation with one number. Use `aligned` when the block must sit beside another symbol, inside braces, or as part of a larger formula. ## Common Errors | Problem | Cause | Fix | | - | - | - | | `Environment align undefined` | `amsmath` is not loaded | Add `\usepackage{amsmath}` in the preamble | | `Misplaced alignment tab character &` | `&` is outside an alignment environment | Move the expression into `align`, `aligned`, or `split` | | Each line gets an unwanted number | `align` numbers every line | Use `align*` or add `\notag` to selected lines | | One long formula aligns badly | `align` was used without a real alignment point | Use `multline` instead | | Nested display-math error | `align` was placed inside `equation` or `\[...\]` | Use `align` alone, or use `split` inside `equation` | ## Practical Rules * Align at a mathematical relation such as `=`, `\leq`, or `\approx`, not at arbitrary visual positions. * Keep one `&` alignment scheme across related lines so the derivation is easy to scan. * Use starred environments for unnumbered display math instead of removing numbers manually from every line. * Add `\label{...}` only to lines that readers will reference; suppress decorative numbers with `\notag`. ## Try Multi-line Equations in LaTeX Cloud Studio > [card] Compile an align example > > Paste an `amsmath` example into the browser editor and compare numbered and unnumbered output. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=align_multline_open_app) > [card] Review equation fundamentals > > See the complete guide to display math, equation numbering, cases, and derivations. [Open](/learn/latex/mathematics/equations) ## Related Pages * [Equations](/learn/latex/mathematics/equations) * [Brackets and parentheses](/learn/latex/mathematics/brackets-parentheses) * [Subscripts and superscripts](/learn/latex/mathematics/subscripts-superscripts) # LaTeX Mathematics - Getting Started Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/basics Master mathematical typesetting in LaTeX. Learn how to write equations, use math symbols, and create beautiful mathematical documents. LaTeX is renowned for its superior mathematical typesetting. This guide will take you from basic equations to advanced mathematical expressions.> [!NOTE] > > **Fun fact**: LaTeX's math rendering is so good that even Microsoft Word now uses a LaTeX-like syntax for its equation editor!## Why LaTeX for Math?Compare these approaches to writing the quadratic formula:**Plain text**: x = (-b +/- sqrt(b^2 - 4ac)) / 2a**LaTeX result**: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$The difference is clear – LaTeX produces publication-quality mathematics.## Math ModesLaTeX has two math modes:### 1. Inline Math ModeFor math within text, use `$...$` or `\(...\)`:```latex inline-math.tex theme=\{null} The famous equation $E = mc^2$ was discovered by Einstein. We can also write \(a^2 + b^2 = c^2\) for the Pythagorean theorem. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from inline-math.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-03/page-1.svg)
> [card] Expected output > > The famous equation $E = mc^2$ was discovered by Einstein. We can also write $a^2 + b^2 = c^2$ for the Pythagorean theorem.### 2. Display Math ModeFor centered equations on their own line, use `\[...\]` or `equation` environment:```latex display-math.tex theme=\{null} The quadratic formula is: \[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\] For numbered equations, use: \begin{equation} \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from display-math.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-04/page-1.svg)
> [card] Expected output > > The quadratic formula is: > > $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ > > For numbered equations: > > $\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} \tag{1}$> [!TIP] > > Use `\[...\]` for important formulas you want to highlight. Use `$...$` for variables and simple expressions within sentences.## Basic Math Elements### Superscripts and Subscripts```latex super-subscripts.tex theme=\{null} % Superscripts with ^ $x^2$, $x^{10}$, $x^{n+1}$ % Subscripts with _ $x_1$, $x_{10}$, $x_{i,j}$ % Combined $x_1^2$, $a_n^{k+1}$ % Chemical formulas $\text{H}_2\text{O}$, $\text{CO}_2$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from super-subscripts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-05/page-1.svg)
> [card] Expected output > > **Superscripts:** $x^2$, $x^{10}$, $x^{n+1}$ > > **Subscripts:** $x_1$, $x_{10}$, $x_{i,j}$ > > **Combined:** $x_1^2$, $a_n^{k+1}$ > > **Chemical formulas:** $\text{H}_2\text{O}$, $\text{CO}_2$### Fractions```latex fractions.tex theme=\{null} % Simple fractions $\frac{1}{2}$, $\frac{a}{b}$ % Nested fractions $\frac{1}{1 + \frac{1}{2}}$ % Display style in inline math $\displaystyle\frac{a+b}{c+d}$ % Alternative notation $a/b$ or $^a/_b$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from fractions.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-06/page-1.svg)
> [card] Expected output > > **Simple fractions:** $\frac{1}{2}$, $\frac{a}{b}$ > > **Nested fractions:** $\frac{1}{1 + \frac{1}{2}}$ > > **Display style:** $\displaystyle\frac{a+b}{c+d}$ > > **Alternative notation:** $a/b$ or $^a/_b$### Roots```latex roots.tex theme=\{null} % Square root $\sqrt{2}$, $\sqrt{x^2 + y^2}$ % nth root $\sqrt[3]{8}$, $\sqrt[n]{x}$ % Nested roots $\sqrt{2 + \sqrt{3}}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from roots.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-07/page-1.svg)
> [card] Expected output > > **Square root:** $\sqrt{2}$, $\sqrt{x^2 + y^2}$ > > **nth root:** $\sqrt[3]{8}$, $\sqrt[n]{x}$ > > **Nested roots:** $\sqrt{2 + \sqrt{3}}$## Common Math Symbols### Greek Letters```latex greek-letters.tex theme=\{null} % Lowercase $\alpha, \beta, \gamma, \delta, \epsilon$ $\theta, \lambda, \mu, \pi, \sigma, \phi$ % Uppercase $\Gamma, \Delta, \Theta, \Lambda, \Sigma, \Phi$ % Variants $\epsilon$ vs $\varepsilon$ $\phi$ vs $\varphi$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from greek-letters.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-08/page-1.svg)
> [card] Expected output > > **Lowercase:** $\alpha, \beta, \gamma, \delta, \epsilon$ and $\theta, \lambda, \mu, \pi, \sigma, \phi$ > > **Uppercase:** $\Gamma, \Delta, \Theta, \Lambda, \Sigma, \Phi$ > > **Variants:** $\epsilon$ vs $\varepsilon$ and $\phi$ vs $\varphi$### Operators and Relations```latex operators.tex theme=\{null} % Basic operators $a + b - c \times d \div e$ % Comparison $a < b \leq c = d \geq e > f$ $a \neq b \approx c \equiv d$ % Set operations $A \cup B \cap C \subset D$ $x \in A, y \notin B$ % Logic $p \land q \lor r \implies s$ $\forall x \exists y$ ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > **Basic operators:** $a + b - c \times d \div e$ > > **Comparison:** $a < b \leq c = d \geq e > f$ and $a \neq b \approx c \equiv d$ > > **Set operations:** $A \cup B \cap C \subset D$ and $x \in A, y \notin B$ > > **Logic:** $p \land q \lor r \implies s$ and $\forall x \exists y$### Arrows```latex arrows.tex theme=\{null} % Basic arrows $\rightarrow, \leftarrow, \leftrightarrow$ $\Rightarrow, \Leftarrow, \Leftrightarrow$ % Long arrows $\longrightarrow, \longleftarrow$ % Special arrows $\uparrow, \downarrow, \updownarrow$ $\nearrow, \searrow, \swarrow, \nwarrow$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from arrows.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-10/page-1.svg)
> [card] Expected output > > **Basic arrows:** $\rightarrow, \leftarrow, \leftrightarrow$ and $\Rightarrow, \Leftarrow, \Leftrightarrow$ > > **Long arrows:** $\longrightarrow, \longleftarrow$ > > **Special arrows:** $\uparrow, \downarrow, \updownarrow$ and $\nearrow, \searrow, \swarrow, \nwarrow$## Functions and Operators### Standard Functions```latex functions.tex theme=\{null} % Trigonometric $\sin\theta, \cos\theta, \tan\theta$ % Logarithms $\log x, \ln x, \log_2 x$ % Limits $\lim_{x \to 0} \frac{\sin x}{x} = 1$ % Min/Max $\min(a,b), \max(a,b)$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from functions.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-11/page-1.svg)
> [card] Expected output > > **Trigonometric:** $\sin\theta, \cos\theta, \tan\theta$ > > **Logarithms:** $\log x, \ln x, \log_2 x$ > > **Limits:** $\displaystyle\lim_{x \to 0} \frac{\sin x}{x} = 1$ > > **Min/Max:** $\min(a,b), \max(a,b)$### Sums and Products```latex sums-products.tex theme=\{null} % Summation $\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$ % Product $\prod_{i=1}^{n} i = n!$ % Multiple lines $\sum_{\substack{i=1 \\ i \neq j}}^{n} a_i$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from sums-products.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-12/page-1.svg)
> [card] Expected output > > **Summation:** $\displaystyle\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$ > > **Product:** $\displaystyle\prod_{i=1}^{n} i = n!$ > > **Multiple lines:** $\displaystyle\sum_{\substack{i=1 \\ i \neq j}}^{n} a_i$## Integrals and Derivatives```latex calculus.tex theme=\{null} % Derivatives $f'(x), f''(x), f^{(n)}(x)$ $\frac{df}{dx}, \frac{d^2f}{dx^2}$ $\frac{\partial f}{\partial x}$ % Integrals $\int f(x)\,dx$ $\int_a^b f(x)\,dx$ $\iint_D f(x,y)\,dx\,dy$ % Special notation $\oint_C F \cdot dr$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from calculus.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-13/page-1.svg)
> [card] Expected output > > **Derivatives:** $f'(x), f''(x), f^{(n)}(x)$ and $\frac{df}{dx}, \frac{d^2f}{dx^2}$ and $\frac{\partial f}{\partial x}$ > > **Integrals:** $\displaystyle\int f(x)\,dx$ and $\displaystyle\int_a^b f(x)\,dx$ and $\displaystyle\iint_D f(x,y)\,dx\,dy$ > > **Special notation:** $\displaystyle\oint_C F \cdot dr$## Matrices and Arrays### Basic Matrices```latex matrices.tex theme=\{null} % Using pmatrix (parentheses) $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ % Using bmatrix (brackets) $\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}$ % Using vmatrix (determinant) $\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-14/page-1.svg)
> [card] Expected output > > **pmatrix (parentheses):** $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ > > **bmatrix (brackets):** $\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}$ > > **vmatrix (determinant):** $\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$### Advanced Arrays```latex arrays.tex theme=\{null} % Custom arrays $\left[ \begin{array}{cc|c} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array} \right]$ % Cases (piecewise functions) $f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from arrays.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-15/page-1.svg)
> [card] Expected output > > **Custom arrays:** $\left[ \begin{array}{cc|c} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array} \right]$ > > **Cases (piecewise functions):** $f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$## Spacing in Math Mode```latex math-spacing.tex theme=\{null} % Default spacing $a b$ vs $ab$ % Manual spacing $a\,b$ % thin space $a\:b$ % medium space $a\;b$ % thick space $a\quad b$ % quad space $a\qquad b$ % double quad % Negative space $a\!b$ % negative thin space ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-16/page-1.svg)
> [card] Expected output > > **Default:** $a b$ vs $ab$ > > **Thin space:** $a\,b$ | **Medium space:** $a\:b$ | **Thick space:** $a\;b$ > > **Quad space:** $a\quad b$ | **Double quad:** $a\qquad b$ > > **Negative space:** $a\!b$> [!TIP] > > Use `\,` before differentials in integrals: `\int f(x)\,dx` looks better than `\int f(x)dx`.## Advanced Features### Theorem Environments```latex theorems.tex theme=\{null} \documentclass{article} \usepackage{amsthm} \newtheorem{theorem}{Theorem} \newtheorem{lemma}{Lemma} \begin{document} \begin{theorem}[Pythagoras] For a right triangle with legs $a$ and $b$ and hypotenuse $c$, we have $a^2 + b^2 = c^2$. \end{theorem} \begin{proof} Consider a square with side length $a + b$... \end{proof} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from theorems.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-basics-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_basics)### Aligning Equations```latex align.tex theme=\{null} \begin{align} 2x + 3y &= 7 \\ x - y &= 1 \end{align} % Multi-line derivation \begin{align} (x + y)^2 &= (x + y)(x + y) \\ &= x^2 + xy + yx + y^2 \\ &= x^2 + 2xy + y^2 \end{align} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from align.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-basics-02/page-1.svg)
## Common Mistakes to Avoid> [!WARNING] > > **1. Forgetting braces for multi-character super/subscripts** > > * Wrong: `$x^10$` → x¹0 > * Right: `$x^{10}$` → x¹⁰ > > **2. Using text in math mode** > > * Wrong: `$x = speed * time$` > * Right: `$x = \text{speed} \times \text{time}$` > > **3. Incorrect fraction syntax** > > * Wrong: `$\frac{1/2}$` > * Right: `$\frac{1}{2}$`## Math PackagesEssential packages for advanced mathematics:```latex example.tex theme=\{null} \usepackage{amsmath} % Advanced math environments \usepackage{amssymb} % Additional symbols \usepackage{mathtools} % Enhanced amsmath \usepackage{physics} % Physics notation \usepackage{siunitx} % SI units ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Practice ExercisesTry typesetting these formulas:1) **Euler's Identity**: $e^{i\pi} + 1 = 0$ 2) **Gaussian Integral**: $\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$ 3) **Binomial Theorem**: $(x+y)^n = \sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k$ 4) **Maxwell's Equation**: $\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}$## Quick Reference| Feature | Syntax | Example | | - | - | - | | Inline math | `$...$` | `$x^2$` | | Display math | `\[...\]` | `\[x^2\]` | | Fraction | `\frac{num}{den}` | `$\frac{a}{b}$` | | Square root | `\sqrt{x}` | `$\sqrt{2}$` | | Subscript | `_` | `$x_1$` | | Superscript | `^` | `$x^2$` | | Greek letter | `\alpha` | `$\alpha$` | | Sum | `\sum` | `$\sum_{i=1}^n$` | | Integral | `\int` | `$\int_a^b$` |## Next Steps> [card] Math Symbols Reference > > Complete list of mathematical symbols[Open](/learn/reference/symbols)> [card] Advanced Equations > > Multi-line equations and advanced layouts[Open](/learn/latex/mathematics/equations)> [card] Matrices & Arrays > > Complex matrix operations and layouts[Open](/learn/latex/mathematics/matrices)> [card] Scientific Notation > > Physics, chemistry, and scientific formatting[Open](/learn/latex/mathematics/science)***Ready to create beautiful mathematical documents? You now have the foundation to typeset any mathematical expression in LaTeX! # LaTeX Brackets: \left, \right, Curly Braces, and Sizing Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/brackets-parentheses Write parentheses, square brackets, and curly braces in LaTeX. Use \left and \right for automatic sizing or \big for manual control. Write ordinary LaTeX brackets directly as `( )` or `[ ]`, but escape curly braces as `\{ \}` because unescaped braces group source code. For fractions, matrices, or other tall expressions, wrap the pair with `\left` and `\right`; use `\big`, `\Big`, `\bigg`, or `\Bigg` when both sides need a fixed size.> [!NOTE] > > **Quick answer**: `\left( \frac{a}{b} \right)` produces parentheses that grow with the fraction. Every `\left` needs a matching `\right`; use an invisible `\left.` or `\right.` when only one side should be visible. > > **Prerequisites**: Basic LaTeX math mode knowledge. See [Mathematical Expressions](/learn/latex/mathematics/mathematical-expressions) for math mode basics.## Quick answers| If you need... | Use | | - | - | | Ordinary parentheses | `(a+b)` | | Square brackets | `[a,b]` | | Curly braces in math mode | `\{x \in A\}` | | Angle brackets | `\langle u, v \rangle` | | Automatically sized brackets | `\left( \frac{a}{b} \right)` | | Manually larger brackets | `\big( ... \big)` or `\Big( ... \Big)` | | One visible delimiter only | `\left.` or `\right.` |## Types of Brackets and Delimiters### Complete Visual Reference| Type | LaTeX Code | Output | Common Use | | - | - | - | - | | Parentheses | `( )` | $( \, )$ | General grouping | | Square brackets | `[ ]` | $[ \, ]$ | Arrays, intervals | | Curly braces | `\{ \}` | $\{ \, \}$ | Sets, systems | | Angle brackets | `\langle \rangle` | $\langle \, \rangle$ | Inner products | | Vertical bars | `\|` or `\vert` | $\lvert \, \rvert$ | Absolute value | | Double bars | `\|\|` or `\Vert` | $\lVert \, \rVert$ | Norms | | Floor | `\lfloor \rfloor` | $\lfloor \, \rfloor$ | Floor function | | Ceiling | `\lceil \rceil` | $\lceil \, \rceil$ | Ceiling function |### Basic Examples```latex basic-brackets.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Parentheses $(a + b)$ % Square brackets $[x, y]$ % Curly braces (must be escaped) $\{z : z > 0\}$ % Angle brackets $\langle u, v \rangle$ % Absolute value $|x - y|$ % Norm $\|v\|$ % Floor and ceiling $\lfloor x \rfloor$ and $\lceil x \rceil$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-brackets.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_brackets_parentheses)## Automatic Delimiter Sizing### The `\left` and `\right` CommandsLaTeX can automatically size delimiters to match their content using `\left` and `\right`:```latex auto-sizing.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Without automatic sizing $(\frac{1}{2})$ % With automatic sizing $\left(\frac{1}{2}\right)$ % Works with any delimiter type $\left[\frac{x^2}{y}\right]$ $\left\{\sqrt{\frac{a}{b}}\right\}$ $\left|\sum_{i=1}^n x_i\right|$ % Nested fractions $\left(\frac{\frac{a}{b}}{\frac{c}{d}}\right)$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from auto-sizing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-02/page-1.svg)
### Important Rules for `\left` and `\right`> [!WARNING] > > **Critical**: Every `\left` must have a matching `\right` in the same math environment. They must be balanced like opening and closing HTML tags.#### Invisible DelimitersSometimes you need an invisible delimiter to balance the equation:```latex invisible-delimiters.tex theme=\{null} % Using \right. for invisible right delimiter $\left\{\begin{array}{ll} x + y = 1 \\ x - y = 0 \end{array}\right.$ % Using \left. for invisible left delimiter $\left.\frac{dy}{dx}\right|_{x=0}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from invisible-delimiters.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-03/page-1.svg)
## Manual Size Control### Size CommandsWhen automatic sizing doesn't give the desired result, use manual size commands:> [!NOTE] > > **Delimiter Size Commands (smallest to largest):** > > | Command | Size | > | - | - | > | `\big` | 50% larger than normal | > | `\Big` | 2× normal size | > | `\bigg` | 2.5× normal size | > | `\Bigg` | 3× normal size |### Size Comparison```latex size-comparison.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Normal size $( \frac{1}{2} )$ % \big $\big( \frac{1}{2} \big)$ % \Big $\Big( \frac{1}{2} \Big)$ % \bigg $\bigg( \frac{1}{2} \bigg)$ % \Bigg $\Bigg( \frac{1}{2} \Bigg)$ % For opening and closing separately $\bigl( x \bigr)$ % 'l' for left, 'r' for right \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from size-comparison.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-04/page-1.svg)
### Left and Right Variants> [!TIP] > > Use `l` and `r` suffixes for proper spacing: `\bigl(`, `\bigr)`, `\Bigl[`, `\Bigr]`, etc. This ensures correct spacing around the delimiters.## Advanced Techniques### Nested Brackets```latex nested-brackets.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Poor: all brackets same size $[1 + [2 + [3 + 4]]]$ % Better: graduated sizes $\Big[1 + \big[2 + [3 + 4]\big]\Big]$ % Best: automatic sizing $\left[1 + \left[2 + \left[3 + 4\right]\right]\right]$ % Complex nesting $\left\{x : \left[a + \left(\frac{b}{c}\right)\right] > 0\right\}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from nested-brackets.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-05/page-1.svg)
### Multi-line Equations with BracketsFor equations that span multiple lines, you need special handling:```latex multiline-brackets.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Using \right. and \left. for invisible delimiters \begin{align} f(x) = & \left[ x^2 + 2x \right. \\ & \left. + 1 \right] \end{align} % Alternative using \big commands \begin{align} g(x) = & \Big[ x^3 + 3x^2 \\ & \phantom{\Big[} + 3x + 1 \Big] \end{align} % For cases/piecewise functions \begin{equation} f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x^2 & \text{if } x < 0 \end{cases} \end{equation} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multiline-brackets.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-06/page-1.svg)
### Matrix Delimiters```latex matrix-delimiters.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Different matrix environments $\begin{pmatrix} % parentheses a & b \\ c & d \end{pmatrix}$ $\begin{bmatrix} % brackets a & b \\ c & d \end{bmatrix}$ $\begin{Bmatrix} % braces a & b \\ c & d \end{Bmatrix}$ $\begin{vmatrix} % vertical bars a & b \\ c & d \end{vmatrix}$ $\begin{Vmatrix} % double bars a & b \\ c & d \end{Vmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrix-delimiters.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-07/page-1.svg)
## Special Use Cases### Set Notation```latex set-notation.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} % Basic set $A = \{1, 2, 3, 4, 5\}$ % Set builder notation $B = \{x \in \mathbb{R} : x^2 < 4\}$ % Set with conditions $C = \left\{x \in \mathbb{Z} : \begin{array}{l} x > 0 \\ x \text{ is even} \end{array}\right\}$ % Empty set $\emptyset = \{\}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from set-notation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-08/page-1.svg)
### Interval Notation```latex intervals.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Open interval $(a, b)$ % Closed interval $[a, b]$ % Half-open intervals $[a, b)$ and $(a, b]$ % Infinite intervals $(-\infty, a]$ and $[b, \infty)$ % Union of intervals $[0, 1] \cup [2, 3]$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from intervals.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-09/page-1.svg)
### Physics and Engineering```latex physics-brackets.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \usepackage{physics} % provides \bra, \ket, \braket \begin{document} % Quantum mechanics bra-ket notation $\langle \psi | \phi \rangle$ % With physics package $\bra{\psi}\ket{\phi}$ $\braket{\psi|\phi}$ % Commutator $[A, B] = AB - BA$ % Anticommutator $\{A, B\} = AB + BA$ % Poisson bracket $\{f, g\} = \sum_i \left(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\right)$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from physics-brackets.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-10/page-1.svg)
## Common Errors and Solutions> [accordion] Error: Missing \right. inserted > > **Problem**: Every `\left` needs a matching `\right`, even across line breaks. > > **Solution**: Use `\right.` for an invisible right delimiter: > > ```latex example.tex theme=\{null} > \left[ x + y \right. % End of first line > \left. + z \right] % Start of second line > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-11/page-1.svg) >
> [accordion] Brackets too large with \left...\right > > **Problem**: Automatic sizing makes brackets unnecessarily large. > > **Solution**: Use manual sizing instead: > > ```latex example.tex theme=\{null} > % Instead of > $\left( \sum_{i=1}^n x_i \right)$ > > % Use > $\bigg( \sum_{i=1}^n x_i \bigg)$ > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-12/page-1.svg) >
> [accordion] Curly braces not showing > > **Problem**: `{` and `}` have special meaning in LaTeX. > > **Solution**: Escape them with backslash: > > ```latex example.tex theme=\{null} > $\{ x : x > 0 \}$ % Correct > ${ x : x > 0 }$ % Wrong - braces disappear > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-13/page-1.svg) >
> [accordion] Mismatched bracket sizes in aligned equations > > **Problem**: Brackets don't match across aligned lines. > > **Solution**: Use phantom brackets: > > ```latex example.tex theme=\{null} > \begin{align} > f(x) = & \Big[ x^2 + 2x \\ > & \phantom{\Big[} + 1 \Big] > \end{align} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-brackets-parentheses-14/page-1.svg) >
## Best Practices### 1. Choose the Right Delimiter> [!TIP] > > **Good Delimiter Choices:** > > * **Parentheses**: General grouping, function arguments > * **Square brackets**: Matrices, commutators, intervals > * **Curly braces**: Sets, systems of equations > * **Angle brackets**: Inner products, averages > * **Vertical bars**: Absolute values, determinants, norms### 2. Sizing Guidelines* Use `\left...\right` for **complex expressions** with varying heights * Use manual sizing (`\big`, `\Big`, etc.) for **simple expressions** * Be consistent within the same document * Don't oversize—readability is key### 3. Spacing Considerations```latex spacing-examples.tex theme=\{null} % Good spacing with \bigl and \bigr $\bigl( x + y \bigr)$ % Poor spacing with just \big $\big( x + y \big)$ % For better spacing around bars $\left\lvert x \right\rvert$ % Better than |x| ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### 4. Semantic MarkupUse meaningful commands when available:```latex semantic-markup.tex theme=\{null} % Instead of manual brackets $|| v ||$ % Use semantic commands $\lVert v \rVert$ % Double bars for norm $\lvert x \rvert$ % Single bars for absolute value $\langle u, v \rangle$ % Angle brackets for inner product ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Quick Reference Card| Category | Commands | Result | | - | - | - | | Parentheses | `( )` | $(x)$ | | Square brackets | `[ ]` | $[x]$ | | Curly braces | `\{ \}` | $\{x\}$ | | Angle brackets | `\langle \rangle` | $\langle x \rangle$ | | Vertical bars | `\|` or `\vert` | $\lvert x \rvert$ | | Double bars | `\|\|` or `\Vert` | $\lVert x \rVert$ | | Floor | `\lfloor \rfloor` | $\lfloor x \rfloor$ | | Ceiling | `\lceil \rceil` | $\lceil x \rceil$ | | Auto sizing | `\left( \frac{1}{2} \right)` | $\left(\frac{1}{2}\right)$ | | Manual sizing | `\Big( x \Big)` | $\Big( x \Big)$ |## Practice in LaTeX Cloud Studio> [card] Try bracket sizing in the editor > > Test `\left`, `\right`, `\lvert`, and `\lVert` in a live document without leaving the browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=brackets_parentheses_open_app)> [card] Write a first project > > Move from isolated syntax examples to a full document workflow.[Open](/learn/latex/how-to/first-project?utm_source=resources\&utm_medium=related_guide\&utm_campaign=docs_open_app\&utm_content=brackets_parentheses_first_project)New to LaTeX Cloud Studio? The [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=brackets_parentheses_online_editor) page explains how writing and compiling in the browser works without a local TeX installation.## Related Topics> [card] Mathematical Expressions > > Learn math mode basics and expressions[Open](/learn/latex/mathematics/mathematical-expressions)> [card] Matrices Guide > > Complete guide to matrices and arrays[Open](/learn/latex/mathematics/matrices)> [card] Equations > > Multi-line and numbered equations[Open](/learn/latex/mathematics/equations)> [card] Math Symbols > > Comprehensive symbol reference[Open](/learn/latex/mathematics/symbols)> [!WARNING] > > **LaTeX Cloud Studio** automatically handles package loading! The `amsmath` package is pre-loaded, so all bracket commands work immediately without manual package management. # Mathematical Equations Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/equations Master complex mathematical equations in LaTeX. Learn multi-line equations, alignment, numbering, and advanced equation environments. Building on the math basics, this guide covers advanced equation formatting, multi-line equations, alignment, and professional mathematical typesetting.> [!NOTE] > > **Prerequisites**: Familiarity with basic math mode (`$...$` and `\[...\]`). See our [Mathematics Basics](/learn/latex/mathematics/basics) guide if needed. > > **Related topics**: [Mathematical symbols](/learn/latex/mathematics/symbols) | [Text formatting in math](/learn/latex/text-formatting) | [Cross-referencing equations](/learn/latex/cross-referencing)## Single Equations### Basic Display Equations```latex display-equations.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Simple display equation \[ E = mc^2 \] % With equation number \begin{equation} E = mc^2 \end{equation} % Without equation number \begin{equation*} E = mc^2 \end{equation*} % Reference an equation \begin{equation}\label{eq:energy} E = mc^2 \end{equation} As shown in Equation \ref{eq:energy}, energy and mass are related. % Using \eqref for parentheses As shown in Equation \eqref{eq:energy}... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from display-equations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-equations-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_equations)### Equation Numbering Control```latex equation-numbering.tex theme=\{null} % Suppress numbering for specific equation \begin{equation} a^2 + b^2 = c^2 \nonumber \end{equation} % Custom numbering \begin{equation} F = ma \tag{Newton's 2nd Law} \end{equation} % Numbered with custom tag \begin{equation} e^{i\pi} + 1 = 0 \tag{$\star$} \end{equation} % Subequations \begin{subequations} \begin{equation} x + y = 5 \end{equation} \begin{equation} 2x - y = 1 \end{equation} \end{subequations} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from equation-numbering.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-07/page-1.svg)
## Multi-line Equations### Split EnvironmentFor single equations that are too long:```latex split-environment.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} (a + b)^4 &= (a + b)^2(a + b)^2 \\ &= (a^2 + 2ab + b^2)(a^2 + 2ab + b^2) \\ &= a^4 + 4a^3b + 6a^2b^2 + 4ab^3 + b^4 \end{split} \end{equation} % Left-aligned split \begin{equation} \begin{split} \text{LHS} &= \text{some long expression} \\ &\quad + \text{continuation} \\ &\quad + \text{more terms} \\ &= \text{RHS} \end{split} \end{equation} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from split-environment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-equations-02/page-1.svg)
### Multline EnvironmentFor very long single equations:```latex multline-environment.tex theme=\{null} \begin{multline} \int_0^1 \biggl\{ \sum_{i=1}^n x_i^2 + \sum_{j=1}^m y_j^2 + \sum_{k=1}^p z_k^2 \biggr\} \, dx \\ + \int_1^2 \biggl\{ \sum_{i=1}^n x_i^3 + \sum_{j=1}^m y_j^3 + \sum_{k=1}^p z_k^3 \biggr\} \, dx \\ = \text{some complicated result} \end{multline} % Control positioning \begin{multline} \text{First line flush left} \\ \text{Middle lines centered} \\ \shoveleft{\text{This line shoved left}} \\ \shoveright{\text{This line shoved right}} \\ \text{Last line flush right} \end{multline} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multline-environment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-08/page-1.svg)
## Aligned Equations### Align EnvironmentThe most versatile environment for multiple equations:```latex align-environment.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Basic alignment \begin{align} 2x + 3y &= 7 \\ 5x - 2y &= 4 \end{align} % Multiple alignment points \begin{align} x &= a + b &\qquad y &= c + d \\ 2x &= 2(a + b) &\qquad 3y &= 3(c + d) \end{align} % Without numbering \begin{align*} \sin^2\theta + \cos^2\theta &= 1 \\ 1 + \tan^2\theta &= \sec^2\theta \\ 1 + \cot^2\theta &= \csc^2\theta \end{align*} % Selective numbering \begin{align} a &= b + c \\ d &= e + f \nonumber \\ g &= h + i \end{align} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from align-environment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-equations-03/page-1.svg)
### Aligned Within Equation```latex aligned-within.tex theme=\{null} % For alignment within a single equation number \begin{equation} \begin{aligned} f(x) &= (x+a)(x+b) \\ &= x^2 + (a+b)x + ab \end{aligned} \end{equation} % Multiple aligned blocks \begin{equation} \left\{ \begin{aligned} x + y + z &= 1 \\ 2x - y + 3z &= 0 \\ x - 2y - z &= 4 \end{aligned} \right. \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from aligned-within.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-09/page-1.svg)
## Equation Arrays### Eqnarray (Deprecated)> [!WARNING] > > **Note**: `eqnarray` is deprecated. Use `align` instead. Shown here for reference only.### Array EnvironmentFor complex layouts:```latex array-equations.tex theme=\{null} \begin{equation} \begin{array}{lcl} f(x) &=& (x+1)^2 \\ &=& x^2 + 2x + 1 \end{array} \end{equation} % Multiple columns \begin{equation} \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from array-equations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-10/page-1.svg)
## Cases and Piecewise Functions### Cases Environment```latex cases-environment.tex theme=\{null} \documentclass{article} \usepackage{mathtools} \begin{document} % Basic cases \begin{equation} f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x^2 & \text{if } x < 0 \end{cases} \end{equation} % Multiple conditions \begin{equation} \text{sgn}(x) = \begin{cases} 1 & \text{if } x > 0 \\ 0 & \text{if } x = 0 \\ -1 & \text{if } x < 0 \end{cases} \end{equation} % Nested cases \begin{equation} f(x,y) = \begin{cases} \begin{cases} 1 & \text{if } y > x \\ 0 & \text{if } y = x \end{cases} & \text{if } x \geq 0 \\ -1 & \text{if } x < 0 \end{cases} \end{equation} % Left cases \begin{equation} \begin{rcases} x^2 + y^2 = 1 \\ x + y = 0 \end{rcases} \text{defines a curve} \end{equation} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cases-environment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-equations-04/page-1.svg)
## Gathered and Centered Equations```latex gathered-equations.tex theme=\{null} % Multiple centered lines with one number \begin{equation} \begin{gathered} (a + b)^2 = a^2 + 2ab + b^2 \\ (a - b)^2 = a^2 - 2ab + b^2 \\ (a + b)(a - b) = a^2 - b^2 \end{gathered} \end{equation} % Within text The identities $\begin{gathered} \sin^2\theta + \cos^2\theta = 1 \\ \tan\theta = \frac{\sin\theta}{\cos\theta} \end{gathered}$ are fundamental. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from gathered-equations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-11/page-1.svg)
## Advanced Alignment### Complex Alignment Patterns```latex complex-alignment.tex theme=\{null} % Aligning equals signs and operators \begin{align} f(x) &= x^2 + 2x + 1 \\ &= (x + 1)^2 \\ &> 0 \quad \text{for all } x \neq -1 \end{align} % Multiple columns \begin{align} a_1 &= b_1 + c_1 & a_2 &= b_2 + c_2 \\ d_1 &= e_1 + f_1 & d_2 &= e_2 + f_2 \end{align} % Alignment with text \begin{align} 2x + 3 &= 7 & &\text{(given)} \\ 2x &= 4 & &\text{(subtract 3)} \\ x &= 2 & &\text{(divide by 2)} \end{align} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from complex-alignment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-12/page-1.svg)
### Intertext and Shortintertext```latex intertext.tex theme=\{null} \begin{align} a &= b + c \\ &= d + e + f \intertext{Now we substitute the known values:} &= 1 + 2 + 3 \\ &= 6 \end{align} % Shorter spacing \begin{align} x^2 + y^2 &= r^2 \shortintertext{and} x &= r\cos\theta \\ y &= r\sin\theta \end{align} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Boxed and Highlighted Equations```latex boxed-equations.tex theme=\{null} % Simple box \begin{equation} \boxed{E = mc^2} \end{equation} % Colored box \usepackage{xcolor} \begin{equation} \colorbox{yellow}{$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$} \end{equation} % Framed important result \begin{equation} \boxed{ \int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi} } \end{equation} % Highlight part of equation \begin{equation} f(x) = \underbrace{x^2 + 2x}_{\text{quadratic}} + \overbrace{3x + 4}^{\text{linear}} \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from boxed-equations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-14/page-1.svg)
## Equation Spacing### Manual Spacing in Equations```latex equation-spacing.tex theme=\{null} % Spacing commands \begin{align} f(x) &= x^2+2x+1 \\ % No space f(x) &= x^2 + 2x + 1 \\ % Normal space f(x) &= x^2\,+\,2x\,+\,1 \\ % Thin space f(x) &= x^2\:+\:2x\:+\:1 \\ % Medium space f(x) &= x^2\;+\;2x\;+\;1 \\ % Thick space f(x) &= x^2\quad+\quad2x\quad+\quad1 % Quad space \end{align} % Negative space \begin{equation} \int\!\!\!\int f(x,y) \, dx \, dy % Bring integral signs closer \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from equation-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-15/page-1.svg)
## How to Turn Off Equation Auto NumberingEvery `equation`, `align` and `gather` environment numbers its output automatically. To remove the number, use the starred form of the environment:- `\begin{equation*} ... \end{equation*}` for a single unnumbered equation - `\begin{align*} ... \end{align*}` for unnumbered aligned equations - `\[ ... \]` for a quick unnumbered displayThe starred environments need `amsmath`, which you almost certainly already load.To suppress the number on **one line inside** a numbered environment, put `\nonumber` (or `\notag`) before the line break:`x + y &= z \nonumber \\`To stop numbering for a whole document, load `amsmath` and use the starred forms throughout — there is no global switch, and redefining the equation counter causes more problems than it solves.## Best Practices> [!TIP] > > **Equation guidelines:** > > 1. **Consistency**: Use the same alignment style throughout > 2. **Readability**: Don't over-align; prioritize clarity > 3. **References**: Label important equations for cross-referencing > 4. **Spacing**: Use `\,` before differentials in integrals > 5. **Breaking**: Break long equations at operators (+, -, =) > 6. **Grouping**: Use `subequations` for related equations## Common Patterns### System of Equations```latex system-equations.tex theme=\{null} % Using array \begin{equation} \left\{ \begin{array}{rcrcrcr} 2x & + & 3y & - & z & = & 4 \\ x & - & y & + & 2z & = & 1 \\ 3x & + & y & - & z & = & 0 \end{array} \right. \end{equation} % Using aligned \begin{equation} \left\{ \begin{aligned} 2x + 3y - z &= 4 \\ x - y + 2z &= 1 \\ 3x + y - z &= 0 \end{aligned} \right. \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from system-equations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-05/page-1.svg)
### Derivations```latex derivations.tex theme=\{null} \begin{align} (x + y)^2 &= (x + y)(x + y) \\ &= x(x + y) + y(x + y) \\ &= x^2 + xy + yx + y^2 \\ &= x^2 + 2xy + y^2 \end{align} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from derivations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-equations-06/page-1.svg)
## Quick Reference| Environment | Purpose | Numbering | | - | - | - | | `equation` | Single equation | Yes | | `equation*` | Single equation | No | | `align` | Multiple aligned equations | Yes (each) | | `align*` | Multiple aligned equations | No | | `split` | Split long equation | One number | | `multline` | Very long equation | One number | | `gather` | Centered equations | Yes (each) | | `cases` | Piecewise functions | Within equation |***> [!NOTE] > > **Next**: Explore [Mathematical symbols](/learn/latex/mathematics/symbols) for a comprehensive guide to mathematical notation in LaTeX. # Fractions and Binomials in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/fractions-binomials Typeset fractions, continued fractions, and binomial notation in LaTeX with clear math formatting. Use dedicated fraction commands for clarity and consistency. ## Core Commands ```latex fractions.tex theme={null} \frac{a}{b} \dfrac{a+b}{c+d} \tfrac{1}{2} \binom{n}{k} \dbinom{n}{k} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from fractions.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-fractions-binomials-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_fractions_binomials) ## Continued Fractions ```latex cfrac.tex theme={null} \usepackage{amsmath} \[ x = a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3}}} \] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cfrac.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-fractions-binomials-02/page-1.svg)
## Related Pages * [Mathematics basics](/learn/latex/mathematics/basics) * [Align and multline environments](/learn/latex/mathematics/align-and-multline-environments) # Mathematical Expressions Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/mathematical-expressions Master writing mathematical expressions in LaTeX. Learn fractions, roots, integrals, limits, and complex mathematical notation. Learn how to write beautiful mathematical expressions in LaTeX, from basic arithmetic to complex formulas.## Basic Mathematical Expressions### Inline vs Display Math```latex example.tex theme=\{null} % Inline math - flows with text The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. % Display math - centered on its own line The quadratic formula is: \[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\] % Or using equation environment (numbered) \begin{equation} x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \end{equation} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-08/page-1.svg)
### Basic Operations| Expression | LaTeX | Result | | :- | :- | :- | | Addition | `a + b` | a + b | | Subtraction | `a - b` | a - b | | Multiplication | `a \times b` or `a \cdot b` | a × b or a · b | | Division | `a \div b` or `a / b` | a ÷ b or a / b | | Powers | `a^2` or `a^{10}` | a² or a¹⁰ | | Subscripts | `a_1` or `a_{ij}` | a₁ or aᵢⱼ |## Fractions and Binomials### Fractions```latex example.tex theme=\{null} % Basic fraction \[\frac{1}{2}\] % Nested fractions \[\frac{1}{1 + \frac{1}{2}}\] % Display style in inline math $\displaystyle\frac{1}{2}$ % Text style in display math \[\textstyle\frac{1}{2}\] % Continued fractions \[\cfrac{1}{2 + \cfrac{1}{3 + \cfrac{1}{4}}}\] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_mathematical_expressions)### Binomial Coefficients```latex example.tex theme=\{null} % Binomial coefficient \[\binom{n}{k} = \frac{n!}{k!(n-k)!}\] % Different styles \[\dbinom{n}{k}\] % Display style \[\tbinom{n}{k}\] % Text style ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-02/page-1.svg)
## Roots and Radicals```latex example.tex theme=\{null} % Square root \[\sqrt{x}\] % nth root \[\sqrt[n]{x}\] % Complex expressions \[\sqrt{a^2 + b^2}\] % Nested roots \[\sqrt{\sqrt{x} + 1}\] % Large expressions \[\sqrt{\frac{x^2 + y^2}{2}}\] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-03/page-1.svg)
## Sums, Products, and Integrals### Summation```latex example.tex theme=\{null} % Basic sum \[\sum_{i=1}^{n} i = \frac{n(n+1)}{2}\] % Display style \[\displaystyle\sum_{i=1}^{n} i\] % Multiple indices \[\sum_{\substack{i=1 \\ j=1}}^{n} a_{ij}\] % Infinite series \[\sum_{n=0}^{\infty} \frac{x^n}{n!} = e^x\] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-04/page-1.svg)
### Products```latex example.tex theme=\{null} % Basic product \prod_{i=1}^{n} i = n! % Infinite product \prod_{n=1}^{\infty} \left(1 - \frac{1}{n^2}\right) % Co-product \coprod_{i \in I} X_i ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Integration```latex example.tex theme=\{null} % Indefinite integral \[\int f(x) \, dx\] % Definite integral \[\int_a^b f(x) \, dx\] % Multiple integrals \[\iint_D f(x,y) \, dx \, dy\] \[\iiint_V f(x,y,z) \, dx \, dy \, dz\] % Contour integrals \[\oint_C F \cdot dr\] % With limits \[\int\limits_0^1 x^2 \, dx = \frac{1}{3}\] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-05/page-1.svg)
## Limits and Derivatives### Limits```latex example.tex theme=\{null} % Basic limit \[\lim_{x \to 0} \frac{\sin x}{x} = 1\] % Limits with approach direction \[\lim_{x \to 0^+} f(x)\] \[\lim_{x \to 0^-} f(x)\] % Limits to infinity \[\lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n = e\] % Supremum and infimum \[\sup_{x \in A} f(x)\] \[\inf_{x \in A} f(x)\] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-06/page-1.svg)
### Derivatives```latex example.tex theme=\{null} % First derivative \[f'(x) \text{ or } \frac{df}{dx}\] % Higher derivatives \[f''(x) \text{ or } \frac{d^2f}{dx^2}\] % Partial derivatives \[\frac{\partial f}{\partial x}\] \[\frac{\partial^2 f}{\partial x \partial y}\] % With evaluation \[\left.\frac{df}{dx}\right|_{x=0}\] ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-07/page-1.svg)
## Brackets and Delimiters### Automatic Sizing```latex example.tex theme=\{null} % Manual sizing ( \big( \Big( \bigg( \Bigg( % Automatic sizing \left( \frac{1}{2} \right) \left[ \sum_{i=1}^n i \right] \left\{ x : x > 0 \right\} % Mixed delimiters \left< \frac{a}{b} \right| \left\lfloor x \right\rfloor \left\lceil x \right\rceil ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Special Cases```latex example.tex theme=\{null} % Cases f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x^2 & \text{if } x < 0 \end{cases} % Matrices with brackets \begin{pmatrix} a & b \\ c & d \end{pmatrix} % Norms and absolute values \|x\| = \sqrt{x_1^2 + x_2^2} |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Functions and Operators### Standard Functions```latex example.tex theme=\{null} % Trigonometric \sin x, \cos x, \tan x \arcsin x, \arccos x, \arctan x % Exponential and logarithmic \exp(x), e^x \log x, \ln x, \log_2 x % Hyperbolic \sinh x, \cosh x, \tanh x % Other functions \max(a,b), \min(a,b) \gcd(a,b), \det(A) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Custom Operators```latex example.tex theme=\{null} % Define new operators \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\tr}{tr} \DeclareMathOperator*{\argmax}{arg\,max} % Usage \sgn(x) = \begin{cases} 1 & x > 0 \\ 0 & x = 0 \\ -1 & x < 0 \end{cases} \argmax_{x \in \mathbb{R}} f(x) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Advanced Techniques### Aligning Equations```latex example.tex theme=\{null} \begin{align} (a + b)^2 &= (a + b)(a + b) \\ &= a^2 + ab + ba + b^2 \\ &= a^2 + 2ab + b^2 \end{align} % Without numbering \begin{align*} e^{i\pi} + 1 &= 0 \\ e^{i\pi} &= -1 \end{align*} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-mathematical-expressions-14/page-1.svg)
### Text in Math Mode```latex example.tex theme=\{null} % Using \text f(x) = x^2 \text{ for all } x \in \mathbb{R} % Using \intertext in align \begin{align} a &= b + c \\ \intertext{and therefore} a - b &= c \end{align} % Math in text The value of $\pi$ is approximately $3.14159$. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Common Mistakes to Avoid> [!WARNING] > > **Common errors**: > > * Forgetting braces for multi-character superscripts: Use `x^{10}` not `x^10` > * Missing `\` before functions: Use `\sin x` not `sin x` > * Wrong math mode: Use `$...$` for inline, `\[...\]` for display > * Inconsistent notation: Stick to one style throughout your document## Best Practices> [card] Use Proper Spacing > > Add thin spaces with `\,` in integrals: `\int f(x) \, dx`> [card] Choose Right Size > > Use `\dfrac` for display fractions in inline math> [card] Be Consistent > > Use the same notation style throughout your document> [card] Number Wisely > > Only number equations you reference## Further Reading> [card] Symbol Reference > > Complete list of mathematical symbols[Open](/learn/reference/symbols)> [card] Advanced Mathematics > > Complex mathematical typesetting[Open](/learn/latex/mathematics/advanced-math)> [card] Equations Guide > > Multi-line equations and systems[Open](/learn/latex/mathematics/equations)> [card] Physics Notation > > Physics-specific expressions[Open](/learn/latex/specialized-notation/physics) # LaTeX Matrix Tutorial - pmatrix, bmatrix, vmatrix, and More Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/matrices Learn how to write a matrix in LaTeX with pmatrix, bmatrix, vmatrix, smallmatrix, augmented matrices, and block matrices using copy-paste examples. If you want to create a matrix in LaTeX, the usual answer is to load `amsmath` and use `pmatrix` or `bmatrix`.Use `pmatrix` for parentheses, `bmatrix` for square brackets, `vmatrix` for determinants, and `smallmatrix` for inline math. When you need vertical separators for an augmented matrix or custom alignment, switch to `array`.This guide starts with the common matrix environments, then covers augmented matrices, block matrices, spacing, and alignment.> [!NOTE] > > **Quick answer**: > > ```latex example.tex theme=\{null} > \usepackage{amsmath} > > \[ > A = \begin{pmatrix} > 1 & 2 \\ > 3 & 4 > \end{pmatrix} > \] > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-15/page-1.svg) >
> > Use `pmatrix` for `( )`, `bmatrix` for `[ ]`, and `vmatrix` for determinants. > > **Package required**: Most matrix environments need `\usepackage{amsmath}`. Some advanced layouts also use `array` or `mathtools`. > > **Related topics**: [Mathematical equations](/learn/latex/mathematics/equations) | [Subscripts & superscripts](/learn/latex/mathematics/subscripts-superscripts) | [Brackets & parentheses](/learn/latex/mathematics/brackets-parentheses) | [LaTeX symbols](/learn/latex/mathematics/symbols) > > **Last updated**: April 2026 | **Reading time**: 15 min | **Difficulty**: Beginner to Intermediate## What You'll Learn- ✅ All LaTeX matrix environments (pmatrix, bmatrix, vmatrix, Bmatrix, Vmatrix) - ✅ Creating arrays with custom delimiters and column alignment - ✅ Block matrices and augmented matrix notation - ✅ Matrix operations, determinants, and transpose notation - ✅ Small inline matrices with smallmatrix environment - ✅ Advanced matrix formatting, spacing, and decorations - ✅ Troubleshooting common LaTeX matrix issues## Frequently Asked Questions> [accordion] What is the difference between pmatrix and bmatrix in LaTeX? > > The main difference between `pmatrix` and `bmatrix` is the type of **delimiters** (brackets) they use: > > * **pmatrix** uses **parentheses** ( ) - most common for general matrices in mathematics > * **bmatrix** uses **square brackets** \[ ] - preferred for numerical data and engineering > > Both require the `amsmath` package and work identically in terms of syntax: > > ```latex example.tex theme=\{null} > % Using pmatrix (parentheses) > $A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$ > > % Using bmatrix (square brackets) > $B = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$ > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-16/page-1.svg) >
> > **When to use each:** > > * Use **pmatrix** for: linear transformations, general matrices, mathematical proofs > * Use **bmatrix** for: numerical data, matrices in data science, engineering applications > * Use **vmatrix** for: determinants (single vertical bars)> [accordion] How do I create a matrix with vertical lines between columns (augmented matrix)? > > To create an **augmented matrix** with vertical lines separating columns, use the `array` environment with the pipe symbol `|` in the column specification: > > ```latex example.tex theme=\{null} > \[ > \left[\begin{array}{cc|c} > 1 & 2 & 5 \\ > 3 & 4 & 11 > \end{array}\right] > \] > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-17/page-1.svg) >
> > **How it works:** > > * `{cc|c}` means: column-center, column-center, **vertical line**, column-center > * Use `c` for centered, `l` for left-aligned, `r` for right-aligned > * The pipe `|` symbol creates the vertical separator line > * Use `\left[` and `\right]` to automatically scale brackets> [accordion] What is the amsmath package and why do I need it for LaTeX matrices? > > The **amsmath** package (American Mathematical Society) provides essential **matrix environments** that aren't available in plain LaTeX:- `pmatrix` (parentheses) > > * `bmatrix` (square brackets) > * `vmatrix` (determinant notation) > * `Vmatrix` (norm notation) > * `Bmatrix` (curly braces) > * `smallmatrix` (inline matrices)**How to load it:**\`\`\`latex example.tex theme=\{null} > \documentclass > \usepackage > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
Without amsmath, you'd be limited to the basic `array` environment with manual delimiter management. > ```> [accordion] How do I fix alignment issues with numbers in LaTeX matrices? > > **Number alignment problems** occur when columns contain different-width numbers. Use these solutions: > > **Solution 1: Right-aligned array** > > ```latex example.tex theme=\{null} > \left[\begin{array}{rr} > 1.2 & 345.6 \\ > 12.34 & 5.6 > \end{array}\right] > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-19/page-1.svg) >
> > **Solution 2: Use siunitx for decimal alignment** > > ```latex example.tex theme=\{null} > \usepackage{siunitx} > \begin{array}{SS} > 1.2 & 345.6 \\ > 12.34 & 5.6 > \end{array} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-20/page-1.svg) >
> > **Solution 3: Use phantom spacing** > > ```latex example.tex theme=\{null} > \phantom{0}1.2 % Adds invisible space > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-21/page-1.svg) >
> [accordion] How do I create a small inline matrix in LaTeX? > > For **matrices within text paragraphs**, use the `smallmatrix` environment: > > ```latex example.tex theme=\{null} > The rotation matrix $\left(\begin{smallmatrix} > \cos\theta & -\sin\theta \\ > \sin\theta & \cos\theta > \end{smallmatrix}\right)$ transforms points in 2D space. > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-22/page-1.svg) >
> > Regular `pmatrix` environments are too large for inline use and disrupt line spacing. The `smallmatrix` environment uses smaller fonts and tighter spacing.> [accordion] What does the array column specifier mean in LaTeX matrices? > > **Column specifiers** define how each column is formatted: > > | Specifier | Alignment | Example | > | - | - | - | > | `l` | Left | `{lll}` | > | `c` | Center | `{ccc}` | > | `r` | Right | `{rrr}` | > | `\|` | Vertical line | `{c\|c}` | > | `@{text}` | Custom separator | `@{,}` | > > Example with vertical line: > > ```latex example.tex theme=\{null} > \begin{array}{cc|c} > 1 & 2 & 5 \\ > 3 & 4 & 11 > \end{array} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-23/page-1.svg) >
> [accordion] How do I calculate and display a determinant in LaTeX? > > Use the `vmatrix` environment for **determinant notation** with vertical bar delimiters: > > ```latex example.tex theme=\{null} > \det(A) = \begin{vmatrix} > a & b \\ > c & d > \end{vmatrix} = ad - bc > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-24/page-1.svg) >
> > For 3×3 matrices: > > ```latex example.tex theme=\{null} > \begin{vmatrix} > a_{11} & a_{12} & a_{13} \\ > a_{21} & a_{22} & a_{23} \\ > a_{31} & a_{32} & a_{33} > \end{vmatrix} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-25/page-1.svg) >
> [accordion] How do I increase spacing between elements in a LaTeX matrix? > > Use `\renewcommand{\arraystretch}{factor}` to control **matrix element spacing**: > > ```latex example.tex theme=\{null} > % 50% more space between rows > {\renewcommand{\arraystretch}{1.5} > $\begin{pmatrix} > a & b \\ > c & d > \end{pmatrix}$} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-26/page-1.svg) >
> > **Recommended values:** > > * `1.0` - Default compact spacing > * `1.2` - Standard matrices > * `1.5` - Matrices with fractions or subscripts > * `2.0` - Matrices with tall expressions > > Use curly braces to limit the effect to just one matrix.## Basic Matrix EnvironmentsLaTeX provides six standard matrix environments through the `amsmath` package, each with different delimiters:### Matrix Environment Overview```latex all-matrix-types.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Parentheses matrix (most common) $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ % Square bracket matrix $\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}$ % Curly brace matrix $\begin{Bmatrix} x_1 \\ x_2 \\ x_3 \end{Bmatrix}$ % Determinant (vertical bars) $\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$ % Norm (double vertical bars) $\begin{Vmatrix} \mathbf{v} \end{Vmatrix} = \begin{Vmatrix} 1 & 2 \\ 3 & 4 \end{Vmatrix}$ % No delimiters $\begin{matrix} a & b \\ c & d \end{matrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from all-matrix-types.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_matrices)### Matrix Environment Summary Table| Environment | Delimiters | Common Use | Example | | - | - | - | - | | `matrix` | None | Building block for custom delimiters | Basic array | | `pmatrix` | ( ) | General matrices, transformations | Linear algebra | | `bmatrix` | \[ ] | General matrices, data tables | Numerical data | | `Bmatrix` | Set notation, systems | Set theory | | `vmatrix` | \| \| | Determinants | det(A) | | `Vmatrix` | \|\| \|\| | Norms, magnitudes | \|\|v\|\| |## Creating Your First Matrix### Simple 2×2 Matrix```latex simple-matrix.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Basic 2x2 matrix The matrix $A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$ is invertible. % With variables The general form is $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ where $ad - bc \neq 0$. % Matrix equation $\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 5 \\ 7 \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from simple-matrix.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-02/page-1.svg)
> [!TIP] > > **Key points for matrix creation:** > > * Use `&` to separate columns > * Use `\\` to end rows > * Don't add `\\` after the last row > * Matrices must be in math mode (`$...$` or `\[...\]`)## Matrix Elements and Structure### Matrix with Subscripts```latex matrix-subscripts.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % General m×n matrix $A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}$ % 3×3 example $B = \begin{bmatrix} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \\ b_{31} & b_{32} & b_{33} \end{bmatrix}$ % Column vector $\mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ \vdots \\ x_n \end{pmatrix}$ % Row vector $\mathbf{y}^T = \begin{pmatrix} y_1 & y_2 & y_3 & \cdots & y_n \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrix-subscripts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-03/page-1.svg)
### Using Dots in MatricesLaTeX provides three types of dots for indicating patterns in matrices:```latex matrix-dots.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Horizontal dots: \cdots % Vertical dots: \vdots % Diagonal dots: \ddots % General matrix pattern $\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}$ % Diagonal matrix $D = \begin{bmatrix} d_1 & 0 & \cdots & 0 \\ 0 & d_2 & \ddots & \vdots \\ \vdots & \ddots & \ddots & 0 \\ 0 & \cdots & 0 & d_n \end{bmatrix}$ % Block pattern $\begin{pmatrix} A_{11} & A_{12} & \cdots & A_{1n} \\ A_{21} & A_{22} & \cdots & A_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ A_{m1} & A_{m2} & \cdots & A_{mn} \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrix-dots.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-04/page-1.svg)
## Special Matrix Types### Identity and Zero Matrices```latex special-matrices.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Identity matrix $I_3 = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$ % General identity $I_n = \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{pmatrix}$ % Zero matrix $\mathbf{0}_{3 \times 3} = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}$ % Ones matrix $\mathbf{1}_{2 \times 3} = \begin{pmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from special-matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-05/page-1.svg)
### Triangular Matrices```latex triangular-matrices.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Upper triangular $U = \begin{pmatrix} u_{11} & u_{12} & u_{13} & u_{14} \\ 0 & u_{22} & u_{23} & u_{24} \\ 0 & 0 & u_{33} & u_{34} \\ 0 & 0 & 0 & u_{44} \end{pmatrix}$ % Lower triangular $L = \begin{pmatrix} l_{11} & 0 & 0 & 0 \\ l_{21} & l_{22} & 0 & 0 \\ l_{31} & l_{32} & l_{33} & 0 \\ l_{41} & l_{42} & l_{43} & l_{44} \end{pmatrix}$ % Strictly upper triangular $U_0 = \begin{pmatrix} 0 & u_{12} & u_{13} \\ 0 & 0 & u_{23} \\ 0 & 0 & 0 \end{pmatrix}$ % Tridiagonal $T = \begin{pmatrix} a_1 & b_1 & 0 & 0 \\ c_1 & a_2 & b_2 & 0 \\ 0 & c_2 & a_3 & b_3 \\ 0 & 0 & c_3 & a_4 \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from triangular-matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-06/page-1.svg)
## Arrays - The Foundation of MatricesThe `array` environment provides the most flexibility for creating custom matrix-like structures:### Basic Array Usage```latex array-basics.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Basic array with alignment $\begin{array}{crl} \text{center} & \text{right} & \text{left} \\ a + b & 12.34 & xyz \\ c & 5.6 & pqrs \end{array}$ % Array with vertical lines $\left[\begin{array}{c|cc|c} 1 & 2 & 3 & 4 \\ \hline 5 & 6 & 7 & 8 \end{array}\right]$ % Custom spacing $\begin{array}{r@{\,}c@{\,}l} x &=& 2y + 3z \\ 2x - y &=& 7 \\ x + 3y &=& 4z - 1 \end{array}$ % Mixed content $\begin{array}{|l|c|} \hline \text{Type} & \text{Matrix} \\ \hline \text{Identity} & \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \\ \hline \text{Zero} & \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix} \\ \hline \end{array}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from array-basics.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-07/page-1.svg)
### Array Column Specifiers| Specifier | Alignment | Description | | - | - | - | | `l` | Left | Left-aligned column | | `c` | Center | Centered column | | `r` | Right | Right-aligned column | | `p{width}` | Paragraph | Fixed width with text wrapping | | \` | \` | — | Vertical line between columns | | `@{text}` | — | Custom separator (replaces default spacing) | | `*{n}{spec}` | — | Repeat specifier n times |## Block MatricesBlock matrices are used to partition large matrices into smaller submatrices:### Basic Block Matrices```latex block-matrices.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Simple 2×2 block matrix $M = \begin{pmatrix} A & B \\ C & D \end{pmatrix}$ % With array for lines $\left[\begin{array}{c|c} A & B \\ \hline C & D \end{array}\right]$ % Detailed block matrix $\begin{pmatrix} \begin{matrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{matrix} & \begin{matrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{matrix} \\[1em] \begin{matrix} c_{11} & c_{12} \\ c_{21} & c_{22} \end{matrix} & \begin{matrix} d_{11} & d_{12} \\ d_{21} & d_{22} \end{matrix} \end{pmatrix}$ % Mixed size blocks $\begin{pmatrix} A_{2 \times 2} & \mathbf{b}_{2 \times 1} \\ \mathbf{c}_{1 \times 2} & d_{1 \times 1} \end{pmatrix} = \begin{pmatrix} \begin{matrix} a & b \\ c & d \end{matrix} & \begin{matrix} e \\ f \end{matrix} \\[0.5em] \begin{matrix} g & h \end{matrix} & i \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from block-matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-08/page-1.svg)
## Augmented MatricesAugmented matrices are commonly used for solving systems of linear equations:```latex augmented-matrices.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Basic augmented matrix $\left[\begin{array}{ccc|c} 1 & 2 & 3 & 6 \\ 4 & 5 & 6 & 15 \\ 7 & 8 & 9 & 24 \end{array}\right]$ % Row reduction example $\left[\begin{array}{rrr|r} 1 & 2 & -1 & 3 \\ 2 & -1 & 3 & 7 \\ -1 & 3 & 2 & 0 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{rrr|r} 1 & 2 & -1 & 3 \\ 0 & -5 & 5 & 1 \\ -1 & 3 & 2 & 0 \end{array}\right]$ % Extended augmentation $\left[\begin{array}{cc|c|cc} a & b & e & 1 & 0 \\ c & d & f & 0 & 1 \end{array}\right]$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from augmented-matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-09/page-1.svg)
## Matrix Operations### Basic Operations Notation```latex matrix-operations.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Matrix multiplication $AB = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} e & f \\ g & h \end{pmatrix} = \begin{pmatrix} ae + bg & af + bh \\ ce + dg & cf + dh \end{pmatrix}$ % Transpose $A^T = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}^T = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}$ % Inverse (2×2 formula) $A^{-1} = \begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{ad-bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$ % Matrix power $A^2 = AA = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}^2 = \begin{pmatrix} 7 & 10 \\ 15 & 22 \end{pmatrix}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrix-operations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-10/page-1.svg)
### Determinants and Traces```latex determinants.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % 2×2 determinant $\det(A) = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$ % 3×3 determinant $\begin{vmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{vmatrix}$ % Alternative notations $|A| = \det(A) = \det\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = -2$ % Trace $\text{tr}(A) = \sum_{i=1}^n a_{ii} = a_{11} + a_{22} + \cdots + a_{nn}$ % Example $\text{tr}\begin{pmatrix} 5 & 2 & 1 \\ 3 & 7 & 4 \\ 6 & 8 & 9 \end{pmatrix} = 5 + 7 + 9 = 21$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from determinants.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-11/page-1.svg)
## Small Inline MatricesFor matrices within text, use the `smallmatrix` environment:```latex inline-matrices.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Inline matrix in text The rotation matrix $\left(\begin{smallmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{smallmatrix}\right)$ rotates vectors by angle $\theta$. % Pauli matrices The Pauli matrices are $\sigma_x = \left(\begin{smallmatrix} 0 & 1 \\ 1 & 0 \end{smallmatrix}\right)$, $\sigma_y = \left(\begin{smallmatrix} 0 & -i \\ i & 0 \end{smallmatrix}\right)$, and $\sigma_z = \left(\begin{smallmatrix} 1 & 0 \\ 0 & -1 \end{smallmatrix}\right)$. % Custom command for convenience \newcommand{\mat}[1]{\left(\begin{smallmatrix}#1\end{smallmatrix}\right)} Then we can write $A = \mat{a & b \\ c & d}$ inline. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from inline-matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-12/page-1.svg)
## Advanced Techniques### Matrices with Labels```latex labeled-matrices.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \usepackage{blkarray} % For labeled matrices \begin{document} % Using array for labels $\begin{array}{c|ccc} & \text{Col 1} & \text{Col 2} & \text{Col 3} \\ \hline \text{Row 1} & a_{11} & a_{12} & a_{13} \\ \text{Row 2} & a_{21} & a_{22} & a_{23} \\ \text{Row 3} & a_{31} & a_{32} & a_{33} \end{array}$ % Using blkarray package $\begin{blockarray}{cccc} & x_1 & x_2 & x_3 \\ \begin{block}{c(ccc)} y_1 & 0.8 & 0.1 & 0.1 \\ y_2 & 0.2 & 0.7 & 0.1 \\ y_3 & 0.1 & 0.2 & 0.7 \\ \end{block} \end{blockarray}$ % Correlation matrix example $R = \begin{array}{c|ccc} & X & Y & Z \\ \hline X & 1.00 & 0.85 & 0.42 \\ Y & 0.85 & 1.00 & 0.67 \\ Z & 0.42 & 0.67 & 1.00 \end{array}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from labeled-matrices.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-13/page-1.svg)
### Matrix Decorations```latex matrix-decorations.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \usepackage{color} \begin{document} % Highlighting diagonal elements $\begin{pmatrix} \color{red}1 & 0 & 0 \\ 0 & \color{red}2 & 0 \\ 0 & 0 & \color{red}3 \end{pmatrix}$ % Boxed elements $\begin{pmatrix} \boxed{1} & 0 & 0 \\ 0 & \boxed{1} & 0 \\ 0 & 0 & \boxed{1} \end{pmatrix}$ % Matrix equation with decorations $\underbrace{\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix}}_{A} \underbrace{\begin{pmatrix} x \\ y \end{pmatrix}}_{\mathbf{x}} = \underbrace{\begin{pmatrix} 5 \\ 7 \end{pmatrix}}_{\mathbf{b}}$ % Annotated matrix $\left(\begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array}\right) \begin{array}{l} \leftarrow \text{row 1} \\ \leftarrow \text{row 2} \\ \leftarrow \text{row 3} \end{array}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from matrix-decorations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-matrices-14/page-1.svg)
## Common Pitfalls and Solutions> [accordion] My matrix delimiters are too small > > **Problem**: Parentheses/brackets don't scale with matrix size. > > **Solution**: Use `\left` and `\right` with array: > > ```latex example.tex theme=\{null} > $\left(\begin{array}{cc} > a & b \\ > c & d > \end{array}\right)$ > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-matrices-27/page-1.svg) >
> > Or use the pre-defined environments like `pmatrix` which handle this automatically.> [accordion] Alignment issues in matrices > > **Problem**: Numbers don't align properly in columns. > > **Solution**: > > 1. Use `array` with explicit alignment: `{rrr}` for right-aligned > 2. For decimals, use the `siunitx` package with `S` columns > 3. Add spacing with `\phantom{}` for consistent widths> [accordion] Matrix too wide for page > > **Problem**: Large matrices extend beyond margins. > > **Solutions**: > > 1. Use `\small` or `\footnotesize` before the matrix > 2. Use `bmatrix*}[r]` from `mathtools` for right-aligned entries > 3. Split into block matrices > 4. Consider using `array` environment with custom column spacing \> \[accordion] Spacing between matrix elements \> \> \*\*Problem\*\*: Elements too cramped or too spread out.\*\*Solution\*\*: Adjust array stretch:\`\`\`latex example.tex theme=\\\{null} \> \renewcommand\{\arraystretch}\{1.5} % 1.5x normal spacing \> \begin\{pmatrix} \> a & b \\\\ \> c & d \> \end\{pmatrix} \> \`\`\`\\\
\\\Expected effect\\\ \> \ \\> \\\\\\\[!NOTE] \> \\> \> \\> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\\\
## Best Practices> [!TIP] > > **Matrix typesetting guidelines:** > > 1. **Choose appropriate delimiters**: Use `vmatrix` for determinants, `pmatrix` for general matrices > 2. **Consistency**: Use the same notation style throughout your document > 3. **Size considerations**: Use `smallmatrix` for inline matrices > 4. **Alignment**: Right-align numbers in numeric matrices > 5. **Spacing**: Add `\,` or `\:` for better readability when needed > 6. **Block structure**: Use block matrices to show structure > 7. **Labels**: Add row/column labels when they aid understanding## Package Recommendations### Essential Packages| Package | Purpose | Key Features | | - | - | - | | `amsmath` | Basic matrix environments | All standard matrix types | | `mathtools` | Extended matrix features | Starred versions, more options | | `array` | Custom column types | Full control over layout | | `siunitx` | Numeric alignment | Decimal alignment in matrices | | `blkarray` | Block arrays | Labels and blocks | | `nicematrix` | Enhanced matrices | Many advanced features |### Loading Order```latex example.tex theme=\{null} \usepackage{amsmath} % Load first \usepackage{mathtools} % Extends amsmath \usepackage{array} % For custom columns \usepackage{siunitx} % For numeric columns ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Quick Reference Card### Matrix Environments Summary```latex example.tex theme=\{null} % Basic environments (requires amsmath) \begin{matrix} ... \end{matrix} % no delimiters \begin{pmatrix} ... \end{pmatrix} % parentheses ( ) \begin{bmatrix} ... \end{bmatrix} % brackets [ ] \begin{Bmatrix} ... \end{Bmatrix} % braces { } \begin{vmatrix} ... \end{vmatrix} % single bars | | \begin{Vmatrix} ... \end{Vmatrix} % double bars || || % Small matrices (inline) \begin{smallmatrix} ... \end{smallmatrix} % Custom delimiters with array \left[\begin{array}{cc} ... \end{array}\right] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Common Patterns```latex example.tex theme=\{null} % Identity matrix \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} % General element notation \begin{pmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1} & \cdots & a_{mn} \end{pmatrix} % Augmented matrix \left[\begin{array}{cc|c} a & b & e \\ c & d & f \end{array}\right] % Block matrix \begin{pmatrix} A & B \\ C & D \end{pmatrix} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Practice in LaTeX Cloud Studio> [card] Try matrices in the editor > > Test `pmatrix`, `bmatrix`, and augmented matrices in a live document and inspect the rendered output directly.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=matrices_open_app)> [card] Tables vs matrices > > Jump here when you need structured data layout rather than mathematical notation.[Open](/learn/latex/tables/creating-tables?utm_source=resources\&utm_medium=related_guide\&utm_campaign=docs_open_app\&utm_content=matrices_tables_guide)***## Related Topics> [card] Subscripts & Superscripts > > Matrix element notation with indices[Open](/learn/latex/mathematics/subscripts-superscripts)> [card] Mathematical Equations > > Multi-line equations and alignment[Open](/learn/latex/mathematics/equations)> [card] LaTeX Symbols Reference > > Greek letters and math operators[Open](/learn/reference/symbols)> [card] Advanced Mathematics > > Complex mathematical notation[Open](/learn/latex/mathematics/advanced-math)## Further Reading & ReferencesFor authoritative documentation on LaTeX matrix environments and mathematical typesetting:- **amsmath Package Documentation** - The standard package providing all matrix environments (pmatrix, bmatrix, vmatrix) - **mathtools Package** - Extended features for matrices including starred versions and additional options - **The LaTeX Companion (3rd Edition)** - Comprehensive reference for mathematical typesetting best practices - **Linear Algebra Done Right** by Sheldon Axler - Standard textbook demonstrating matrix notation conventions> [!NOTE] > > **Next steps**: > > * Learn about [Creating figures and images](/learn/latex/figures/inserting-images) > * Explore [Advanced mathematics](/learn/latex/mathematics/advanced-math) > * Master [Table creation](/learn/latex/tables/creating-tables) for data presentation> [!TIP] > > **LaTeX Cloud Studio** tip: Use our real-time preview feature to instantly see how your matrices render. No compilation wait time needed! # Operators and Spacing in LaTeX Math Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/operators-and-spacing Write clean mathematical notation with proper operators, spacing commands, and readable equation layout. Correct spacing improves equation readability.## Operator Commands```latex operators.tex theme=\{null} \sin x, \cos x, \log x, \exp x, \lim_{n\to\infty} a_n \operatorname{Var}(X) \DeclareMathOperator{\argmax}{arg\,max} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Spacing Commands```latex spacing.tex theme=\{null} a\,b \quad a\qquad b \; c \! d ```
Rendered output Open zoomable preview: Compiled PDF page 1 from spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-operators-and-spacing-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_operators_and_spacing)## Text In Math```latex text-math.tex theme=\{null} \text{if } x > 0, \text{ then } f(x)=x^2. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from text-math.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-operators-and-spacing-03/page-1.svg)
## Related Pages- [Mathematical expressions](/learn/latex/mathematics/mathematical-expressions) - [Align and multline environments](/learn/latex/mathematics/align-and-multline-environments) # Scientific Notation in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/science Master scientific and technical notation in LaTeX. Learn physics formulas, chemistry equations, units, and specialized scientific formatting. Learn to typeset scientific and technical documents with LaTeX. This guide covers physics, chemistry, units, and specialized notation used in scientific fields.> [!NOTE] > > **Prerequisites**: Familiarity with [basic mathematics](/learn/latex/mathematics/basics) in LaTeX. Knowledge of mathematical symbols is helpful.## Physics Notation### Fundamental Constants and Variables```latex physics-constants.tex theme=\{null} \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{siunitx} % For units \begin{document} % Common physics constants $c = \SI{3.0e8}{\meter\per\second}$ % Speed of light $h = \SI{6.626e-34}{\joule\second}$ % Planck constant $\hbar = \frac{h}{2\pi}$ % Reduced Planck constant $k_B = \SI{1.381e-23}{\joule\per\kelvin}$ % Boltzmann constant $e = \SI{1.602e-19}{\coulomb}$ % Elementary charge % Common variables $\vec{F}$ % Force vector $\vec{v}$ % Velocity vector $\vec{E}$ % Electric field $\vec{B}$ % Magnetic field $\mathbf{r}$ % Position vector \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from physics-constants.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-science-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_science)### Quantum Mechanics```latex quantum-mechanics.tex theme=\{null} % Dirac notation $\langle \psi | \phi \rangle$ % Inner product $| \psi \rangle$ % Ket $\langle \phi |$ % Bra $\langle \psi | \hat{H} | \phi \rangle$ % Expectation value % Schrödinger equation $i\hbar \frac{\partial}{\partial t} |\psi\rangle = \hat{H}|\psi\rangle$ % Wave function $\Psi(x,t) = A e^{i(kx - \omega t)}$ % Commutation relations $[\hat{x}, \hat{p}] = i\hbar$ $[\hat{L}_i, \hat{L}_j] = i\hbar\epsilon_{ijk}\hat{L}_k$ % Uncertainty principle $\Delta x \Delta p \geq \frac{\hbar}{2}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from quantum-mechanics.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-02/page-1.svg)
### Electromagnetism```latex electromagnetism.tex theme=\{null} % Maxwell's equations \begin{align} \nabla \cdot \vec{E} &= \frac{\rho}{\epsilon_0} \\ \nabla \cdot \vec{B} &= 0 \\ \nabla \times \vec{E} &= -\frac{\partial \vec{B}}{\partial t} \\ \nabla \times \vec{B} &= \mu_0 \vec{J} + \mu_0\epsilon_0\frac{\partial \vec{E}}{\partial t} \end{align} % Lorentz force $\vec{F} = q(\vec{E} + \vec{v} \times \vec{B})$ % Electromagnetic wave $\vec{E}(\vec{r},t) = \vec{E}_0 \cos(\vec{k} \cdot \vec{r} - \omega t + \phi)$ % Poynting vector $\vec{S} = \frac{1}{\mu_0} \vec{E} \times \vec{B}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from electromagnetism.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-03/page-1.svg)
### Thermodynamics and Statistical Mechanics```latex thermodynamics.tex theme=\{null} % First law of thermodynamics $dU = \delta Q - \delta W$ % Entropy $S = k_B \ln \Omega$ % Maxwell-Boltzmann distribution $f(v) = 4\pi n \left(\frac{m}{2\pi k_B T}\right)^{3/2} v^2 e^{-\frac{mv^2}{2k_B T}}$ % Partition function $Z = \sum_i e^{-\beta E_i}$ % Boltzmann factor $P_i \propto e^{-\beta E_i}$ where $\beta = \frac{1}{k_B T}$ % Heat capacity $C_V = \left(\frac{\partial U}{\partial T}\right)_V$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from thermodynamics.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-04/page-1.svg)
## Chemistry Notation### Chemical Formulas and Equations```latex chemistry.tex theme=\{null} \documentclass{article} \usepackage{chemfig} % For chemical structures \usepackage{mhchem} % For chemical equations \begin{document} % Simple molecules \ce{H2O} % Water \ce{CO2} % Carbon dioxide \ce{NH3} % Ammonia \ce{C6H12O6} % Glucose % Chemical reactions \ce{2H2 + O2 -> 2H2O} \ce{CaCO3 <=> CaO + CO2} \ce{A + B <<>> C + D} % Ions and charges \ce{Na+} \ce{Cl-} \ce{SO4^2-} \ce{NH4+} % Isotopes \ce{^{14}C} \ce{^{235}U} \ce{^{1}H} % Reaction conditions \ce{A + B ->[\Delta][catalyst] C + D} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Chemical Structures```latex chemical-structures.tex theme=\{null} \usepackage{chemfig} % Simple structures \chemfig{H-C(-[2]H)(-[6]H)-H} % Methane \chemfig{*6(=-=-=-)} % Benzene \chemfig{H-N(-H)-H} % Ammonia % More complex molecules \chemfig{[:30]*6((-=O)-N(-CH_3)-*5(-N=-N(-CH_3)-=)-=-=-=-)} % Reaction schemes \schemestart \chemfig{A} \arrow{->} \chemfig{B} \arrow{<=>} \chemfig{C} \schemestop ```
Rendered output Open zoomable preview: Compiled PDF page 1 from chemical-structures.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-06/page-1.svg)
### Spectroscopy```latex spectroscopy.tex theme=\{null} % NMR notation $^1$H NMR: $\delta$ \SI{7.26}{\ppm} $^{13}$C NMR: $\delta$ \SI{77.16}{\ppm} % IR frequencies $\tilde{\nu} = \SI{3000}{\per\centi\meter}$ % Wavenumber % UV-Vis $\lambda_{\max} = \SI{280}{\nano\meter}$ $\epsilon = \SI{1500}{\liter\per\mole\per\centi\meter}$ % Molar absorptivity % Mass spectrometry $m/z = 91$ % Mass-to-charge ratio $[\text{M}]^+ = 120$ % Molecular ion ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Units and Measurements### SI Units with siunitx```latex si-units.tex theme=\{null} \usepackage{siunitx} % Basic units \SI{10}{\meter} \SI{5.2}{\kilogram} \SI{3.7}{\second} \SI{298}{\kelvin} \SI{2.5}{\ampere} % Derived units \SI{9.8}{\meter\per\second\squared} % Acceleration \SI{101325}{\pascal} % Pressure \SI{4.18}{\joule\per\gram\per\kelvin} % Specific heat \SI{1.5}{\tesla} % Magnetic field % Powers of 10 \SI{6.022e23}{\per\mole} % Avogadro's number \SI{1.38e-23}{\joule\per\kelvin} % Boltzmann constant % Ranges \SIrange{10}{20}{\celsius} \SIrange{1e-3}{1e-6}{\meter} % Complex units \SI{2.5e-4}{\meter\squared\per\second} \SI{1.6e-19}{\joule\per\particle} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Unit Formatting Best Practices```latex unit-best-practices.tex theme=\{null} % Correct formatting The reaction proceeded at \SI{298}{\kelvin}. Pressure was maintained at \SI{1.5}{\bar}. The sample had a mass of \SI{2.5 \pm 0.1}{\gram}. % Avoid these common mistakes % Wrong: 298 K, 1.5 bar, 2.5±0.1 g % Right: Use siunitx as shown above % Scientific notation \num{6.022e23} particles per mole \SI{1.602e-19}{\coulomb} per electron % Percentages and ratios \SI{15}{\percent} yield \num{1:2:1} stoichiometric ratio ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Specialized Scientific Packages### Physics Package```latex physics-package.tex theme=\{null} \usepackage{physics} % Derivatives \dv{f}{x} % df/dx \dv[2]{f}{x} % d²f/dx² \pdv{f}{x} % ∂f/∂x \pdv{f}{x}{y} % ∂²f/∂x∂y % Integrals \int \dd{x} % Better spacing \int f(x) \dd{x} \int \dd[3]{r} % 3D integral % Operators \grad % Gradient \div % Divergence \curl % Curl \laplacian % Laplacian % Brackets \abs{x} % |x| \norm{v} % ||v|| \eval{f(x)}_a^b % Evaluated at limits % Commutators and anticommutators \comm{A}{B} % [A,B] \anticomm{A}{B} % {A,B} % Matrix elements \matrixel{n}{A}{m} % ⟨n|A|m⟩ \ev{A}{\psi} % ⟨ψ|A|ψ⟩ ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Chemistry Packages```latex chemistry-packages.tex theme=\{null} % mhchem for chemical equations \usepackage[version=4]{mhchem} \ce{H2SO4} % Sulfuric acid \ce{^{235}U} % Uranium-235 \ce{A + B -> C + D} % Reaction % chemfig for structures \usepackage{chemfig} \chemfig{H-C(-[2]H)(-[6]H)-H} % chemmacros for chemical symbols \usepackage{chemmacros} \pH % pH symbol \pOH % pOH symbol \Enthalpy{298} % Enthalpy at 298K \Entropy{298} % Entropy at 298K % chemformula alternative \usepackage{chemformula} \ch{H2O} % Water \ch{"\ox{+1,Na}" + "\ox{-1,Cl}" -> NaCl} % Oxidation states ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Mathematical Physics### Vector Calculus```latex vector-calculus.tex theme=\{null} % Vector operators \vec{\nabla} \cdot \vec{F} % Divergence \vec{\nabla} \times \vec{F} % Curl \nabla^2 \phi % Laplacian % Green's theorem \oint_C \vec{F} \cdot d\vec{r} = \iint_D (\nabla \times \vec{F}) \cdot \hat{n} \, dA % Gauss's theorem \iiint_V (\nabla \cdot \vec{F}) \, dV = \oiint_S \vec{F} \cdot \hat{n} \, dA % Stokes' theorem \oint_C \vec{F} \cdot d\vec{r} = \iint_S (\nabla \times \vec{F}) \cdot \hat{n} \, dA ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Tensor Notation```latex tensor-notation.tex theme=\{null} % Einstein notation $g_{\mu\nu} x^\mu x^\nu$ % Metric tensor $T^{\mu\nu}$ % Stress-energy tensor $R_{\mu\nu} - \frac{1}{2}Rg_{\mu\nu} = 8\pi G T_{\mu\nu}$ % Einstein field equation % Christoffel symbols $\Gamma^\lambda_{\mu\nu} = \frac{1}{2}g^{\lambda\rho}(\partial_\mu g_{\rho\nu} + \partial_\nu g_{\rho\mu} - \partial_\rho g_{\mu\nu})$ % Covariant derivative $\nabla_\mu V^\nu = \partial_\mu V^\nu + \Gamma^\nu_{\mu\lambda} V^\lambda$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tensor-notation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-13/page-1.svg)
## Laboratory and Experimental### Error Analysis```latex error-analysis.tex theme=\{null} % Measurements with uncertainty $m = \SI{2.45 \pm 0.05}{\gram}$ $T = \SI{298.2 \pm 0.3}{\kelvin}$ % Relative error $\frac{\Delta x}{x} = \SI{2.3}{\percent}$ % Error propagation $\Delta f = \sqrt{\left(\frac{\partial f}{\partial x}\Delta x\right)^2 + \left(\frac{\partial f}{\partial y}\Delta y\right)^2}$ % Statistical measures $\bar{x} = \frac{1}{n}\sum_{i=1}^n x_i$ % Mean $s = \sqrt{\frac{\sum_{i=1}^n (x_i - \bar{x})^2}{n-1}}$ % Standard deviation $\sigma_{\bar{x}} = \frac{s}{\sqrt{n}}$ % Standard error of mean ```
Rendered output Open zoomable preview: Compiled PDF page 1 from error-analysis.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-14/page-1.svg)
### Data Presentation```latex data-presentation.tex theme=\{null} % Significant figures \num{1.23e-4} % Scientific notation \num{1.234567} % Regular number % Tables with uncertainties \begin{tabular}{cS[table-format=3.2(2)]} \toprule Trial & {Mass (\si{\gram})} \\ \midrule 1 & 2.45(5) \\ 2 & 2.52(3) \\ 3 & 2.48(4) \\ \bottomrule \end{tabular} % Concentration notation $[\text{HCl}] = \SI{0.1}{\Molar}$ $c(\text{NaOH}) = \SI{0.05}{\mol\per\liter}$ ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Best Practices for Scientific Writing> [!TIP] > > **Scientific LaTeX guidelines:** > > 1. **Consistency**: Use the same notation throughout your document > 2. **Units**: Always use the `siunitx` package for proper unit formatting > 3. **Variables**: Use consistent fonts for variables (italic for scalars, bold for vectors) > 4. **Spacing**: Proper spacing around operators and in equations > 5. **Packages**: Load appropriate packages for your field (physics, mhchem, etc.) > 6. **Standards**: Follow field-specific conventions and style guides## Common Scientific Symbols```latex scientific-symbols.tex theme=\{null} % Physics $\hbar$ % Reduced Planck constant $\alpha$ % Fine structure constant $\mu_0$ % Permeability of free space $\epsilon_0$ % Permittivity of free space $\sigma$ % Stefan-Boltzmann constant % Chemistry $\Delta H$ % Enthalpy change $\Delta S$ % Entropy change $\Delta G$ % Gibbs free energy change $K_{\text{eq}}$ % Equilibrium constant $K_{\text{sp}}$ % Solubility product % Mathematics/Statistics $\sigma$ % Standard deviation $\mu$ % Population mean $\chi^2$ % Chi-squared $R^2$ % Coefficient of determination $p$ % p-value ```
Rendered output Open zoomable preview: Compiled PDF page 1 from scientific-symbols.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-science-16/page-1.svg)
## Quick Reference### Essential Packages```latex example.tex theme=\{null} \usepackage{amsmath,amssymb} % Mathematics \usepackage{siunitx} % Units and numbers \usepackage{physics} % Physics notation \usepackage{mhchem} % Chemistry \usepackage{chemfig} % Chemical structures \usepackage{booktabs} % Professional tables ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Common Templates| Field | Template Start | | - | - | | **Physics Paper** | `\documentclass{article}` + `amsmath` + `siunitx` + `physics` | | **Chemistry Paper** | `\documentclass{article}` + `amsmath` + `mhchem` + `chemfig` | | **Laboratory Report** | `\documentclass{report}` + `siunitx` + `booktabs` + `graphicx` | | **Thesis** | `\documentclass{book}` + all packages + `biblatex` |***> [!NOTE] > > **Next**: Learn about [Bibliography and citations](/learn/latex/bibliography-citations) for managing references in scientific documents. # Subscript in LaTeX: _, Braces, Superscripts, and Common Errors Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/subscripts-superscripts Write a subscript in LaTeX with `_` and a superscript with `^`. Use braces for multiple characters and fix double-subscript errors. To write a subscript in LaTeX, use `_` in math mode: `x_1`. Use `^` for a superscript: `x^2`. Braces are required when more than one character belongs in the lower or upper position, as in `x_{12}` or `x^{2n}`.> [!NOTE] > > **Copy-paste syntax**: `$x_1$`, `$x_{n+1}$`, `$x^2$`, and `$x^{2n}$`. Put the expression in math mode and group multi-character subscripts or superscripts with `{...}`. > > **Prerequisites**: Basic LaTeX knowledge. For math mode basics, see [Mathematical Expressions](/learn/latex/mathematics/mathematical-expressions). > > **Last updated**: April 2026 | **Reading time**: 12 min | **Difficulty**: Beginner to Intermediate## What You'll Learn- ✅ Basic LaTeX subscript and superscript syntax for mathematical notation - ✅ Multiple character subscripts and compound superscript expressions - ✅ Special cases (limits, operators, tensor notation) - ✅ Chemical formula subscript notation and isotopes - ✅ Advanced subscript positioning and formatting techniques - ✅ Common subscript errors and how to fix them - ✅ Best practices for readable mathematical notation## Frequently Asked Questions> [accordion] What is the difference between subscripts and superscripts in LaTeX? > > In LaTeX, **subscripts** are notations placed below the baseline using the underscore character (`_`), commonly used for indices and chemical formulas. **Superscripts** are placed above the baseline using the caret character (`^`), typically for exponents and powers. Both are essential for mathematical and scientific notation in professional documents. > > **Quick Example:** > > * Subscript: `x_1` renders as x₁ > * Superscript: `x^2` renders as x²> [accordion] How do I write multiple character subscripts in LaTeX? > > Always use braces `{}` to group multiple characters in a LaTeX subscript or superscript. Without braces, only the first character becomes a subscript.**Correct subscript syntax:**\`\`\`latex example.tex theme=\{null} > x_12 % Both 1 and 2 are subscript > x\_ % Entire expression is subscript > > ````\
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-01/page-1.svg) >
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_subscripts_superscripts) > **Wrong syntax:**```latex example.tex theme=\{null} > x_12 % Only 1 is subscript (renders as x₁2) > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
This is one of the most common subscript errors in LaTeX. > ````> [accordion] Why do I get a 'Double subscript' error in LaTeX? > > The "Double subscript" error occurs when you try to apply two subscripts to the same variable without proper grouping:\`\`\`latex example.tex theme=\{null} > x_a_b % ERROR: Double subscript > > ````\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Solutions:**1) Use nested braces if one subscript depends on another:```latex example.tex theme=\{null} > x_{a_b} % Correct: a has subscript b, all subscript to x > ```
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-04/page-1.svg) >
2. Or separate them with an empty group:```latex example.tex theme=\{null} > x_a{}_{b} % Correct: separate subscripts > ```
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-05/page-1.svg) >
> ````> [accordion] How do I use subscripts in chemical formulas? > > For chemical formula subscript notation, enclose the formula in `\mathrm{}` and use subscripts for atom counts: > > ```latex example.tex theme=\{null} > $\mathrm{H_2O}$ % Water > $\mathrm{SO_4^{2-}}$ % Sulfate ion > $^{14}\mathrm{C}$ % Carbon-14 isotope > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-06/page-1.svg) >
> > For better chemistry support, use the `mhchem` package: > > ```latex example.tex theme=\{null} > \usepackage{mhchem} > \ce{H2O} % Simpler syntax > \ce{SO4^{2-}} % Cleaner appearance > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-07/page-1.svg) >
> [accordion] What's the correct syntax for tensor notation subscripts? > > Tensor notation typically places superscripts before subscripts for contravariant and covariant indices: > > ```latex example.tex theme=\{null} > $T^{\mu\nu}_{\rho\sigma}$ % Standard tensor notation > $R^{\alpha}_{\beta\gamma\delta}$ % Riemann curvature tensor > $g_{\mu\nu}$ % Metric tensor > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-08/page-1.svg) >
> > The `tensor` package can simplify pre-superscripts and pre-subscripts in tensor notation.> [accordion] Can I use subscripts in LaTeX text mode (outside of equations)? > > Yes! Use `\textsubscript{}` and `\textsuperscript{}` commands for text mode subscript notation: > > ```latex example.tex theme=\{null} > H\textsubscript{2}O is water. > E = mc\textsuperscript{2} is Einstein's equation. > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-09/page-1.svg) >
> > Alternatively, use math mode notation within text: > > ```latex example.tex theme=\{null} > H$_2$O is water. > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-10/page-1.svg) >
> [accordion] How do I avoid deeply nested subscript errors? > > Avoid excessive subscript nesting beyond 2-3 levels, as it becomes hard to read: > > **Acceptable nesting:** > > ```latex example.tex theme=\{null} > $x_{i_j}$ % OK: two levels > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-11/page-1.svg) >
> > **Problematic nesting:** > > ```latex example.tex theme=\{null} > $x_{i_{j_{k}}}$ % Difficult to read and maintain > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-12/page-1.svg) >
> > **Best practice:** For complex notation, break expressions into parts for clarity.> [accordion] What's the best practice for mathematical indices in research papers? > > **Consistency guidelines for academic subscript notation:** > > 1. **Index naming:** Use consistent single letters (i, j, k) throughout > 2. **Coordinate systems:** Stick to one notation style consistently > 3. **Vector notation:** Use either subscripts or superscripts consistently > 4. **Summation indices:** Follow Einstein summation convention in physics > 5. **Semantic meaning:** Choose meaningful indices: `v_x` instead of `v_1` for x-component## Basic Syntax### Subscripts (Indices)```latex basic-subscripts.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Single character subscript $x_1$, $x_2$, $x_n$ % Multiple character subscript (requires braces) $x_{12}$, $x_{n+1}$, $x_{max}$ % Variables with subscripts $a_i$, $b_j$, $c_{ij}$ % Greek letters with subscripts $\alpha_1$, $\beta_{n}$, $\gamma_{i,j}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-subscripts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-13/page-1.svg)
> [card] Expected output > > **Single character:** $x_1$, $x_2$, $x_n$ > > **Multiple characters:** $x_{12}$, $x_{n+1}$, $x_{max}$ > > **Variables:** $a_i$, $b_j$, $c_{ij}$ > > **Greek letters:** $\alpha_1$, $\beta_{n}$, $\gamma_{i,j}$### Superscripts (Exponents)```latex basic-superscripts.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Single character superscript $x^2$, $x^n$, $x^*$ % Multiple character superscript (requires braces) $x^{10}$, $x^{2n}$, $x^{n+1}$ % Common exponents $e^x$, $2^n$, $10^{-3}$ % Special notations $x^{\prime}$, $x^{\dagger}$, $x^{\ast}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-superscripts.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-14/page-1.svg)
> [card] Expected output > > **Single character:** $x^2$, $x^n$, $x^*$ > > **Multiple characters:** $x^{10}$, $x^{2n}$, $x^{n+1}$ > > **Common exponents:** $e^x$, $2^n$, $10^{-3}$ > > **Special notations:** $x^{\prime}$, $x^{\dagger}$, $x^{\ast}$### Important Rule: Braces for Multiple Characters> [!WARNING] > > **Critical**: Without braces, only the first character after `_` or `^` becomes sub/superscript: > > * `x_12` renders as x₁2 (only 1 is subscript) > * `x_{12}` renders as x₁₂ (both 1 and 2 are subscript)## Combined Subscripts and Superscripts### Basic Combinations```latex combined-sub-super.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Both subscript and superscript $x_1^2$, $a_n^m$, $x_i^{j+1}$ % Order doesn't matter $x_1^2 = x^2_1$ % Complex combinations $x_{n+1}^{2m}$, $a_{ij}^{kl}$ % With operators $\sum_{i=1}^n$, $\int_0^{\infty}$ % Tensor notation $T_{\mu\nu}^{\rho\sigma}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from combined-sub-super.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-15/page-1.svg)
> [card] Expected output > > **Both subscript and superscript:** $x_1^2$, $a_n^m$, $x_i^{j+1}$ > > **Order doesn't matter:** $x_1^2 = x^2_1$ > > **Complex combinations:** $x_{n+1}^{2m}$, $a_{ij}^{kl}$ > > **With operators:** $\displaystyle\sum_{i=1}^n$, $\displaystyle\int_0^{\infty}$ > > **Tensor notation:** $T_{\mu\nu}^{\rho\sigma}$### Nested Subscripts and Superscripts```latex nested-sub-super.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Nested superscripts $x^{2^n}$, $e^{x^2}$, $2^{2^{2^2}}$ % Nested subscripts $x_{i_j}$, $a_{n_{k+1}}$ % Mixed nesting $x_i^{j^k}$, $a_{m_n}^{p^q}$ % Using additional braces for clarity ${(x^2)}^3 = x^6$ % Tower notation $2^{2^{2^{\cdot^{\cdot^{\cdot}}}}}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from nested-sub-super.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-16/page-1.svg)
The preview demonstrates every nesting pattern from the source in one compiled page. Prefer the shallowest notation that communicates the structure, and add braces explicitly at each level so the grouping remains readable and maintainable.## Special Use Cases### Limits and Operators```latex limits-operators.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Inline limits $\lim_{x \to 0} f(x)$ % Display style limits \[\lim_{x \to \infty} \frac{1}{x} = 0\] % Summation \[\sum_{i=1}^{n} i = \frac{n(n+1)}{2}\] % Product \[\prod_{k=1}^{n} k = n!\] % Integration \[\int_0^1 x^2 \, dx = \frac{1}{3}\] % Multiple limits \[\lim_{\substack{x \to 0 \\ y \to 0}} f(x,y)\] \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from limits-operators.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-17/page-1.svg)
The compiled result above shows the important layout difference: inline limits keep their condition beside the operator, while display-style limits, sums, products, integrals, and multi-line conditions place their scripts in the conventional display positions. Use the source and preview together to compare the exact input with the typeset result.### Chemical Formulas```latex chemical-formulas.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \usepackage{mhchem} % Better chemistry support \begin{document} % Basic chemical formulas $\mathrm{H_2O}$, $\mathrm{CO_2}$, $\mathrm{H_2SO_4}$ % Isotopes $^{14}\mathrm{C}$, $^{235}\mathrm{U}$, $^2\mathrm{H}$ % Ions $\mathrm{Na^+}$, $\mathrm{Cl^-}$, $\mathrm{SO_4^{2-}}$ % With mhchem package (recommended) \ce{H2O}, \ce{CO2}, \ce{H2SO4} \ce{^{14}C}, \ce{Na+}, \ce{SO4^{2-}} % Chemical equations \ce{2H2 + O2 -> 2H2O} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from chemical-formulas.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-18/page-1.svg)
> [card] Expected output > > **Basic chemical formulas:** $\mathrm{H_2O}$, $\mathrm{CO_2}$, $\mathrm{H_2SO_4}$ > > **Isotopes:** $^{14}\mathrm{C}$, $^{235}\mathrm{U}$, $^{2}\mathrm{H}$ > > **Ions:** $\mathrm{Na^+}$, $\mathrm{Cl^-}$, $\mathrm{SO_4^{2-}}$ > > **Chemical equation:** $2\mathrm{H_2} + \mathrm{O_2} \rightarrow 2\mathrm{H_2O}$### Physics and Engineering Notation```latex physics-notation.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \usepackage{tensor} % For tensor notation \begin{document} % Vector components $\vec{v} = v_x\hat{i} + v_y\hat{j} + v_z\hat{k}$ % Derivatives $\frac{d^2y}{dx^2}$, $\frac{\partial^2 f}{\partial x^2}$ % Tensors $g_{\mu\nu}$, $R^{\alpha}_{\beta\gamma\delta}$ % Four-vectors $x^\mu = (ct, x, y, z)$ % Christoffel symbols $\Gamma^{\lambda}_{\mu\nu}$ % Units $10^{-9}\,\mathrm{m}$, $3.0 \times 10^8\,\mathrm{m/s}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from physics-notation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-19/page-1.svg)
> [card] Expected output > > **Vector components:** $\vec{v} = v_x\hat{i} + v_y\hat{j} + v_z\hat{k}$ > > **Derivatives:** $\frac{d^2y}{dx^2}$, $\frac{\partial^2 f}{\partial x^2}$ > > **Tensors:** $g_{\mu\nu}$, $R^{\alpha}_{\beta\gamma\delta}$ > > **Four-vectors:** $x^\mu = (ct, x, y, z)$ > > **Christoffel symbols:** $\Gamma^{\lambda}_{\mu\nu}$ > > **Units:** $10^{-9}\,\mathrm{m}$, $3.0 \times 10^8\,\mathrm{m/s}$## Advanced Techniques### Primes and Multiple Primes```latex primes.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Single prime $f'(x)$, $y'$ % Multiple primes $f''(x)$, $f'''(x)$ % Alternative notation $f^{\prime}(x)$, $f^{\prime\prime}(x)$ % With subscripts $x'_1$, $x''_n$ % Prime on subscript $x_{n'}$, $x_{n''}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from primes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-20/page-1.svg)
> [card] Expected output > > **Single prime:** $f'(x)$, $y'$ > > **Multiple primes:** $f''(x)$, $f'''(x)$ > > **Alternative notation:** $f^{\prime}(x)$, $f^{\prime\prime}(x)$ > > **With subscripts:** $x'_1$, $x''_n$ > > **Prime on subscript:** $x_{n'}$, $x_{n''}$### Positioning and Spacing```latex positioning.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Pre-subscripts and superscripts ${}_a^b X_c^d$ % Tensor notation with prescript package \usepackage{tensor} \tensor[^a_b]{X}{_c^d} % Manual spacing adjustments $x_{\!n}$ % negative thin space $x_{\,n}$ % thin space $x_{\:n}$ % medium space $x_{\;n}$ % thick space % Phantom subscripts for alignment \begin{align} x_1 &= a \\ x_{\phantom{1}2} &= b \end{align} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
### Accents with Sub/Superscripts```latex accents-sub-super.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Accents with subscripts $\hat{x}_i$, $\tilde{y}_n$, $\bar{z}_k$ % Accents with superscripts $\hat{x}^2$, $\vec{v}^T$, $\dot{x}^n$ % Combined $\hat{x}_i^2$, $\tilde{\phi}_{nm}^{kl}$ % Wide accents $\widehat{xyz}_1^2$, $\widetilde{ABC}_{ij}$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from accents-sub-super.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-22/page-1.svg)
> [card] Expected output > > **Accents with subscripts:** $\hat{x}_i$, $\tilde{y}_n$, $\bar{z}_k$ > > **Accents with superscripts:** $\hat{x}^2$, $\vec{v}^T$, $\dot{x}^n$ > > **Combined:** $\hat{x}_i^2$, $\tilde{\phi}_{nm}^{kl}$ > > **Wide accents:** $\widehat{xyz}_1^2$, $\widetilde{ABC}_{ij}$## Text Mode Subscripts and Superscripts```latex text-mode.tex theme=\{null} \documentclass{article} \usepackage{fixltx2e} % For \textsubscript \begin{document} % In text mode H\textsubscript{2}O is water. E = mc\textsuperscript{2} is Einstein's equation. % Or use math mode H$_2$O is water. E = mc$^2$ is Einstein's equation. % Ordinals 1\textsuperscript{st}, 2\textsuperscript{nd}, 3\textsuperscript{rd} % Footnote markers Text\textsuperscript{a}, Reference\textsuperscript{1} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from text-mode.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-23/page-1.svg)
> [card] Expected output > > **In text mode:** H$_2$O is water. E = mc$^2$ is Einstein's equation. > > **Ordinals:** 1$^{\text{st}}$, 2$^{\text{nd}}$, 3$^{\text{rd}}$ > > **Footnote markers:** Text$^{\text{a}}$, Reference$^1$## Common Errors and Solutions> [accordion] Error: Double subscript > > **Problem**: `x_a_b` causes "Double subscript" error. > > **Solution**: Use braces to clarify structure: > > ```latex example.tex theme=\{null} > x_{a_b} % a with subscript b, all subscript to x > x_a{}_{b} % separate subscripts a and b > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-24/page-1.svg) >
> [accordion] Only first character is sub/superscript > > **Problem**: `x_12` shows as x₁2 instead of x₁₂. > > **Solution**: Always use braces for multiple characters: > > ```latex example.tex theme=\{null} > x_{12} % Correct > x_12 % Wrong > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-25/page-1.svg) >
> [accordion] Subscripts in limit are inline > > **Problem**: Limits appear cramped in inline math. > > **Solution**: Use display style or `\limits`: > > ```latex example.tex theme=\{null} > $\lim\limits_{x \to 0}$ % Forces display style > \[\lim_{x \to 0}\] % Use display math > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-26/page-1.svg) >
> [accordion] Prime notation conflicts > > **Problem**: `x'^2` doesn't work as expected. > > **Solution**: Use proper grouping: > > ```latex example.tex theme=\{null} > {x'}^2 % Correct > x'^2 % May cause issues > x^{\prime 2} % Alternative > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-27/page-1.svg) >
## Best Practices### 1. Readability Guidelines> [!TIP] > > **Good Practices:** > > * Use meaningful subscripts: `v_x` not `v_1` for x-component > * Avoid deep nesting: `x_{i_j}` is okay, deeper is confusing > * Be consistent: If using `i,j,k` for indices, stick to it > * Use semantic notation: `\max` not `max`> [!WARNING] > > **Poor Practices to Avoid:** > > * Overusing sub/superscripts: `x_{a_{b_{c_{d}}}}` > * Mixing notation styles in same document > * Using subscripts for non-mathematical text > * Forgetting braces: `x_min` instead of `x_{min}`### 2. Consistency Rules* **Indices**: Use consistent letters (i, j, k or m, n, p) * **Coordinates**: Be consistent (x, y, z or r, θ, φ) * **Time derivatives**: Choose notation and stick to it (ẋ or dx/dt) * **Vector components**: Consistent notation (subscripts or superscripts)### 3. Special Notation Standards```latex standard-notations.tex theme=\{null} % Tensors - superscripts before subscripts $T^{\mu\nu}_{\rho\sigma}$ % Correct $T_{\rho\sigma}^{\mu\nu}$ % Less standard % Derivatives - use consistent notation $\frac{\partial^2 f}{\partial x^2}$ % Standard $f_{xx}$ % Alternative % Units - use upright text $10^{-3}\,\mathrm{m}$ % Correct $10^{-3}\,m$ % Wrong (italic m) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from standard-notations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-subscripts-superscripts-28/page-1.svg)
### 4. Accessibility Considerations- Avoid excessive nesting that's hard to read - Use `\text{}` for words in subscripts: `x_{\text{max}}` - Consider alternative notations for complex expressions - Break very complex expressions into parts## Quick Reference Card| Command | Result | Description | | - | - | - | | `x_1` | $x_1$ | Single subscript | | `x^2` | $x^2$ | Single superscript | | `x_{12}` | $x_{12}$ | Multiple character subscript | | `x^{2n}` | $x^{2n}$ | Multiple character superscript | | `x_i^j` | $x_i^j$ | Combined sub/superscript | | `\sum_{i=1}^n` | $\displaystyle\sum_{i=1}^n$ | Summation limits | | `\lim_{x \to 0}` | $\displaystyle\lim_{x \to 0}$ | Limit notation | | `f'(x)` | $f'(x)$ | Prime notation | | `{}_{a}^{b}X_{c}^{d}` | ${}_a^b X_c^d$ | Pre-superscript/subscript | | `\textsubscript{2}` | H$_2$O | Text mode subscript | | `^{14}\mathrm{C}` | $^{14}\mathrm{C}$ | Isotope notation | | `T^{\mu\nu}_{\rho}` | $T^{\mu\nu}_{\rho}$ | Tensor notation |## Related Topics> [card] Mathematical Expressions > > Basic math mode and LaTeX subscript expressions[Open](/learn/latex/mathematics/mathematical-expressions)> [card] Equations Guide > > Multi-line and numbered equations[Open](/learn/latex/mathematics/equations)> [card] Matrices & Arrays > > Matrix notation with subscript indices[Open](/learn/latex/mathematics/matrices)> [card] LaTeX Symbols Reference > > Complete symbol reference for subscripts[Open](/learn/reference/symbols)> [card] Chemistry Notation > > Chemical formula subscript notation[Open](/learn/latex/specialized-notation/chemistry)> [card] Physics Notation > > Physics symbols and tensor notation[Open](/learn/latex/specialized-notation/physics)## Further Reading & ReferencesFor authoritative documentation on LaTeX subscript and superscript handling:- **amsmath Package Documentation** - The standard package for advanced mathematical notation, including enhanced subscript positioning - **The LaTeX Companion (3rd Edition)** - Comprehensive reference for mathematical typesetting best practices - **ISO 80000-2** - International standard for mathematical notation in scientific documents## Try Subscripts and Superscripts> [card] Open a math example > > Paste the examples into a project and compile them to check braces, combined indices, and common error fixes.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=subscripts_open_app)> [card] See the online LaTeX editor > > Review the browser editor workflow on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=subscripts_online_editor) page before starting a math-heavy document. # LaTeX Math Symbols Guide: operators, relations, arrows, and sets Source: https://resources.latex-cloud-studio.com/learn/latex/mathematics/symbols Learn how to use LaTeX math symbols, which packages provide them, and when to use different operators, relations, arrows, and set commands. This page explains how LaTeX math symbols are grouped and used. It focuses on operators, relations, arrows, set notation, delimiter choices, and package requirements rather than acting as a long copy-and-paste list.> [!NOTE] > > **Use this page for**: understanding which symbol command to choose, which package adds it, and how different symbol families are usually used. > > **Need a searchable list instead?** Use the [LaTeX symbols list](/learn/reference/symbols) when you only want to find a command and copy it.## Use This Guide When| You need... | Best page | | - | - | | A command list you can scan quickly | [LaTeX symbols list](/learn/reference/symbols) | | An explanation of operators, relations, arrows, and sets | This page | | Package guidance for missing symbols | This page | | A symbol reference you can search with `Ctrl+F` | [LaTeX symbols list](/learn/reference/symbols) |## Quick Symbol Reference### Common Mathematical Symbols| Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **+** | `+` | **-** | `-` | | **×** | `\times` | **÷** | `\div` | | **±** | `\pm` | **∓** | `\mp` | | **·** | `\cdot` | **∗** | `\ast` | | **⋆** | `\star` | **∘** | `\circ` | | **⊕** | `\oplus` | **⊖** | `\ominus` | | **⊗** | `\otimes` | **⊘** | `\oslash` | | **=** | `=` | **≠** | `\neq` | | **\<** | `<` | **>** | `>` | | **≤** | `\leq` | **≥** | `\geq` | | **≪** | `\ll` | **≫** | `\gg` | | **≈** | `\approx` | **∼** | `\sim` | | **≃** | `\simeq` | **≅** | `\cong` | | **≡** | `\equiv` | **∝** | `\propto` |### Set Theory and Logic Symbols| Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **∈** | `\in` | **∉** | `\notin` | | **⊂** | `\subset` | **⊆** | `\subseteq` | | **⊃** | `\supset` | **⊇** | `\supseteq` | | **∪** | `\cup` | **∩** | `\cap` | | **∅** | `\emptyset` | **∅** | `\varnothing` | | **∀** | `\forall` | **∃** | `\exists` | | **∄** | `\nexists` | **∴** | `\therefore` | | **∵** | `\because` | **⇒** | `\implies` | | **⇔** | `\iff` | **¬** | `\neg` | | **∧** | `\land` | **∨** | `\lor` |### Calculus and Analysis| Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **∑** | `\sum` | **∏** | `\prod` | | **∫** | `\int` | **∮** | `\oint` | | **∂** | `\partial` | **∇** | `\nabla` | | **∞** | `\infty` | **lim** | `\lim` | | **→** | `\to` | **→** | `\rightarrow` | | **⇒** | `\Rightarrow` | **⇔** | `\Leftrightarrow` |## Mathematical Operators### Basic Arithmetic Operators```latex basic-operators.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Standard operators $a + b - c \times d \div e$ % Alternative multiplication $a \cdot b$ or $a \ast b$ or $a \star b$ % Plus/minus and minus/plus $x = a \pm b$, $y = c \mp d$ % Advanced operators $a \oplus b \ominus c \otimes d \oslash e$ % Fractions and ratios $\frac{a}{b}$, $a/b$, $a:b$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-operators.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_mathematics_symbols)### Binary Operators```latex binary-operators.tex theme=\{null} % Set operations $A \cup B$ (union) $A \cap B$ (intersection) $A \setminus B$ (set difference) $A \triangle B$ (symmetric difference) % Logic operations $p \land q$ or $p \wedge q$ (and) $p \lor q$ or $p \vee q$ (or) $\neg p$ or $\lnot p$ (not) $p \oplus q$ (exclusive or) % Other binary operators $a \circ b$ (composition) $a \bullet b$ (bullet) $a \diamond b$ (diamond) $a \Box b$ (box) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > **Union:** $A \cup B$ > > **Intersection:** $A \cap B$ > > **Logical and:** $p \land q$### Large Operators```latex large-operators.tex theme=\{null} % Summation $\sum_{i=1}^{n} a_i$ $\displaystyle\sum_{i=1}^{n} a_i$ % Larger in inline % Product $\prod_{i=1}^{n} a_i$ % Integrals $\int_a^b f(x)\,dx$ $\iint_D f(x,y)\,dA$ $\iiint_V f(x,y,z)\,dV$ $\oint_C F \cdot dr$ % Unions and intersections $\bigcup_{i=1}^{n} A_i$ $\bigcap_{i=1}^{n} A_i$ % Other large operators $\coprod$ (coproduct) $\bigoplus$ (direct sum) $\bigotimes$ (tensor product) $\bigvee$ (join) $\bigwedge$ (meet) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from large-operators.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-03/page-1.svg)
> [card] Expected output > > **Summation:** $\displaystyle\sum_{i=1}^{n} a_i$ > > **Integral:** $\displaystyle\int_a^b f(x)\,dx$ > > **Big union:** $\displaystyle\bigcup_{i=1}^{n} A_i$## Relations and Comparisons### Basic Relations```latex relations.tex theme=\{null} \documentclass{article} \usepackage{amssymb} \begin{document} % Equality and inequality $a = b$, $a \neq b$ or $a \ne b$ % Comparisons $a < b$, $a > b$ $a \leq b$ or $a \le b$ $a \geq b$ or $a \ge b$ % Much less/greater $a \ll b$, $a \gg b$ % Approximately equal $a \approx b$ (approximately) $a \simeq b$ (similar equal) $a \sim b$ (similar) $a \cong b$ (congruent) % Equivalence $a \equiv b$ (equivalent) $a \triangleq b$ (defined as) \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from relations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-04/page-1.svg)
### Set Relations```latex set-relations.tex theme=\{null} % Membership $x \in A$ (element of) $x \notin A$ (not element of) $A \ni x$ (contains) % Subset relations $A \subset B$ (proper subset) $A \subseteq B$ (subset or equal) $A \supset B$ (proper superset) $A \supseteq B$ (superset or equal) % Special subsets $A \sqsubset B$ (square subset) $A \sqsubseteq B$ $A \subsetneq B$ (subset not equal) % Parallel and perpendicular $a \parallel b$ $a \perp b$ ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Advanced Relations```latex advanced-relations.tex theme=\{null} % Proportional and asymptotic $y \propto x$ (proportional to) $f(x) \asymp g(x)$ (asymptotic) % Order relations $a \prec b$ (precedes) $a \preceq b$ (precedes or equal) $a \succ b$ (succeeds) $a \succeq b$ (succeeds or equal) % Other relations $a \models b$ (models) $a \vdash b$ (proves) $a \dashv b$ (reverse proves) $a \smile b$ (smile) $a \frown b$ (frown) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from advanced-relations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-06/page-1.svg)
## Arrows### Basic Arrows```latex basic-arrows.tex theme=\{null} % Single arrows $\rightarrow$ or $\to$ $\leftarrow$ or $\gets$ $\leftrightarrow$ $\uparrow$, $\downarrow$ $\updownarrow$ % Double arrows $\Rightarrow$ (implies) $\Leftarrow$ (implied by) $\Leftrightarrow$ or $\iff$ (if and only if) $\Uparrow$, $\Downarrow$ $\Updownarrow$ % Long arrows $\longrightarrow$ $\longleftarrow$ $\longleftrightarrow$ $\Longrightarrow$ $\Longleftarrow$ $\Longleftrightarrow$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-arrows.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-07/page-1.svg)
### Special Arrows```latex special-arrows.tex theme=\{null} % Maps to $f: A \to B$ or $f: A \rightarrow B$ $x \mapsto f(x)$ $x \longmapsto f(x)$ % Hooked arrows $\hookrightarrow$ (injection) $\hookleftarrow$ % Two-headed arrows $\twoheadrightarrow$ (surjection) $\twoheadleftarrow$ % Harpoons $\rightharpoonup$, $\rightharpoondown$ $\leftharpoonup$, $\leftharpoondown$ $\rightleftharpoons$ % Diagonal arrows $\nearrow$ (northeast) $\searrow$ (southeast) $\swarrow$ (southwest) $\nwarrow$ (northwest) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Delimiters### Brackets and Parentheses```latex delimiters.tex theme=\{null} \documentclass{article} \usepackage{amsmath} \begin{document} % Basic delimiters $(a + b)$ $[a + b]$ $\{a + b\}$ $\langle a, b \rangle$ % Floor and ceiling $\lfloor x \rfloor$ (floor) $\lceil x \rceil$ (ceiling) % Absolute value and norm $|x|$ or $\lvert x \rvert$ $\|x\|$ or $\lVert x \rVert$ % Automatic sizing $\left( \frac{a}{b} \right)$ $\left[ \sum_{i=1}^{n} a_i \right]$ $\left\{ x : x > 0 \right\}$ % Manual sizing $\big( \Big( \bigg( \Bigg($ $\big] \Big] \bigg] \Bigg]$ \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from delimiters.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-09/page-1.svg)
### Advanced Delimiters```latex advanced-delimiters.tex theme=\{null} % Mixed delimiters $\left( a, b \right]$ (half-open interval) $\left[ a, b \right)$ % Invisible delimiters $\left. \frac{df}{dx} \right|_{x=0}$ % Multiple sizes \begin{align} &\text{Small: } (x) \\ &\text{big: } \big(x\big) \\ &\text{Big: } \Big(x\Big) \\ &\text{bigg: } \bigg(x\bigg) \\ &\text{Bigg: } \Bigg(x\Bigg) \end{align} % Angle brackets for inner products $\langle x, y \rangle$ $\langle x \mid y \rangle$ % Quantum mechanics ```
Rendered output Open zoomable preview: Compiled PDF page 1 from advanced-delimiters.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-10/page-1.svg)
## Greek Letters Extended### Variant Forms```latex greek-variants.tex theme=\{null} % Standard vs variant forms $\epsilon$ vs $\varepsilon$ $\theta$ vs $\vartheta$ $\pi$ vs $\varpi$ $\rho$ vs $\varrho$ $\sigma$ vs $\varsigma$ $\phi$ vs $\varphi$ % Bold Greek (requires bm package) \usepackage{bm} $\bm{\alpha}$, $\bm{\beta}$, $\bm{\Omega}$ % Upright Greek (requires upgreek) \usepackage{upgreek} $\upalpha$, $\upbeta$, $\upgamma$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from greek-variants.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-11/page-1.svg)
## Special Notation### Dots and Accents```latex dots-accents.tex theme=\{null} % Dots $a_1 + a_2 + \cdots + a_n$ (centered dots) $a_1, a_2, \ldots, a_n$ (low dots) $\vdots$ (vertical dots) $\ddots$ (diagonal dots) % Over and under dots $\dot{x}$ (first derivative) $\ddot{x}$ (second derivative) $\dddot{x}$ (third derivative) $\ddddot{x}$ (fourth derivative) % Accents $\hat{a}$ (hat) $\check{a}$ (check) $\tilde{a}$ (tilde) $\acute{a}$ (acute) $\grave{a}$ (grave) $\bar{a}$ (bar) $\vec{a}$ (vector) $\breve{a}$ (breve) % Wide accents $\widehat{ABC}$ $\widetilde{xyz}$ $\overline{a + b}$ $\underline{a + b}$ ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Over and Under Operations```latex over-under.tex theme=\{null} % Overbraces and underbraces $\overbrace{a + b + c}^{\text{sum}}$ $\underbrace{x \cdot x \cdot x}_{n \text{ times}}$ % Overlining and underlining $\overline{AB}$ (line segment) $\underline{important}$ % Stacking $\overset{?}{=}$ (question over equals) $\underset{n \to \infty}{\lim}$ (limit notation) $\overset{def}{=}$ (defined as) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from over-under.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-13/page-1.svg)
## Mathematical Alphabets### Special Font Commands```latex math-alphabets.tex theme=\{null} % Blackboard bold (requires amssymb) $\mathbb{N}$ (natural numbers) $\mathbb{Z}$ (integers) $\mathbb{Q}$ (rationals) $\mathbb{R}$ (reals) $\mathbb{C}$ (complex) % Calligraphic $\mathcal{A}$, $\mathcal{B}$, $\mathcal{L}$ % Fraktur (requires amssymb) $\mathfrak{a}$, $\mathfrak{g}$, $\mathfrak{H}$ % Script (requires mathrsfs) \usepackage{mathrsfs} $\mathscr{A}$, $\mathscr{F}$, $\mathscr{L}$ % Bold $\mathbf{x}$, $\mathbf{A}$ $\boldsymbol{\alpha}$ (bold Greek) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Spacing in Math Mode### Manual Spacing```latex math-spacing.tex theme=\{null} % Spacing commands $ab$ (no space) $a\,b$ (thin space) $a\:b$ (medium space) $a\;b$ (thick space) $a\quad b$ (quad space) $a\qquad b$ (double quad) % Negative spacing $a\!b$ (negative thin space) % Common uses $\int f(x)\,dx$ (before dx) $n\text{-}th$ (hyphen in text) $5\,\text{cm}$ (before units) % Text in math $x \in \mathbb{R} \text{ such that } x > 0$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-15/page-1.svg)
## Common Symbol Combinations### Physics Notation```latex physics-symbols.tex theme=\{null} % Derivatives $\frac{d}{dx}$, $\frac{\partial}{\partial x}$ $\nabla$ (gradient) $\nabla \cdot$ (divergence) $\nabla \times$ (curl) $\Box$ or $\square$ (d'Alembertian) % Quantum mechanics $\hbar$ (reduced Planck constant) $\langle \psi | \phi \rangle$ (inner product) $| \psi \rangle$ (ket) $\langle \phi |$ (bra) % Units $^\circ$ (degree) $\AA$ (Angstrom) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from physics-symbols.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-16/page-1.svg)
### Statistics and Probability```latex statistics-symbols.tex theme=\{null} % Probability $P(A \mid B)$ (conditional) $\mathbb{E}[X]$ (expectation) $\text{Var}(X)$ (variance) $X \sim N(\mu, \sigma^2)$ (distribution) % Statistics $\bar{x}$ (mean) $\hat{\theta}$ (estimator) $s^2$ (sample variance) $r$ (correlation) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from statistics-symbols.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-mathematics-symbols-17/page-1.svg)
## Best Practices> [!TIP] > > **Symbol usage guidelines:** > > 1. **Consistency**: Use the same notation throughout your document > 2. **Standards**: Follow field-specific conventions > 3. **Clarity**: Define non-standard symbols > 4. **Spacing**: Use proper spacing around operators > 5. **Size**: Use `\displaystyle` in important inline formulas > 6. **Packages**: Load necessary packages (amsmath, amssymb)## Troubleshooting> [!WARNING] > > **Common symbol issues:** > > 1. **Missing symbols**: Add `\usepackage{amssymb}` > 2. **Wrong size**: Use `\displaystyle` or display math > 3. **Spacing issues**: Use manual spacing commands > 4. **Font issues**: Check if special packages needed > 5. **Encoding**: Use `\usepackage[utf8]{inputenc}`## Quick Reference Card### Essential Symbols| Category | Symbols | | - | - | | **Greek** | `\alpha \beta \gamma \delta \epsilon \theta \lambda \mu \pi \sigma \phi \omega` | | **Operators** | `\sum \prod \int \cup \cap \oplus \otimes` | | **Relations** | `\leq \geq \neq \approx \equiv \sim \subset \in` | | **Arrows** | `\to \gets \leftrightarrow \Rightarrow \mapsto` | | **Delimiters** | `\{ \} \langle \rangle \lfloor \rfloor` | | **Accents** | `\hat{} \tilde{} \bar{} \vec{} \dot{}` |***> [!NOTE] > > **Next**: Master [Matrices and arrays](/learn/latex/mathematics/matrices) for structured mathematical layouts, or explore [Scientific notation](/learn/latex/mathematics/science) for physics and chemistry. # LaTeX Package Management Source: https://resources.latex-cloud-studio.com/learn/latex/package-management Learn to find, install, and manage LaTeX packages. Understand CTAN, package documentation, troubleshooting conflicts, and best practices. Master LaTeX package management to extend your documents with powerful features. This guide covers package discovery, installation, usage, and troubleshooting.> [!NOTE] > > **Good news**: LaTeX Cloud Studio includes all major packages pre-installed. You can focus on using packages rather than installing them!## Understanding LaTeX Packages### What Are Packages?Packages extend LaTeX's core functionality by providing:- Additional commands and environments - New document classes - Enhanced formatting options - Specialized symbols and fonts - Integration with external tools```latex package-basics.tex theme=\{null} % Loading packages in the preamble \documentclass{article} % Essential packages \usepackage[utf8]{inputenc} % Input encoding \usepackage[T1]{fontenc} % Font encoding \usepackage[english]{babel} % Language support \usepackage{graphicx} % Graphics inclusion \usepackage{amsmath} % Enhanced mathematics % Packages with options \usepackage[margin=1in]{geometry} % Page layout \usepackage[style=authoryear]{biblatex} % Bibliography \usepackage[table,xcdraw]{xcolor} % Colors \begin{document} % Package commands now available \includegraphics{image.png} % From graphicx \textcolor{blue}{Blue text} % From xcolor \begin{align} % From amsmath E &= mc^2 \end{align} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Package Categories> [card] Core Extensions > > **amsmath, amssymb, graphicx, geometry** > Essential packages that most documents need> [card] Specialized Tools > > **tikz, minted, algorithm2e, chemfig** > Domain-specific packages for specialized content> [card] Formatting & Style > > **fancyhdr, titlesec, enumitem, booktabs** > Packages that enhance document appearance> [card] Language & Fonts > > **babel, fontspec, polyglossia, microtype** > Internationalization and typography## Finding Packages### CTAN: The Comprehensive TeX Archive Network```latex finding-packages.tex theme=\{null} % CTAN is the central repository for LaTeX packages % Visit: https://ctan.org % Common search strategies: % 1. Browse by topic: https://ctan.org/topics % 2. Search by name: https://ctan.org/search % 3. Browse alphabetically: https://ctan.org/pkg % Popular package categories: % - Graphics: tikz, pgfplots, graphicx % - Mathematics: amsmath, mathtools, physics % - Tables: booktabs, array, longtable % - Bibliography: biblatex, natbib % - Code: listings, minted, algorithm2e % - Fonts: fontspec, lmodern, libertine ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Package DocumentationEvery package should include documentation. Here's how to access it:```bash package-documentation.bash theme=\{null} # Command line (if you have LaTeX installed locally) texdoc packagename # Opens package documentation texdoc graphicx # Example: graphicx documentation texdoc amsmath # Example: amsmath documentation # Alternative methods: # 1. CTAN package page: https://ctan.org/pkg/packagename # 2. Google: "latex packagename documentation" # 3. LaTeX package galleries and guides ```### Popular Package Collections```latex popular-packages.tex theme=\{null} % Essential mathematics \usepackage{amsmath} % Enhanced math environments \usepackage{amssymb} % Additional math symbols \usepackage{mathtools} % Extensions to amsmath % Graphics and figures \usepackage{graphicx} % Include graphics \usepackage{tikz} % Create graphics programmatically \usepackage{pgfplots} % Create plots and charts % Tables and arrays \usepackage{booktabs} % Professional table formatting \usepackage{array} % Enhanced column types \usepackage{longtable} % Multi-page tables % Text formatting \usepackage{microtype} % Improved typography \usepackage{enumitem} % Customizable lists \usepackage{fancyhdr} % Custom headers/footers % Colors and styling \usepackage{xcolor} % Color support \usepackage{listings} % Code listings \usepackage{hyperref} % Hyperlinks and PDF features % Bibliography and citations \usepackage{biblatex} % Modern bibliography (recommended) \usepackage{natbib} % Traditional bibliography ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Package Installation### LaTeX Cloud Studio (Pre-installed)> [!NOTE] > > **LaTeX Cloud Studio advantage**: All major packages are pre-installed and ready to use. Simply add `\usepackage{packagename}` to your document.```latex cloud-studio-packages.tex theme=\{null} % These packages work immediately in LaTeX Cloud Studio: \usepackage{amsmath} ✓ Mathematics \usepackage{graphicx} ✓ Graphics \usepackage{tikz} ✓ Drawings \usepackage{booktabs} ✓ Tables \usepackage{listings} ✓ Code \usepackage{biblatex} ✓ Bibliography \usepackage{hyperref} ✓ Links \usepackage{xcolor} ✓ Colors \usepackage{geometry} ✓ Page layout \usepackage{fancyhdr} ✓ Headers/footers % And hundreds more... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Local Installation (For Reference)```bash local-installation.bash theme=\{null} # TeX Live (Linux/macOS/Windows) sudo apt-get install texlive-full # Ubuntu/Debian brew install --cask mactex # macOS # Windows: Download from https://tug.org/texlive/ # MiKTeX (Windows/macOS/Linux) # Download from https://miktex.org/ # Automatically installs packages on first use # Manual package installation (if needed) # 1. Download package from CTAN # 2. Extract to appropriate directory # 3. Run texhash to update database # 4. Update package database if required ```## Package Usage Patterns### Loading Order Matters```latex package-order.tex theme=\{null} \documentclass{article} % 1. Input/Output encoding (first) \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % 2. Language and fonts \usepackage[english]{babel} \usepackage{lmodern} % 3. Page layout \usepackage[margin=1in]{geometry} % 4. Mathematics (early for widespread use) \usepackage{amsmath,amssymb} % 5. Graphics and colors \usepackage{graphicx} \usepackage{xcolor} % 6. Tables and lists \usepackage{booktabs} \usepackage{enumitem} % 7. Bibliography (before hyperref) \usepackage[backend=biber]{biblatex} % 8. Hyperref (near the end) \usepackage{hyperref} % 9. Packages that must load after hyperref \usepackage{cleveref} \begin{document} % Content here \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code performs setup or defines reusable behavior without producing visible page content on its own. It must be used inside a complete document to have a rendered result.\
### Package Options```latex package-options.tex theme=\{null} % Packages often accept options to modify behavior % Geometry with specific margins \usepackage[ top=1in, bottom=1in, left=1.5in, right=1in, headheight=15pt ]{geometry} % Babel with multiple languages \usepackage[english,spanish,french]{babel} % Biblatex with style and backend \usepackage[ backend=biber, style=authoryear, sorting=nyt, maxcitenames=2 ]{biblatex} % Hyperref with link colors \usepackage[ colorlinks=true, linkcolor=blue, citecolor=green, urlcolor=red ]{hyperref} % Listings with default language \usepackage[language=Python]{listings} % Multiple options for xcolor \usepackage[table,xcdraw,dvipsnames]{xcolor} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Conditional Package Loading```latex conditional-loading.tex theme=\{null} % Check if package is available \IfPackageExists{microtype}{ \usepackage{microtype} \newcommand{\hasmicrotype}{true} }{ \newcommand{\hasmicrotype}{false} } % Load different packages based on compiler \usepackage{iftex} \ifPDFTeX \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \else \usepackage{fontspec} \fi % Version-specific loading \@ifpackagelater{tikz}{2020/12/27}{ % TikZ version 3.1.8 or later \usetikzlibrary{new-features} }{ % Older TikZ version \usetikzlibrary{legacy-features} } % Global options vs package options \documentclass[12pt]{article} % Global option affects all packages \usepackage{geometry} % Inherits 12pt if relevant % Override global options \usepackage[10pt]{package} % This package uses 10pt regardless ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Package Conflicts and Compatibility### Common Conflicts> [!WARNING] > > **Known package conflicts:** > > 1. **hyperref conflicts**: Load hyperref late, but before cleveref > 2. **Font conflicts**: Don't mix incompatible font packages > 3. **Math conflicts**: amsmath and mathtools can conflict with some packages > 4. **Table conflicts**: Some table packages don't work together > 5. **Encoding conflicts**: inputenc and fontspec are mutually exclusive```latex handling-conflicts.tex theme=\{null} % Conflict: subfigure vs subcaption % DON'T DO THIS: % \usepackage{subfigure} % Obsolete % \usepackage{subcaption} % Modern % DO THIS: \usepackage{subcaption} % Use only the modern package % Conflict: times vs newtx % DON'T DO THIS: % \usepackage{times} % Obsolete % \usepackage{newtxtext} % Modern replacement % DO THIS: \usepackage{newtxtext,newtxmath} % Complete modern replacement % Conflict: hyperref positioning % WRONG ORDER: % \usepackage{cleveref} % \usepackage{hyperref} % CORRECT ORDER: \usepackage{hyperref} \usepackage{cleveref} % Resolving font encoding conflicts \usepackage{iftex} \ifPDFTeX \usepackage[utf8]{inputenc} % For pdflatex \usepackage[T1]{fontenc} \else \usepackage{fontspec} % For xelatex/lualatex \fi ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Debugging Package Issues```latex debugging-packages.tex theme=\{null} % Method 1: Minimal example \documentclass{article} \usepackage{problematic-package} \begin{document} Test content \end{document} % Method 2: Load packages incrementally \documentclass{article} % \usepackage{package1} % Comment out packages one by one % \usepackage{package2} % to identify conflicts % \usepackage{package3} \usepackage{package4} % Until you find the problematic combination % Method 3: Check package versions \listfiles % Add this before \begin{document} % This will list all loaded packages and versions in the log % Method 4: Verbose error reporting \errorcontextlines=999 % Show more context in error messages \tracingmacros=1 % Trace macro expansions (very verbose!) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Essential Package Categories### Mathematics and Science```latex math-science-packages.tex theme=\{null} % Core mathematics \usepackage{amsmath} % Essential math environments \usepackage{amssymb} % Additional symbols \usepackage{mathtools} % Enhanced amsmath % Advanced mathematics \usepackage{physics} % Physics notation \usepackage{siunitx} % SI units \usepackage{tensor} % Tensor notation \usepackage{cancel} % Cancel terms in equations % Chemistry \usepackage{mhchem} % Chemical formulas \usepackage{chemfig} % Chemical structures \usepackage{chemmacros} % Chemical macros % Algorithm typesetting \usepackage{algorithm} % Algorithm floats \usepackage{algpseudocode} % Pseudocode \usepackage{algorithm2e} % Alternative algorithm package ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Graphics and Visualization```latex graphics-packages.tex theme=\{null} % Basic graphics \usepackage{graphicx} % Include images \usepackage{rotating} % Rotate content \usepackage{wrapfig} % Wrap text around figures % Advanced graphics \usepackage{tikz} % Programmatic graphics \usepackage{pgfplots} % Data plotting \usepackage{circuitikz} % Circuit diagrams % Subfigures \usepackage{subcaption} % Modern subfigures \usepackage{subfig} % Alternative (less recommended) % Figure positioning \usepackage{float} % Enhanced float control \usepackage{placeins} % Float barriers ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Text and Document Formatting```latex formatting-packages.tex theme=\{null} % Typography \usepackage{microtype} % Improved typography \usepackage{setspace} % Line spacing control \usepackage{parskip} % Paragraph spacing % Page layout \usepackage{geometry} % Page dimensions \usepackage{fancyhdr} % Headers and footers \usepackage{titlesec} % Section title formatting % Lists and itemization \usepackage{enumitem} % Customizable lists \usepackage{mdwlist} % Compact lists % Tables \usepackage{booktabs} % Professional tables \usepackage{array} % Enhanced column types \usepackage{tabularx} % Auto-width tables \usepackage{longtable} % Multi-page tables \usepackage{ltxtable} % Combination of longtable and tabularx ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Code and Verbatim```latex code-packages.tex theme=\{null} % Code listings \usepackage{listings} % Basic code listings \usepackage{minted} % Advanced syntax highlighting (requires pygments) \usepackage{fancyvrb} % Enhanced verbatim % Listings configuration \lstset{ language=Python, basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green}, stringstyle=\color{red}, numbers=left, numberstyle=\tiny, breaklines=true } % Minted configuration \setminted{ fontsize=\small, linenos=true, breaklines=true, frame=lines } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
## Advanced Package Management### Creating Your Own Packages```latex custom-package.sty theme=\{null} % mypackage.sty - Custom package file \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mypackage}[2024/01/01 My Custom Package] % Package options \newif\if@myoption \@myoptionfalse \DeclareOption{myoption}{\@myoptiontrue} \ProcessOptions\relax % Required packages \RequirePackage{amsmath} \RequirePackage{xcolor} % Custom commands \newcommand{\highlight}[1]{\textcolor{yellow}{#1}} \newcommand{\important}[1]{\textbf{\textcolor{red}{#1}}} % Custom environments \newenvironment{myenv}{% \begin{center}\color{blue}\bfseries }{% \end{center} } % Conditional code based on options \if@myoption \newcommand{\optionalcommand}{This appears with myoption} \else \newcommand{\optionalcommand}{This appears without myoption} \fi ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex using-custom-package.tex theme=\{null} % Using the custom package \documentclass{article} \usepackage[myoption]{mypackage} % Load with option \begin{document} \highlight{Highlighted text} \important{Important text} \begin{myenv} Content in custom environment \end{myenv} \optionalcommand \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Package Version Control```latex version-control.tex theme=\{null} % Require specific package version \usepackage{l3packages} \ExplSyntaxOn \msg_new:nnn { mypackage } { version-too-old } { Package~'#1'~is~too~old.~Required:~#2,~Found:~#3 } % Check if package version is sufficient \@ifpackagelater{tikz}{2020/12/27}{ % Version is 3.1.8 or later }{ \msg_error:nnn { mypackage } { version-too-old } { tikz } { 3.1.8 } { \@ifpackageloaded{tikz}{\csname ver@tikz.sty\endcsname}{not loaded} } } \ExplSyntaxOff % Alternative simple version check \@ifpackagelater{amsmath}{2017/09/02}{}{ \PackageError{mydocument}{amsmath package too old}{} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Best Practices> [!TIP] > > **Package management best practices:** > > 1. **Document requirements**: List all required packages in comments > 2. **Use stable packages**: Prefer well-established packages over experimental ones > 3. **Read documentation**: Always check package documentation before use > 4. **Test compatibility**: Test package combinations in minimal examples > 5. **Version control**: Document package versions for reproducible builds > 6. **Minimal loading**: Only load packages you actually use > 7. **Load order**: Follow standard loading order to avoid conflicts > 8. **Keep updated**: Use recent package versions when possible### Package Documentation Template```latex package-documentation.tex theme=\{null} % Document header with package requirements % % Required packages: % - amsmath (core LaTeX distribution) % - graphicx (core LaTeX distribution) % - tikz (CTAN: tikz) % - booktabs (CTAN: booktabs) % - biblatex with biber backend % % Optional packages: % - microtype (improved typography) % - hyperref (PDF links and bookmarks) % % Compilation: pdflatex -> biber -> pdflatex -> pdflatex % \documentclass{article} % Package loading with version comments \usepackage{amsmath} % v2.17 or later \usepackage{graphicx} % v1.1 or later \usepackage{tikz} % v3.1.8 or later for advanced features \usepackage{booktabs} % v1.6 or later \usepackage[backend=biber]{biblatex} % v3.16 or later % Document content \begin{document} Content requiring the above packages... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from package-documentation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-package-management-17/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_package_management)## Troubleshooting Guide### Common Error Messages> [!WARNING] > > **Fixing common package errors:** > > 1. **"Package not found"**: Check spelling and availability > 2. **"Option clash"**: Package loaded twice with different options > 3. **"Command already defined"**: Two packages define the same command > 4. **"Missing number"**: Syntax error in package options > 5. **"Unknown option"**: Option not supported by package version > 6. **"File not found"**: Missing package files or dependencies```latex troubleshooting.tex theme=\{null} % Error: Package not found % Solution: Check package name spelling \usepackage{graphicx} % Correct % \usepackage{graphics} % Common misspelling % Error: Option clash % Problem: % \usepackage[utf8]{inputenc} % \usepackage[latin1]{inputenc} % Conflict! % Solution: Use global options or load once \PassOptionsToPackage{utf8}{inputenc} \usepackage{inputenc} % Error: Command redefinition % Problem: Two packages define \example % Solution: Rename one command \usepackage{package1} \let\exampleoriginal\example \usepackage{package2} % Redefines \example \let\examplenew\example \let\example\exampleoriginal % Restore original % Error: Unknown option % Check package documentation for valid options \usepackage[colorlinks=true]{hyperref} % Valid option % \usepackage[invalidoption]{hyperref} % Would cause error ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Quick Reference### Essential Package Loading Order```latex example.tex theme=\{null} % 1. Input/Output \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % 2. Language \usepackage[english]{babel} % 3. Layout \usepackage{geometry} % 4. Math \usepackage{amsmath,amssymb} % 5. Graphics \usepackage{graphicx} % 6. Colors \usepackage{xcolor} % 7. Bibliography \usepackage{biblatex} % 8. Hyperref (late) \usepackage{hyperref} % 9. After hyperref \usepackage{cleveref} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Package Categories Quick List| Category | Essential Packages | | - | - | | **Math** | `amsmath`, `amssymb`, `mathtools` | | **Graphics** | `graphicx`, `tikz`, `subcaption` | | **Tables** | `booktabs`, `array`, `longtable` | | **Bibliography** | `biblatex`, `natbib` | | **Typography** | `microtype`, `setspace`, `enumitem` | | **Layout** | `geometry`, `fancyhdr`, `titlesec` | | **Code** | `listings`, `minted`, `fancyvrb` | | **PDF** | `hyperref`, `cleveref`, `bookmark` |***> [!NOTE] > > **Next**: Learn about [Enhanced cross-linking](/learn/latex/cross-referencing) to improve navigation between related topics in your documentation. # LaTeX Paragraph Spacing: \parskip, \parindent, \vspace, and line spacing Source: https://resources.latex-cloud-studio.com/learn/latex/paragraphs-spacing Control paragraph spacing in LaTeX with \parskip, \parindent, \vspace, and setspace. Includes the common fixes for extra space and missing indents. Use `\parskip` to add space between paragraphs, `\parindent` to control the first-line indent, and `\vspace` for one-off vertical gaps. This guide focuses on those common spacing tasks first, then covers line spacing, list spacing, section spacing, and troubleshooting.> [!NOTE] > > **Quick answer**: most paragraph-spacing changes come down to `\setlength{\parskip}{...}`, `\setlength{\parindent}{...}`, `\noindent`, and `\vspace{...}`. Use page-level settings for consistent layout, and use `\vspace` only for local adjustments.## Quick fixes for common spacing tasks| If you need... | Use | Notes | | - | - | - | | Space between paragraphs | `\setlength{\parskip}{1em}` | Applies to the whole document or current group | | No first-line indent | `\setlength{\parindent}{0pt}` | Common when `\parskip` is non-zero | | Remove indent for one paragraph | `\noindent` | Local change only | | Add a one-off vertical gap | `\vspace{1em}` | Best for local layout fixes, not global paragraph spacing | | Change line spacing | `\usepackage{setspace}` and `\onehalfspacing` | Better than manual `\baselineskip` changes in most cases |## Quick Start```latex paragraph-spacing-quickstart.tex theme=\{null} \documentclass{article} \usepackage{setspace} \setlength{\parskip}{0.75em} \setlength{\parindent}{0pt} \begin{document} First paragraph. Second paragraph with space above it. \onehalfspacing This paragraph uses wider line spacing. \vspace{1em} This line has an extra local gap above it. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from paragraph-spacing-quickstart.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_paragraphs_spacing)## Paragraph Spacing Basics### Default BehaviorLaTeX's default paragraph handling:- First line indented - No extra space between paragraphs - Justified text alignment```latex default-paragraphs.tex theme=\{null} \documentclass{article} \begin{document} This is the first paragraph. It demonstrates LaTeX's default formatting with first-line indentation and no extra spacing between paragraphs. This is the second paragraph. Notice how it starts with an indent but has no extra vertical space separating it from the previous paragraph. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from default-paragraphs.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-02/page-1.svg)
### Controlling Paragraph Spacing```latex paragraph-spacing.tex theme=\{null} \documentclass{article} % Add space between paragraphs \setlength{\parskip}{1em} % Remove first-line indent \setlength{\parindent}{0pt} \begin{document} This paragraph has no indentation and is followed by extra space. This paragraph also has no indentation. The space between paragraphs makes the document structure clearer. % Temporarily change spacing {\setlength{\parskip}{2em} These paragraphs have even more space between them. See how the larger gap creates stronger visual separation. } Back to normal spacing here. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from paragraph-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-03/page-1.svg)
## Line Spacing### Basic Line Spacing Commands```latex line-spacing.tex theme=\{null} \documentclass{article} \usepackage{setspace} \begin{document} % Single spacing (default) \singlespacing This text uses single spacing, which is the LaTeX default. % One and a half spacing \onehalfspacing This text uses one-and-a-half spacing, providing more space between lines for better readability. % Double spacing \doublespacing This text uses double spacing, often required for academic manuscripts and drafts. % Custom spacing \setstretch{1.25} This text uses custom 1.25 line spacing. % Return to single \singlespacing \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from line-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-04/page-1.svg)
### Local Line Spacing```latex local-spacing.tex theme=\{null} \documentclass{article} \usepackage{setspace} \begin{document} Normal spacing paragraph here. \begin{doublespace} This paragraph uses double spacing. It's useful for quotes or sections that need emphasis through spacing. \end{doublespace} Back to normal spacing. % Inline spacing change {\onehalfspacing This paragraph temporarily uses 1.5 spacing without affecting the rest of the document. } \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from local-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-05/page-1.svg)
## Vertical Spacing### Adding Vertical Space```latex vertical-space.tex theme=\{null} \documentclass{article} \begin{document} First paragraph. \vspace{1cm} This paragraph has 1cm of extra space above it. \vspace{10pt} This has 10 points of space above. \bigskip The bigskip command adds a large vertical space. \medskip The medskip command adds medium vertical space. \smallskip The smallskip command adds small vertical space. % Negative space (move up) \vspace{-5mm} This paragraph is moved up by 5mm. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from vertical-space.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-06/page-1.svg)
### Flexible Vertical Space```latex flexible-space.tex theme=\{null} % Fixed space \vspace{2cm} % Flexible space (can shrink/stretch) \vspace{2cm plus 1cm minus 0.5cm} % Fill remaining space \vfill % Multiple fills for proportional spacing Text at top \vfill Text in middle (1/3 down) \vfill \vfill Text at bottom ```
Rendered output Open zoomable preview: Compiled PDF page 1 from flexible-space.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-07/page-1.svg)
## Indentation Control### Managing Paragraph Indentation```latex indentation.tex theme=\{null} \documentclass{article} \begin{document} % Default indented paragraph This paragraph has the default indentation. \noindent This paragraph has no indentation because of the noindent command. \indent This paragraph is indented even if global indentation is turned off. % Change indent size \setlength{\parindent}{2cm} This paragraph has a 2cm indent. % Remove all indentation \setlength{\parindent}{0pt} Now all paragraphs have no indentation by default. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from indentation.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-08/page-1.svg)
### Hanging Indentation```latex hanging-indent.tex theme=\{null} \documentclass{article} \begin{document} % Simple hanging indent \hangindent=2cm \hangafter=1 This paragraph has a hanging indent. The first line starts at the left margin, but all subsequent lines are indented by 2cm. This is useful for bibliographies and lists. % Negative hanging indent \hangindent=-2cm \hangafter=1 This paragraph has a reverse hanging indent. The first line is indented to the right, while subsequent lines extend to the left margin. % Multiple line hanging \hangindent=1.5cm \hangafter=2 This paragraph's hanging indent starts after the second line. The first two lines are normal, then all following lines are indented. This creates an interesting visual effect. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from hanging-indent.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-09/page-1.svg)
## Special Spacing Environments### Quote and Quotation Environments```latex quotes.tex theme=\{null} \documentclass{article} \begin{document} Regular paragraph before the quote. \begin{quote} This is a short quote. It's indented from both margins and has no paragraph indentation. Perfect for short excerpts. \end{quote} \begin{quotation} This is a longer quotation environment. Unlike the quote environment, it indents the first line of each paragraph. This is the second paragraph in the quotation, showing the first-line indentation. \end{quotation} Regular text continues here. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from quotes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-10/page-1.svg)
### Custom Spacing Environments```latex custom-environments.tex theme=\{null} \documentclass{article} % Define custom environment \newenvironment{widespace} {\par\vspace{1em}\begin{minipage}{\textwidth}\setstretch{1.5}} {\end{minipage}\vspace{1em}\par} \begin{document} Normal spacing paragraph. \begin{widespace} This custom environment adds vertical space before and after, plus increases line spacing. It's useful for important passages that need visual emphasis. \end{widespace} Back to normal spacing. \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## List Spacing### Controlling List Spacing```latex list-spacing.tex theme=\{null} \documentclass{article} \usepackage{enumitem} \begin{document} % Compact list \begin{itemize}[noitemsep,topsep=0pt] \item First item \item Second item \item Third item \end{itemize} % Wide spacing \begin{enumerate}[itemsep=1em,topsep=1em] \item First item with extra space \item Second item with extra space \item Third item with extra space \end{enumerate} % Custom spacing \begin{itemize}[ topsep=5pt, % Space before list partopsep=0pt, % Space before list if new paragraph itemsep=10pt, % Space between items parsep=5pt, % Space between paragraphs within item leftmargin=2cm % Indent from left ] \item First customized item \item Second customized item \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from list-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-12/page-1.svg)
## Page Layout Spacing### Margins and Text Area```latex page-layout.tex theme=\{null} \documentclass{article} \usepackage[ top=2.5cm, bottom=2.5cm, left=3cm, right=2cm, headheight=15pt ]{geometry} % Or use individual commands % \setlength{\topmargin}{0pt} % \setlength{\textheight}{9in} % \setlength{\textwidth}{6.5in} % \setlength{\oddsidemargin}{0pt} % \setlength{\evensidemargin}{0pt} \begin{document} Content with custom margins... \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from page-layout.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-13/page-1.svg)
### Section Spacing```latex section-spacing.tex theme=\{null} \documentclass{article} \usepackage{titlesec} % Customize section spacing \titlespacing{\section} {0pt} % Left indent {12pt} % Space before {6pt} % Space after \titlespacing{\subsection} {0pt}{8pt}{4pt} \begin{document} \section{First Section} Text after section heading. \subsection{Subsection} Text after subsection. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from section-spacing.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-14/page-1.svg)
## Advanced Techniques### Baseline Skip Control```latex baseline-skip.tex theme=\{null} \documentclass{article} \begin{document} % Normal baseline skip Normal text with default spacing between lines. % Increase baseline skip {\setlength{\baselineskip}{20pt} This text has increased baseline skip, creating more space between lines without changing the font size.} % Proportional baseline skip {\setlength{\baselineskip}{1.5\baselineskip} This uses proportional spacing based on the current value.} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from baseline-skip.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-15/page-1.svg)
### Rubber Lengths```latex rubber-lengths.tex theme=\{null} % Stretchable space \hspace{1cm plus 2cm minus 0.5cm} % Paragraph skip with flexibility \setlength{\parskip}{6pt plus 2pt minus 1pt} % Flexible vertical space \vspace{1cm plus 0.5cm minus 0.2cm} % Fill space examples Text\hfill Text % Horizontal fill \vfill % Vertical fill ```
Rendered output Open zoomable preview: Compiled PDF page 1 from rubber-lengths.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-16/page-1.svg)
## Troubleshooting Spacing Issues### Common Problems and Solutions```latex spacing-fixes.tex theme=\{null} % Unwanted page breaks \begin{samepage} Keep this content together on one page. \end{samepage} % Orphan/widow control \widowpenalty=10000 \clubpenalty=10000 % Prevent spacing at page top \raggedbottom % Don't stretch vertical space % Fix spacing after floats \clearpage % Force new page after floats ```
Rendered output Open zoomable preview: Compiled PDF page 1 from spacing-fixes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-paragraphs-spacing-17/page-1.svg)
## Best Practices> [!TIP] > > **Spacing guidelines:** > > 1. **Consistency**: Use the same spacing throughout similar elements > 2. **Readability first**: Don't sacrifice readability for density > 3. **Document class**: Choose appropriate class for spacing defaults > 4. **Global settings**: Set document-wide spacing in preamble > 5. **Local changes**: Use grouping `{}` for temporary changes## Quick Reference| Command | Purpose | Example | | - | - | - | | `\parskip` | Space between paragraphs | `\setlength{\parskip}{1em}` | | `\parindent` | Paragraph indentation | `\setlength{\parindent}{0pt}` | | `\baselineskip` | Space between lines | `\setlength{\baselineskip}{15pt}` | | `\vspace{}` | Vertical space | `\vspace{1cm}` | | `\hspace{}` | Horizontal space | `\hspace{2em}` | | `\bigskip` | Large vertical space | `\bigskip` | | `\noindent` | No indent for paragraph | `\noindent Text` |## Try the Spacing Examples> [card] Open a spacing example > > Paste the examples into a project and compile them to compare `\vspace`, paragraph spacing, indentation, and line spacing.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=paragraph_spacing_open_app)> [card] See the online LaTeX editor > > Review the browser editor workflow on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=paragraph_spacing_online_editor) page before testing document-wide spacing changes.***> [!NOTE] > > **Next**: Explore [Font selection and customization](/learn/latex/fonts) to enhance your document's typography. # Algorithms, Complexity, and CS Notation in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/algorithms Learn algorithm notation, complexity classes, and computer science symbols in LaTeX. For step-by-step pseudocode with algorithmicx, see the dedicated guide. This guide covers the broader computer-science notation stack in LaTeX: algorithms, graph notation, asymptotic complexity, and related mathematical symbols.> [!NOTE] > > **Looking for pseudocode?** Use the focused [LaTeX pseudocode guide](/learn/latex/specialized-notation/pseudocode) for `algorithm`, `algorithmicx`, and `algpseudocode` examples.## Essential Algorithm Packages```latex example.tex theme=\{null} \usepackage{algorithm} % Algorithm environment \usepackage{algorithmicx} % Extended algorithmic commands \usepackage{algpseudocode} % Pseudocode style \usepackage{listings} % Code listings \usepackage{clrscode3e} % CLRS book style \usepackage{complexity} % Complexity classes \usepackage{amsmath} % Mathematical notation ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Basic Pseudocode### Simple Algorithm Structure```latex example.tex theme=\{null} \begin{algorithm} \caption{Binary Search} \begin{algorithmic}[1] \Procedure{BinarySearch}{$A, n, x$} \State $\textit{left} \gets 1$ \State $\textit{right} \gets n$ \While{$\textit{left} \leq \textit{right}$} \State $\textit{mid} \gets \lfloor (\textit{left} + \textit{right})/2 \rfloor$ \If{$A[\textit{mid}] = x$} \State \textbf{return} $\textit{mid}$ \ElsIf{$A[\textit{mid}] < x$} \State $\textit{left} \gets \textit{mid} + 1$ \Else \State $\textit{right} \gets \textit{mid} - 1$ \EndIf \EndWhile \State \textbf{return} $\textit{null}$ \EndProcedure \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_algorithms)### Control Structures```latex example.tex theme=\{null} \begin{algorithmic}[1] \State $x \gets 0$ \If{condition} \State statement \ElsIf{other condition} \State other statement \Else \State default statement \EndIf \While{condition} \State loop body \EndWhile \For{$i = 1$ \textbf{to} $n$} \State loop body \EndFor \For{\textbf{each} $item$ \textbf{in} $collection$} \State process item \EndFor \Repeat \State loop body \Until{condition} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > The algorithmicx package produces formatted pseudocode with proper indentation: > > **`\State`** produces a simple statement line > > **`\If{condition}`** produces: **if** *condition* **then** > > **`\For{$i = 1$ \textbf{to} $n$}`** produces: **for** $i = 1$ **to** $n$ **do**## Sorting Algorithms### Merge Sort```latex example.tex theme=\{null} \begin{algorithm} \caption{Merge Sort} \begin{algorithmic}[1] \Procedure{MergeSort}{$A, p, r$} \If{$p < r$} \State $q \gets \lfloor (p + r)/2 \rfloor$ \State \Call{MergeSort}{$A, p, q$} \State \Call{MergeSort}{$A, q+1, r$} \State \Call{Merge}{$A, p, q, r$} \EndIf \EndProcedure \Procedure{Merge}{$A, p, q, r$} \State $n_1 \gets q - p + 1$ \State $n_2 \gets r - q$ \State Create arrays $L[1..n_1+1]$ and $R[1..n_2+1]$ \For{$i = 1$ \textbf{to} $n_1$} \State $L[i] \gets A[p + i - 1]$ \EndFor \For{$j = 1$ \textbf{to} $n_2$} \State $R[j] \gets A[q + j]$ \EndFor \State $L[n_1 + 1] \gets \infty$ \State $R[n_2 + 1] \gets \infty$ \State $i \gets 1$, $j \gets 1$ \For{$k = p$ \textbf{to} $r$} \If{$L[i] \leq R[j]$} \State $A[k] \gets L[i]$ \State $i \gets i + 1$ \Else \State $A[k] \gets R[j]$ \State $j \gets j + 1$ \EndIf \EndFor \EndProcedure \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-04/page-1.svg)
## Graph Algorithms### Depth-First Search```latex example.tex theme=\{null} \begin{algorithm} \caption{Depth-First Search} \begin{algorithmic}[1] \Procedure{DFS}{$G$} \For{\textbf{each} vertex $u \in V[G]$} \State $color[u] \gets \text{WHITE}$ \State $\pi[u] \gets \text{NIL}$ \EndFor \State $time \gets 0$ \For{\textbf{each} vertex $u \in V[G]$} \If{$color[u] = \text{WHITE}$} \State \Call{DFS-Visit}{$u$} \EndIf \EndFor \EndProcedure \Procedure{DFS-Visit}{$u$} \State $color[u] \gets \text{GRAY}$ \State $time \gets time + 1$ \State $d[u] \gets time$ \For{\textbf{each} $v \in Adj[u]$} \If{$color[v] = \text{WHITE}$} \State $\pi[v] \gets u$ \State \Call{DFS-Visit}{$v$} \EndIf \EndFor \State $color[u] \gets \text{BLACK}$ \State $time \gets time + 1$ \State $f[u] \gets time$ \EndProcedure \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-05/page-1.svg)
### Dijkstra's Algorithm```latex example.tex theme=\{null} \begin{algorithm} \caption{Dijkstra's Shortest Path} \begin{algorithmic}[1] \Procedure{Dijkstra}{$G, w, s$} \State \Call{Initialize-Single-Source}{$G, s$} \State $S \gets \emptyset$ \State $Q \gets V[G]$ \While{$Q \neq \emptyset$} \State $u \gets \Call{Extract-Min}{Q}$ \State $S \gets S \cup \{u\}$ \For{\textbf{each} vertex $v \in Adj[u]$} \State \Call{Relax}{$u, v, w$} \EndFor \EndWhile \EndProcedure \Procedure{Relax}{$u, v, w$} \If{$d[v] > d[u] + w(u,v)$} \State $d[v] \gets d[u] + w(u,v)$ \State $\pi[v] \gets u$ \EndIf \EndProcedure \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-06/page-1.svg)
## Complexity Analysis### Big O Notation```latex example.tex theme=\{null} % Time complexities $O(1)$ \quad\text{constant time} $O(\log n)$ \quad\text{logarithmic time} $O(n)$ \quad\text{linear time} $O(n \log n)$ \quad\text{linearithmic time} $O(n^2)$ \quad\text{quadratic time} $O(n^3)$ \quad\text{cubic time} $O(2^n)$ \quad\text{exponential time} $O(n!)$ \quad\text{factorial time} % Space complexities $O(1)$ \quad\text{constant space} $O(n)$ \quad\text{linear space} $O(n^2)$ \quad\text{quadratic space} % Asymptotic notation $f(n) = O(g(n))$ \quad\text{upper bound} $f(n) = \Omega(g(n))$ \quad\text{lower bound} $f(n) = \Theta(g(n))$ \quad\text{tight bound} $f(n) = o(g(n))$ \quad\text{strict upper bound} $f(n) = \omega(g(n))$ \quad\text{strict lower bound} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-07/page-1.svg)
### Complexity Classes```latex example.tex theme=\{null} % Using complexity package \P \quad\text{Polynomial time} \NP \quad\text{Nondeterministic polynomial time} \coNP \quad\text{Co-NP} \PSPACE \quad\text{Polynomial space} \EXPTIME \quad\text{Exponential time} \NEXPTIME \quad\text{Nondeterministic exponential time} % Reductions $A \leq_p B$ \quad\text{polynomial-time reduction} $A \leq_m B$ \quad\text{many-one reduction} % Completeness $L$ is $\NP$-complete if: \begin{enumerate} \item $L \in \NP$ \item For every $L' \in \NP$, $L' \leq_p L$ \end{enumerate} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Data Structures### Binary Search Tree Operations```latex example.tex theme=\{null} \begin{algorithm} \caption{Binary Search Tree Insert} \begin{algorithmic}[1] \Procedure{Tree-Insert}{$T, z$} \State $y \gets \text{NIL}$ \State $x \gets root[T]$ \While{$x \neq \text{NIL}$} \State $y \gets x$ \If{$key[z] < key[x]$} \State $x \gets left[x]$ \Else \State $x \gets right[x]$ \EndIf \EndWhile \State $p[z] \gets y$ \If{$y = \text{NIL}$} \State $root[T] \gets z$ \ElsIf{$key[z] < key[y]$} \State $left[y] \gets z$ \Else \State $right[y] \gets z$ \EndIf \EndProcedure \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-09/page-1.svg)
### Hash Table Operations```latex example.tex theme=\{null} \begin{algorithm} \caption{Hash Table with Chaining} \begin{algorithmic}[1] \Procedure{Chained-Hash-Insert}{$T, x$} \State Insert $x$ at head of list $T[h(key[x])]$ \EndProcedure \Procedure{Chained-Hash-Search}{$T, k$} \State Search for element with key $k$ in list $T[h(k)]$ \EndProcedure \Procedure{Chained-Hash-Delete}{$T, x$} \State Delete $x$ from list $T[h(key[x])]$ \EndProcedure \Function{Hash-Function}{$k, m$} \State \textbf{return} $k \bmod m$ \EndFunction ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Dynamic Programming### Longest Common Subsequence```latex example.tex theme=\{null} \begin{algorithm} \caption{Longest Common Subsequence} \begin{algorithmic}[1] \Procedure{LCS-Length}{$X, Y$} \State $m \gets length[X]$ \State $n \gets length[Y]$ \For{$i = 1$ \textbf{to} $m$} \State $c[i,0] \gets 0$ \EndFor \For{$j = 0$ \textbf{to} $n$} \State $c[0,j] \gets 0$ \EndFor \For{$i = 1$ \textbf{to} $m$} \For{$j = 1$ \textbf{to} $n$} \If{$x_i = y_j$} \State $c[i,j] \gets c[i-1,j-1] + 1$ \State $b[i,j] \gets$ "↖" \ElsIf{$c[i-1,j] \geq c[i,j-1]$} \State $c[i,j] \gets c[i-1,j]$ \State $b[i,j] \gets$ "↑" \Else \State $c[i,j] \gets c[i,j-1]$ \State $b[i,j] \gets$ "←" \EndIf \EndFor \EndFor \State \textbf{return} $c$ and $b$ \EndProcedure \end{algorithmic} \end{algorithm} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Mathematical Algorithms### Euclidean Algorithm```latex example.tex theme=\{null} \begin{algorithm} \caption{Euclidean Algorithm} \begin{algorithmic}[1] \Function{GCD}{$a, b$} \While{$b \neq 0$} \State $temp \gets b$ \State $b \gets a \bmod b$ \State $a \gets temp$ \EndWhile \State \textbf{return} $a$ \EndFunction \Function{Extended-GCD}{$a, b$} \If{$b = 0$} \State \textbf{return} $(a, 1, 0)$ \Else \State $(d, x', y') \gets \Call{Extended-GCD}{b, a \bmod b}$ \State $x \gets y'$ \State $y \gets x' - \lfloor a/b \rfloor \cdot y'$ \State \textbf{return} $(d, x, y)$ \EndIf \EndFunction \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-12/page-1.svg)
## Machine Learning Algorithms### Gradient Descent```latex example.tex theme=\{null} \begin{algorithm} \caption{Gradient Descent} \begin{algorithmic}[1] \Procedure{Gradient-Descent}{$f, \nabla f, \alpha, \epsilon$} \State Initialize $\mathbf{x}_0$ \State $k \gets 0$ \Repeat \State $\mathbf{g}_k \gets \nabla f(\mathbf{x}_k)$ \State $\mathbf{x}_{k+1} \gets \mathbf{x}_k - \alpha \mathbf{g}_k$ \State $k \gets k + 1$ \Until{$\|\mathbf{g}_k\| < \epsilon$} \State \textbf{return} $\mathbf{x}_k$ \EndProcedure \Function{Learning-Rate-Schedule}{$k$} \State \textbf{return} $\frac{\alpha_0}{1 + \beta k}$ \EndFunction \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-13/page-1.svg)
## Parallel Algorithms### Parallel Merge Sort```latex example.tex theme=\{null} \begin{algorithm} \caption{Parallel Merge Sort} \begin{algorithmic}[1] \Procedure{P-Merge-Sort}{$A, p, r$} \If{$p < r$} \State $q \gets \lfloor (p + r)/2 \rfloor$ \State \textbf{spawn} \Call{P-Merge-Sort}{$A, p, q$} \State \Call{P-Merge-Sort}{$A, q+1, r$} \State \textbf{sync} \State \Call{P-Merge}{$A, p, q, r$} \EndIf \EndProcedure \Procedure{P-Merge}{$A, p, q, r$} \State $n_1 \gets q - p + 1$ \State $n_2 \gets r - q$ \If{$n_1 < n_2$} \State Exchange $p \leftrightarrow q+1$ and $n_1 \leftrightarrow n_2$ \EndIf \If{$n_1 = 0$} \State \textbf{return} \Else \State $q' \gets \lfloor (p + q)/2 \rfloor$ \State $r' \gets \Call{Binary-Search}{A[q'], A, q+1, r}$ \State $s \gets p + (q' - p) + (r' - (q+1))$ \State $A'[s] \gets A[q']$ \State \textbf{spawn} \Call{P-Merge}{A, p, q'-1, r'-1} \State \Call{P-Merge}{A, q'+1, q, r'+1} \State \textbf{sync} \EndIf \EndProcedure \end{algorithmic} \end{algorithm} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-14/page-1.svg)
## Recurrence Relations### Solving Recurrences```latex example.tex theme=\{null} % Master Theorem \textbf{Master Theorem:} Let $T(n) = aT(n/b) + f(n)$ where $a \geq 1$ and $b > 1$. \textbf{Case 1:} If $f(n) = O(n^{\log_b a - \epsilon})$ for some $\epsilon > 0$, then $T(n) = \Theta(n^{\log_b a})$. \textbf{Case 2:} If $f(n) = \Theta(n^{\log_b a})$, then $T(n) = \Theta(n^{\log_b a} \log n)$. \textbf{Case 3:} If $f(n) = \Omega(n^{\log_b a + \epsilon})$ for some $\epsilon > 0$, and $af(n/b) \leq cf(n)$ for some $c < 1$ and sufficiently large $n$, then $T(n) = \Theta(f(n))$. % Examples $T(n) = 2T(n/2) + n$ \quad $\Rightarrow$ \quad $T(n) = \Theta(n \log n)$ $T(n) = 3T(n/4) + n^2$ \quad $\Rightarrow$ \quad $T(n) = \Theta(n^2)$ $T(n) = T(n-1) + 1$ \quad $\Rightarrow$ \quad $T(n) = \Theta(n)$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-15/page-1.svg)
## Algorithm Analysis Proofs### Correctness Proofs```latex example.tex theme=\{null} % Loop invariant \textbf{Loop Invariant for Insertion Sort:} At the start of each iteration of the \textbf{for} loop of lines 1-8, the subarray $A[1..j-1]$ consists of the elements originally in $A[1..j-1]$, but in sorted order. \textbf{Initialization:} Prior to the first iteration, when $j = 2$, the subarray $A[1..j-1] = A[1..1] = \{A[1]\}$ is trivially sorted. \textbf{Maintenance:} Assume the invariant holds at the beginning of an iteration. The loop body moves $A[j-1], A[j-2], \ldots$ one position to the right until it finds the proper position for $A[j]$. \textbf{Termination:} When the loop terminates, $j = n + 1$. The subarray $A[1..n]$ consists of the original elements in sorted order. % Asymptotic proof \textbf{Theorem:} For any function $f(n)$ and $g(n)$, $f(n) = O(g(n))$ if and only if there exist positive constants $c$ and $n_0$ such that $0 \leq f(n) \leq c \cdot g(n)$ for all $n \geq n_0$. ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-algorithms-16/page-1.svg)
## Best Practices> [card] Clear Variable Names > > Use descriptive variable names and consistent notation> [card] Proper Indentation > > Use consistent indentation to show algorithm structure> [card] Complexity Analysis > > Always include time and space complexity analysis> [card] Invariants and Proofs > > Document loop invariants and correctness proofs## Common Algorithm Notation| Notation | Meaning | | :- | :- | | **←** | Assignment | | **⊕** | XOR operation | | **⊕** | Addition in GF(2) | | **∀** | For all | | **∃** | There exists | | **∈** | Element of | | **⊆** | Subset of | | **∪** | Union | | **∩** | Intersection | | **∅** | Empty set |## Troubleshooting> [!WARNING] > > **Common issues**: > > * Missing algorithm package: Install `algorithm` and `algorithmicx` > * Line numbering: Use `[1]` option in algorithmic environment > * Indentation problems: Check matching `\If`/`\EndIf` pairs > * Symbol conflicts: Some symbols may conflict with math mode## Further Reading> [card] Mathematics Notation > > Mathematical expressions and notation[Open](/learn/latex/mathematics/mathematical-expressions)> [card] Creating Tables > > Complexity comparison tables[Open](/learn/latex/tables/creating-tables)> [card] Code Listings > > Including actual code implementations[Open](/learn/latex/formatting/code-listings-minted)> [card] Physics Notation > > Scientific computing applications[Open](/learn/latex/specialized-notation/physics) # Chemistry Notation Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/chemistry Master chemistry notation in LaTeX. Learn chemical formulas, reactions, molecular structures, and specialized chemistry symbols. Create professional chemistry documents with LaTeX, including chemical formulas, reaction equations, and molecular structures.## Essential Chemistry Packages```latex example.tex theme=\{null} \usepackage{chemfig} % Molecular structures \usepackage{mhchem} % Chemical formulas and equations \usepackage{chemmacros} % Chemistry macros \usepackage{siunitx} % SI units \usepackage{chemformula} % Alternative to mhchem \usepackage{mol2chemfig} % Convert SMILES to chemfig ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Chemical Formulas with mhchem### Basic Formulas```latex example.tex theme=\{null} % Simple molecules \ce{H2O} % Water \ce{CO2} % Carbon dioxide \ce{H2SO4} % Sulfuric acid \ce{Ca(OH)2} % Calcium hydroxide % Ions \ce{Na+} % Sodium ion \ce{SO4^2-} % Sulfate ion \ce{NH4+} % Ammonium ion % Isotopes \ce{^{14}C} % Carbon-14 \ce{^{235}U} % Uranium-235 ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_chemistry)> [card] Expected output > > **Water:** $\ce{H2O}$ > > **Carbon dioxide:** $\ce{CO2}$ > > **Sulfuric acid:** $\ce{H2SO4}$ > > **Sodium ion:** $\ce{Na+}$ > > **Sulfate ion:** $\ce{SO4^{2-}}$### States and Phases```latex example.tex theme=\{null} % Physical states \ce{H2O(l)} % Liquid water \ce{CO2(g)} % Gaseous CO2 \ce{NaCl(s)} % Solid salt \ce{Na+(aq)} % Aqueous sodium ion % Crystal structures \ce{CaCO3.H2O} % Hydrate \ce{Fe^{II}Fe^{III}2O4} % Mixed oxidation states ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-03/page-1.svg)
## Chemical Reactions### Basic Reactions```latex example.tex theme=\{null} % Simple reaction \ce{2H2 + O2 -> 2H2O} % With conditions \ce{N2 + 3H2 ->[\text{Fe cat.}][450°C, 200 atm] 2NH3} % Equilibrium \ce{N2O4 <=> 2NO2} % With heat \ce{CaCO3 ->[\Delta] CaO + CO2} % Precipitation \ce{AgNO3(aq) + NaCl(aq) -> AgCl v + NaNO3(aq)} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > **Simple reaction:** $\ce{2H2 + O2 -> 2H2O}$ > > **Equilibrium:** $\ce{N2O4 <=> 2NO2}$ > > **Precipitation:** $\ce{AgCl v}$ (silver chloride precipitate)### Complex Reactions```latex example.tex theme=\{null} % Multi-step reactions \begin{align} \ce{CH4 + Cl2 &->[\text{UV}] CH3Cl + HCl}\\ \ce{CH3Cl + Cl2 &->[\text{UV}] CH2Cl2 + HCl} \end{align} % Organic reactions \ce{R-OH + R'-COOH <=>[H+] R'-COO-R + H2O} % Redox reactions \ce{MnO4- + 8H+ + 5e- -> Mn^2+ + 4H2O} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Molecular Structures with chemfig### Simple Molecules```latex example.tex theme=\{null} % Methane \chemfig{C(-[2]H)(-[4]H)(-[6]H)-H} % Ethanol \chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]H)-OH} % Benzene \chemfig{*6(=-=-=-)} % Cyclohexane (chair conformation) \chemfig{*6(---(-[,,,,line width=2pt])---)} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-06/page-1.svg)
> [card] Expected output > > **Methane:** $\mathrm{CH_4}$ - tetrahedral structure with central carbon bonded to four hydrogens > > **Benzene:** $\mathrm{C_6H_6}$ - hexagonal aromatic ring with alternating double bonds### Complex Structures```latex example.tex theme=\{null} % Glucose \chemfig{ HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,line width=2pt] (-[6,0.5]OH)>[1,0.7](-[6,0.5]OH)-[3,0.7] (-[4,0.5]OH)-[1,0.7]O-[7,0.7]? } % Aspirin \chemfig{ *6(=-*6(-(=O)-O-(-=[:30]O)-CH_3)=-=-) } % DNA base pairing \chemfig{ N**6(--N--C(=[::60]O)--*5(-N=-N(-H)-)) @{a1}.|[,3.0]|@{a2}. N**6(-C(-H_3)-C(=[::60]O)-N(-H)--*5(=N--N=)) } \chemmove{\draw[dashed] (a1) -- (a2);} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-07/page-1.svg)
> [card] Expected output > > **Glucose:** $\mathrm{C_6H_{12}O_6}$ - six-membered ring structure with hydroxyl groups > > **Aspirin:** $\mathrm{C_9H_8O_4}$ - acetylsalicylic acid with benzene ring and ester group## Reaction Mechanisms### Arrow Pushing```latex example.tex theme=\{null} % Nucleophilic substitution \schemestart \chemfig{R-X} + \chemfig{\charge{90=\|}{Nu}} \arrow{->[$S_N2$]} \chemfig{R-Nu} + \chemfig{X^-} \schemestop % Elimination reaction \schemestart \chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]X)-H} \arrow{->[$E2$][-HX]} \chemfig{H-C(-[2]H)=C(-[6]H)-H} \schemestop ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > **Nucleophilic substitution:** $\mathrm{R\text{-}X + Nu^- \xrightarrow{S_N2} R\text{-}Nu + X^-}$ > > **Elimination reaction:** $\mathrm{R\text{-}CH_2\text{-}CHX\text{-}R' \xrightarrow{E2} R\text{-}CH=CH\text{-}R' + HX}$### Curved Arrows```latex example.tex theme=\{null} \chemfig{ @{a1}\charge{45=\|}{O}-H@{a2} \+ R-@{b1}\charge{180=\|}{Br}@{b2} } \chemmove{ \draw[->] (a1) .. controls +(45:5mm) and +(135:5mm) .. (b1); \draw[->] (b1) .. controls +(0:5mm) and +(0:5mm) .. (b2); } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > **Curved arrow mechanism:** Shows electron flow from nucleophile ($\mathrm{O^-}$) attacking the electrophilic carbon, with leaving group ($\mathrm{Br^-}$) departure indicated by curved arrows.## Laboratory Equipment### Common Glassware```latex example.tex theme=\{null} % Using TikZ for simple diagrams \begin{tikzpicture} % Round bottom flask \draw (0,0) circle (1cm); \draw (-0.3,1) -- (-0.3,2); \draw (0.3,1) -- (0.3,2); % Beaker \draw (3,0) -- (3,2) -- (4,2) -- (4,0); \draw (3,0) arc (180:360:0.5cm); \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-10/page-1.svg)
## Chemical Tables### Periodic Table Elements```latex example.tex theme=\{null} \begin{table}[h] \centering \begin{tabular}{|c|c|c|c|} \hline \textbf{Symbol} & \textbf{Name} & \textbf{Number} & \textbf{Mass} \\ \hline H & Hydrogen & 1 & 1.008 \\ He & Helium & 2 & 4.003 \\ Li & Lithium & 3 & 6.941 \\ Be & Beryllium & 4 & 9.012 \\ \hline \end{tabular} \caption{First four elements} \end{table} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-11/page-1.svg)
### Thermodynamic Data```latex example.tex theme=\{null} % Using siunitx for proper formatting \begin{table}[h] \centering \begin{tabular}{l S[table-format=3.1] S[table-format=3.1]} \toprule Compound & {$\Delta H_f°$ (\si{kJ/mol})} & {$S°$ (\si{J/(mol.K)})} \\ \midrule \ce{H2O(l)} & -285.8 & 69.9 \\ \ce{CO2(g)} & -393.5 & 213.8 \\ \ce{O2(g)} & 0.0 & 205.0 \\ \bottomrule \end{tabular} \end{table} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-12/page-1.svg)
## Units and Measurements### Using siunitx```latex example.tex theme=\{null} % Basic units \SI{25.0}{°C} % Temperature \SI{101.325}{kPa} % Pressure \SI{2.5e-3}{mol/L} % Concentration \SI{98.5}{\percent} % Percentage % Complex units \SI{8.314}{J/(mol.K)} % Gas constant \SI{6.022e23}{mol^{-1}} % Avogadro's number % Ranges \SIrange{20}{25}{°C} \SIrange{1}{5}{mL} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-13/page-1.svg)
## Chemical Equations with chemformula### Alternative Syntax```latex example.tex theme=\{null} % Using chemformula package \ch{H2O} % Water \ch{H+ + OH- <=> H2O} % Equilibrium \ch{CO2 + H2O -> H2CO3} % Reaction % With stoichiometry \ch{!( 2 H2 + O2 -> 2 H2O )} % Oxidation states \ch{Fe^{III}Cl3} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Common Chemistry Symbols> [card] Symbol Reference > > | Symbol | LaTeX | Meaning | > | :-: | :- | :- | > | $\rightleftharpoons$ | `\ce{<=>}` | Equilibrium | > | $\rightarrow$ | `\ce{->}` | Reaction arrow | > | $\downarrow$ | `\ce{v}` | Precipitate | > | $\uparrow$ | `\ce{^}` | Gas evolution | > | $\Delta$ | `\Delta` | Heat | > | $°$ | `°` or `\degree` | Degree | > | $\pm$ | `\pm` | Plus/minus | > | $\cdot$ | `\cdot` | Hydrate dot |## Spectroscopy Notation### NMR Spectroscopy```latex example.tex theme=\{null} % Chemical shifts $\delta$ \SI{7.25}{ppm} (s, 5H, Ph) $\delta$ \SI{3.65}{ppm} (q, $J = \SI{7.1}{Hz}$, 2H, \ce{CH2}) % Coupling constants $^3J_\text{HH} = \SI{7.5}{Hz}$ $^1J_\text{CH} = \SI{125}{Hz}$ ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-15/page-1.svg)
### IR Spectroscopy```latex example.tex theme=\{null} % Wavenumbers \SI{3500}{cm^{-1}} (O--H stretch) \SI{1715}{cm^{-1}} (C=O stretch) \SI{2950}{cm^{-1}} (C--H stretch) % Peak descriptions $\tilde{\nu}$ = \SI{1650}{cm^{-1}} (s, br) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-chemistry-16/page-1.svg)
## Best Practices> [card] Consistent Notation > > Use the same package throughout your document> [card] Define Abbreviations > > Define all chemical abbreviations when first used> [card] Use SI Units > > Always use siunitx for measurements> [card] Clear Structures > > Keep molecular structures simple and readable## Troubleshooting> [!WARNING] > > **Common issues**: > > * Package conflicts: Don't load both mhchem and chemformula > * Font issues: Some chemistry fonts require special setup > * Compilation: chemfig structures may need multiple passes## Further Reading> [card] Physics Notation > > Physics symbols and equations[Open](/learn/latex/specialized-notation/physics)> [card] Symbol Reference > > General symbol reference[Open](/learn/reference/symbols)> [card] Tables Guide > > Creating data tables[Open](/learn/latex/tables/creating-tables)> [card] Mathematics > > Mathematical expressions[Open](/learn/latex/mathematics/mathematical-expressions) # Circuit Diagrams and Electronics Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/circuits Master electronic circuit diagrams in LaTeX. Learn circuit symbols, components, and professional electronic schematics with CircuiTikZ. Learn how to create professional electronic circuit diagrams and schematics in LaTeX.## Essential Circuit Packages```latex example.tex theme=\{null} \usepackage{circuitikz} % Complete circuit diagrams \usepackage{tikz} % TikZ graphics \usepackage{siunitx} % SI units for electronics \usepackage{steinmetz} % Phasor notation \usepackage{units} % Unit formatting \usepackage{amsmath} % Math expressions ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Basic Circuit Elements### Passive Components```latex example.tex theme=\{null} \begin{circuitikz} % Resistor \draw (0,0) to[R, l=$R_1$] (2,0); % Capacitor \draw (0,0) to[C, l=$C_1$] (2,0); % Inductor \draw (0,0) to[L, l=$L_1$] (2,0); % Variable resistor \draw (0,0) to[vR, l=$R_{var}$] (2,0); % Potentiometer \draw (0,0) to[pR, l=$P_1$] (2,0); \end{circuitikz} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-circuits-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_circuits)### Active Components```latex example.tex theme=\{null} \begin{circuitikz} % Voltage source \draw (0,0) to[V, l=$V_s$] (2,0); % Current source \draw (0,0) to[I, l=$I_s$] (2,0); % Battery \draw (0,0) to[battery, l=$E$] (2,0); % AC source \draw (0,0) to[sV, l=$V_{ac}$] (2,0); % Dependent sources \draw (0,0) to[cV, l=$k V_x$] (2,0); % Voltage controlled \draw (0,0) to[cI, l=$g V_x$] (2,0); % Current controlled \end{circuitikz} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-circuits-03/page-1.svg)
> [card] Expected output > > CircuiTikZ renders circuit components as schematic symbols: > > **Resistor:** `to[R, l=$R_1$]` draws a zigzag resistor symbol labeled $R_1$ > > **Capacitor:** `to[C, l=$C_1$]` draws parallel plates symbol labeled $C_1$ > > **Voltage Source:** `to[V, l=$V_s$]` draws a circle with +/- terminals labeled $V_s$## Semiconductor Devices### Diodes and Transistors```latex example.tex theme=\{null} \begin{circuitikz} % Diode \draw (0,0) to[D, l=$D_1$] (2,0); % LED \draw (0,0) to[leDo, l=LED] (2,0); % Zener diode \draw (0,0) to[zD, l=$D_z$] (2,0); % Bipolar transistors \draw (0,0) node[npn](npn1){Q1}; \draw (0,-2) node[pnp](pnp1){Q2}; % MOSFET \draw (4,0) node[nmos](mos1){M1}; \draw (4,-2) node[pmos](mos2){M2}; % JFET \draw (8,0) node[njfet](jfet1){J1}; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Operational Amplifiers```latex example.tex theme=\{null} \begin{circuitikz} % Basic op-amp \draw (0,0) node[op amp](opamp1){}; % With power supplies \draw (0,-3) node[op amp, yscale=-1](opamp2){} (opamp2.up) node[above] {$+V_{CC}$} (opamp2.down) node[below] {$-V_{EE}$}; % Inverting amplifier circuit \draw (0,0) node[op amp](opamp){} (opamp.+) to[R, l=$R_2$] ++(0,-2) node[ground]{} (opamp.-) to[R, l=$R_1$] ++(-3,0) to[sV, l=$V_{in}$] ++(0,-2) node[ground]{} (opamp.-) to[R, l=$R_f$] ++(0,2) -| (opamp.out) (opamp.out) to[R, l=$R_L$] ++(2,0) node[ocirc, label=right:$V_{out}$]{}; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Complex Circuits### Complete Circuit Example```latex example.tex theme=\{null} \begin{circuitikz}[scale=1.2] % Power supply \draw (0,4) to[V, l=$12V$] (0,0) (0,4) to[short] (2,4) (0,0) node[ground]{}; % Voltage divider \draw (2,4) to[R, l=$R_1=\SI{10}{k\ohm}$] (2,2) to[R, l=$R_2=\SI{5}{k\ohm}$] (2,0) (2,0) to[short] (0,0); % Transistor amplifier \draw (2,2) to[short] (3,2) (3,2) to[R, l=$R_B=\SI{47}{k\ohm}$] (5,2) (5,2) node[npn, anchor=base](Q1){Q1} (Q1.collector) to[R, l=$R_C=\SI{2.2}{k\ohm}$] (5,4) (5,4) to[short] (2,4) (Q1.emitter) to[R, l=$R_E=\SI{1}{k\ohm}$] (5,0) (5,0) to[short] (2,0); % Output coupling \draw (Q1.collector) to[C, l=$C_{out}=\SI{10}{\mu F}$] (7,3) to[R, l=$R_L=\SI{8}{\ohm}$] (7,0) (7,0) to[short] (5,0) (7,3) node[ocirc, label=right:Output]{}; % Input coupling \draw (3,2) to[C, l=$C_{in}=\SI{1}{\mu F}$] (1,2) node[ocirc, label=left:Input]{}; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Digital Logic Circuits### Logic Gates```latex example.tex theme=\{null} \begin{circuitikz} % Basic gates \draw (0,0) node[and port](and1){}; \draw (0,-2) node[or port](or1){}; \draw (0,-4) node[not port](not1){}; \draw (4,0) node[xor port](xor1){}; \draw (4,-2) node[nand port](nand1){}; \draw (4,-4) node[nor port](nor1){}; % Labels \draw (and1.out) node[right=5mm] {AND}; \draw (or1.out) node[right=5mm] {OR}; \draw (not1.out) node[right=5mm] {NOT}; \draw (xor1.out) node[right=5mm] {XOR}; \draw (nand1.out) node[right=5mm] {NAND}; \draw (nor1.out) node[right=5mm] {NOR}; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Flip-Flops and Counters```latex example.tex theme=\{null} \begin{circuitikz} % D Flip-flop \draw (0,0) node[flipflop D](ff1){} (ff1.bpin 1) node[left] {D} (ff1.bpin 2) node[left] {CLK} (ff1.bpin 6) node[right] {Q} (ff1.bpin 7) node[right] {$\overline{Q}$}; % JK Flip-flop \draw (0,-4) node[flipflop JK](ff2){} (ff2.bpin 1) node[left] {J} (ff2.bpin 2) node[left] {CLK} (ff2.bpin 3) node[left] {K} (ff2.bpin 6) node[right] {Q} (ff2.bpin 7) node[right] {$\overline{Q}$}; % Clock signal \draw (ff1.bpin 2) to[short] ++(-1,0) to[square voltage source, l=CLK] ++(0,-1.5) to[short] ++(1,0) to (ff2.bpin 2); \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## AC Circuit Analysis### Phasor Diagrams```latex example.tex theme=\{null} \begin{circuitikz} % AC source and impedances \draw (0,0) to[sV, l=$V_s \angle 0°$] (0,3) to[R, l=$R=\SI{50}{\ohm}$] (3,3) to[L, l=$L=\SI{10}{mH}$] (6,3) to[C, l=$C=\SI{100}{\mu F}$] (6,0) to[short] (0,0); % Phasor diagram \begin{scope}[shift={(8,1.5)}, scale=1.5] \draw[->] (0,0) -- (2,0) node[right] {Re}; \draw[->] (0,0) -- (0,2) node[above] {Im}; \draw[->, thick, red] (0,0) -- (1.5,0.8) node[above right] {$V_R$}; \draw[->, thick, blue] (0,0) -- (0.5,1.5) node[above left] {$V_L$}; \draw[->, thick, green] (0,0) -- (0.8,-0.6) node[below right] {$V_C$}; \end{scope} \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Specialized Components### Transformers and Coupled Circuits```latex example.tex theme=\{null} \begin{circuitikz} % Ideal transformer \draw (0,0) to[L, l=$L_1$] (0,2) to[sV, l=$V_1$] (2,2) to[short] (2,0) to[short] (0,0); \draw (3,0) to[L, l=$L_2$] (3,2) to[R, l=$R_L$] (5,2) to[short] (5,0) to[short] (3,0); % Coupling \draw[dashed] (0.5,1) -- (2.5,1); \node at (1.5,1.2) {$k$}; % Center-tapped transformer \draw (0,-4) to[L, l=$L_1$] (0,-2) to[sV, l=$V_{ac}$] (2,-2) to[short] (2,-4) to[short] (0,-4); \draw (3,-4) to[L, l=$L_{2a}$] (3,-3) (3,-3) to[L, l=$L_{2b}$] (3,-2) to[short] (5,-2) to[D] (5,-3) to[D] (5,-4) to[short] (3,-4); \draw (3,-3) to[short] (6,-3) node[ground]{}; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Measurement and Test Equipment### Meters and Instruments```latex example.tex theme=\{null} \begin{circuitikz} % Voltmeter \draw (0,0) to[V, l=V] (2,0); % Ammeter \draw (0,-1) to[A, l=A] (2,-1); % Oscilloscope \draw (4,0) node[oscilloscope](scope){} (scope.in 1) node[left] {CH1} (scope.in 2) node[left] {CH2}; % Function generator \draw (0,-4) node[generator](gen){} (gen.out 1) node[right] {OUT} (gen.out 2) node[right] {GND}; % Multimeter \draw (4,-4) node[multimeter](mm){MM} (mm.north) node[above] {Digital} (mm.south) node[below] {Multimeter}; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Circuit Analysis Techniques### Node Voltage Analysis```latex example.tex theme=\{null} % Circuit with node labels \begin{circuitikz} \draw (0,0) node[ground]{} to[I, l=$I_s$] (0,2) to[short] (2,2) coordinate(n1) to[R, l=$R_1$] (4,2) coordinate(n2) to[R, l=$R_2$] (4,0) to[short] (0,0); \draw (n1) to[R, l=$R_3$] ++(0,-2) node[ground]{}; \draw (n2) to[I, l_=$I_o$, i_=$i_o$] ++(2,0) coordinate(n3) to[R, l=$R_L$] ++(0,-2) node[ground]{}; % Node labels \node at (n1) [above] {$v_1$}; \node at (n2) [above] {$v_2$}; \node at (n3) [above] {$v_3$}; % Equations \node at (2,-3) [align=left] { Node 1: $\frac{v_1}{R_3} + \frac{v_1-v_2}{R_1} = I_s$ \\ Node 2: $\frac{v_2-v_1}{R_1} + \frac{v_2}{R_2} + \frac{v_2-v_3}{R_L} = 0$ }; \end{circuitikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Units and Measurements### Electronic Units with siunitx```latex example.tex theme=\{null} % Basic electrical units \SI{12}{V} % Voltage \SI{2.5}{A} % Current \SI{100}{\ohm} % Resistance \SI{10}{k\ohm} % Kiloohms \SI{1}{M\ohm} % Megohms % Capacitance and inductance \SI{100}{\mu F} % Microfarads \SI{22}{pF} % Picofarads \SI{10}{mH} % Millihenries \SI{1}{\mu H} % Microhenries % Power and energy \SI{25}{W} % Watts \SI{100}{mW} % Milliwatts \SI{3.6}{kW.h} % Kilowatt-hours % Frequency \SI{60}{Hz} % Hertz \SI{1}{kHz} % Kilohertz \SI{2.4}{GHz} % Gigahertz ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-circuits-13/page-1.svg)
## Component Values and Tolerances### Standard Component Values```latex example.tex theme=\{null} % Resistor with tolerance $R_1 = \SI{4.7}{k\ohm} \pm 5\%$ % Capacitor specifications $C_1 = \SI{100}{\mu F}, \SI{25}{V}$ % Inductor with core material $L_1 = \SI{1}{mH}$ (ferrite core) % Transistor specifications $\beta = 100$, $V_{CE(sat)} = \SI{0.2}{V}$ % Power ratings $P_{max} = \SI{1/4}{W}$ at $\SI{25}{°C}$ ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Best Practices> [card] Clear Component Labels > > Always label components with both reference designators and values> [card] Consistent Symbol Style > > Use consistent symbols throughout your document> [card] Proper Scaling > > Scale circuits appropriately for readability> [card] Ground References > > Clearly indicate ground and reference points## Troubleshooting> [!WARNING] > > **Common issues**: > > * Component overlap: Adjust node spacing for complex circuits > * Label positioning: Use `l=`, `l_=`, `l^=` for different positions > * Line thickness: Use `thick` or `very thick` for emphasis > * Grid alignment: Use coordinates for precise component placement## Further Reading> [card] Physics Notation > > Physics equations and symbols[Open](/learn/latex/specialized-notation/physics)> [card] TikZ Diagrams > > Advanced TikZ diagrams[Open](/learn/latex/how-to/tikz-diagrams)> [card] Tables Reference > > Component specification tables[Open](/learn/latex/tables/creating-tables)> [card] Mathematics > > Mathematical analysis[Open](/learn/latex/mathematics/mathematical-expressions) # Linguistics Notation Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/linguistics Master linguistic notation in LaTeX. Learn phonetic symbols, syntax trees, morphological analysis, and specialized linguistics formatting. Learn how to typeset linguistic notation, phonetic symbols, and syntactic structures professionally in LaTeX.## Essential Linguistics Packages```latex example.tex theme=\{null} \usepackage{tipa} % Phonetic symbols (IPA) \usepackage{linguex} % Example numbering \usepackage{gb4e} % Alternative example numbering \usepackage{qtree} % Syntax trees \usepackage{forest} % Advanced tree diagrams \usepackage{tikz-qtree} % TikZ-based trees \usepackage{covington} % Linguistic examples \usepackage{vowel} % Vowel charts ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Phonetic Symbols (IPA)### Consonants```latex example.tex theme=\{null} % Stops \textipa{p b t d \:t \:d c \textbardotlessj k g q \textscg ?} % Fricatives \textipa{f v T D s z S Z s\super h z\super h C j\super h x G X R h H} % Nasals \textipa{m M n n\super h \:n N n\super G} % Liquids \textipa{l l\super h \:l L r r\super h \:r R} % Approximants \textipa{B j M\super j w \textbeltl} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Vowels```latex example.tex theme=\{null} % Front vowels \textipa{i I e E a} % Central vowels \textipa{1 @\super r @ 6 a} % Back vowels \textipa{u U o O A Q} % Additional vowels \textipa{y Y 2 9 O/ \textbari \textschwa} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > The TIPA package renders IPA phonetic symbols: > > **`\textipa{p}`** renders as **p** (voiceless bilabial stop) > > **`\textipa{T}`** renders as **θ** (voiceless dental fricative) > > **`\textipa{S}`** renders as **ʃ** (voiceless postalveolar fricative) > > **`\textipa{@}`** renders as **ə** (schwa)## Suprasegmentals and Prosodic Notation### Stress and Tone```latex example.tex theme=\{null} % Stress \textipa{"kA:l@} % Primary stress \textipa{%kA:l@} % Secondary stress % Tone markings \textipa{\`a} % Low tone \textipa{\'a} % High tone \textipa{\^a} % Rising tone \textipa{\v a} % Falling tone \textipa{\~a} % Mid tone % Tone letters \textipa{ma\tone{51}} % High falling \textipa{ma\tone{35}} % Mid rising \textipa{ma\tone{214}} % Low falling-rising % Length \textipa{a:} % Long \textipa{a\super h} % Half-long ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Syllable Structure```latex example.tex theme=\{null} % Syllable boundaries \textipa{sI.l@.b@l} % Prosodic word boundaries \textipa{|| wO:d || bawn.d@.ri ||} % Phonological phrases \textipa{( f@"nA.l@.dZI.k@l ) ( "freI.z@z )} % Metrical feet \textipa{(. "stres.t@d .) (. sI"la.b@l .)} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Linguistic Examples### Numbered Examples with linguex```latex example.tex theme=\{null} \ex. This is a simple example. \ex. \a. This is a subexample. \b. This is another subexample. \c. And yet another one. \ex. \label{important-ex} This example has a label for referencing. % Referencing As shown in (\ref{important-ex}), we can reference examples. % Glossed examples \ex. \gll Mary-ga hon-o yonda. Mary-NOM book-ACC read.PAST \glt 'Mary read a book.' ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Glossed Examples with gb4e```latex example.tex theme=\{null} \begin{exe} \ex This is an example. \ex \begin{xlist} \ex First subexample \ex Second subexample \end{xlist} \ex \gll Dies ist ein Beispiel. this is a example \glt 'This is an example.' \ex \glll María le-yó el libro. María 3.DAT-read.3SG.PAST the book Maria to.him-read the book \glt 'Maria read the book to him.' \end{exe} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Morphological Analysis### Morpheme Boundaries```latex example.tex theme=\{null} % Morpheme boundaries un-break-able re-write-ing cat-s % Allomorphs \{Z\} $\rightarrow$ [s] / [+voiceless] \{Z\} $\rightarrow$ [z] / [+voiced] \{Z\} $\rightarrow$ [@z] / [+sibilant] % Morphological rules \textsc{plural}: N $\rightarrow$ N + \{Z\} % Feature structures \begin{tabular}{l} [+animate] \\ [+human] \\ [-definite] \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Autosegmental Representation```latex example.tex theme=\{null} % Tone spreading \begin{tikzpicture} \node at (0,0) {k}; \node at (1,0) {a}; \node at (2,0) {l}; \node at (3,0) {a}; \draw (0.5,1) node {H} -- (1,0); \draw (0.5,1) -- (2,0); \draw (2.5,1) node {L} -- (3,0); \end{tikzpicture} % Multiple tiers \begin{tikzpicture}[scale=0.8] % Segmental tier \node at (0,0) {k}; \node at (1,0) {a}; \node at (2,0) {l}; \node at (3,0) {a}; % Tonal tier \node at (0,1) {H}; \node at (2,1) {L}; % Association lines \draw (0,1) -- (1,0); \draw (2,1) -- (3,0); \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-linguistics-09/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_linguistics)## Syntax Trees### Simple Trees with qtree```latex example.tex theme=\{null} % Basic tree \Tree [.S [.NP [.Det The ] [.N cat ] ] [.VP [.V sat ] [.PP [.P on ] [.NP [.Det the ] [.N mat ] ] ] ] ] % With movement \Tree [.CP [.C$'$ [.C that ] [.IP [.NP$_i$ Mary ] [.I$'$ [.I -ed ] [.VP [.V think ] [.CP [.NP$_j$ what ] [.C$'$ [.C ∅ ] [.IP [.NP t$_i$ ] [.VP [.V bought ] [.NP t$_j$ ] ] ] ] ] ] ] ] ] ] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Advanced Trees with forest```latex example.tex theme=\{null} \begin{forest} [S [NP [Det [the]] [N [student]] ] [VP [V [read]] [NP [Det [a]] [N [book]] ] ] ] \end{forest} % With features \begin{forest} [S [NP,roof [John]] [VP [V [believes]] [CP [C [that]] [S [NP,roof [Mary]] [VP [V [left]]]]]]] \end{forest} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Phonological Rules### Rule Notation```latex example.tex theme=\{null} % Basic rule format A $\rightarrow$ B / C \_ D % Specific examples /t/ $\rightarrow$ [t\super h] / \_ [+vowel] /n/ $\rightarrow$ [N] / \_ [+velar] % Feature-based rules [+consonant] $\rightarrow$ [+voice] / [+voice] \_ [+voice] % Syllable-based rules V $\rightarrow$ V: / \_ C\$ (vowel lengthening before coda) % Optional rules /t/ $\rightarrow$ (∅) / V \_ V (optional /t/ deletion) % Multiple environments /k/ $\rightarrow$ [c] / \_ \{i, e\} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Optimality Theory### Tableaux```latex example.tex theme=\{null} \begin{tabular}{|l||c|c|c|} \hline Input: /kata/ & \textsc{NoCoda} & \textsc{Max} & \textsc{Dep} \\ \hline\hline a. [kata] & *! & & \\ \hline b. [kat] & & *! & \\ \hline c. ☞ [ka.ta] & & & * \\ \hline \end{tabular} % Ranking \textsc{NoCoda} $\gg$ \textsc{Max} $\gg$ \textsc{Dep} % Violation marks * violation *! fatal violation ☞ optimal candidate ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Historical Linguistics### Sound Changes```latex example.tex theme=\{null} % Regular sound changes Proto-Indo-European *p > Germanic f % Conditioned changes PIE *k > Latin c / \_ [+front vowel] PIE *k > Latin qu / \_ [+back vowel] % Merger and split Middle English /a:/ > Modern English /eI/ (name) Middle English /a:/ > Modern English /A:/ (father) % Comparative method \begin{tabular}{lll} \textbf{English} & \textbf{German} & \textbf{Proto-Germanic} \\ father & Vater & *faðer- \\ mother & Mutter & *mo:ðer- \\ brother & Bruder & *broðer- \\ \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Sociolinguistics### Variation and Variables```latex example.tex theme=\{null} % Variables (ing): [IN] vs. [In] (th): [T] vs. [f] vs. [d] % Variable rules (r) $\rightarrow$ ∅ / V \_ \# (r-dropping) Probability: 0.8 (working class), 0.2 (middle class) % Correlation tables \begin{tabular}{|l|c|c|} \hline \textbf{Social Class} & \textbf{[IN]\%} & \textbf{[In]\%} \\ \hline Upper Middle & 95 & 5 \\ Lower Middle & 75 & 25 \\ Working & 25 & 75 \\ \hline \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Acoustic Phonetics### Spectrograms and Formants```latex example.tex theme=\{null} % Formant notation F1 = \SI{500}{Hz}, F2 = \SI{1500}{Hz}, F3 = \SI{2500}{Hz} % Vowel formant space \begin{tikzpicture}[scale=0.8] \draw[->] (0,0) -- (4,0) node[right] {F2 (Hz)}; \draw[->] (0,0) -- (0,3) node[above] {F1 (Hz)}; \node at (0.5,0.5) {i}; \node at (3.5,0.5) {u}; \node at (2,2.5) {a}; \node at (1.5,1) {e}; \node at (2.5,1) {o}; \end{tikzpicture} % VOT measurements VOT = \SI{+15}{ms} (aspirated) VOT = \SI{+5}{ms} (unaspirated) VOT = \SI{-85}{ms} (voiced) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-linguistics-16/page-1.svg)
## Language Typology### Typological Features```latex example.tex theme=\{null} % Word order typology \begin{tabular}{ll} \textbf{Type} & \textbf{Example} \\ SOV & Japanese, Turkish \\ SVO & English, Mandarin \\ VSO & Welsh, Irish \\ VOS & Malagasy \\ OVS & Hixkaryana \\ OSV & Warao \\ \end{tabular} % Implicational universals If a language has dual number, then it has plural number. If SOV $\rightarrow$ then postpositions (generally) % Morphological typology \textbf{Analytic}: Vietnamese, Chinese \textbf{Synthetic}: Latin, Russian \textbf{Agglutinative}: Turkish, Finnish \textbf{Polysynthetic}: Mohawk, Inuktitut ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-linguistics-17/page-1.svg)
## Writing Systems### Grapheme-Phoneme Correspondences```latex example.tex theme=\{null} % English spelling \textipa{/naIt/} $\leftrightarrow$ \textit{night, knight} \textipa{/tu:/} $\leftrightarrow$ \textit{two, too, to} % Arabic transliteration \textarabic{kitAb} ← k-t-b (root) \textarabic{kAtib} ← writer (active participle) % Chinese characters 汉字 hànzì (Chinese characters) 人 rén (person) + 木 mù (tree) = 休 xiū (rest) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Best Practices> [card] Consistent IPA Usage > > Use the same IPA conventions throughout your document> [card] Clear Example Formatting > > Number and format linguistic examples consistently> [card] Proper Glossing > > Follow Leipzig Glossing Rules for morpheme-by-morpheme translation> [card] Tree Readability > > Keep syntax trees simple and well-spaced for clarity## Common Abbreviations| Abbreviation | Meaning | | :- | :- | | **NOM** | Nominative | | **ACC** | Accusative | | **DAT** | Dative | | **GEN** | Genitive | | **1SG** | First person singular | | **3PL** | Third person plural | | **PAST** | Past tense | | **PRES** | Present tense | | **PERF** | Perfect aspect | | **PROG** | Progressive aspect |## Troubleshooting> [!WARNING] > > **Common issues**: > > * Missing TIPA fonts: Install the `tipa` package properly > * Tree alignment: Use appropriate tree packages for complex structures > * IPA rendering: Some symbols require special font handling > * Example numbering: Don't mix linguex and gb4e in the same document## Further Reading> [card] Music Notation > > Musical symbols and notation[Open](/learn/latex/specialized-notation/music)> [card] TikZ Diagrams > > Advanced TikZ diagrams for syntax trees[Open](/learn/latex/how-to/tikz-diagrams)> [card] Symbol Reference > > General symbol reference[Open](/learn/reference/symbols)> [card] Fonts Guide > > Text formatting techniques[Open](/learn/latex/fonts) # Music Notation Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/music Master music notation in LaTeX. Learn musical symbols, notes, chord notation, and how to create professional music scores and examples. Learn how to typeset musical notation, symbols, and scores professionally in LaTeX.## Essential Music Packages```latex example.tex theme=\{null} \usepackage{musixtex} % Complete music typesetting \usepackage{harmony} % Chord symbols \usepackage{guitar} % Guitar chord diagrams \usepackage{abc} % ABC notation support \usepackage{lilyglyphs} % LilyPond symbols \usepackage{leadsheets} % Lead sheets and songs ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
**Expected output:**> [card] Expected output > > Packages are loaded in the preamble and produce no visible output. They enable music notation commands throughout your document.## Musical Symbols| Symbol | LaTeX | Description | | :-: | :- | :- | | **♩** | `\quarternote` | Quarter note | | **♪** | `\eighthnote` | Eighth note | | **♫** | `\twonotes` | Beamed eighth notes | | **♭** | `\flat` | Flat | | **♯** | `\sharp` | Sharp | | **♮** | `\natural` | Natural | | **𝄞** | `\trebleclef` | Treble clef | | **𝄢** | `\bassclef` | Bass clef | | **𝄐** | `\textmusicalnote` | Generic note |## Basic Music Notation### Note Values and Rests```latex example.tex theme=\{null} % Note values \whole % Whole note \half % Half note \quarter % Quarter note \eighth % Eighth note \sixteenth % Sixteenth note % Rests \wholerest % Whole rest \halfrest % Half rest \quarterrest % Quarter rest \eighthrest % Eighth rest % Dotted notes \quarter. % Dotted quarter \half.. % Double dotted half ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Displays musical note values: whole note (𝅝), half note (𝅗𝅥), quarter note (♩), eighth note (♪), sixteenth note (𝅘𝅥𝅯). Corresponding rests appear as horizontal bars or symbols. Dotted notes show a small dot after the note head extending the duration by half.### Accidentals and Key Signatures```latex example.tex theme=\{null} % Accidentals C\sharp % C sharp B\flat % B flat F\natural % F natural G\doublesharp % G double sharp D\doubleflat % D double flat % Key signatures \keysignature{3\sharp} % A major / F# minor \keysignature{2\flat} % Bb major / G minor \keysignature{0} % C major / A minor ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Shows accidental symbols: C♯ (sharp raises pitch), B♭ (flat lowers pitch), F♮ (natural cancels previous accidental), G𝄪 (double sharp), D𝄫 (double flat). Key signatures display appropriate sharps or flats at the beginning of the staff.## Chord Notation### Chord Symbols with harmony```latex example.tex theme=\{null} % Basic chords \Cma % C major \Cmi % C minor \Cdim % C diminished \Caug % C augmented % Seventh chords \CmaSe % C major 7 \CmiSe % C minor 7 \Cdom % C7 (dominant) \CmiSeFlat % C minor 7 flat 5 % Extended chords \Cnine % C9 \Celeven % C11 \Cthirteen % C13 % Slash chords C/G % C major over G Am/F % A minor over F ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Displays professionally formatted chord symbols: Cmaj, Cmin, Cdim, Caug for basic triads. Seventh chords appear as Cmaj7, Cmin7, C7, Cm7♭5. Extended chords show C9, C11, C13. Slash chords display as C/G and Am/F with the bass note after the slash.## Guitar Chord Diagrams### Using the guitar Package```latex example.tex theme=\{null} % Basic chord diagram \gtab{C}{3:002010} \gtab{G}{3:002220} \gtab{Am}{X02210} \gtab{F}{1:X33211} % With finger positions \gtab*{D}{XX0232:000132} \gtab*{Em}{022000:012000} % Barre chords \gtab{Bm}{2:X13321} \gtab{F\sharp m}{2:133111} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Renders guitar chord diagrams as fretboard grids showing finger positions. Each diagram displays 6 vertical strings and horizontal frets with dots indicating where to press. X marks strings not played, O marks open strings. Barre chords show a bar across multiple strings.## Simple Scores with MusiXTeX### Basic Staff Notation```latex example.tex theme=\{null} \begin{music} \instrumentnumber{1} \setstaffs1{1} \generalmeter{\meterfrac44} \startpiece % Simple melody \notes\qu c\en % Quarter note C \notes\hu d\en % Half note D \notes\qu{ef}\en % Quarter notes E and F \notes\wh g\en % Whole note G \endpiece \end{music} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-music-06/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_music)**Expected output:**> [card] Expected output > > Displays a musical staff with treble clef (𝄞) and 4/4 time signature. Notes appear on the five-line staff: C (quarter), D (half), E-F (quarters), G (whole). Note heads are positioned at correct pitch heights with appropriate stems.### Two-Staff System```latex example.tex theme=\{null} \begin{music} \instrumentnumber{1} \setstaffs1{2} % Two staves \setclef1{\treble\bass} % Treble and bass clefs \generalmeter{\meterfrac44} \startpiece % Right hand \notes\qu{ceg}\en % C major chord \notes\qu{ceg}\en % Left hand \Notes\ql{C}\en \Notes\ql{G}\en \endpiece \end{music} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-music-07/page-1.svg)
**Expected output:**> [card] Expected output > > Shows a grand staff (piano system) with treble clef (𝄞) on top and bass clef (𝄢) on bottom, connected by a brace. The right hand plays C major chord (C-E-G) on the upper staff while the left hand plays bass notes C and G on the lower staff.## Lead Sheets with leadsheets### Song Structure```latex example.tex theme=\{null} \begin{song}{title={My Song}, composer={John Doe}, key={C major}} \begin{verse} \chord{C}This is the \chord{Am}first line \chord{F}Of my \chord{G}song \chord{C}today \end{verse} \begin{chorus} \chord{F}Sing a\chord{C}long \chord{G}Everyone \chord{C}sing \end{chorus} \end{song} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Produces a formatted lead sheet with title "My Song" and composer credit. Verse and chorus sections are labeled. Chord symbols (C, Am, F, G) appear above the lyrics at the appropriate syllables, creating a professional songbook layout.## Rhythm Notation### Time Signatures and Tempo```latex example.tex theme=\{null} % Time signatures \timesignature{4}{4} % 4/4 time \timesignature{3}{4} % 3/4 time \timesignature{6}{8} % 6/8 time \timesignature{5}{4} % 5/4 time % Tempo markings \tempo{Allegro} \tempo{Andante \quarternote = 72} \tempo{Presto \halfnote = 140} % Metronome markings MM \quarternote = 120 MM \halfnote. = 60 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Displays time signatures as stacked numbers (4/4, 3/4, 6/8, 5/4). Tempo markings show Italian terms like "Allegro" or "Andante" with metronome values. Metronome markings appear as "♩ = 120" indicating beats per minute.## Musical Expressions### Dynamics and Articulation```latex example.tex theme=\{null} % Dynamics \pp % Pianissimo \p % Piano \mp % Mezzo-piano \mf % Mezzo-forte \f % Forte \ff % Fortissimo % Crescendo and diminuendo \cresc % Crescendo \dim % Diminuendo \< % Hairpin crescendo \> % Hairpin diminuendo % Articulation \staccato % Staccato dot \accent % Accent mark \tenuto % Tenuto line \fermata % Fermata ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Shows dynamic markings in italic: pp (very soft), p (soft), mp (medium soft), mf (medium loud), f (loud), ff (very loud). Crescendo and diminuendo appear as hairpin wedges (\< and >). Articulation marks include staccato dots, accent marks (>), tenuto lines, and fermata symbols (𝄐).## ABC Notation Integration### Using ABC Notation```latex example.tex theme=\{null} % ABC notation example \begin{abc}[name=melody] X:1 T:Simple Melody M:4/4 L:1/4 K:C C D E F | G2 G2 | F E D C | C4 || \end{abc} % Inline ABC \abcinline{C D E F G} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Converts ABC notation into standard music notation. The melody "Simple Melody" appears on a staff in C major, 4/4 time. Notes C-D-E-F followed by two half-note Gs, then F-E-D-C, ending with a whole-note C. Bar lines separate measures.## Musical Analysis### Roman Numeral Analysis```latex example.tex theme=\{null} % Roman numerals for harmony \newcommand{\romnum}[1]{\textsc{#1}} In C major: \romnum{I} - \romnum{IV} - \romnum{V} - \romnum{I} % With inversions \romnum{I}\textsuperscript{6} - \romnum{IV}\textsuperscript{6/4} - \romnum{V}\textsuperscript{7} % Minor keys (lowercase) In A minor: \romnum{i} - \romnum{iv} - \romnum{V} - \romnum{i} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-music-12/page-1.svg)
**Expected output:**> [card] Expected output > > Displays Roman numeral chord analysis in small caps. Major key progression: I - IV - V - I. Inversions shown with figured bass: I6, IV6/4, V7. Minor key uses lowercase: i - iv - V - i. These symbols appear below the staff in harmonic analysis.### Form Analysis```latex example.tex theme=\{null} % Sections \textbf{A:} mm. 1-8 \textbf{B:} mm. 9-16 \textbf{A':} mm. 17-24 % Phrases \begin{tikzpicture} \draw[thick] (0,0) -- (4,0); \draw[thick] (0,0) -- (0,0.2); \draw[thick] (4,0) -- (4,0.2); \node at (2,-0.3) {4 measures}; \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-music-13/page-1.svg)
**Expected output:**> [card] Expected output > > Shows musical form sections labeled A (mm. 1-8), B (mm. 9-16), A' (mm. 17-24) in bold text. Phrase diagrams display horizontal lines with vertical endpoints marking phrase boundaries, with "4 measures" labeled beneath each phrase bracket.## Lyrics and Text### Aligning Lyrics to Music```latex example.tex theme=\{null} \begin{music} \instrumentnumber{1} \setstaffs1{1} \setlyrics1{1} \startpiece \notes\qu{c}\en \lyrics{This } \notes\qu{d}\en \lyrics{is } \notes\qu{e}\en \lyrics{my } \notes\hu{f}\en \lyrics{song } \endpiece \end{music} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Displays a melodic line with lyrics aligned below each note. The words "This is my song" appear with each syllable centered under its corresponding note (C, D, E, F). The half note on "song" shows extended duration.## Musical Tables### Interval Reference Table```latex example.tex theme=\{null} \begin{table}[h] \centering \begin{tabular}{|l|c|c|} \hline \textbf{Interval} & \textbf{Semitones} & \textbf{Example} \\ \hline Unison & 0 & C-C \\ Minor 2nd & 1 & C-D♭ \\ Major 2nd & 2 & C-D \\ Minor 3rd & 3 & C-E♭ \\ Major 3rd & 4 & C-E \\ Perfect 4th & 5 & C-F \\ Tritone & 6 & C-F♯ \\ Perfect 5th & 7 & C-G \\ \hline \end{tabular} \caption{Common musical intervals} \end{table} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Expected output:**> [card] Expected output > > Produces a formatted table with columns for Interval, Semitones, and Example. Lists musical intervals from Unison (0 semitones, C-C) through Perfect 5th (7 semitones, C-G), including Minor/Major 2nds, 3rds, Perfect 4th, and Tritone. Includes a caption "Common musical intervals."## Special Music Characters### Unicode Music Symbols```latex example.tex theme=\{null} % Requires fontspec and XeLaTeX/LuaLaTeX \usepackage{fontspec} % Musical symbols 🎵 🎶 🎼 🎹 🎸 🎺 🎻 🥁 % Note values 𝅝 𝅗𝅥 𝅘𝅥 𝅘𝅥𝅮 𝅘𝅥𝅯 𝅘𝅥𝅰 𝅘𝅥𝅱 𝅘𝅥𝅲 % Clefs 𝄞 𝄢 𝄡 𝄟 𝄠 ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-music-16/page-1.svg)
**Expected output:**> [card] Expected output > > Displays Unicode music symbols including emoji instruments: 🎵 🎶 🎼 🎹 🎸 🎺 🎻 🥁. Musical notation symbols show note values from whole to 128th notes. Clef symbols display: 𝄞 (treble), 𝄢 (bass), 𝄡 (alto), and percussion clefs.## Best Practices> [card] Choose the Right Package > > Select packages based on your needs - MusiXTeX for full scores, harmony for chord symbols> [card] Consistent Notation > > Use standard music notation conventions throughout> [card] Clear Layout > > Ensure adequate spacing between staves and systems> [card] Compile Multiple Times > > Music packages often require multiple compilation passes## Troubleshooting> [!WARNING] > > **Common issues**: > > * MusiXTeX requires special compilation: Run `musixtex` command > * Font conflicts: Some music fonts require specific setup > * Spacing issues: Manual adjustment often needed for complex scores## Further Reading> [card] Linguistics Notation > > Phonetic symbols and syntax trees[Open](/learn/latex/specialized-notation/linguistics)> [card] Symbol Reference > > General symbol reference[Open](/learn/reference/symbols)> [card] Creating Diagrams > > Creating diagrams with TikZ[Open](/learn/latex/how-to/tikz-diagrams)> [card] Advanced Text Formatting > > Text styling, emphasis, and structure[Open](/learn/latex/text-formatting) # Physics Notation and Symbols Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/physics Master physics notation in LaTeX - from quantum mechanics to relativity. Learn vectors, tensors, bra-ket notation, and specialized physics symbols. Learn how to typeset physics equations, symbols, and notation professionally in LaTeX.## Essential Physics Packages```latex example.tex theme=\{null} \usepackage{amsmath} % Essential math \usepackage{amssymb} % Extra symbols \usepackage{physics} % Physics shortcuts \usepackage{siunitx} % SI units \usepackage{tensor} % Tensor notation \usepackage{braket} % Quantum mechanics ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Common Physics Symbols| Symbol | LaTeX | Description | | :-: | :- | :- | | **ℏ** | `\hbar` | Reduced Planck constant | | **∇** | `\nabla` | Gradient/Del operator | | **∂** | `\partial` | Partial derivative | | **∞** | `\infty` | Infinity | | **·** | `\cdot` | Dot product | | **×** | `\times` | Cross product | | **⊗** | `\otimes` | Tensor product | | **∑** | `\sum` | Summation | | **∫** | `\int` | Integral | | **∮** | `\oint` | Closed integral |## Vectors and Tensors### Vector Notation```latex example.tex theme=\{null} % Different vector styles \vec{F} = m\vec{a} % Arrow notation \mathbf{F} = m\mathbf{a} % Bold notation \boldsymbol{\tau} = \vec{r} \times \vec{F} % Bold Greek % Vector operations \vec{A} \cdot \vec{B} % Dot product \vec{A} \times \vec{B} % Cross product |\vec{v}| \text{ or } \|\vec{v}\| % Magnitude % Unit vectors \hat{i}, \hat{j}, \hat{k} % Cartesian \hat{r}, \hat{\theta}, \hat{\phi} % Spherical ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [card] Expected output > > **Newton's Second Law:** $\vec{F} = m\vec{a}$ > > **Dot Product:** $\vec{A} \cdot \vec{B}$ > > **Cross Product:** $\vec{A} \times \vec{B}$ > > **Unit Vectors:** $\hat{i}, \hat{j}, \hat{k}$### Tensor Notation```latex example.tex theme=\{null} % Tensor indices T^{\mu\nu} % Contravariant T_{\mu\nu} % Covariant T^{\mu}_{\nu} % Mixed % Einstein notation g_{\mu\nu} = \eta_{\mu\nu} + h_{\mu\nu} % Christoffel symbols \Gamma^{\lambda}_{\mu\nu} % Riemann tensor R^{\rho}_{\sigma\mu\nu} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Quantum Mechanics### Bra-Ket Notation```latex example.tex theme=\{null} % Basic bra-ket \ket{\psi} % Ket \bra{\phi} % Bra \braket{\phi|\psi} % Inner product \braket{\phi|H|\psi} % Matrix element % Operators \hat{H}\ket{\psi} = E\ket{\psi} % Eigenvalue equation \hat{p} = -i\hbar\frac{\partial}{\partial x} % Commutators [\hat{x}, \hat{p}] = i\hbar \{\hat{a}, \hat{a}^{\dagger}\} = 1 % Anticommutator ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Wave Functions```latex example.tex theme=\{null} % Schrödinger equation i\hbar\frac{\partial}{\partial t}\Psi = \hat{H}\Psi % Plane wave \psi(x,t) = Ae^{i(kx - \omega t)} % Spherical harmonics Y_{\ell}^m(\theta, \phi) % Probability density |\psi(x,t)|^2 = \psi^*(x,t)\psi(x,t) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Classical Mechanics### Lagrangian and Hamiltonian```latex example.tex theme=\{null} % Lagrangian L = T - V = \frac{1}{2}m\dot{x}^2 - V(x) % Euler-Lagrange equation \frac{d}{dt}\frac{\partial L}{\partial \dot{q}} - \frac{\partial L}{\partial q} = 0 % Hamiltonian H = \sum_i p_i\dot{q}_i - L % Hamilton's equations \dot{q}_i = \frac{\partial H}{\partial p_i}, \quad \dot{p}_i = -\frac{\partial H}{\partial q_i} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Electromagnetism### Maxwell's Equations```latex example.tex theme=\{null} % Differential form \nabla \cdot \vec{E} = \frac{\rho}{\epsilon_0} \nabla \cdot \vec{B} = 0 \nabla \times \vec{E} = -\frac{\partial \vec{B}}{\partial t} \nabla \times \vec{B} = \mu_0\vec{J} + \mu_0\epsilon_0\frac{\partial \vec{E}}{\partial t} % Integral form \oint_S \vec{E} \cdot d\vec{A} = \frac{Q_{\text{enc}}}{\epsilon_0} \oint_C \vec{E} \cdot d\vec{\ell} = -\frac{d\Phi_B}{dt} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Field Notation```latex example.tex theme=\{null} % Electromagnetic tensor F^{\mu\nu} = \partial^{\mu}A^{\nu} - \partial^{\nu}A^{\mu} % Four-potential A^{\mu} = (\phi/c, \vec{A}) % Lorentz force \vec{F} = q(\vec{E} + \vec{v} \times \vec{B}) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Thermodynamics### Thermodynamic Relations```latex example.tex theme=\{null} % First law dU = \delta Q - \delta W = TdS - PdV % Partial derivatives \left(\frac{\partial U}{\partial S}\right)_V = T \left(\frac{\partial U}{\partial V}\right)_S = -P % Maxwell relations \left(\frac{\partial T}{\partial V}\right)_S = -\left(\frac{\partial P}{\partial S}\right)_V ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Units and Constants### SI Units with siunitx```latex example.tex theme=\{null} % Basic units \SI{3e8}{m/s} % Speed of light \SI{6.626e-34}{J.s} % Planck constant \SI{9.81}{m/s^2} % Acceleration % Complex units \SI{13.6}{eV} % Energy \SI{2.5}{kg.m/s} % Momentum \SI{1.23e-4}{N.m} % Torque % Uncertainties \SI{9.81 \pm 0.02}{m/s^2} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-physics-10/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_physics)## Special Relativity### Four-Vectors and Metrics```latex example.tex theme=\{null} % Four-vectors x^{\mu} = (ct, \vec{x}) p^{\mu} = (E/c, \vec{p}) % Minkowski metric \eta_{\mu\nu} = \text{diag}(1, -1, -1, -1) % Lorentz transformation x'^{\mu} = \Lambda^{\mu}_{\nu} x^{\nu} % Invariant interval ds^2 = c^2dt^2 - dx^2 - dy^2 - dz^2 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Tips for Physics Documents> [card] Use Consistent Notation > > Stick to either arrows or bold for vectors throughout your document> [card] Define Your Symbols > > Always define non-standard symbols when first introduced> [card] Group Related Equations > > Use align environments for related equations> [card] Number Important Equations > > Only number equations you reference later## Common Physics Environments```latex example.tex theme=\{null} % For derivations \begin{align} F &= ma \\ &= m\frac{dv}{dt} \\ &= \frac{dp}{dt} \end{align} % For definitions \begin{equation} \boxed{E = mc^2} \end{equation} % For multiple cases \begin{cases} \psi(x) = Ae^{ikx} + Be^{-ikx} & \text{for } x < 0 \\ \psi(x) = Ce^{-\kappa x} & \text{for } x > 0 \end{cases} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> [!NOTE] > > **Pro tip**: The `physics` package provides many shortcuts like `\dv{f}{x}` for derivatives and `\abs{\psi}` for absolute values.## Further Reading> [card] Mathematical Expressions > > General mathematical typesetting[Open](/learn/latex/mathematics/mathematical-expressions)> [card] Chemistry Notation > > Chemical formulas and equations[Open](/learn/latex/specialized-notation/chemistry)> [card] Symbol Reference > > Complete symbol reference[Open](/learn/reference/symbols)> [card] Advanced Math > > Advanced mathematical concepts[Open](/learn/latex/mathematics/advanced-math) # Pseudocode in LaTeX: algorithm, algorithmicx, and algpseudocode Source: https://resources.latex-cloud-studio.com/learn/latex/specialized-notation/pseudocode Write pseudocode in LaTeX with algorithm and algpseudocode. Copy a working example with line numbers, loops, procedures, captions, and error fixes. To write pseudocode in LaTeX, load `algorithm` for the numbered float and `algpseudocode` for commands such as `\State`, `\If`, `\For`, and `\Procedure`. Put an `algorithmic` block inside `algorithm` when you need both formatted steps and a caption. > [!NOTE] > > **Quick answer**: `algorithm` controls caption, numbering, and float placement; `algpseudocode` supplies the readable pseudocode syntax. The complete example below uses both and compiles with pdfLaTeX. > > **Related topics**: [Algorithms, complexity, and CS notation](/learn/latex/specialized-notation/algorithms) | [Code listings and minted](/learn/latex/formatting/code-listings-minted) ## Minimal Working Pseudocode Example The optional `[1]` after `\begin{algorithmic}` enables a line number on every line. Remove it when the algorithm should be unnumbered. ```latex pseudocode-setup.tex theme={null} \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Linear Search} \begin{algorithmic}[1] \For{$i = 1$ \textbf{to} $n$} \If{$A[i] = x$} \State \Return $i$ \EndIf \EndFor \State \Return \textsc{not found} \end{algorithmic} \end{algorithm} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pseudocode-setup.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-specialized-notation-pseudocode-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_specialized_notation_pseudocode) ## What Each Pseudocode Package Does | Package or environment | Purpose | Use it when... | | - | - | - | | `algorithm` | Creates a floating wrapper with caption and algorithm number | The pseudocode needs a caption, label, or float placement | | `algorithmicx` | Provides the extensible pseudocode framework | You need a base for a specific pseudocode style | | `algpseudocode` | Loads the common `algorithmicx` style and commands | You want `\State`, `\If`, `\For`, `\While`, and procedures | | `algorithm2e` | Provides a separate all-in-one syntax and visual style | A publisher or template explicitly requires it | > [!WARNING] > > The `algorithmic`, `algpseudocode`, and `algorithm2e` interfaces are not interchangeable. Choose one command family for a document instead of mixing their syntax. ## Common Pseudocode Commands | Command | Meaning | | - | - | | `\State` | Add one instruction | | `\If` / `\ElsIf` / `\Else` / `\EndIf` | Create a conditional block | | `\For` / `\EndFor` | Create a for-loop | | `\While` / `\EndWhile` | Create a while-loop | | `\Procedure` / `\EndProcedure` | Define a named procedure | | `\Function` / `\EndFunction` | Define a function with a return value | | `\Call` | Format a procedure or function call | | `\Return` | Format a returned value | ```latex pseudocode-commands.tex theme={null} \begin{algorithmic}[1] \Procedure{BinarySearch}{$A, x$} \State $left \gets 1$ \State $right \gets \Call{length}{A}$ \While{$left \leq right$} \State $mid \gets \lfloor (left + right) / 2 \rfloor$ \If{$A[mid] = x$} \State \Return $mid$ \ElsIf{$A[mid] < x$} \State $left \gets mid + 1$ \Else \State $right \gets mid - 1$ \EndIf \EndWhile \State \Return \textsc{not found} \EndProcedure \end{algorithmic} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from pseudocode-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-specialized-notation-pseudocode-02/page-1.svg)
## Numbered Lines and Procedures The optional number in `\begin{algorithmic}[1]` controls the line-number interval. Use `[1]` for every line, `[2]` for every second line, or omit the option for no line numbers. Use `\Procedure` for a named block of steps and `\Function` when the block conceptually returns a value. ## `algorithm` vs `algorithmicx` vs `algpseudocode` * `algorithm` is only the outer float; it does not define `\State` or `\If`. * `algorithmicx` is the framework on which several pseudocode styles are built. * `algpseudocode` is the commonly used `algorithmicx` style that defines the commands shown on this page. * For most papers and assignments, load `algorithm` and `algpseudocode` together. ## Captions, Labels, and Float Placement Place `\caption` inside `algorithm` and add `\label` immediately after it when you need a cross-reference. Because `algorithm` is a float, LaTeX may move it to a suitable position. A placement option such as `[htbp]` expresses a preference; it does not guarantee an exact location. If the publisher controls algorithm styling, start with its class or template before selecting packages. Some journal classes define their own algorithm environment or disallow conflicting packages. ## Alternatives | If you need... | Better choice | | - | - | | Structured, language-neutral algorithm steps | `algorithm` + `algpseudocode` | | A publisher-required ruled or boxed algorithm style | `algorithm2e`, if the template specifies it | | Real compilable source code | [`listings` or `minted`](/learn/latex/formatting/code-listings-minted) | | A short mathematical definition | An `equation`, `align`, or cases environment | ## Common Errors | Error or symptom | Cause | Fix | | - | - | - | | `Environment algorithm undefined` | The float package is missing | Load `\usepackage{algorithm}` | | `Environment algorithmic undefined` | No pseudocode style is loaded | Load `\usepackage{algpseudocode}` | | `Undefined control sequence \State` | The document loaded a different command family | Use `algpseudocode` commands consistently | | `\caption` does not work | The block is not inside an `algorithm` float | Wrap `algorithmic` in `algorithm` | | Algorithm floats away from the paragraph | Normal float placement is active | Use a sensible placement preference and let LaTeX paginate | | Commands conflict after adding `algorithm2e` | Two incompatible interfaces are loaded | Keep one pseudocode package family | ## Pseudocode Writing Practices * Describe the algorithm rather than the syntax of one programming language. * Use consistent capitalization for commands, variables, and procedure names. * Keep each `\State` focused on one logical action. * Add line numbers when the surrounding text refers to specific steps. * Use a caption that explains the algorithm's purpose, not merely “Pseudocode.” ## When to Use This Page vs the Algorithms Guide Use this page when you specifically need to format pseudocode. Use the broader [algorithms guide](/learn/latex/specialized-notation/algorithms) when you also need complexity notation, graph notation, or other computer-science symbols. ## Try Pseudocode in LaTeX Cloud Studio > [card] Compile the pseudocode example > > Paste the complete example into the browser editor and adapt the procedure, caption, and line numbering. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=pseudocode_open_app) > [card] Compare real code listings > > Use listings or minted when the document should show source code instead of language-neutral pseudocode. [Open](/learn/latex/formatting/code-listings-minted) # Advanced Table Features Source: https://resources.latex-cloud-studio.com/learn/latex/tables/advanced-tables Master complex table layouts in LaTeX. Learn about long tables, landscape orientation, nested tables, and professional formatting techniques. This guide covers advanced table features for complex documents, including multi-page tables, professional layouts, and specialized table environments.> [!NOTE] > > **Prerequisites**: Familiarity with basic table creation. See [Creating Tables](/learn/latex/tables/creating-tables) if you need a refresher.## Long Tables### Tables Spanning Multiple Pages```latex longtable-basic.tex theme=\{null} \documentclass{article} \usepackage{longtable} \begin{document} \begin{longtable}{lcc} \caption{Long table example} \label{tab:long} \\ \hline \textbf{Name} & \textbf{Value} & \textbf{Unit} \\ \hline \endfirsthead \multicolumn{3}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\ \hline \textbf{Name} & \textbf{Value} & \textbf{Unit} \\ \hline \endhead \hline \multicolumn{3}{r}{\textit{Continued on next page}} \\ \endfoot \hline \endlastfoot % Table data Item 1 & 10.5 & kg \\ Item 2 & 23.1 & kg \\ Item 3 & 45.7 & kg \\ % ... many more rows ... Item 50 & 89.2 & kg \\ \end{longtable} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from longtable-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_tables_advanced_tables)### Longtable Features```latex longtable-advanced.tex theme=\{null} \usepackage{longtable} \usepackage{booktabs} \begin{longtable}{@{}lrrr@{}} \caption{Sales data over multiple pages} \\ \toprule Product & Q1 & Q2 & Q3 \\ \midrule \endfirsthead \caption[]{(continued)} \\ \toprule Product & Q1 & Q2 & Q3 \\ \midrule \endhead \midrule \multicolumn{4}{r}{Continued on next page...} \\ \endfoot \bottomrule \multicolumn{4}{r}{Total: \$1,234,567} \\ \endlastfoot % Data rows Product A & 100 & 150 & 120 \\ Product B & 200 & 180 & 220 \\ % ... more data ... \end{longtable} % Column width control \setlength{\LTleft}{0pt} \setlength{\LTright}{0pt} \begin{longtable}{|p{3cm}|p{5cm}|p{4cm}|} % Table content \end{longtable} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from longtable-advanced.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-02/page-1.svg)
## Landscape Tables### Rotating Large Tables```latex landscape-tables.tex theme=\{null} \documentclass{article} \usepackage{rotating} \usepackage{pdflscape} \begin{document} % Sideways table \begin{sidewaystable} \centering \caption{Wide table in landscape} \begin{tabular}{lccccccc} \hline Category & Jan & Feb & Mar & Apr & May & Jun & Jul \\ \hline Sales & 100 & 120 & 135 & 110 & 145 & 160 & 155 \\ Costs & 80 & 85 & 90 & 88 & 95 & 100 & 98 \\ Profit & 20 & 35 & 45 & 22 & 50 & 60 & 57 \\ \hline \end{tabular} \end{sidewaystable} % Landscape page with table \begin{landscape} \begin{table} \centering \caption{Very wide table on landscape page} \begin{tabular}{l*{12}{c}} % 12 columns of data \end{tabular} \end{table} \end{landscape} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from landscape-tables.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from landscape-tables.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-03/page-2.svg)
### Rotating Table Content```latex rotating-content.tex theme=\{null} \usepackage{rotating} \usepackage{array} % Rotate column headers \begin{tabular}{l*{5}{c}} \hline City & \rotatebox{90}{Population} & \rotatebox{90}{Area (km²)} & \rotatebox{90}{Density} & \rotatebox{90}{Founded} & \rotatebox{90}{Elevation} \\ \hline New York & 8.3M & 783 & 10,194 & 1624 & 10m \\ London & 9.0M & 1,572 & 5,701 & 43 & 11m \\ Tokyo & 13.9M & 2,194 & 6,349 & 1457 & 40m \\ \hline \end{tabular} % Angled headers \newcolumntype{R}[1]{>{\rotatebox{45}\bgroup}l<{\egroup}} \begin{tabular}{l*{4}{R{1cm}}} Product & Price & Stock & Sales & Revenue \\ \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from rotating-content.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-04/page-1.svg)
## Nested and Complex Tables### Tables Within Tables```latex nested-tables.tex theme=\{null} \documentclass{article} \usepackage{array} \begin{document} \begin{tabular}{|l|c|} \hline Category & Details \\ \hline Group A & \begin{tabular}{@{}lr@{}} Item 1 & 10 \\ Item 2 & 20 \\ Item 3 & 30 \\ \hline Total & 60 \end{tabular} \\ \hline Group B & \begin{tabular}{@{}lr@{}} Item X & 15 \\ Item Y & 25 \\ \hline Total & 40 \end{tabular} \\ \hline \end{tabular} % More complex nesting \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{Main Table} \\ \hline Left cell with table & \begin{tabular}[t]{@{}cc@{}} \multicolumn{2}{c}{Subtable} \\ A & B \\ C & D \end{tabular} \\ \hline \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from nested-tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-05/page-1.svg)
### Mixed Content Tables```latex mixed-content.tex theme=\{null} \usepackage{graphicx} \usepackage{tikz} \begin{tabular}{lcp{5cm}} \hline Type & Visual & Description \\ \hline Circle & \begin{tikzpicture}[baseline=-0.5ex] \draw[fill=blue!20] (0,0) circle (0.5cm); \end{tikzpicture} & A closed curve where all points are equidistant from the center. \\ \hline Square & \includegraphics[width=1cm]{square} & A quadrilateral with four equal sides and four right angles. \\ \hline Formula & $E = mc^2$ & Einstein's mass-energy equivalence equation. \\ \hline \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Professional Table Packages### Using booktabs```latex booktabs-professional.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \begin{document} % Professional table design \begin{table} \centering \caption{Experimental results with uncertainties} \begin{tabular}{l S[table-format=3.1] @{${}\pm{}$} S[table-format=1.1] S[table-format=3.2]} \toprule Sample & \multicolumn{2}{c}{Mass (g)} & {Density (g/cm³)} \\ \midrule A & 123.4 & 0.5 & 2.34 \\ B & 87.2 & 0.3 & 1.98 \\ C & 156.9 & 0.8 & 3.12 \\ \midrule Mean & 122.5 & 0.5 & 2.48 \\ \bottomrule \end{tabular} \end{table} % Publication-quality table \begin{table*} % Two-column span \centering \caption{Comparison of methods} \begin{tabular}{@{}lrrrrr@{}} \toprule Method & \multicolumn{2}{c}{Dataset A} & \multicolumn{2}{c}{Dataset B} & Overall \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} & Precision & Recall & Precision & Recall & F1-Score \\ \midrule Baseline & 0.82 & 0.79 & 0.75 & 0.81 & 0.79 \\ Proposed & \textbf{0.91} & \textbf{0.88} & \textbf{0.87} & \textbf{0.90} & \textbf{0.89} \\ \bottomrule \end{tabular} \end{table*} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from booktabs-professional.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-07/page-1.svg)
### Using threeparttable```latex threeparttable.tex theme=\{null} \usepackage{threeparttable} \usepackage{booktabs} \begin{threeparttable} \caption{Results with footnotes} \begin{tabular}{lcc} \toprule Treatment & Response\tnote{a} & p-value \\ \midrule Control & 23.4 ± 2.1 & — \\ Drug A & 31.2 ± 1.8\tnote{b} & 0.002 \\ Drug B & 28.9 ± 2.3 & 0.041 \\ Combined & 35.6 ± 1.5\tnote{b,c} & <0.001 \\ \bottomrule \end{tabular} \begin{tablenotes} \item[a] Mean ± standard error \item[b] Significantly different from control (p < 0.01) \item[c] Synergistic effect observed \end{tablenotes} \end{threeparttable} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from threeparttable.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-08/page-1.svg)
## Advanced Formatting### Custom Column Types```latex custom-columns.tex theme=\{null} \documentclass{article} \usepackage{array} \usepackage{ragged2e} \begin{document} % Define custom column types \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} \newcolumntype{N}{@{}l@{}} \begin{tabular}{L{3cm} C{3cm} R{3cm}} \hline Left aligned text with wrapping & Centered text that wraps nicely & Right aligned text with automatic wrapping \\ \hline \end{tabular} % Currency column \newcolumntype{$}{>{\global\let\currentrowstyle\relax}} \newcolumntype{^}{>{\currentrowstyle}} \begin{tabular}{l $r<{\,€}} Product & \multicolumn{1}{c}{Price} \\ \hline Laptop & 1299.99 \\ Mouse & 29.95 \\ Total & \bfseries 1329.94 \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-columns.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-09/page-1.svg)
### Conditional Formatting```latex conditional-formatting.tex theme=\{null} \usepackage{xcolor} \usepackage{array} \usepackage{collcell} % Highlight negative numbers \newcommand{\colorednumber}[1]{% \ifdim#1pt<0pt\color{red}\fi#1% } \newcolumntype{Q}{>{\collectcell\colorednumber}r<{\endcollectcell}} \begin{tabular}{lQ} \hline Item & Profit \\ \hline Product A & 150.00 \\ Product B & -25.50 \\ Product C & 75.25 \\ Product D & -10.00 \\ \hline \end{tabular} % Conditional row coloring \newcommand{\rowcolor}[1]{\rowcolor{#1}} \begin{tabular}{lc} \hline Status & Count \\ \hline \rowcolor{green!20} Success & 45 \\ \rowcolor{red!20} Failed & 3 \\ \rowcolor{yellow!20} Pending & 12 \\ \hline \end{tabular} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Table Automation### Generating Tables from Data```latex table-automation.tex theme=\{null} \usepackage{pgfplotstable} \usepackage{filecontents} % Create data file \begin{filecontents*}{data.csv} Name,Score,Grade Alice,95,A Bob,87,B Carol,92,A David,78,C \end{filecontents*} % Load and display CSV \pgfplotstabletypeset[ col sep=comma, string type, columns={Name,Score,Grade}, every head row/.style={ before row=\toprule, after row=\midrule }, every last row/.style={ after row=\bottomrule } ]{data.csv} % With formatting \pgfplotstabletypeset[ col sep=comma, string type, columns={Name,Score,Grade}, columns/Score/.style={ column type={r}, postproc cell content/.style={ @cell content={##1\%} } } ]{data.csv} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Dynamic Table Generation```latex dynamic-tables.tex theme=\{null} \usepackage{forloop} % Generate multiplication table \newcounter{row} \newcounter{col} \begin{tabular}{c|*{10}{c}} × & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline \forloop{row}{1}{\value{row} < 11}{% \therow & \forloop{col}{1}{\value{col} < 11}{% \number\numexpr\value{row}*\value{col}\relax \ifnum\value{col}<10 & \fi }\\ } \end{tabular} % Calendar table \newcommand{\calendar}[2]{% % #1 = month, #2 = year \begin{tabular}{|*{7}{c|}} \hline \multicolumn{7}{|c|}{\textbf{#1 #2}} \\ \hline S & M & T & W & T & F & S \\ \hline % Calendar logic here \end{tabular} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Table Positioning and Float Control### Precise Table Placement```latex table-placement.tex theme=\{null} \usepackage{float} \usepackage{placeins} % Force table here \begin{table}[H] \centering \caption{This table appears exactly here} \begin{tabular}{cc} A & B \\ \end{tabular} \end{table} % Keep tables in section \FloatBarrier % No tables past this point % Adjust float parameters \renewcommand{\topfraction}{0.9} \renewcommand{\bottomfraction}{0.8} \setcounter{topnumber}{2} \setcounter{bottomnumber}{2} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from table-placement.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-advanced-tables-13/page-1.svg)
## Performance Optimization### Large Table Optimization```latex optimize-tables.tex theme=\{null} % For very large tables \usepackage{array} \usepackage{longtable} % Disable array stretching for speed \renewcommand{\arraystretch}{1.0} % Use simpler column types \begin{longtable}{lll} % Instead of complex types % Compile only table \usepackage{standalone} \documentclass[preview]{standalone} \begin{document} \begin{tabular}{...} % Table content \end{tabular} \end{document} % Then include in main document \includegraphics{table-output.pdf} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## How to Shrink a Table to Fit the Page or ColumnWhen a table is wider than the text block, LaTeX will not shrink it for you — it runs into the margin and reports an `Overfull \hbox`.Scaling the whole table, font included, is the quickest fix. `\resizebox` from `graphicx` takes a target width: `\resizebox{\textwidth}{!}{...}` wraps the `tabular` and scales it to the text width, with `!` preserving the aspect ratio. Use `\columnwidth` instead in a two-column layout.Be aware that this shrinks the font along with the table, so a heavily scaled table becomes hard to read. Before scaling, consider whether reducing column padding with `\setlength{\tabcolsep}{4pt}`, wrapping text with a `p{3cm}` column, or using a smaller font size for the table would keep it legible.For tables that are simply too wide to ever fit, rotating with `sidewaystable` from `rotating`, or splitting across pages with `longtable`, is better than scaling.## Best Practices> [!TIP] > > **Advanced table guidelines:** > > 1. **Long tables**: Use `longtable` for multi-page tables > 2. **Wide tables**: Consider landscape orientation or font size reduction > 3. **Complex layouts**: Break into smaller, simpler tables when possible > 4. **Performance**: For very large tables, consider external generation > 5. **Consistency**: Define custom column types for repeated formats > 6. **Documentation**: Comment complex table structures > 7. **Testing**: Check table appearance at different page positions## Troubleshooting> [!WARNING] > > **Common advanced table issues:** > > 1. **Memory errors**: Large tables may exceed TeX memory - split or optimize > 2. **Float placement**: Use `\FloatBarrier` to control table positions > 3. **Column alignment**: Check array package column definitions > 4. **Page breaks**: Ensure longtable headers/footers are defined correctly > 5. **Compilation time**: Complex tables slow compilation - use caching## Quick Reference### Package Summary| Package | Purpose | | - | - | | `longtable` | Multi-page tables | | `rotating` | Rotate tables | | `booktabs` | Professional formatting | | `tabularx` | Auto-width tables | | `threeparttable` | Tables with notes | | `array` | Enhanced columns | | `multirow` | Multi-row cells | | `colortbl` | Colored tables |### Advanced Commands```latex example.tex theme=\{null} \toprule % Top rule (booktabs) \midrule % Middle rule (booktabs) \bottomrule % Bottom rule (booktabs) \cmidrule(lr){i-j} % Partial rule with trim \addlinespace % Extra vertical space \arraybackslash % Restore \\ in array cells ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
***> [!NOTE] > > **Next**: Ready to create your first LaTeX document? Check out our [How-to Guides](/learn/latex/how-to/articles) for practical examples and complete document templates. # LaTeX Table Tutorial: tabular, table, booktabs, and siunitx Source: https://resources.latex-cloud-studio.com/learn/latex/tables/creating-tables Learn how to create a table in LaTeX with `tabular`, `table`, `booktabs`, `multicolumn`, `multirow`, and decimal alignment examples. To create a table in LaTeX, start with a `tabular` environment, separate columns with `&`, and end each row with `\\`. Wrap that `tabular` block in a `table` environment when you need a caption, label, or float positioning. This guide starts with the basic LaTeX table syntax most people need first, then moves into `booktabs`, decimal alignment, and multi-column or multi-row layouts.If you only need the fastest possible answer:* Use `tabular` to build the rows and columns. * Use `table` when you need a floating table with a caption and label. * Use `booktabs` when you want journal-style horizontal rules. * Use `siunitx` when numbers need to align at decimal points.> [!NOTE] > > **Package required**: Basic tables work with the `tabular` environment. For professional tables, add `\usepackage{booktabs}`. For decimal alignment, use `\usepackage{siunitx}`. > > **Need the `tabular` syntax only?** Start with the focused [tabular environment guide](/learn/latex/tables/tabular). > > **Related topics**: [Mathematical matrices](/learn/latex/mathematics/matrices) | [Figure positioning](/learn/latex/figures/positioning) | [Cross-referencing tables](/learn/latex/cross-referencing) > > **Last updated**: April 2026 | **Reading time**: 25 min | **Difficulty**: Beginner to Advanced## What You'll Learn- ✅ Basic table structure with `tabular` environment - ✅ Column alignment and formatting options - ✅ Professional tables with `booktabs` package - ✅ Multi-column and multi-row cells - ✅ Decimal alignment for numeric data - ✅ Table captions and cross-references - ✅ Advanced formatting techniques - ✅ Troubleshooting common LaTeX table issues## Frequently Asked Questions> [accordion] What is the difference between table and tabular in LaTeX? > > The main difference between `table` and `tabular` in LaTeX is their **purpose**: > > * **tabular** is the actual table content - it creates the rows, columns, and cell data > * **table** is a **float container** that wraps tabular for positioning, captions, and labels > > You typically nest `tabular` inside `table`: > > ```latex example.tex theme=\{null} > \begin{table}[htbp] > \centering > \caption{My table caption} > \label{tab:mytable} > \begin{tabular}{lcc} > Header 1 & Header 2 & Header 3 \\ > Data & Data & Data \\ > \end{tabular} > \end{table} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-22/page-1.svg) >
> > **When to use each:** > > * Use **tabular alone** for inline tables without captions > * Use **table + tabular** when you need positioning control, captions, or cross-references> [accordion] How do I align numbers at decimal points in LaTeX tables? > > To **align decimal points** in LaTeX tables, use the `siunitx` package with the S-type column: > > ```latex example.tex theme=\{null} > \usepackage{siunitx} > \begin{tabular}{l S[table-format=3.2]} > \hline > Item & {Value} \\ > \hline > Product A & 12.5 \\ > Product B & 123.45 \\ > Product C & 1.234 \\ > \hline > \end{tabular} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-23/page-1.svg) >
> > **How it works:** > > * `S[table-format=3.2]` means 3 digits before decimal, 2 after > * Wrap text headers in `{braces}` to prevent siunitx parsing > * Numbers automatically align at the decimal point > > This is essential for financial data, scientific measurements, and any numeric tables.> [accordion] What is booktabs and why should I use it for LaTeX tables? > > **booktabs** is a LaTeX package that provides professional-quality horizontal rules for tables: > > * `\toprule` - Thick line at table top > * `\midrule` - Medium line between header and body > * `\bottomrule` - Thick line at table bottom > > ```latex example.tex theme=\{null} > \usepackage{booktabs} > \begin{tabular}{lcc} > \toprule > Header 1 & Header 2 & Header 3 \\ > \midrule > Data 1 & Data 2 & Data 3 \\ > Data 4 & Data 5 & Data 6 \\ > \bottomrule > \end{tabular} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-24/page-1.svg) >
> > **Why use booktabs:** > > * Better spacing around rules (no cramped rows) > * Professional appearance matching journal standards > * Avoids vertical lines (considered bad practice) > * Required by many academic publishers (Nature, IEEE, etc.)> [accordion] How do I make a cell span multiple columns in LaTeX? > > Use `\multicolumn{n}{alignment}{text}` to span n columns: > > ```latex example.tex theme=\{null} > \begin{tabular}{lcc} > \hline > \multicolumn{3}{c}{Spanning Three Columns} \\ > \hline > Left & Center & Right \\ > \multicolumn{2}{l}{Spans two columns} & Right \\ > \hline > \end{tabular} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-25/page-1.svg) >
> > **Parameters:** > > * `{3}` - Number of columns to span > * `{c}` - Alignment (l, c, r, or with borders like `|c|`) > * `{text}` - Cell content > > **Common uses:** > > * Table titles spanning all columns > * Grouped headers for related columns > * Footnotes or notes spanning the table width> [accordion] How do I make a cell span multiple rows in LaTeX? > > Use the `multirow` package with `\multirow{n}{width}{text}`: > > ```latex example.tex theme=\{null} > \usepackage{multirow} > \begin{tabular}{lcc} > \hline > \multirow{2}{*}{Category} & Value 1 & 100 \\ > & Value 2 & 200 \\ > \hline > \multirow{3}{*}{Group A} & Item 1 & 10 \\ > & Item 2 & 20 \\ > & Item 3 & 30 \\ > \hline > \end{tabular} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-26/page-1.svg) >
> > **Parameters:** > > * `{2}` or `{3}` - Number of rows to span > * `{*}` - Auto width (or specify like `{3cm}`) > * `{text}` - Cell content > > Leave the corresponding cells in subsequent rows empty (just use `&`). \> \[accordion] How do I add colors to LaTeX table rows and cells? \> \> Use the \`xcolor\` package with the \`table\` option:\`\`\`latex example.tex theme=\\\{null} \> \usepackage\[table]\{xcolor} \> \> % Color entire row \> \rowcolor\{gray!20} \> Header 1 & Header 2 & Header 3 \\\\ \> \> % Color single cell \> Normal & \cellcolor\{yellow}Highlighted & Normal \\\\ \> \> % Alternating row colors (zebra striping) \> \rowcolors\{2}\{white}\{gray!10} \> \begin\{tabular}\{lcc} \> ... \> \end\{tabular} \> \`\`\`\\\
\\\Expected effect\\\ \> \ \\> \\\\\\\[!NOTE] \> \\> \> \\> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\\\
\*\*Color syntax:\*\*- \`gray!20\` = 20% gray (lighter) \> - \`red!50\` = 50% red \> - \`blue!10\` = 10% blue (very light) \> - Standard colors: red, green, blue, yellow, cyan, magenta, black, white > [accordion] How do I make a table fit the page width in LaTeX? > > Use the `tabularx` package with the X column type: > > ```latex example.tex theme=\{null} > \usepackage{tabularx} > \begin{tabularx}{\textwidth}{lXr} > \hline > Fixed left & This column expands to fill space & Fixed right \\ > \hline > \end{tabularx} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-28/page-1.svg) >
> > **Options for wide tables:** > > 1. **tabularx** with `X` columns - columns expand to fill `\textwidth` > 2. **Multiple X columns** - `{|X|X|X|}` distributes space equally > 3. **resizebox** - scales entire table: `\resizebox{\textwidth}{!}{\begin{tabular}...}` > 4. **Smaller font** - `{\small \begin{tabular}...}` or `\footnotesize` > 5. **Rotating** - `\usepackage{rotating}` with `sidewaystable` for landscape> [accordion] How do I fix table positioning problems in LaTeX? > > Control table positioning with float placement specifiers:\`\`\`latex example.tex theme=\{null} > \begin\[htbp] % Try here, top, bottom, page > \begin\[H] % Force exact position (requires float package) > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
**Placement options:**- `h` - Here (approximately) > - `t` - Top of page > - `b` - Bottom of page > - `p` - Page of floats only > - `H` - HERE exactly (requires `\usepackage{float}`) > - `!` - Override LaTeX's restrictions**Common issues and fixes:**- Table floats away: Use `[H]` with float package > - Table at wrong page: Use `[t]` or adjust surrounding content > - Too many floats: Use `\clearpage` to flush pending floats > - Want inline table: Use `tabular` without `table` wrapper > ```> [accordion] How do I create a table that spans multiple pages in LaTeX? > > Use the `longtable` package for tables that break across pages: > > ```latex example.tex theme=\{null} > \usepackage{longtable} > \usepackage{booktabs} > > \begin{longtable}{lcc} > \caption{Multi-page table example} \\ > \toprule > Header 1 & Header 2 & Header 3 \\ > \midrule > \endfirsthead > > \multicolumn{3}{c}{\textit{Continued from previous page}} \\ > \toprule > Header 1 & Header 2 & Header 3 \\ > \midrule > \endhead > > \midrule > \multicolumn{3}{r}{\textit{Continued on next page}} \\ > \endfoot > > \bottomrule > \endlastfoot > > % Your data rows here > Row 1 & Data & Data \\ > Row 2 & Data & Data \\ > % ... many more rows > \end{longtable} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-30/page-1.svg) >
> > **Key commands:** > > * `\endfirsthead` - Header for first page only > * `\endhead` - Header for continuation pages > * `\endfoot` - Footer for pages that continue > * `\endlastfoot` - Footer for final page > > **Note:** Unlike `table`, `longtable` is NOT a float - it appears exactly where placed in your document. \> \[accordion] How do I fix row spacing in LaTeX tables? \> \> LaTeX table rows can appear cramped. Here are solutions:\*\*Method 1: Adjust arraystretch (global)\*\*\`\`\`latex example.tex theme=\\\{null} \> \renewcommand\{\arraystretch}\{1.3} % 1.3x normal spacing \> \begin\{tabular}\{lcc} \> ... \> \end\{tabular} \> \`\`\`\
\> \Rendered output\ \> Open zoomable preview: Compiled PDF page 1 from example.tex \> \> Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. \> \> \[Open SVG]\(/images/rendered/learn-latex-tables-creating-tables-31/page-1.svg) \> \
\*\*Method 2: Add struts (per-row control)\*\*\`\`\`latex example.tex theme=\\\{null} \> \begin\{tabular}\{lcc} \> Header 1 & Header 2 & Header 3 \\\\\[6pt] % Extra space after this row \> Data 1 & Data 2 & Data 3 \\\\ \> \end\{tabular} \> \`\`\`\
\> \Rendered output\ \> Open zoomable preview: Compiled PDF page 1 from example.tex \> \> Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. \> \> \[Open SVG]\(/images/rendered/learn-latex-tables-creating-tables-32/page-1.svg) \> \
\*\*Method 3: Use booktabs (recommended)\*\*\`\`\`latex example.tex theme=\\\{null} \> \usepackage\{booktabs} \> \begin\{tabular}\{lcc} \> \toprule \> Header \\\\ \> \midrule \> Data \\\ % booktabs automatically adds proper spacing \> \bottomrule \> \end\{tabular} \> \`\`\`\
\> \Rendered output\ \> Open zoomable preview: Compiled PDF page 1 from example.tex \> \> Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. \> \> \[Open SVG]\(/images/rendered/learn-latex-tables-creating-tables-33/page-1.svg) \> \
\*\*Method 4: cellspace package for consistent padding\*\*\`\`\`latex example.tex theme=\\\{null} \> \usepackage\{cellspace} \> \setlength\{\cellspacetoplimit}\{4pt} \> \setlength\{\cellspacebottomlimit}\{4pt} \> \`\`\`\\\
\\\Expected effect\\\ \> \ \\> \\\\\\\[!NOTE] \> \\> \> \\> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\\\
The \`booktabs\` package is generally the best solution as it handles spacing automatically with professional results. ## Basic Table Structure### Simple Tabular Environment```latex basic-table.tex theme=\{null} \documentclass{article} \begin{document} % Basic table without float \begin{tabular}{lcr} Left & Center & Right \\ 1 & 2 & 3 \\ 4 & 5 & 6 \end{tabular} % With horizontal lines \begin{tabular}{|l|c|r|} \hline Name & Age & Score \\ \hline Alice & 25 & 95 \\ Bob & 30 & 87 \\ Carol & 28 & 92 \\ \hline \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from basic-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_tables_creating_tables)### Column Specifications| Specifier | Alignment | Description | | - | - | - | | `l` | Left | Left-aligned column | | `c` | Center | Centered column | | `r` | Right | Right-aligned column | | `p{width}` | Justified | Paragraph column with fixed width | | \` | \` | — | Vertical line | | `@{...}` | — | Custom column separator |```latex column-types.tex theme=\{null} % Various column types \begin{tabular}{lcrp{3cm}} Left & Center & Right & Paragraph text that wraps \\ \end{tabular} % Custom spacing \begin{tabular}{l@{\hspace{2cm}}r} Name & Value \\ \end{tabular} % Remove default spacing \begin{tabular}{@{}lcr@{}} No space & on & sides \\ \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from column-types.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-02/page-1.svg)
## Table Float Environment### Basic Table with Caption```latex table-float.tex theme=\{null} \documentclass{article} \usepackage{caption} \begin{document} \begin{table}[htbp] \centering \caption{Student grades} \label{tab:grades} \begin{tabular}{lcc} \hline Student & Midterm & Final \\ \hline Alice & 85 & 92 \\ Bob & 78 & 88 \\ Carol & 92 & 95 \\ \hline \end{tabular} \end{table} As shown in Table \ref{tab:grades}, all students improved. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from table-float.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-03/page-1.svg)
### Table Positioning```latex table-positioning.tex theme=\{null} % Positioning options \begin{table}[h] % Here \begin{table}[t] % Top of page \begin{table}[b] % Bottom of page \begin{table}[p] % Page of floats \begin{table}[htbp] % Try here, top, bottom, page % Force exact placement \usepackage{float} \begin{table}[H] % HERE exactly ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Lines and Rules### Horizontal Lines```latex horizontal-lines.tex theme=\{null} \documentclass{article} \usepackage{booktabs} % For professional tables \begin{document} % Basic lines \begin{tabular}{lcc} \hline Header 1 & Header 2 & Header 3 \\ \hline Data 1 & Data 2 & Data 3 \\ \hline \end{tabular} % Professional tables with booktabs \begin{tabular}{lcc} \toprule Header 1 & Header 2 & Header 3 \\ \midrule Data 1 & Data 2 & Data 3 \\ Data 4 & Data 5 & Data 6 \\ \bottomrule \end{tabular} % Partial horizontal lines \begin{tabular}{lcr} Full line \\ \hline Partial & line & below \\ \cline{2-3} Only & under & these \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from horizontal-lines.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-04/page-1.svg)
> [!TIP] > > **Best practice**: Use the `booktabs` package for professional-looking tables. It provides better spacing and line weights than standard LaTeX rules.### Vertical Lines```latex vertical-lines.tex theme=\{null} % Single vertical lines \begin{tabular}{l|c|r} Left & Center & Right \\ \end{tabular} % Double vertical lines \begin{tabular}{l||c||r} Left & Center & Right \\ \end{tabular} % Mixed lines \begin{tabular}{|l|c|r|} \hline A & B & C \\ \hline 1 & 2 & 3 \\ \hline \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from vertical-lines.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-05/page-1.svg)
> [!WARNING] > > **Note**: Vertical lines are generally discouraged in professional tables. They can make tables look cluttered and harder to read.## Column Formatting### Text Alignment and Width```latex column-formatting.tex theme=\{null} \documentclass{article} \usepackage{array} % Enhanced column types \begin{document} % Fixed width columns \begin{tabular}{p{3cm}p{3cm}p{3cm}} This is a paragraph column & Text wraps automatically & Within the specified width \\ \end{tabular} % Array package column types \begin{tabular}{>{\bfseries}l c >{\itshape}r} Bold & Normal & Italic \\ Left & Center & Right \\ \end{tabular} % Centered fixed-width columns \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} \begin{tabular}{C{3cm}C{3cm}} Centered & Fixed Width \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from column-formatting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-06/page-1.svg)
### Multi-column Cells```latex multicolumn.tex theme=\{null} \begin{tabular}{lcr} \hline \multicolumn{3}{c}{Spanning Three Columns} \\ \hline Left & Center & Right \\ A & B & C \\ \multicolumn{2}{l}{Span two} & Right \\ \hline \end{tabular} % Complex headers \begin{tabular}{lcc} \hline \multicolumn{1}{c}{Item} & \multicolumn{2}{c}{Measurements} \\ \cline{2-3} & Length & Width \\ \hline Box A & 10 cm & 5 cm \\ Box B & 15 cm & 8 cm \\ \hline \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicolumn.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-07/page-1.svg)
### Multi-row Cells```latex multirow\.tex theme=\{null} \documentclass{article} \usepackage{multirow} \begin{document} \begin{tabular}{lcc} \hline \multirow{2}{*}{Category} & Value 1 & Value 2 \\ & 10 & 20 \\ \hline \multirow{3}{*}{Group A} & Item 1 & 100 \\ & Item 2 & 200 \\ & Item 3 & 300 \\ \hline \end{tabular} % With width specification \begin{tabular}{lp{3cm}c} \hline \multirow{2}{3cm}{Long text that needs wrapping} & Description & Value \\ & More info & 42 \\ \hline \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multirow\.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-08/page-1.svg)
### Grouped Headers with `cmidrule`Results tables often compare two conditions with the same statistics. Put a `\multicolumn` header over each group and draw a partial `booktabs` rule under it with `\cmidrule(lr){2-3}`. The `(lr)` option trims the rule at both ends, so the rules under neighboring groups stay visibly separate. `\multirow` from the `multirow` package spans a label across rows:```latex multicolumn-table.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{multirow} \pagestyle{empty} \begin{document} \begin{tabular}{lcccc} \toprule & \multicolumn{2}{c}{Low density} & \multicolumn{2}{c}{High density} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} System size & Mean & SD & Mean & SD \\ \midrule \multirow{2}{*}{$64^2$} & 0.12 & 0.02 & 0.71 & 0.04 \\ & 0.11 & 0.02 & 0.69 & 0.05 \\ $128^2$ & 0.09 & 0.01 & 0.74 & 0.03 \\ \bottomrule \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicolumn-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/blog-latex-tables-03/page-1.svg)
This "two conditions × two statistics" layout is the pattern behind most results tables in experimental papers. It uses no vertical rules: the grouped headers and partial rules do the separating.## Numeric Alignment### Decimal Alignment```latex decimal-alignment.tex theme=\{null} \documentclass{article} \usepackage{siunitx} % For numeric alignment \begin{document} % Using siunitx S column \begin{tabular}{l S[table-format=3.2]} \hline Item & {Value} \\ \hline Product A & 12.5 \\ Product B & 123.45 \\ Product C & 1.234 \\ \hline \end{tabular} % Multiple numeric columns \begin{tabular}{l *{3}{S[table-format=2.1]}} \hline Test & {Run 1} & {Run 2} & {Run 3} \\ \hline A & 9.5 & 10.2 & 9.8 \\ B & 12.1 & 11.9 & 12.3 \\ C & 8.7 & 8.9 & 8.8 \\ \hline \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from decimal-alignment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-09/page-1.svg)
### Currency and Units```latex currency-units.tex theme=\{null} \usepackage{siunitx} % Currency alignment \begin{tabular}{l S[table-format=4.2, table-space-text-pre=\$]} \hline Item & {Price} \\ \hline Laptop & \$1299.99 \\ Mouse & \$29.95 \\ Keyboard & \$89.50 \\ \hline Total & \$1419.44 \\ \hline \end{tabular} % Units in headers \begin{tabular}{l S[table-format=3.1]} \hline Material & {Density (\si{g/cm^3})} \\ \hline Water & 1.0 \\ Iron & 7.9 \\ Gold & 19.3 \\ \hline \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from currency-units.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-10/page-1.svg)
## Coloring Tables### Row and Cell Colors```latex colored-tables.tex theme=\{null} \documentclass{article} \usepackage[table]{xcolor} \begin{document} % Alternating row colors \begin{tabular}{lcc} \rowcolor{gray!20} Header 1 & Header 2 & Header 3 \\ Row 1 & Data & Data \\ \rowcolor{gray!10} Row 2 & Data & Data \\ Row 3 & Data & Data \\ \rowcolor{gray!10} Row 4 & Data & Data \\ \end{tabular} % Individual cell colors \begin{tabular}{lcc} \hline Normal & \cellcolor{yellow}Highlighted & Normal \\ \cellcolor{red!20}Light red & Normal & \cellcolor{blue!20}Light blue \\ \hline \end{tabular} % Column colors \begin{tabular}{>{\columncolor{gray!20}}l cc} Gray column & Normal & Normal \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from colored-tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-11/page-1.svg)
### Professional Striped Tables```latex striped-tables.tex theme=\{null} \usepackage[table]{xcolor} \usepackage{booktabs} % Define alternating colors \rowcolors{2}{white}{gray!10} \begin{tabular}{lcc} \toprule \rowcolor{gray!40} Product & Quantity & Price \\ \midrule Apples & 10 & \$5.00 \\ Oranges & 15 & \$7.50 \\ Bananas & 20 & \$4.00 \\ Grapes & 5 & \$6.00 \\ \bottomrule \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from striped-tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-12/page-1.svg)
## Table Width Control### Full Width Tables```latex full-width-tables.tex theme=\{null} \documentclass{article} \usepackage{tabularx} \begin{document} % Using tabularx \begin{tabularx}{\textwidth}{lXr} \hline Left & Expanding middle column & Right \\ \hline A & This column expands to fill available space & 100 \\ B & Automatically adjusts width & 200 \\ \hline \end{tabularx} % Multiple X columns \begin{tabularx}{\textwidth}{|X|X|X|} \hline Equal & Width & Columns \\ \hline These three columns & share the available & space equally \\ \hline \end{tabularx} % Custom width distribution \begin{tabularx}{\textwidth}{l>{\hsize=.5\hsize}X>{\hsize=1.5\hsize}Xr} Fixed & Narrow & Wide expanding column & Fixed \\ \end{tabularx} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from full-width-tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-13/page-1.svg)
### Resizing Tables```latex resizing-tables.tex theme=\{null} \usepackage{graphicx} % Scale to specific width \resizebox{\textwidth}{!}{% \begin{tabular}{lcccccc} \hline Many & Columns & That & Would & Be & Too & Wide \\ \hline Data & Data & Data & Data & Data & Data & Data \\ \hline \end{tabular} } % Scale to fit column width \resizebox{\columnwidth}{!}{% \begin{tabular}{lcr} % Table content \end{tabular} } % Scale by percentage \scalebox{0.8}{% \begin{tabular}{lcr} % 80% of original size \end{tabular} } ```
Rendered output Open zoomable preview: Compiled PDF page 1 from resizing-tables.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-14/page-1.svg)
## Table Design Principles### Professional Table Design GuidelinesCreating professional tables in LaTeX requires attention to both technical implementation and design principles. Here are the key guidelines that will elevate your table design:> [card] Clarity First > > Tables should communicate data clearly. Avoid unnecessary decorations that distract from the content.> [card] Consistent Formatting > > Use consistent number formats, alignment, and styling throughout your document.> [card] Appropriate Spacing > > Proper spacing makes tables more readable. Use `\arraystretch` or booktabs for better spacing.> [card] Meaningful Headers > > Clear, descriptive headers help readers understand your data structure immediately.### When to Use Tables vs Other FormatsNot all data belongs in a table. Consider these alternatives:| Data Type | Best Format | When to Use | | - | - | - | | **Few data points** | Inline text | When you have 2-3 values that can be mentioned in a sentence | | **Trends over time** | Line graph | When showing how values change over a continuous variable | | **Proportions** | Pie/bar chart | When showing parts of a whole or comparing categories | | **Complex relationships** | Diagram | When showing connections or flow between elements | | **Structured lists** | Tables | When comparing multiple attributes across items |## Advanced Table Techniques### Creating Publication-Quality TablesProfessional journals often have specific requirements for tables. Here's how to meet common standards:```latex publication-table.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \usepackage{threeparttable} \usepackage[font=small,labelfont=bf]{caption} \begin{document} \begin{table}[htbp] \centering \small % Reduce font size for journal requirements \caption{Comparison of experimental results across different conditions} \label{tab:results} \begin{threeparttable} \begin{tabular}{@{}lS[table-format=3.1]S[table-format=2.1]S[table-format=1.3]@{}} \toprule Condition & {Temperature (\si{\celsius})} & {Time (h)} & {Yield} \\ \midrule Control\tnote{a} & 25.0 & 2.0 & 0.850 \\ Optimized\tnote{b} & 35.5 & 1.5 & 0.923 \\ Modified & 30.2 & 1.8 & 0.891 \\ \bottomrule \end{tabular} \begin{tablenotes} \footnotesize \item[a] Standard laboratory conditions \item[b] Conditions optimized through preliminary experiments \end{tablenotes} \end{threeparttable} \end{table} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from publication-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-15/page-1.svg)
### Dynamic Table Generation from External DataFor reproducible research, generating tables from data files is essential:```latex csv-table.tex theme=\{null} \documentclass{article} \usepackage{pgfplotstable} \usepackage{booktabs} \usepackage{siunitx} \usepackage{xcolor} \usepackage{etoolbox} % Create sample data file \begin{filecontents*}{data.csv} Sample,Temperature,Pressure,Result A,25.3,101.2,Pass B,26.1,102.5,Pass C,24.8,99.8,Fail D,25.7,101.9,Pass \end{filecontents*} \begin{document} % Basic CSV import \pgfplotstabletypeset[ col sep=comma, string type, every head row/.style={ before row=\toprule, after row=\midrule }, every last row/.style={ after row=\bottomrule } ]{data.csv} % Advanced formatting \pgfplotstabletypeset[ col sep=comma, string type, columns={Sample,Temperature,Result}, % Select specific columns column type/.add={}{}, % Clear default column types columns/Sample/.style={column name=\textbf{Sample ID}}, columns/Temperature/.style={ column name=\textbf{Temp. (\si{\celsius})}, fixed, precision=1 }, columns/Result/.style={ column name=\textbf{Status}, postproc cell content/.code={ \ifstrequal{##1}{Pass} {\pgfkeysalso{@cell content=\textcolor{green!60!black}{##1}}} {\pgfkeysalso{@cell content=\textcolor{red!60!black}{##1}}} } } ]{data.csv} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from csv-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-16/page-1.svg)
## Accessibility in Tables### Making Tables Screen-Reader FriendlyWhile LaTeX primarily produces PDF output, considering accessibility improves document usability:```latex accessible-table.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{array} % Define column type for headers \newcolumntype{H}{>{\bfseries}l} \begin{document} % Use semantic markup \begin{table}[htbp] \caption{Student enrollment by department and year} \label{tab:enrollment} \centering \begin{tabular}{H*{4}{r}} \toprule Department & \textbf{2021} & \textbf{2022} & \textbf{2023} \\ \midrule Computer Science & 245 & 289 & 312 \\ Mathematics & 156 & 162 & 171 \\ Physics & 98 & 103 & 99 \\ Chemistry & 134 & 141 & 139 \\ \midrule \textbf{Total} & \textbf{633} & \textbf{695} & \textbf{721} \\ \bottomrule \end{tabular} \end{table} % Alternative text description \begin{quote} \textit{Table description: This table shows student enrollment numbers across four science departments from 2021 to 2023, with totals for each year. Overall enrollment increased from 633 to 721 students.} \end{quote} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from accessible-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-17/page-1.svg)
## Troubleshooting Complex Tables### Common Table Problems and Solutions> [accordion] Table extends beyond page margins > > **Problem**: Your table is too wide for the page. > > **Solutions**: > > 1. Use `\small` or `\footnotesize` to reduce font size > 2. Use `tabularx` to automatically adjust column widths > 3. Rotate the table with `rotating` package > 4. Use `\resizebox` (last resort - can make text too small) > > ```latex example.tex theme=\{null} > % Option 1: Reduce font size > {\small > \begin{tabular}{llllll} > % Table content > \end{tabular} > } > > % Option 2: Use tabularx > \begin{tabularx}{\textwidth}{l*{5}{X}} > % Content automatically fits page width > \end{tabularx} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-36/page-1.svg) >
> [accordion] Decimal points don't align > > **Problem**: Numbers in columns don't align at decimal points. > > **Solution**: Use the `siunitx` package with S-type columns: > > ```latex example.tex theme=\{null} > \usepackage{siunitx} > \begin{tabular}{l S[table-format=3.2]} > Item & {Value} \\ > \hline > Product A & 12.5 \\ > Product B & 123.45 \\ > Product C & 1.234 \\ > \end{tabular} > ``` > >
> Rendered output > Open zoomable preview: Compiled PDF page 1 from example.tex > > Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. > > [Open SVG](/images/rendered/learn-latex-tables-creating-tables-37/page-1.svg) >
> [accordion] Table numbering is wrong > > **Problem**: Tables are numbered incorrectly or out of sequence.**Solutions**:1) Check for manual `\setcounter` commands > 2\) Ensure proper placement of `\caption` > 3\) Use `\numberwithin{table}{section}` for section-based numbering\`\`\`latex example.tex theme=\{null} > % Reset numbering by section > \usepackage > \numberwithin > > % Manual adjustment if needed > \setcounter0 > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
> ```## Performance Optimization for Large Tables### Handling Tables with Thousands of Rows```latex large-dataset.tex theme=\{null} \documentclass{article} \usepackage{longtable} \usepackage{array} \usepackage{booktabs} % Optimize compilation for large tables \usepackage{etoolbox} \AtBeginEnvironment{longtable}{\small} \begin{document} % For very large datasets, consider: % 1. External processing % 2. Pagination % 3. Summary tables \begin{longtable}{@{}lrrr@{}} \caption{Large dataset with automatic page breaks} \\ \toprule ID & Value A & Value B & Result \\ \midrule \endfirsthead \multicolumn{4}{c}{\tablename\ \thetable\ -- \textit{Continued}} \\ \toprule ID & Value A & Value B & Result \\ \midrule \endhead \midrule \multicolumn{4}{r}{\textit{Continued on next page}} \\ \endfoot \bottomrule \endlastfoot % Representative rows. Generate very large datasets outside TeX and input them. 1 & 2 & 3 & 5 \\ 2 & 4 & 6 & 10 \\ 3 & 6 & 9 & 15 \\ 4 & 8 & 12 & 20 \\ 5 & 10 & 15 & 25 \\ 6 & 12 & 18 & 30 \\ 7 & 14 & 21 & 35 \\ 8 & 16 & 24 & 40 \\ 9 & 18 & 27 & 45 \\ 10 & 20 & 30 & 50 \\ \end{longtable} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from large-dataset.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-18/page-1.svg)
## Best Practices> [!TIP] > > **Table design guidelines:** > > 1. **Simplicity**: Less is more - avoid excessive lines and decoration > 2. **Alignment**: Right-align numbers, left-align text > 3. **Spacing**: Use adequate white space for readability > 4. **Captions**: Place captions above tables (convention) > 5. **Consistency**: Use the same style throughout your document > 6. **Booktabs**: Use `\toprule`, `\midrule`, `\bottomrule` for professional appearance > 7. **Width**: Avoid tables wider than text width## Common Issues and Solutions> [!WARNING] > > **Troubleshooting tables:** > > 1. **Table too wide**: Use `tabularx`, `\small`, or rotate the table > 2. **Text not wrapping**: Use `p{width}` columns instead of `l`, `c`, or `r` > 3. **Vertical alignment**: Use `[t]`, `[c]`, or `[b]` with `p` columns > 4. **Missing package errors**: Load required packages (`array`, `booktabs`, etc.) > 5. **Spacing issues**: Adjust `\arraystretch` or use `\renewcommand{\arraystretch}{1.2}`## Comparison with Other Table Tools### LaTeX Tables vs Word/Excel TablesUnderstanding when to use LaTeX tables versus other tools:| Feature | LaTeX | Word | Excel | | - | - | - | - | | **Precision** | Exact control | Limited | Good for calculations | | **Consistency** | Excellent | Manual | Good within sheet | | **Math support** | Native | Limited | Basic | | **Automation** | Scriptable | Limited | VBA/Macros | | **Version control** | Text-based | Binary | Binary | | **Learning curve** | Steep | Gentle | Moderate |### Converting Tables Between Formats```latex excel-to-latex.tex theme=\{null} \documentclass{article} \usepackage{datatool} \begin{filecontents*}{data.csv} Name,Value,Status Alpha,12,Ready Beta,18,Review Gamma,24,Ready \end{filecontents*} \begin{document} \DTLloaddb{mydata}{data.csv} \section*{Imported rows} \DTLforeach{mydata}{% \name=Name,\value=Value,\status=Status}{% \textbf{\name}: value \value, status \status\par } \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from excel-to-latex.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-19/page-1.svg)
## Real-World Table Examples### Financial Reports```latex financial-table.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \usepackage{xcolor} \begin{document} \begin{table}[htbp] \centering \caption{Quarterly Financial Summary (in millions)} \begin{tabular}{l*{4}{S[table-format=4.1]}S[table-format=+3.1]} \toprule {Revenue Stream} & {Q1} & {Q2} & {Q3} & {Q4} & {Change (\%)} \\ \midrule Product Sales & 125.4 & 132.7 & 141.2 & 156.8 & +25.0 \\ Services & 45.2 & 47.8 & 49.1 & 52.3 & +15.7 \\ Licensing & 12.3 & 11.9 & 13.2 & 14.1 & +14.6 \\ \midrule \textbf{Total Revenue} & 182.9 & 192.4 & 203.5 & 223.2 & +22.0 \\ \midrule Operating Expenses & 89.2 & 91.5 & 94.8 & 98.2 & +10.1 \\ \midrule \textbf{Net Income} & \textbf{93.7} & \textbf{100.9} & \textbf{108.7} & \textbf{125.0} & \textcolor{green!60!black}{\textbf{+33.4}} \\ \bottomrule \end{tabular} \end{table} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from financial-table.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-20/page-1.svg)
### Scientific Data Tables```latex scientific-data.tex theme=\{null} \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \usepackage{multirow} \begin{document} \begin{table}[htbp] \centering \caption{Experimental measurements with uncertainties} \begin{tabular}{ l S[table-format=2.3(1)] S[table-format=3.2(2)] S[table-format=1.4(1)] } \toprule {Sample} & {Mass (\si{\gram})} & {Volume (\si{\milli\liter})} & {Density (\si{\gram\per\cubic\centi\meter})} \\ \midrule Water (control) & 10.000(5) & 10.02(3) & 0.9980(8) \\ Solution A & 12.345(8) & 11.23(5) & 1.0990(12) \\ Solution B & 15.678(10) & 13.45(8) & 1.1658(15) \\ \multirow{2}{*}{Solution C} & 18.234(12) & 15.12(10) & 1.2061(18) \\ & \multicolumn{3}{c}{\textit{Measurement repeated due to anomaly}} \\ \bottomrule \end{tabular} \end{table} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from scientific-data.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-21/page-1.svg)
## Quick Reference### Essential Commands| Command | Purpose | | - | - | | `\hline` | Horizontal line | | `\cline{i-j}` | Partial horizontal line | | `\multicolumn{n}{format}{text}` | Span n columns | | `\multirow{n}{width}{text}` | Span n rows | | `&` | Column separator | | `\\` | Row separator | | `\caption{}` | Table caption | | `\label{}` | Reference label |### Column Types Summary```latex example.tex theme=\{null} l % left-aligned c % centered r % right-aligned p{3cm} % paragraph, fixed width | % vertical line @{text} % custom separator >{decl}col % apply declaration to column <{decl} % apply declaration after column ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-creating-tables-39/page-1.svg)
## Practice in LaTeX Cloud Studio> [card] Build the table in the editor > > Paste a `tabular` example into the editor, change alignment and spacing, and check the PDF output immediately.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=creating_tables_open_app)> [card] Advanced tables next > > Use this when you need longtable, multirow, decimal alignment, or more complex layouts.[Open](/learn/latex/tables/advanced-tables?utm_source=resources\&utm_medium=related_guide\&utm_campaign=docs_open_app\&utm_content=creating_tables_advanced_tables)***## Related Topics> [card] Mathematical Matrices > > Create matrices with pmatrix, bmatrix, vmatrix environments[Open](/learn/latex/mathematics/matrices)> [card] Figure Positioning > > Control float placement for figures and tables[Open](/learn/latex/figures/positioning)> [card] Cross-Referencing > > Reference tables, figures, and equations in text[Open](/learn/latex/cross-referencing)> [card] Advanced Tables > > Long tables, complex layouts, and professional formatting[Open](/learn/latex/tables/advanced-tables)## Further Reading & ReferencesFor authoritative documentation on LaTeX table creation and formatting:- **LaTeX Tables Guide** - The standard reference for tabular environment options and column specifications - **booktabs Package Documentation** - Professional table rules and spacing guidelines (CTAN) - **siunitx Package Manual** - Complete guide to number and unit formatting including decimal alignment - **The LaTeX Companion (3rd Edition)** - Comprehensive reference for table typesetting best practices - **Publication Style Guides** - IEEE, APA, and Nature journals specify booktabs-style tables as standard> [!NOTE] > > **Next steps**: > > * Learn about [Long tables spanning pages](/learn/latex/tables/advanced-tables) with longtable > * Explore [Mathematical matrices](/learn/latex/mathematics/matrices) for similar structured layouts > * Master [Figure and table positioning](/learn/latex/figures/positioning)> [!TIP] > > **LaTeX Cloud Studio** tip: Use our real-time preview feature to instantly see how your tables render. Experiment with booktabs styling and column alignment without waiting for compilation! # LaTeX Tabular Environment Guide: Syntax, Columns, and Alignment Source: https://resources.latex-cloud-studio.com/learn/latex/tables/tabular Learn how to use the LaTeX tabular environment. Covers syntax, column alignment, line breaks, multicolumn cells, and the difference between table and tabular. If you searched for `latex tabular`, this is the page you want. The `tabular` environment creates the actual rows and columns inside a LaTeX table. > [!NOTE] > > **Quick answer**: define the column layout in `\begin{tabular}{...}`, separate cells with `&`, and end each row with `\\`. > > **Related topics**: [Creating tables in LaTeX](/learn/latex/tables/creating-tables) | [Advanced tables](/learn/latex/tables/advanced-tables) ## Basic `tabular` Syntax ```latex tabular-basic.tex theme={null} \begin{tabular}{lcr} Left & Center & Right \\ A & B & C \\ 12 & 34 & 56 \\ \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tabular-basic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-tabular-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_tables_tabular) * `l` means left-aligned column * `c` means centered column * `r` means right-aligned column * `&` separates columns * `\\` ends the row ## A Minimal Example ```latex minimal-tabular.tex theme={null} \documentclass{article} \begin{document} \begin{tabular}{lcr} Name & Score & Rank \\ Alice & 95 & 1 \\ Ben & 87 & 2 \\ Cara & 81 & 3 \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from minimal-tabular.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-tables-tabular-02/page-1.svg)
## Column Alignment Options | Column type | Meaning | | - | - | | `l` | Left aligned | | `c` | Center aligned | | `r` | Right aligned | | `p{width}` | Fixed-width paragraph column | | `m{width}` | Fixed-width column with vertical centering | | `b{width}` | Fixed-width column aligned at the bottom | For `m{}` and `b{}`, load the `array` package. ## Horizontal Lines and Better Rules The simplest way to draw lines is with `\hline`: ```latex tabular-lines.tex theme={null} \begin{tabular}{|l|c|r|} \hline Name & Score & Rank \\ \hline Alice & 95 & 1 \\ Ben & 87 & 2 \\ \hline \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tabular-lines.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-tabular-03/page-1.svg)
For cleaner, publication-style tables, prefer `booktabs`: ```latex tabular-booktabs.tex theme={null} \usepackage{booktabs} \begin{tabular}{lcr} \toprule Name & Score & Rank \\ \midrule Alice & 95 & 1 \\ Ben & 87 & 2 \\ \bottomrule \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tabular-booktabs.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-tabular-04/page-1.svg)
## `table` vs `tabular` These are different: * `tabular` creates the grid of rows and columns * `table` is a float wrapper used for captions, labels, and placement ```latex table-vs-tabular.tex theme={null} \begin{table}[htbp] \centering \caption{Exam results} \label{tab:results} \begin{tabular}{lcr} Name & Score & Rank \\ Alice & 95 & 1 \\ Ben & 87 & 2 \\ \end{tabular} \end{table} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from table-vs-tabular.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-tabular-05/page-1.svg)
## Spanning Columns with `\multicolumn` Use `\multicolumn` when one cell should cover multiple columns: ```latex multicolumn.tex theme={null} \begin{tabular}{lcc} \hline \multicolumn{3}{c}{Quarterly Results} \\ \hline Region & Q1 & Q2 \\ North & 12 & 15 \\ South & 9 & 11 \\ \hline \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicolumn.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-tables-tabular-06/page-1.svg)
## When `tabular` Is Not Enough Use a different tool when you need more than a basic grid: * `tabularx` for tables that should fill a fixed width * `longtable` for tables that span multiple pages * `siunitx` when you need decimal alignment * `booktabs` for cleaner horizontal rules ## Common `tabular` Problems * Columns do not line up: check that every row has the same number of `&` separators. * Text runs too wide: switch to `p{width}` or `tabularx`. * Caption does not work: wrap `tabular` inside `table`. * Numbers look uneven: use `siunitx` instead of plain `r` alignment. ## Next Step If you are starting from scratch, continue with [creating tables in LaTeX](/learn/latex/tables/creating-tables). If your issue is layout quality rather than syntax, go to [advanced tables](/learn/latex/tables/advanced-tables). # Text Formatting in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/text-formatting Master text formatting in LaTeX including font sizes, styles, colors, alignment, and special formatting techniques. Beyond the basics of bold and italic, LaTeX offers extensive text formatting capabilities. This guide covers font sizes, families, shapes, colors, and advanced formatting options.> [!NOTE] > > **Quick tip**: LaTeX separates content from presentation. Define your formatting once and apply it consistently throughout your document. > > **Related topics**: [Font selection](/learn/latex/fonts) | [Paragraph formatting](/learn/latex/paragraphs-spacing) | [Mathematics formatting](/learn/latex/mathematics/basics) | [Document classes](/learn/reference/document-classes)## Font SizesLaTeX provides ten standard font size commands:```latex font-sizes.tex theme=\{null} \documentclass{article} \begin{document} {\tiny This is tiny text}\\ {\scriptsize This is scriptsize text}\\ {\footnotesize This is footnotesize text}\\ {\small This is small text}\\ {\normalsize This is normalsize text}\\ {\large This is large text}\\ {\Large This is Large text}\\ {\LARGE This is LARGE text}\\ {\huge This is huge text}\\ {\Huge This is Huge text} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-sizes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_text_formatting)### Using Font Sizes```latex using-sizes.tex theme=\{null} % Inline usage This is {\large important} text. % Block usage {\Large This entire paragraph is in Large size. All text here maintains the same size. } % Environment usage \begin{large} Everything in this environment is large. \end{large} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from using-sizes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-text-formatting-02/page-1.svg)
## Font FamiliesLaTeX has three main font families:```latex font-families.tex theme=\{null} \documentclass{article} \begin{document} % Roman (serif) - default \textrm{This is Roman text (serif)} % Sans serif \textsf{This is Sans Serif text} % Typewriter (monospace) \texttt{This is Typewriter text} % Combining with other formatting \textsf{\textbf{Bold Sans Serif}} \texttt{\textit{Italic Typewriter}} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-families.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-03/page-1.svg)
### Setting Default Font Family```latex default-family.tex theme=\{null} % Make sans serif the default \renewcommand{\familydefault}{\sfdefault} % Make typewriter the default \renewcommand{\familydefault}{\ttdefault} % Return to roman (default) \renewcommand{\familydefault}{\rmdefault} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Font Shapes and Series### Font Shapes```latex font-shapes.tex theme=\{null} \documentclass{article} \begin{document} % Upright (default) \textup{Upright text} % Italic \textit{Italic text} % Slanted (different from italic) \textsl{Slanted text} % Small caps \textsc{Small Capitals} % Emphasis (context-aware) \emph{Emphasized text} % Nested emphasis \textit{Italic with \emph{emphasized} text} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-shapes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-05/page-1.svg)
### Font Series (Weight)```latex font-weight.tex theme=\{null} % Medium (default) \textmd{Medium weight text} % Bold \textbf{Bold text} % Bold extended (if available) {\fontseries{bx}\selectfont Bold Extended} % Light (if available) {\fontseries{l}\selectfont Light text} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-weight.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-text-formatting-06/page-1.svg)
## Color Text```latex color-text.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \begin{document} % Basic colors \textcolor{red}{Red text} \textcolor{blue}{Blue text} \textcolor{green}{Green text} % Define custom colors \definecolor{myorange}{RGB}{255,96,55} \definecolor{darkblue}{HTML}{003366} \definecolor{lightgray}{gray}{0.8} % Use custom colors \textcolor{myorange}{LaTeX Cloud Studio orange} \textcolor{darkblue}{Dark blue text} \textcolor{lightgray}{Light gray text} % Background colors \colorbox{yellow}{Highlighted text} \colorbox{myorange}{\textcolor{white}{White on orange}} % Colored box with frame \fcolorbox{red}{yellow}{Text in box} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from color-text.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-07/page-1.svg)
### Color Models```latex color-models.tex theme=\{null} % RGB (0-255) \definecolor{mycolor}{RGB}{255,128,0} % HTML hex \definecolor{mycolor}{HTML}{FF8000} % Gray scale (0-1) \definecolor{mycolor}{gray}{0.5} % CMYK (0-1) \definecolor{mycolor}{cmyk}{0,0.5,1,0} % HSB (0-360,0-1,0-1) \definecolor{mycolor}{hsb}{30,1,1} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Text Alignment```latex alignment.tex theme=\{null} \documentclass{article} \begin{document} % Left aligned (default) \begin{flushleft} This text is aligned to the left edge. Multiple lines maintain left alignment. \end{flushleft} % Centered \begin{center} This text is centered.\\ Each line is individually centered. \end{center} % Right aligned \begin{flushright} This text is aligned to the right edge.\\ All lines align to the right margin. \end{flushright} % Justified (default for normal text) This is justified text, which is the default in LaTeX. The text is aligned to both left and right margins, with spacing adjusted between words. % Ragged right (unjustified) \raggedright This text has a ragged right edge. Lines break naturally without justification. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from alignment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-09/page-1.svg)
## Special Text Effects### Underline Variations```latex underline-variations.tex theme=\{null} \documentclass{article} \usepackage{ulem} \begin{document} % Normal underline \underline{Simple underline} % Better underlines with ulem \uline{Better underline} \uuline{Double underline} \uwave{Wavy underline} \sout{Strikethrough} \xout{Crossed out} \dashuline{Dashed underline} \dotuline{Dotted underline} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from underline-variations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-10/page-1.svg)
### Text Decorations```latex decorations.tex theme=\{null} \documentclass{article} \usepackage{soul} \begin{document} % Highlighting \hl{Highlighted text} % Letter spacing \so{S p a c e d o u t} % Caps with spacing \caps{SPACED CAPITALS} % Strike out \st{Struck through text} % Underline with soul \ul{Underlined with soul package} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from decorations.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-11/page-1.svg)
## Text Boxes and Frames```latex text-boxes.tex theme=\{null} \documentclass{article} \usepackage{xcolor} \usepackage{tcolorbox} \begin{document} % Simple box \fbox{Text in a box} % Box with padding \fbox{\parbox{0.8\textwidth}{ This is a longer text in a box with controlled width. }} % Colored boxes with tcolorbox \begin{tcolorbox}[colback=blue!5,colframe=blue!75!black] This is text in a fancy colored box. \end{tcolorbox} \begin{tcolorbox}[colback=red!5,colframe=red!75!black,title=Warning] This box has a title and custom colors. \end{tcolorbox} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from text-boxes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-12/page-1.svg)
## Advanced Formatting### Rotating Text```latex rotating-text.tex theme=\{null} \documentclass{article} \usepackage{rotating} \begin{document} Normal text \rotatebox{90}{Rotated 90°} more text \begin{turn}{45} This entire block is rotated 45 degrees \end{turn} % Sideways text \begin{sideways} This text appears sideways \end{sideways} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from rotating-text.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-13/page-1.svg)
### Scaling Text```latex scaling-text.tex theme=\{null} \documentclass{article} \usepackage{graphicx} \begin{document} Normal \scalebox{2}{Scaled 2x} text \scalebox{1.5}[0.5]{Stretched horizontally} \scalebox{0.5}[1.5]{Stretched vertically} \resizebox{3cm}{!}{Resized to 3cm width} \resizebox{!}{1cm}{Resized to 1cm height} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from scaling-text.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-14/page-1.svg)
## Custom Commands for Consistent Formatting```latex custom-commands.tex theme=\{null} \documentclass{article} \usepackage{xcolor} % Define custom commands \newcommand{\keyword}[1]{\textbf{\textcolor{blue}{#1}}} \newcommand{\important}[1]{\textcolor{red}{\textbf{#1}}} \newcommand{\code}[1]{\texttt{\colorbox{gray!20}{#1}}} \newcommand{\term}[1]{\textit{#1}} \begin{document} The \keyword{function} keyword declares a new function. \important{Warning:} This action cannot be undone. Use the \code{print()} function to display output. The \term{algorithm} processes data efficiently. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from custom-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-15/page-1.svg)
## Multilingual Text```latex multilingual.tex theme=\{null} \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{babel} % For XeLaTeX/LuaLaTeX % \usepackage{fontspec} % \usepackage{polyglossia} \begin{document} % Accented characters café, naïve, résumé, Zürich % Special characters €100, £50, ¥1000, °C, ±5% % Different languages \foreignlanguage{spanish}{¡Hola! ¿Cómo estás?} \foreignlanguage{german}{Größe, Übung, ähnlich} \foreignlanguage{french}{Château, œuvre, garçon} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multilingual.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-text-formatting-16/page-1.svg)
## How to Write Ordinals Like 1st, 2nd and 3rdType the suffix as normal text — `21st March` — for ordinary prose. LaTeX needs no special command, and plain text is what most style guides expect.For a raised suffix, `\textsuperscript{}` does the job: `2\textsuperscript{nd}` renders the "nd" above the baseline. Do not use maths mode (`$2^{nd}$`) for this; it sets the suffix in a maths italic font, which is wrong for text and spaces badly.If your document uses many ordinals, define a command once so the style stays consistent:`\newcommand{\ordinal}[2]{#1\textsuperscript{#2}}`then write `\ordinal{2}{nd}`. Note that superscripted ordinals are a typographic convention rather than a rule — most modern style guides prefer plain "2nd".## Best Practices> [!TIP] > > **Formatting guidelines:** > > 1. **Semantic markup**: Use `\emph{}` for emphasis, not just `\textit{}` > 2. **Consistency**: Define custom commands for repeated formatting > 3. **Avoid hardcoding**: Use relative sizes (em, ex) not absolute (pt) > 4. **Color sparingly**: Too many colors reduce professionalism > 5. **Test output**: Check how formatting appears in final PDF## Common Pitfalls> [!WARNING] > > **Avoid these mistakes:** > > 1. **Over-formatting**: Don't use too many different styles > 2. **Manual spacing**: Let LaTeX handle spacing automatically > 3. **Absolute sizes**: Use relative sizes for better scaling > 4. **Direct formatting**: Define styles once, reuse throughout > 5. **Poor contrast**: Ensure colored text is readable## Quick Reference| Command | Purpose | Example | | - | - | - | | `\large` | Larger text | `{\large Big}` | | `\textbf{}` | Bold | `\textbf{Bold}` | | `\textit{}` | Italic | `\textit{Italic}` | | `\texttt{}` | Monospace | `\texttt{Code}` | | `\textsc{}` | Small caps | `\textsc{Name}` | | `\textcolor{}{}` | Colored text | `\textcolor{red}{Red}` | | `\colorbox{}{}` | Background | `\colorbox{yellow}{Hi}` | | `\underline{}` | Underline | `\underline{Text}` |***## Related Formatting Guides> [card] Headers & Footers > > Customize page headers and footers[Open](/learn/latex/formatting/headers-footers)> [card] Page Numbering > > Control page number styles and placement[Open](/learn/latex/formatting/page-numbering)> [card] Multiple Columns > > Create multi-column layouts[Open](/learn/latex/formatting/multiple-columns)> [card] Lengths & Units > > Master LaTeX measurement units[Open](/learn/latex/formatting/lengths-units)> [card] Counters & Numbering > > Customize automatic numbering[Open](/learn/latex/formatting/counters-numbering)> [card] Code Listings > > Format source code with syntax highlighting[Open](/learn/latex/formatting/code-listings-minted)> [!NOTE] > > **Next**: Learn about [Paragraph spacing](/learn/latex/paragraphs-spacing) to control the layout and flow of your documents. # Fix Bibliography Build Errors in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/bibliography-build-errors Troubleshoot BibTeX and BibLaTeX build problems, undefined citations, backend mismatches, and empty bibliographies. Bibliography failures often come from backend mismatches and build order issues. ## Typical Errors * `undefined citations` * `empty bibliography` * `Please (re)run Biber` * `I couldn't open database file references.bib` ## Fix Workflow 1. Confirm system: BibTeX or BibLaTeX. 2. Match backend (`bibtex` vs `biber`). 3. Verify `.bib` filename and path. 4. Rebuild in correct sequence. ## Build Sequences * BibTeX: LaTeX -> BibTeX -> LaTeX -> LaTeX * BibLaTeX: LaTeX -> Biber -> LaTeX -> LaTeX ## Related Pages * [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) * [Natbib guide](/learn/latex/bibliography/natbib-guide) * [Bibliography hub](/learn/latex/bibliography) # Fix Compiler and Engine Errors in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/compiler-and-engine-errors Resolve compiler mismatch errors by selecting the correct engine: pdfLaTeX, XeLaTeX, or LuaLaTeX. Some packages and fonts require a specific engine.## Common Symptoms- Unicode glyph failures under pdfLaTeX. - `fontspec` errors with pdfLaTeX. - CJK or RTL rendering issues. For ctex documents that stop with `Font unisong30 at 632 not found`, see [Chinese font not found with ctex](/learn/latex/troubleshooting/ctex-font-unisong-not-found).### The exact error you probably searched for```bash fontspec-pdftex.log theme=\{null} ! Fatal Package fontspec Error: The fontspec package requires either XeTeX or LuaTeX. (fontspec) {cannot-use-pdftex} ````{cannot-use-pdftex}` means exactly one thing: the document loads `fontspec`, which needs system fonts, but it is being compiled with pdfLaTeX, which cannot use them.Switch the compiler to XeLaTeX or LuaLaTeX. Nothing in the document needs to change. If you cannot switch, remove `fontspec` and select fonts with a pdfLaTeX package such as `\usepackage{times}` or `\usepackage{newtxtext}` instead.In LaTeX Cloud Studio the compiler is a project setting, so this is a one-click fix rather than a rewrite.## Rule of Thumb- pdfLaTeX: classic latin workflows. - XeLaTeX/LuaLaTeX: modern Unicode, system fonts, CJK, RTL.## Example```latex engine-choice.tex theme=\{null} % Requires XeLaTeX or LuaLaTeX \usepackage{fontspec} \setmainfont{TeX Gyre Termes} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Related Pages- [Choosing a compiler](/learn/latex/basics/choosing-compiler) - [Languages hub](/learn/latex/languages) # Fix "Font unisong not found" in Chinese LaTeX (ctex) Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/ctex-font-unisong-not-found pdfLaTeX cannot compile ctex documents: "Font unisong30 at 632 not found". Compile Chinese LaTeX with XeLaTeX, or use CJKutf8 with gbsn on pdfLaTeX. ```log pdflatex.log theme=\{null} .../ctex/fontset/ctex-fontset-fandol.def:103: Critical Class ctexart Error: CTeX fontset `fandol' is unavailable in (ctexart) current mode. !pdfTeX error: pdflatex (file unisong30): Font unisong30 at 632 not found ==> Fatal error occurred, no output PDF file produced! ```Your document uses ctex (`\documentclass{ctexart}`, `ctexbook`, `ctexrep`, `ctexbeamer`, or `\usepackage{ctex}`) and it was compiled with pdfLaTeX. Compile it with XeLaTeX instead. The document itself does not need to change.The font number and size in the message (`unisong30 at 632` above) vary with the document and its font size. Every variant has the same cause and the same fix.## Why pdfLaTeX failsctex loads its Chinese fonts from a font set. In TeX Live 2026 on Linux, which is the environment the examples on this page are compiled in, ctex selects the Fandol font set. That font set needs XeLaTeX or LuaLaTeX, so under pdfLaTeX ctex reports ``CTeX fontset `fandol' is unavailable in current mode`` and falls back to the old `unisong` font names of the CJK package. TeX Live does not include those fonts, so pdfTeX stops with a fatal error and writes no PDF.The first message is the cause. The `unisong` message is the consequence, and it is the one most logs show last.## Minimal failing example```latex ctex-pdflatex.tex theme=\{null} % Fails when the compiler is pdfLaTeX \documentclass{ctexart} \begin{document} 你好,世界。This line mixes Chinese and English. \end{document} ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`Critical Class ctexart Error: CTeX fontset\`.\
## Fix: compile with XeLaTeXChange the compiler, not the document. The same source compiles with XeLaTeX:```latex ctex-xelatex.tex theme=\{null} % Same document, compiled with XeLaTeX \documentclass{ctexart} \begin{document} 你好,世界。This line mixes Chinese and English. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from ctex-xelatex.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-troubleshooting-ctex-font-unisong-not-found-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_troubleshooting_ctex_font_unisong_not_found)On the command line, run `xelatex main.tex` or `latexmk -xelatex main.tex` instead of `pdflatex main.tex`. LuaLaTeX (`lualatex main.tex`) also compiles this document.## If you must stay on pdfLaTeXSome journal or university templates only build with pdfLaTeX. In that case, do not load ctex. Use the `CJKutf8` package with a font that TeX Live ships, such as `gbsn` (Simplified Chinese, Song style), `gkai` (Simplified Chinese, Kai style), or `bsmi` (Traditional Chinese):```latex cjkutf8-pdflatex.tex theme=\{null} % pdfLaTeX only: CJKutf8 with the gbsn font that TeX Live ships \documentclass{article} \usepackage{CJKutf8} \begin{document} \begin{CJK}{UTF8}{gbsn} 你好,世界。 \end{CJK} This line is ordinary English text. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cjkutf8-pdflatex.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-troubleshooting-ctex-font-unisong-not-found-03/page-1.svg)
This only typesets the characters. ctex features such as Chinese captions (`目录`, `参考文献`) and the `\zihao` font-size command are not available, so prefer XeLaTeX whenever the template allows it.### The same error with the CJK package`\begin{CJK}{UTF8}{song}` fails under pdfLaTeX in the same way, with a different font name:```log pdflatex.log theme=\{null} !pdfTeX error: pdflatex (file cyberb30): Font cyberb30 at 600 not found ==> Fatal error occurred, no output PDF file produced! ```Replace `song` with `gbsn`, or switch to XeLaTeX and ctex.## In LaTeX Cloud Studio- The project's **LaTeX Engine** setting defaults to **Auto (Recommended)**. With Auto, a document that uses `ctex`, `ctexart`, `ctexbook`, `ctexrep`, `ctexbeamer`, `xeCJK`, `fontspec`, or `polyglossia`, or calls `\setCJKmainfont`, compiles with XeLaTeX. Packages loaded from your own `.sty` and `.cls` files count too, and commented-out lines are ignored. - Documents that use `luatexja` or the `ltjs*` classes for Japanese compile with LuaLaTeX. - If the engine is set to **PDFLaTeX** explicitly, that choice is kept and the compile fails. The Problems panel then shows `Chinese font unisong30 is not available for pdfLaTeX`. Open the project **Settings**, and under **General** set **LaTeX Engine** to **Auto (Recommended)** or **XeLaTeX**.## Related pages- [LaTeX in Chinese](/learn/latex/languages/chinese): set up a Chinese document with XeLaTeX and xeCJK - [Compiler and engine errors](/learn/latex/troubleshooting/compiler-and-engine-errors): `fontspec` and other engine mismatches - [Choosing a compiler](/learn/latex/basics/choosing-compiler): pdfLaTeX, XeLaTeX, and LuaLaTeX compared - [LaTeX in Japanese](/learn/latex/languages/japanese) - [Emergency stop](/learn/latex/troubleshooting/emergency-stop): when the compile stops before `\end{document}` - [Troubleshooting center](/learn/latex/troubleshooting) # Fix "! Emergency stop" and "job aborted" in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/emergency-stop What "! Emergency stop" means in LaTeX, and how to fix "no legal \end found", "file error in nonstop mode", and "cannot \read from terminal". ```log main.log theme=\{null} ! Emergency stop. <*> main.tex *** (job aborted, no legal \end found) ````! Emergency stop` means TeX had to stop before it reached `\end{document}`, and it could not ask you what to do because the compile runs without a terminal. The line that starts with `***` names the cause. Find it in your log, then use the matching section below.| Line after `Emergency stop` | What it means | Fix | | - | - | - | | `*** (job aborted, no legal \end found)` | The main file ended without `\end{document}` | [Close the document](#job-aborted-no-legal-end-found) | | `*** (job aborted, file error in nonstop mode)` | The main file could not be opened | [Compile the right file](#job-aborted-file-error-in-nonstop-mode) | | `*** (cannot \read from terminal in nonstop modes)` | A file that the document loads is missing | [Fix the missing file](#cannot-read-from-terminal-in-nonstop-modes) |If your log shows none of these, see [any other emergency stop](#any-other-emergency-stop).## Job aborted: no legal end foundThe log ends with `*** (job aborted, no legal \end found)`: TeX read the whole main file and never found `\end{document}`. Common causes:- `\end{document}` was deleted, or the file was cut off while it was copied or uploaded. - The main file is empty. This happens when an empty `main.tex` sits next to the real document. - An environment or conditional was never closed and swallowed the rest of the file. In that case the log shows a different error first, such as `File ended while scanning use of \@xverbatim` for an unclosed `verbatim` environment, or `Incomplete \iffalse; all text was ignored after line 3` for an `\iffalse` without `\fi`. Close that environment or conditional.### Minimal failing example```latex truncated.tex theme=\{null} \documentclass{article} \begin{document} \section{Results} The file stops here, before the document is closed. ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`job aborted, no legal \end found\`.\
### Fixed versionAdd `\end{document}` as the last line of the main file:```latex complete.tex theme=\{null} \documentclass{article} \begin{document} \section{Results} The file stops here, before the document is closed. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from complete.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-latex-troubleshooting-emergency-stop-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_troubleshooting_emergency_stop)In LaTeX Cloud Studio, this failure appears in the Problems panel as `The main file ended before \end{document}`. If the configured main file is empty and another `.tex` file in the project is the real document, LaTeX Cloud Studio compiles that file instead, as described [below](#in-latex-cloud-studio).## Job aborted: file error in nonstop modeTeX could not open the file it was asked to compile, so it never read a line of your document. The terminal output names the file:```log terminal theme=\{null} ! I can't find file `main.tex'. <*> main.tex (Press Enter to retry, or Control-D to exit) Please type another input file name ! Emergency stop. <*> main.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on texput.log. ```The log file is named `texput.log` instead of `main.log`, because TeX never opened your file:```log texput.log theme=\{null} ! Emergency stop. <*> main.tex *** (job aborted, file error in nonstop mode) ```Common causes:- The main file was renamed, or the document has a different name, such as `thesis.tex` or `report.tex`. - The document is in a subfolder, but the compile starts in the project root. - The name differs only in case. On Linux, `Main.tex` and `main.tex` are different files.To fix it, compile the file that contains `\documentclass` and `\begin{document}`, from the folder that contains it. On the command line, that is `pdflatex thesis.tex` or `latexmk -pdf thesis.tex` in the document's folder.### In LaTeX Cloud Studio- If the configured main file, usually `main.tex`, is missing or does not contain both `\documentclass` and `\begin{document}`, the compiler uses the `.tex` file that does. It looks at the shallowest folder level first, so an imported project whose document is called `thesis.tex` compiles without a settings change. - If two files at the same level both qualify, the compiler keeps the configured main file. Rename or remove the copy you do not compile, so that one root document remains. - When the main file cannot be opened, the Problems panel shows `The main file could not be opened`.## Cannot read from terminal in nonstop modesA file that the document loads with `\input`, `\include`, `\usepackage`, or `\documentclass` is missing. TeX asks for a new file name, gets no answer in nonstop mode, and stops. The real error is the `not found` line above the emergency stop:```log report.log theme=\{null} ! LaTeX Error: File `chapter1.tex' not found. Type X to quit or to proceed, or enter new name. (Default extension: tex) Enter file name: ./report.tex:4: Emergency stop. l.4 \input{chapter1} ^^M *** (cannot \read from terminal in nonstop modes) ``````latex report.tex theme=\{null} \documentclass{article} \begin{document} % chapter1.tex is not in the project, or has a different name \input{chapter1} \end{document} ```\
\Compiler result\ \> \\\[!WARNING] \> \> This example is intentionally invalid. The automated example test verifies that compilation fails with: \`cannot \read from terminal in nonstop modes\`.\
To fix it:- Upload the missing file, or correct its name. Names are case-sensitive. - Write the path relative to the main file's folder. If the chapter is in `chapters/`, use `\input{chapters/chapter1}`. - If the missing file ends in `.sty` or `.cls`, it is a package or class. See [missing package errors](/learn/latex/troubleshooting/missing-packages).## Any other emergency stopIn nonstop mode, an emergency stop is often the last line of a longer failure. Read the log from the top and fix the first error. Errors start with `!`, or with `./file.tex:LINE:` when the compile uses `-file-line-error`. On the command line, this prints the first one:```bash theme=\{null} grep -n -m1 -E '^!|^\./.*:[0-9]+:' main.log ```In LaTeX Cloud Studio, if the Problems panel cannot classify an error, it shows a **Report this problem** button. The report includes the end of the compile log, so you do not need to copy it.## Related pages- [Common LaTeX errors](/learn/latex/basics/errors): `Missing $ inserted`, `Undefined control sequence`, and others - [Fix "Font unisong not found" in Chinese LaTeX](/learn/latex/troubleshooting/ctex-font-unisong-not-found) - [Missing package errors](/learn/latex/troubleshooting/missing-packages) - [Large documents](/learn/latex/how-to/large-documents): split a project with `\input` and `\include` - [Troubleshooting center](/learn/latex/troubleshooting) # Fix Figure and Table Placement Issues in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/float-and-placement-issues Control figure and table placement in LaTeX with float options, barriers, and layout tuning. Float behavior is controlled by layout rules, not exact insertion points.## Symptoms- Figure appears several pages later. - Table jumps to top or bottom unexpectedly. - `Too many unprocessed floats` warnings.## Fix Workflow1) Use sensible float hints (`[htbp]`). 2) Reduce oversized figures/tables. 3) Insert float barriers between sections. 4) Avoid forcing every float with `[H]`.## Example```latex float-control.tex theme=\{null} \usepackage{placeins} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{plot.pdf} \caption{Model performance} \end{figure} \FloatBarrier ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Related Pages- [Positioning figures](/learn/latex/figures/positioning) - [Advanced tables](/learn/latex/tables/advanced-tables) # Fix Image and Path Errors in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/image-and-path-errors Solve image not found errors in LaTeX by correcting paths, file extensions, and compiler compatibility. Image path issues are one of the most common LaTeX build blockers.## Typical Errors- `File 'figure1' not found` - `Cannot determine size of graphic` - `Unknown graphics extension`## Fix Workflow1) Confirm file exists in project tree. 2) Use relative paths from main file. 3) Match extension compatibility with compiler. 4) Avoid spaces in filenames.## Example```latex image-paths.tex theme=\{null} \usepackage{graphicx} \graphicspath{{figures/}{images/}} % Good \includegraphics[width=0.7\textwidth]{architecture.pdf} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Related Pages- [Inserting images](/learn/latex/figures/inserting-images) # LaTeX Troubleshooting Center Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/index Diagnose and fix common LaTeX issues: compiler errors, package problems, bibliography failures, image paths, and float placement. Use this hub to find the right fix path for your compilation issue. ## Core Troubleshooting Guides * [Fixing compilation errors](/learn/latex/basics/errors) * [Emergency stop: no legal \end found, file error in nonstop mode](/learn/latex/troubleshooting/emergency-stop) * [Chinese font not found with ctex (Font unisong30)](/learn/latex/troubleshooting/ctex-font-unisong-not-found) * [Warnings explained: overfull, underfull, lost floats](/learn/latex/troubleshooting/warnings-explained) * [Missing packages](/learn/latex/troubleshooting/missing-packages) * [Bibliography build errors](/learn/latex/troubleshooting/bibliography-build-errors) * [Image and path errors](/learn/latex/troubleshooting/image-and-path-errors) * [Compiler and engine errors](/learn/latex/troubleshooting/compiler-and-engine-errors) * [Float and placement issues](/learn/latex/troubleshooting/float-and-placement-issues) ## Errors or Warnings? An error stops the compile. A warning does not — you still get a PDF, and TeX is reporting a layout compromise. If your document compiled but something looks wrong, start with [warnings explained](/learn/latex/troubleshooting/warnings-explained). ## Fast Triage 1. Identify the first error line in logs. 2. Confirm compiler (`pdflatex`, `xelatex`, or `lualatex`). 3. Isolate with a minimal reproducible example. 4. Recompile after each single change. ## Related Pages * [Choosing a compiler](/learn/latex/basics/choosing-compiler) * [Package management](/learn/latex/package-management) * [Bibliography hub](/learn/latex/bibliography) * [Working with images](/learn/latex/figures/inserting-images) ## Start in LaTeX Cloud Studio > [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=troubleshooting_hub_open_app) > [card] Start from Article Template > > Use a ready-made template, then adapt it to your content. [Open](/templates/article) # Fix Missing Package Errors in LaTeX Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/missing-packages Resolve .sty not found errors in LaTeX by checking package names, installation state, and dependency conflicts. Missing package errors typically look like: `File 'xyz.sty' not found`.## Common Causes- Typo or wrong package name. - Package not installed in local TeX distribution. - Outdated TeX distribution. - Template expects a package unavailable in your environment.## Fix Workflow1) Verify exact package name in docs. 2) Remove duplicate/conflicting package calls. 3) Update TeX distribution. 4) In cloud editors, remove local-only package assumptions.## Example```latex package-fix.tex theme=\{null} % Wrong \usepackage{TikZ} % Correct \usepackage{tikz} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Related Pages- [Package management](/learn/latex/package-management) - [Fixing compilation errors](/learn/latex/basics/errors) # LaTeX Warnings Explained: Overfull hbox, Underfull hbox, Badness 10000 Source: https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/warnings-explained Understand what Overfull \hbox, Underfull \hbox (badness 10000), and Float(s) lost actually mean, which ones you can safely ignore, and how to fix the ones that matter. LaTeX warnings are not errors. Your document still compiles and produces a PDF. They are TeX telling you it made a layout compromise, and some of those compromises are visible on the page while others are invisible and safe to ignore.This page explains what the most common messages mean in plain language, so you can tell the difference.## Which warnings actually matter| Message | Visible in the PDF? | Act on it? | | - | - | - | | `Overfull \hbox (Xpt too wide)` | Usually yes — text runs into the margin | Yes, if X is more than a point or two | | `Underfull \hbox (badness 10000)` | Sometimes — wide word gaps | Only if the spacing looks wrong | | `Underfull \vbox` | Sometimes — content spread down the page | Only if the page looks wrong | | `Float(s) lost` | Yes — a figure or table vanishes | Always | | `There were undefined references` | Yes — `??` in the text | Always | | `Label(s) may have changed` | No | No, just recompile |## Overfull \hbox```bash overfull-warning.log theme=\{null} Overfull \hbox (15.58524pt too wide) in paragraph at lines 42--45 ```TeX could not break a line within the text width, so the line sticks out past the right margin by the amount shown. A value under about 2pt is usually invisible. Anything larger normally is visible.The usual causes are a long unbreakable item: a URL, a code identifier, a chemical name, or a wide equation or table.### Find it firstCompile with the `draft` class option. LaTeX draws a black bar in the margin next to every overfull box, which is far faster than reading line numbers out of the log.```latex find-overfull.tex theme=\{null} \documentclass[draft]{article} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Fix itFor long words and URLs, let TeX hyphenate them. The `url` package breaks URLs at sensible points, and `microtype` reduces overfull boxes across the whole document by subtly adjusting character widths and spacing.```latex fix-overfull.tex theme=\{null} \usepackage{microtype} \usepackage{url} % Allow breaks inside a specific long word long\-word\-that\-needs\-breaking % Teach TeX a hyphenation pattern for a word it gets wrong \hyphenation{data-base bio-in-for-mat-ics} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from fix-overfull.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-troubleshooting-warnings-explained-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_troubleshooting_warnings_explained)If a single stubborn paragraph resists, `\sloppy` tells TeX to prefer wide word gaps over running into the margin. Scope it to the paragraph rather than the document, or you trade overfull boxes for ugly spacing everywhere.```latex sloppy-scoped.tex theme=\{null} \begin{sloppypar} Paragraph containing the awkward unbreakable content. \end{sloppypar} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from sloppy-scoped.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-troubleshooting-warnings-explained-03/page-1.svg)
Wide tables and equations need a different fix: see [advanced tables](/learn/latex/tables/advanced-tables) and [breaking long equations](/learn/latex/mathematics/align-and-multline-environments).## Underfull \hbox and badness 10000```bash underfull-warning.log theme=\{null} Underfull \hbox (badness 10000) in paragraph at lines 88--91 ```This is the message that confuses people most, because nothing looks broken.**Badness measures how far TeX had to stretch the spaces to fill a line.** It runs from 0 (perfect) to 10000, and 10000 means "infinitely bad" — TeX gave up and stretched the spaces as far as it needed to. It is a complaint about spacing quality, not a sign of a broken document.Badness 10000 is by far the most common value because it is the ceiling. Seeing it does not mean the problem is severe; it means the problem hit the maximum on the scale.### Common causes- `\\` used to force a line break in ordinary text. The forced short line must be stretched to full width. This is the single most frequent cause. - `\raggedright`, or a narrow column such as a `minipage` or a two-column layout. - A paragraph where TeX chose stretched spaces over an overfull line.### Fix itIf the spacing looks fine in the PDF, ignore it. That is a legitimate decision, not laziness — the warning is advisory.If it does look wrong, in body text use a blank line for a new paragraph rather than `\\`:```latex forced-break.tex theme=\{null} % Causes Underfull \hbox: forces a short line First line of text \\ Second line of text % Correct: a paragraph break First line of text Second line of text ```
Rendered output Open zoomable preview: Compiled PDF page 1 from forced-break.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-latex-troubleshooting-warnings-explained-04/page-1.svg)
To silence the warnings from deliberately ragged text, tell TeX not to complain:```latex ragged-no-warnings.tex theme=\{null} \usepackage{ragged2e} \RaggedRight % ragged right, with hyphenation and no badness warnings ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
To relax TeX's standards document-wide, raise the tolerance. `\emergencystretch` gives TeX extra room on a final pass rather than lowering quality everywhere:```latex tolerance.tex theme=\{null} \setlength{\emergencystretch}{3em} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Underfull \vboxThe vertical equivalent: TeX stretched the spacing between elements to fill a page.It usually appears near a page break where a float, a heading, or a `\clearpage` left material that could not fill the page. If the page looks acceptable, ignore it. If not, adjusting float placement is normally the real fix — see [float and placement issues](/learn/latex/troubleshooting/float-and-placement-issues).## Float(s) lost```bash floats-lost.log theme=\{null} LaTeX Warning: Float(s) lost on input line 120. ```This one is never safe to ignore. A figure or table has been silently dropped and will not appear in the PDF at all.It happens when a float is declared somewhere TeX cannot move it out of — floats must be able to migrate to the top or bottom of a page, and inside a box there is nowhere to migrate to. The usual culprits are a `figure` or `table` environment placed inside:- a `minipage`, `\parbox`, or `\fbox` - another float - a footnoteThe closely related error `! LaTeX Error: Not in outer par mode` has the same root cause and is thrown in the same situations.### Fix itMove the float to the top level of the document. If you genuinely need a captioned figure inside a `minipage`, do not use the `figure` environment — use `\captionof` from the `caption` package, which produces a caption without creating a float:```latex captionof.tex theme=\{null} \usepackage{caption} \begin{minipage}{0.45\textwidth} \centering \includegraphics[width=\linewidth]{plot.pdf} \captionof{figure}{A caption without creating a float} \label{fig:plot} \end{minipage} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
For two figures side by side, `subcaption` handles the common case properly:```latex subfigure.tex theme=\{null} \usepackage{subcaption} \begin{figure}[htbp] \begin{subfigure}{0.45\textwidth} \includegraphics[width=\linewidth]{left.pdf} \caption{Left panel} \end{subfigure} \hfill \begin{subfigure}{0.45\textwidth} \includegraphics[width=\linewidth]{right.pdf} \caption{Right panel} \end{subfigure} \caption{Both panels} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Undefined references and changed labels```bash reference-warnings.log theme=\{null} LaTeX Warning: There were undefined references. LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. ```LaTeX resolves cross-references by writing them to an `.aux` file on one pass and reading them back on the next. On the first compile the labels do not exist yet.`Label(s) may have changed` simply means run it again. `There were undefined references` after a second run means a `\ref` or `\cite` points at a label that does not exist — check for a typo, or a `\label` placed before its `\caption`.Cloud compilers usually handle the repeated passes for you. For citations, see [bibliography build errors](/learn/latex/troubleshooting/bibliography-build-errors).## Reading the log yourselfWarnings name the input line, which is the fastest way to find the source:```bash grep-warnings.sh theme=\{null} # Every warning and overfull box, with line numbers grep -nE "Warning|Overfull|Underfull" main.log # Just the ones that are usually visible grep -nE "Overfull \\\\hbox \([0-9]{2,}" main.log ```That second command filters to overfull boxes of 10pt or more, which is a practical way to skip the noise and find the ones a reader would actually notice.## Related Pages- [Fixing compilation errors](/learn/latex/basics/errors) - [Float and placement issues](/learn/latex/troubleshooting/float-and-placement-issues) - [Compiler and engine errors](/learn/latex/troubleshooting/compiler-and-engine-errors) - [Troubleshooting center](/learn/latex/troubleshooting)## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Compile in the browser and read the full log next to your source.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=warnings_explained_open_app)> [card] Troubleshooting center > > Work through the other common failure modes.[Open](/learn/latex/troubleshooting) # LaTeX Commands Reference Source: https://resources.latex-cloud-studio.com/learn/reference/commands Comprehensive reference guide for LaTeX commands. Find syntax, usage examples, and options for all essential LaTeX commands. This reference provides a comprehensive guide to LaTeX commands organized by category. Each command includes syntax, options, and practical examples.> [!NOTE] > > **Quick tip**: Use Ctrl/Cmd + F to search for specific commands. Commands are organized alphabetically within each category.## Document Structure Commands### Document Class and Packages```latex document-setup.tex theme=\{null} % Document class \documentclass[options]{class} \documentclass[12pt,a4paper]{article} \documentclass[11pt,twoside]{report} \documentclass[letterpaper,draft]{book} % Package loading \usepackage[options]{package} \usepackage{amsmath} \usepackage[utf8]{inputenc} \usepackage[margin=1in]{geometry} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Sectioning Commands| Command | Level | Numbered | Example | | - | - | - | - | | `\part{}` | -1 | Yes | `\part{Part Title}` | | `\chapter{}` | 0 | Yes | `\chapter{Chapter Title}` | | `\section{}` | 1 | Yes | `\section{Section Title}` | | `\subsection{}` | 2 | Yes | `\subsection{Subsection}` | | `\subsubsection{}` | 3 | Yes | `\subsubsection{Subsubsection}` | | `\paragraph{}` | 4 | No\* | `\paragraph{Paragraph}` | | `\subparagraph{}` | 5 | No\* | `\subparagraph{Subparagraph}` |\*Can be numbered by adjusting `secnumdepth````latex sectioning-examples.tex theme=\{null} % Unnumbered sections \section*{Introduction} \subsection*{Background} % With short title for TOC \section[Short Title]{Long Descriptive Title for the Document} % Adjusting numbering depth \setcounter{secnumdepth}{3} % Number up to subsubsection \setcounter{tocdepth}{2} % TOC up to subsection ```
Rendered output Open zoomable preview: Compiled PDF page 1 from sectioning-examples.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_reference_commands)### Document Parts```latex document-parts.tex theme=\{null} % Title commands \title{Document Title} \author{Author Name \and Second Author} \date{\today} % or specific date \maketitle % Abstract \begin{abstract} Abstract content... \end{abstract} % Table of contents \tableofcontents \listoffigures \listoftables % Appendix \appendix \chapter{First Appendix} % Bibliography \bibliographystyle{plain} \bibliography{references} % or with biblatex \printbibliography ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Text Formatting Commands### Font Styles| Command | Effect | Example | Alternative | | - | - | - | - | | `\textbf{}` | **Bold** | `\textbf{bold text}` | `{\bfseries text}` | | `\textit{}` | *Italic* | `\textit{italic text}` | `{\itshape text}` | | `\textsl{}` | *Slanted* | `\textsl{slanted text}` | `{\slshape text}` | | `\textsc{}` | Small Caps | `\textsc{small caps}` | `{\scshape text}` | | `\texttt{}` | `Monospace` | `\texttt{monospace}` | `{\ttfamily text}` | | `\textrm{}` | Roman | `\textrm{roman text}` | `{\rmfamily text}` | | `\textsf{}` | Sans Serif | `\textsf{sans serif}` | `{\sffamily text}` | | `\emph{}` | Emphasis | `\emph{emphasized}` | `{\em text}` |### Font Sizes```latex font-sizes.tex theme=\{null} {\tiny tiny text} {\scriptsize scriptsize text} {\footnotesize footnotesize text} {\small small text} {\normalsize normalsize text} {\large large text} {\Large Large text} {\LARGE LARGE text} {\huge huge text} {\Huge Huge text} % As commands \tiny This text is tiny \normalsize Back to normal ```
Rendered output Open zoomable preview: Compiled PDF page 1 from font-sizes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-04/page-1.svg)
### Text Alignment```latex text-alignment.tex theme=\{null} % Environments \begin{center} Centered text \end{center} \begin{flushleft} Left-aligned text \end{flushleft} \begin{flushright} Right-aligned text \end{flushright} % Commands \centering Centered paragraph \raggedright Left-aligned paragraph \raggedleft Right-aligned paragraph ```
Rendered output Open zoomable preview: Compiled PDF page 1 from text-alignment.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-05/page-1.svg)
## Spacing Commands### Horizontal Spacing| Command | Space Type | Width | | - | - | - | | `~` | Non-breaking space | Normal space | | `\,` | Thin space | 3/18 em | | `\:` | Medium space | 4/18 em | | `\;` | Thick space | 5/18 em | | `\!` | Negative thin space | -3/18 em | | `\ ` | Normal space | Normal space | | `\quad` | Em space | 1 em | | `\qquad` | 2 em space | 2 em | | `\hspace{length}` | Custom space | Specified | | `\hfill` | Stretchable space | Fill available |### Vertical Spacing```latex vertical-spacing.tex theme=\{null} % Fixed vertical space \vspace{1cm} \vspace*{1cm} % Not removed at page breaks % Relative vertical space \smallskip % About 3pt \medskip % About 6pt \bigskip % About 12pt % Fill vertical space \vfill % Page breaks \newpage % Start new page \clearpage % Clear floats and start new page \cleardoublepage % For two-sided documents % Line breaks \\\\ % New line \\\\[1cm] % New line with extra space \\linebreak % Suggests line break \\newline % Forces new line ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Paragraph Formatting```latex paragraph-formatting.tex theme=\{null} % Paragraph indentation \setlength{\parindent}{0pt} % No indent \setlength{\parindent}{1cm} % 1cm indent \noindent % No indent for one paragraph % Paragraph spacing \setlength{\parskip}{1em} % Line spacing \usepackage{setspace} \singlespacing \onehalfspacing \doublespacing \setstretch{1.5} % Custom % Manual spacing \par % End paragraph \indent % Force indent ```
Rendered output Open zoomable preview: Compiled PDF page 1 from paragraph-formatting.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-07/page-1.svg)
## List Commands### Itemize, Enumerate, Description```latex list-commands.tex theme=\{null} % Itemize (bullets) \begin{itemize} \item First item \item Second item \item[$\diamond$] Custom bullet \end{itemize} % Enumerate (numbered) \begin{enumerate} \item First item \item Second item \item[3a.] Custom label \end{enumerate} % Description \begin{description} \item[Term] Description of term \item[Another term] Its description \end{description} % Nested lists \begin{enumerate} \item First level \begin{enumerate} \item Second level \begin{enumerate} \item Third level \end{enumerate} \end{enumerate} \end{enumerate} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from list-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-08/page-1.svg)
### List Customization```latex list-customization.tex theme=\{null} \usepackage{enumitem} % Customize itemize \begin{itemize}[label=$\star$, itemsep=0pt] \item Starred item \end{itemize} % Customize enumerate \begin{enumerate}[label=\alph*), start=5] \item Fifth item (labeled 'e)') \end{enumerate} % Inline lists \begin{itemize*}[label=\textbullet] \item One \item Two \item Three \end{itemize*} % Resume numbering \begin{enumerate}[resume] \item Continues from before \end{enumerate} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Math Commands### Math Environments```latex math-environments.tex theme=\{null} % Inline math $E = mc^2$ \(E = mc^2\) \begin{math}E = mc^2\end{math} % Display math $$E = mc^2$$ \[E = mc^2\] \begin{displaymath}E = mc^2\end{displaymath} % Numbered equation \begin{equation} E = mc^2 \end{equation} % Aligned equations \begin{align} a &= b + c \\ d &= e + f \end{align} % Cases \begin{cases} x, & \text{if } x \geq 0 \\ -x, & \text{if } x < 0 \end{cases} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Common Math Commands| Command | Output | Usage | | - | - | - | | `\frac{a}{b}` | a/b | Fractions | | `\sqrt{x}` | √x | Square root | | `\sqrt[n]{x}` | ⁿ√x | nth root | | `x^{2}` | x² | Superscript | | `x_{i}` | xᵢ | Subscript | | `\sum_{i=1}^{n}` | ∑ᵢ₌₁ⁿ | Summation | | `\int_{a}^{b}` | ∫ₐᵇ | Integral | | `\lim_{x \to 0}` | lim x→0 | Limit | | `\prod_{i=1}^{n}` | ∏ᵢ₌₁ⁿ | Product |### Greek Letters```latex greek-letters.tex theme=\{null} % Lowercase \alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu \nu \xi \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega % Uppercase \Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega % Variants \varepsilon \vartheta \varpi \varrho \varsigma \varphi ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Table Commands### Basic Tables```latex table-basics.tex theme=\{null} % Tabular \begin{tabular}{lcr} Left & Center & Right \\ 1 & 2 & 3 \\ \end{tabular} % Table float \begin{table}[htbp] \centering \caption{Table caption} \label{tab:label} \begin{tabular}{|l|c|r|} \hline A & B & C \\ \hline 1 & 2 & 3 \\ \hline \end{tabular} \end{table} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from table-basics.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-12/page-1.svg)
### Table Commands| Command | Purpose | Example | | - | - | - | | `&` | Column separator | `A & B & C` | | `\\` | Row end | `A & B & C \\` | | `\hline` | Horizontal line | Full width | | `\cline{i-j}` | Partial line | `\cline{2-3}` | | `\multicolumn{n}{align}{text}` | Span columns | `\multicolumn{2}{c}{Centered}` | | `\multirow{n}{width}{text}` | Span rows | `\multirow{2}{*}{Text}` |## Figure Commands### Including Graphics```latex figure-commands.tex theme=\{null} % Basic inclusion \includegraphics{image} \includegraphics[width=5cm]{image} \includegraphics[height=3cm]{image} \includegraphics[scale=0.5]{image} % Figure environment \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{image} \caption{Figure caption} \label{fig:label} \end{figure} % Subfigures \usepackage{subcaption} \begin{figure} \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{image1} \caption{First} \end{subfigure} \hfill \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{image2} \caption{Second} \end{subfigure} \caption{Main caption} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Reference Commands### Labels and References```latex references.tex theme=\{null} % Creating labels \label{sec:intro} \label{fig:diagram} \label{tab:results} \label{eq:einstein} % Basic references \ref{sec:intro} % 1.1 \pageref{sec:intro} % 5 % With packages \usepackage{hyperref} \autoref{sec:intro} % Section 1.1 \usepackage{cleveref} \cref{sec:intro} % section 1.1 \Cref{sec:intro} % Section 1.1 \cref{fig:a,fig:b} % figures 1 and 2 ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
### Citations```latex citations.tex theme=\{null} % With natbib \cite{key} % [1] \citep{key} % (Author, Year) \citet{key} % Author (Year) \citeauthor{key} % Author \citeyear{key} % Year % With biblatex \cite{key} \parencite{key} \textcite{key} \footcite{key} \fullcite{key} % Multiple citations \cite{key1,key2,key3} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Special Characters### Escaped Characters| Character | Command | Output | | - | - | - | | `#` | `\#` | # | | `$` | `\$` | \$ | | `%` | `\%` | % | | `&` | `\&` | & | | `_` | `\_` | \_ | | `{` | `\{` | \{ | | `}` | `\}` | } | | `~` | `\textasciitilde` | \~ | | `^` | `\textasciicircum` | ^ | | `\` | `\textbackslash` | \\ |### Quotes and Dashes```latex quotes-dashes.tex theme=\{null} % Quotes `single quotes' ``double quotes'' \textquoteleft text\textquoteright \textquotedblleft text\textquotedblright % Dashes - % Hyphen -- % En dash (ranges) --- % Em dash (punctuation) % Special spaces Non~breaking~space Thin\,space ```
Rendered output Open zoomable preview: Compiled PDF page 1 from quotes-dashes.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-16/page-1.svg)
## Box Commands### Text Boxes```latex box-commands.tex theme=\{null} % Horizontal boxes \mbox{unbreakable text} \makebox[5cm][c]{centered in 5cm} \fbox{framed text} \framebox[5cm][r]{right-aligned frame} % Vertical boxes \parbox{5cm}{Paragraph in 5cm box} \parbox[t]{5cm}{Top-aligned} \parbox[b]{5cm}{Bottom-aligned} % Minipage \begin{minipage}{0.5\textwidth} Content in half-width box \end{minipage} % Save boxes \newsavebox{\mybox} \savebox{\mybox}{Saved content} \usebox{\mybox} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from box-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-17/page-1.svg)
## Color Commands### Using Colors```latex color-commands.tex theme=\{null} \usepackage{xcolor} % Text color \textcolor{red}{Red text} \textcolor{blue}{Blue text} \textcolor[RGB]{255,128,0}{Orange text} % Background color \colorbox{yellow}{Highlighted} \fcolorbox{red}{yellow}{Framed} % Define colors \definecolor{myblue}{RGB}{0,114,189} \definecolor{mygreen}{HTML}{00A86B} % Page/text color {\color{blue} Blue paragraph} \pagecolor{gray!10} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from color-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-18/page-1.svg)
## Length Commands### Setting Lengths```latex length-commands.tex theme=\{null} % Define new length \newlength{\mylength} \setlength{\mylength}{2cm} \addtolength{\mylength}{1cm} % Common lengths \setlength{\parindent}{0pt} \setlength{\parskip}{1em} \setlength{\textwidth}{15cm} \setlength{\textheight}{25cm} % Calculations \setlength{\mylength}{0.5\textwidth} \setlength{\mylength}{\textwidth-2cm} % Using calc package \usepackage{calc} \setlength{\mylength}{\widthof{Sample text}+1cm} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Counter Commands### Using Counters```latex counter-commands.tex theme=\{null} % New counter \newcounter{mycounter} \setcounter{mycounter}{0} \stepcounter{mycounter} \addtocounter{mycounter}{5} % Display counter \arabic{mycounter} % 1, 2, 3 \roman{mycounter} % i, ii, iii \Roman{mycounter} % I, II, III \alph{mycounter} % a, b, c \Alph{mycounter} % A, B, C % Page numbering \pagenumbering{roman} \setcounter{page}{1} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from counter-commands.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-commands-20/page-1.svg)
## Environment Commands### Custom Environments```latex custom-environments.tex theme=\{null} % Define environment \newenvironment{myenv} {\begin{center}\bfseries} % Begin {\end{center}} % End % Usage \begin{myenv} Bold centered text \end{myenv} % With arguments \newenvironment{mybox}[1] {\begin{center}\fbox{\begin{minipage}{#1}}} {\end{minipage}}\end{center}} \begin{mybox}{5cm} Content in 5cm box \end{mybox} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Useful Macros### Common Custom Commands```latex custom-commands.tex theme=\{null} % Simple macros \newcommand{\R}{\mathbb{R}} \newcommand{\vect}[1]{\mathbf{#1}} \newcommand{\norm}[1]{\left\|#1\right\|} % With optional arguments \newcommand{\myitem}[1][\textbullet]{#1~} % Renewing commands \renewcommand{\thesection}{\Roman{section}} \renewcommand{\arraystretch}{1.5} % Conditional commands \newcommand{\ie}{\textit{i.e.}} \newcommand{\eg}{\textit{e.g.}} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Quick Reference Card### Essential Commands| Category | Commands | | - | - | | **Structure** | `\section`, `\subsection`, `\chapter` | | **Formatting** | `\textbf`, `\textit`, `\emph` | | **Math** | `$...$`, `\[...\]`, `\frac`, `\sqrt` | | **Lists** | `itemize`, `enumerate`, `description` | | **References** | `\label`, `\ref`, `\cite` | | **Spacing** | `\\`, `\vspace`, `\hspace` | | **Special** | `\%`, `\&`, `\_`, `\#` |***> [!NOTE] > > **Next**: Explore essential [LaTeX packages](/learn/reference/packages) to extend functionality and add features to your documents. # LaTeX Document Classes: article vs report vs book vs beamer Source: https://resources.latex-cloud-studio.com/learn/reference/document-classes Choose the right LaTeX document class. Compare article, report, book, beamer, and letter, then set font, paper, and layout options correctly. The `\documentclass` command selects the structure and default layout for a LaTeX document. Use `article` for papers without chapters, `report` for chapter-based reports or shorter theses, `book` for long two-sided works, and `beamer` for presentation slides.> [!NOTE] > > **Quick answer**: choose by structure, not only by page count. If the document needs `\chapter`, start with `report` or `book`; `article` does not define that command.**Basic syntax**:\`\`\`latex example.tex theme=\{null} > \documentclass\[12pt,a4paper] > > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
**Common default**: when no publisher or university provides a required class, `article` is the safest starting point for an essay, assignment, or research paper. > ```## The `\documentclass` CommandThis is the basic syntax:```latex source-1.tex theme=\{null} \documentclass[options]{class} ``````latex source-2.tex theme=\{null} \documentclass[12pt,a4paper,twoside]{report} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
## article vs report vs book vs beamer| Class | Best for | Chapters | Default behavior that matters | | - | - | - | - | | `article` | Essays, homework, journal papers | No | Sections are the highest normal division | | `report` | Technical reports, projects, shorter theses | Yes | Chapters can begin on either side; usually one-sided | | `book` | Books, dissertations, long manuals | Yes | Front matter support and a two-sided book layout | | `beamer` | Slides and presentations | No | Content is organized into frames rather than pages | | `letter` | Formal correspondence | No | Provides sender, opening, closing, and signature commands |> [!TIP] > > If a journal, conference, or university supplies a `.cls` file or official template, use that required class instead of converting the document to a standard class.## Standard Document Classes### articleFor short documents without chapters.```latex article-class.tex theme=\{null} \documentclass[options]{article} % Best for: % - Research papers % - Journal articles % - Reports (short) % - Homework assignments % - Essays % Structure hierarchy: % \section{} % \subsection{} % \subsubsection{} % \paragraph{} % \subparagraph{} \begin{document} \title{Article Title} \author{Author Name} \date{\today} \maketitle \begin{abstract} Abstract content for articles. \end{abstract} \section{Introduction} Article content starts here. \section{Main Content} More sections as needed. \section{Conclusion} Final thoughts. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-class.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-02/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_reference_document_classes)**Article Features:**- No `\chapter` command - Abstract environment available - Compact formatting - Good for papers under 20-30 pages### reportFor longer documents with chapters.```latex report-class.tex theme=\{null} \documentclass[options]{report} % Best for: % - Technical reports % - Theses (shorter) % - Project documentation % - Lab reports % - User manuals % Structure hierarchy: % \chapter{} % \section{} % \subsection{} % \subsubsection{} % \paragraph{} % \subparagraph{} \begin{document} \title{Report Title} \author{Author Name} \date{\today} \maketitle \begin{abstract} Abstract for reports. \end{abstract} \tableofcontents \chapter{Introduction} First chapter content. \chapter{Methodology} Second chapter content. \chapter{Results} Third chapter content. \chapter{Conclusion} Final chapter content. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from report-class.tex Page 1 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from report-class.tex Page 2 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-2.svg) Open zoomable preview: Compiled PDF page 3 from report-class.tex Page 3 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-3.svg) Open zoomable preview: Compiled PDF page 4 from report-class.tex Page 4 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-4.svg) Open zoomable preview: Compiled PDF page 5 from report-class.tex Page 5 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-5.svg) Open zoomable preview: Compiled PDF page 6 from report-class.tex Page 6 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-6.svg) Open zoomable preview: Compiled PDF page 7 from report-class.tex Page 7 of 7. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-03/page-7.svg)
**Report Features:**- `\chapter` command available - Abstract environment included - Separate title page by default - Good for documents 20-100 pages### bookFor books and very long documents.```latex book-class.tex theme=\{null} \documentclass[options]{book} % Best for: % - Books % - Long theses/dissertations % - Textbooks % - Multi-volume works % - Complex documents % Structure hierarchy: % \part{} % \chapter{} % \section{} % \subsection{} % \subsubsection{} % \paragraph{} % \subparagraph{} \begin{document} \frontmatter % Roman page numbers, no chapter numbers \title{Book Title} \author{Author Name} \date{\today} \maketitle \tableofcontents \listoffigures \listoftables \mainmatter % Arabic page numbers, normal numbering \part{First Part} \chapter{Introduction} Chapter content begins here. \chapter{Background} More content here. \backmatter % No chapter numbers \appendix \chapter{Additional Information} \bibliographystyle{plain} \bibliography{references} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from book-class.tex Page 1 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-1.svg) Open zoomable preview: Compiled PDF page 2 from book-class.tex Page 2 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-2.svg) Open zoomable preview: Compiled PDF page 3 from book-class.tex Page 3 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-3.svg) Open zoomable preview: Compiled PDF page 4 from book-class.tex Page 4 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-4.svg) Open zoomable preview: Compiled PDF page 5 from book-class.tex Page 5 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-5.svg) Open zoomable preview: Compiled PDF page 6 from book-class.tex Page 6 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-6.svg) Open zoomable preview: Compiled PDF page 7 from book-class.tex Page 7 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-7.svg) Open zoomable preview: Compiled PDF page 8 from book-class.tex Page 8 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-8.svg) Open zoomable preview: Compiled PDF page 9 from book-class.tex Page 9 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-9.svg) Open zoomable preview: Compiled PDF page 10 from book-class.tex Page 10 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-10.svg) Open zoomable preview: Compiled PDF page 11 from book-class.tex Page 11 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-11.svg) Open zoomable preview: Compiled PDF page 12 from book-class.tex Page 12 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-12.svg) Open zoomable preview: Compiled PDF page 13 from book-class.tex Page 13 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-13.svg) Open zoomable preview: Compiled PDF page 14 from book-class.tex Page 14 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-14.svg) Open zoomable preview: Compiled PDF page 15 from book-class.tex Page 15 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-04/page-15.svg)
**Book Features:**- Two-sided layout by default - Front matter, main matter, back matter - Parts and chapters available - Best for 100+ page documents### beamerFor presentations and slides.```latex beamer-class.tex theme=\{null} \documentclass[options]{beamer} % Best for: % - Conference presentations % - Lecture slides % - Academic talks % - Business presentations % Slide structure: % \frame{} or \begin{frame}...\end{frame} % \section{} for navigation % \subsection{} for organization \usetheme{Warsaw} % Choose theme \usecolortheme{dolphin} % Choose colors \title{Presentation Title} \author{Author Name} \institute{Institution} \date{\today} \begin{document} \frame{\titlepage} \begin{frame} \frametitle{Outline} \tableofcontents \end{frame} \section{Introduction} \begin{frame} \frametitle{Introduction} \begin{itemize} \item First point \item Second point \item<2-> This appears on second click \end{itemize} \end{frame} \section{Main Content} \begin{frame} \frametitle{Main Points} Content of the slide here. \end{frame} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from beamer-class.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-05/page-1.svg) Open zoomable preview: Compiled PDF page 2 from beamer-class.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-05/page-2.svg) Open zoomable preview: Compiled PDF page 3 from beamer-class.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-05/page-3.svg) Open zoomable preview: Compiled PDF page 4 from beamer-class.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-05/page-4.svg) Open zoomable preview: Compiled PDF page 5 from beamer-class.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-05/page-5.svg)
**Beamer Features:**- Built-in themes and color schemes - Overlay specifications for animations - Navigation aids - PDF presentation format### letterFor correspondence.```latex letter-class.tex theme=\{null} \documentclass[options]{letter} % Best for: % - Business letters % - Formal correspondence % - Cover letters % - Official documents \usepackage[utf8]{inputenc} \signature{Your Name} \address{Your Address\\City, State ZIP} \begin{document} \begin{letter}{Recipient Name\\Recipient Address\\City, State ZIP} \opening{Dear Sir or Madam,} Body of the letter goes here. Multiple paragraphs are separated by blank lines. This is the second paragraph of the letter. \closing{Sincerely,} \ps{P.S. Additional note here.} \encl{Enclosure list} \end{letter} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from letter-class.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-06/page-1.svg)
**Letter Features:**- Automatic formatting for addresses - Date insertion - Signature placement - Standard letter conventions## Document Class Options### Font Size Options```latex font-size-options.tex theme=\{null} % Available font sizes \documentclass[10pt]{article} % 10pt (default) \documentclass[11pt]{article} % 11pt \documentclass[12pt]{article} % 12pt % Font size affects: % - Body text size % - Section heading sizes % - Math formula sizes % - Footnote sizes ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Paper Size Options```latex paper-size-options.tex theme=\{null} % US paper sizes \documentclass[letterpaper]{article} % 8.5 × 11 inches (default) \documentclass[legalpaper]{article} % 8.5 × 14 inches \documentclass[executivepaper]{article} % 7.25 × 10.5 inches % International paper sizes \documentclass[a4paper]{article} % 210 × 297 mm \documentclass[a5paper]{article} % 148 × 210 mm \documentclass[b5paper]{article} % 176 × 250 mm % Custom paper size (with geometry package) \usepackage[paperwidth=8in,paperheight=10in]{geometry} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Layout Options```latex layout-options.tex theme=\{null} % Page orientation \documentclass[landscape]{article} % Landscape orientation \documentclass[portrait]{article} % Portrait (default) % Columns \documentclass[onecolumn]{article} % Single column (default) \documentclass[twocolumn]{article} % Two columns % Sides \documentclass[oneside]{article} % Single-sided (default for article) \documentclass[twoside]{book} % Double-sided (default for book) % Draft mode \documentclass[draft]{article} % Shows overfull boxes, faster compilation \documentclass[final]{article} % Final mode (default) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Title Page Options```latex title-options.tex theme=\{null} % Title page behavior \documentclass[titlepage]{article} % Separate title page \documentclass[notitlepage]{report} % Title on first page % Abstract behavior (for article) \documentclass[onecolumn]{article} % Abstract spans full width \documentclass[twocolumn]{article} % Abstract spans both columns ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Equation Options```latex equation-options.tex theme=\{null} % Equation numbering \documentclass[leqno]{article} % Equation numbers on left \documentclass[reqno]{article} % Equation numbers on right (default) % Equation formatting \documentclass[fleqn]{article} % Left-aligned equations % Default: centered equations ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Bibliography Options```latex bibliography-options.tex theme=\{null} % Bibliography formatting \documentclass[openbib]{article} % Open bibliography format % Default: closed bibliography format ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
## Custom Document Classes### Creating Custom Classes```latex myclass.cls theme=\{null} % File: myclass.cls \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myclass}[2024/01/01 My Custom Class] % Based on article class \LoadClass[11pt,a4paper]{article} % Required packages \RequirePackage{geometry} \RequirePackage{fancyhdr} \RequirePackage{graphicx} % Page layout \geometry{margin=1in} % Custom commands \newcommand{\institution}[1]{\def\@institution{#1}} \newcommand{\course}[1]{\def\@course{#1}} % Custom title format \renewcommand{\maketitle}{ \begin{center} {\LARGE\bfseries\@title}\\[1em] {\large\@author}\\ {\large\@institution}\\ {\large\@course}\\ {\large\@date} \end{center} } ``````latex using-custom-class.tex theme=\{null} % Using the custom class \documentclass{myclass} \title{Assignment Title} \author{Student Name} \institution{University Name} \course{Course Code} \begin{document} \maketitle Content goes here. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from using-custom-class.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/learn-reference-document-classes-13/page-1.svg)
## Academic Document Classes### Thesis Classes```latex thesis-classes.tex theme=\{null} % University-specific thesis classes \documentclass{phdthesis} % PhD thesis \documentclass{msthesis} % Master's thesis \documentclass{ucthesis} % UC system thesis % Generic thesis classes \documentclass[thesis]{memoir} \documentclass{scrbook} % KOMA-Script book class % Configuration example \documentclass[12pt,oneside,openright]{report} \usepackage[margin=1.5in,left=2in]{geometry} \usepackage{setspace} \doublespacing ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
### Journal Classes```latex journal-classes.tex theme=\{null} % IEEE papers \documentclass{IEEEtran} % ACM papers \documentclass{acmart} % Springer papers \documentclass{llncs} % Lecture Notes in Computer Science \documentclass{svjour3} % Springer journals % Elsevier papers \documentclass{elsarticle} % AMS papers \documentclass{amsart} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
## KOMA-Script ClassesAlternative to standard classes with enhanced features:```latex koma-script.tex theme=\{null} % KOMA-Script equivalents \documentclass{scrartcl} % Instead of article \documentclass{scrreprt} % Instead of report \documentclass{scrbook} % Instead of book \documentclass{scrlttr2} % Instead of letter % Enhanced features \documentclass[ fontsize=11pt, paper=a4, twoside=false, titlepage=false, headings=small ]{scrartcl} % KOMA options \KOMAoptions{ DIV=12, % Text area calculation BCOR=8mm, % Binding correction headinclude=true, % Include header in text area footinclude=false % Exclude footer from text area } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
## Memoir ClassHighly customizable class for books and articles:```latex memoir-class.tex theme=\{null} \documentclass[11pt,a4paper,oneside]{memoir} % Page layout \settrimmedsize{297mm}{210mm}{*} % A4 paper \setlength{\trimtop}{0pt} \setlength{\trimedge}{\stockwidth} \addtolength{\trimedge}{-\paperwidth} \settypeblocksize{634pt}{448.13pt}{*} \setulmargins{4cm}{*}{*} \setlrmargins{2.5cm}{*}{*} \checkandfixthelayout % Chapter styles \chapterstyle{veelo} % Pre-defined style % or create custom style \makechapterstyle{custom}{ \renewcommand{\chapternamenum}{} \renewcommand{\printchaptername}{} \renewcommand{\printchapternum}{\chapnumfont\thechapter\space} \renewcommand{\afterchapternum}{} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This declaration configures the document class and its options. It does not create visible page content by itself, so no PDF preview is claimed.\
## Document Class Comparison### When to Use Each Class> [tab] article > > **Best for:** > > * Research papers (5-30 pages) > * Journal submissions > * Conference papers > * Technical reports > * Essays and assignments > > **Features:** > > * No chapters > * Compact layout > * Abstract support > * Bibliography integration> [tab] report > > **Best for:** > > * Technical reports (20-100 pages) > * Master's theses > * Project documentation > * Lab reports > * User manuals > > **Features:** > > * Chapter support > * Title page by default > * Abstract support > * Good for structured documents> [tab] book > > **Best for:** > > * Books (100+ pages) > * PhD dissertations > * Textbooks > * Reference manuals > * Multi-volume works > > **Features:** > > * Two-sided by default > * Front/main/back matter > * Parts and chapters > * Professional typography> [tab] beamer > > **Best for:** > > * Academic presentations > * Conference talks > * Lecture slides > * Business presentations > > **Features:** > > * Frame-based content > * Themes and animations > * Navigation tools > * PDF output optimized for projection## Common `\documentclass` Errors| Error or symptom | Cause | Fix | | - | - | - | | `Undefined control sequence \chapter` | The document uses the `article` class | Switch to `report` or `book`, or use `\section` as the highest level | | `File ... .cls not found` | A custom journal or university class is missing | Add the exact `.cls` file supplied with the template or install its package | | `Unused global option(s)` | The selected class or packages do not recognize an option | Check the class documentation and pass package-specific options to that package | | The page uses the wrong paper size | The default differs from the required format | Set `a4paper` or `letterpaper` explicitly | | Blank pages appear before chapters | The class uses `openright` (`book` does by default) | Use `openany` only when the required format permits it | | Layout changes after switching classes | Classes define different headings, margins, and front matter | Treat a class change as a structural change and review the entire PDF |> [!WARNING] > > Do not rename a missing custom `.cls` file to `article.cls` or replace it silently. Publisher and university classes often contain required formatting and metadata rules.## Best Practices> [!TIP] > > **Document class selection tips:** > > 1. **Follow submission requirements first** — an official class overrides a general recommendation. > 2. **Choose the required structure** — chapter support and front matter matter more than a rough page count. > 3. **Set regional defaults explicitly** — declare paper size and any required one- or two-sided layout. > 4. **Keep class options intentional** — unsupported options are ignored and usually produce a warning. > 5. **Compile early with the real template** — class/package conflicts are easier to fix before the document grows. > 6. **Review the class documentation** — custom classes can redefine commands and defaults.## Quick Reference### Standard Classes Summary| Class | Purpose | Length | Chapters | Default Layout | | - | - | - | - | - | | `article` | Papers, reports | Short | No | One-sided | | `report` | Technical reports | Medium | Yes | One-sided | | `book` | Books, theses | Long | Yes | Two-sided | | `beamer` | Presentations | N/A | No | Slides | | `letter` | Correspondence | Short | No | Letter format |### Common Options Summary| Option | Effect | Classes | | - | - | - | | `10pt`, `11pt`, `12pt` | Font size | All | | `a4paper`, `letterpaper` | Paper size | All (except beamer) | | `oneside`, `twoside` | Page layout | All (except beamer) | | `onecolumn`, `twocolumn` | Column layout | article, report | | `titlepage`, `notitlepage` | Title page | article, report | | `draft`, `final` | Draft mode | All |## Practice in LaTeX Cloud Studio> [card] Open a project and choose a class > > Start with `article`, `report`, or `beamer` in the browser editor and compile early to confirm the structure.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=document_classes_open_app)> [card] Templates that match the class > > Use a working template when you want the document class and layout decisions already in place.[Open](/templates/article?utm_source=resources\&utm_medium=related_template\&utm_campaign=docs_open_app\&utm_content=document_classes_templates)***> [!NOTE] > > **Next**: Learn about [LaTeX Packages](/learn/reference/packages) to extend document functionality, or explore [Document Structure](/learn/latex/basics/creating-first-document) for hands-on examples. # LaTeX Packages Reference Source: https://resources.latex-cloud-studio.com/learn/reference/packages Complete guide to essential LaTeX packages. Learn what each package does, how to use it, and see practical examples. This reference covers the most important LaTeX packages organized by functionality. Each entry includes the package purpose, basic usage, and practical examples.> [!NOTE] > > **Package installation**: LaTeX Cloud Studio includes all standard packages. No installation needed - just use `\usepackage{packagename}`.## Essential Packages### Core Document Setup```latex essential-packages.tex theme=\{null} % Input encoding (for older documents) \usepackage[utf8]{inputenc} % Font encoding \usepackage[T1]{fontenc} % Language support \usepackage[english]{babel} % or multiple languages \usepackage[english,spanish,french]{babel} % Better fonts \usepackage{lmodern} % Microtype (better typography) \usepackage{microtype} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Page Layout#### geometryControls page dimensions and margins.```latex geometry-package.tex theme=\{null} \usepackage{geometry} % Common configurations \geometry{margin=1in} \geometry{left=1.5in, right=1in, top=1in, bottom=1in} \geometry{a4paper, margin=2.5cm} \geometry{letterpaper, landscape} % Advanced options \geometry{ paperwidth=210mm, paperheight=297mm, left=25mm, right=25mm, top=30mm, bottom=30mm, headheight=15pt, headsep=10mm, footskip=15mm } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
#### fancyhdrCustom headers and footers.```latex fancyhdr-package.tex theme=\{null} \usepackage{fancyhdr} \pagestyle{fancy} % Clear defaults \fancyhf{} % Custom headers/footers \fancyhead[L]{Left Header} \fancyhead[C]{Center Header} \fancyhead[R]{\thepage} \fancyfoot[C]{Footer Text} % Different odd/even pages \fancyhead[LE,RO]{\thepage} \fancyhead[LO,RE]{\leftmark} % Custom styles \fancypagestyle{plain}{ \fancyhf{} \fancyfoot[C]{\thepage} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Mathematics Packages### amsmathExtended math environments and commands.```latex amsmath-package.tex theme=\{null} \usepackage{amsmath} % Provides environments: \begin{align} f(x) &= x^2 + 2x + 1 \\ &= (x + 1)^2 \end{align} \begin{gather} a = b + c \\ d = e + f \end{gather} \begin{split} (a + b)^3 &= a^3 + 3a^2b \\ &\quad + 3ab^2 + b^3 \end{split} % Commands \text{text in math} \tfrac{a}{b} % Text-style fraction \dfrac{a}{b} % Display-style fraction \binom{n}{k} % Binomial coefficient ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### amssymbAdditional mathematical symbols.```latex amssymb-package.tex theme=\{null} \usepackage{amssymb} % Provides symbols like: \mathbb{R} % Real numbers \mathbb{Z} % Integers \mathbb{N} % Natural numbers \varnothing % Empty set \therefore % Therefore \because % Because \blacksquare % QED symbol \leqslant % Less or equal (slanted) \geqslant % Greater or equal (slanted) ```
Rendered output Open zoomable preview: Compiled PDF page 1 from amssymb-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-05/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_reference_packages)### amsthmTheorem environments.```latex amsthm-package.tex theme=\{null} \usepackage{amsthm} % Define theorem environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} % Usage \begin{theorem}[Fermat's Last Theorem] No three positive integers $a$, $b$, and $c$ satisfy... \end{theorem} \begin{proof} The proof is left as an exercise. \end{proof} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from amsthm-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-06/page-1.svg)
### mathtoolsEnhanced version of amsmath.```latex mathtools-package.tex theme=\{null} \usepackage{mathtools} % Additional features \begin{align} f(x) &= \begin{cases} x^2 & \text{if } x > 0 \\ 0 & \text{otherwise} \end{cases} \end{align} % Better spacing \coloneqq % := \Coloneqq % ::= \eqqcolon % =: % Paired delimiters \DeclarePairedDelimiter\abs{\lvert}{\rvert} \DeclarePairedDelimiter\norm{\lVert}{\rVert} % Usage \abs{x} % Absolute value \abs*{x} % Auto-sizing \norm{v} % Vector norm ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Graphics and Figures### graphicxStandard package for including graphics.```latex graphicx-package.tex theme=\{null} \usepackage{graphicx} % Include images \includegraphics{image.png} \includegraphics[width=5cm]{image.pdf} \includegraphics[height=3cm]{image.jpg} \includegraphics[scale=0.5]{image.eps} \includegraphics[width=0.8\textwidth]{image.svg} % Rotation and scaling \includegraphics[angle=90]{image.png} \rotatebox{45}{Rotated text} \scalebox{2}{Scaled text} \resizebox{5cm}{3cm}{Resized content} % Figure environment \begin{figure}[htbp] \centering \includegraphics[width=\textwidth]{plot.pdf} \caption{Important results} \label{fig:results} \end{figure} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### subcaptionCreate subfigures and subtables.```latex subcaption-package.tex theme=\{null} \usepackage{subcaption} \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{image1.png} \caption{First subplot} \label{fig:sub1} \end{subfigure} \hfill \begin{subfigure}{0.45\textwidth} \includegraphics[width=\textwidth]{image2.png} \caption{Second subplot} \label{fig:sub2} \end{subfigure} \caption{Combined figure} \label{fig:combined} \end{figure} % Reference subfigures See Figure~\ref{fig:sub1} and~\ref{fig:sub2}. ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### tikzPowerful graphics creation.```latex tikz-package.tex theme=\{null} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, shapes} % Simple drawing \begin{tikzpicture} \draw (0,0) -- (2,1) -- (1,2) -- cycle; \node at (1,1) {Center}; \end{tikzpicture} % Complex diagram \begin{tikzpicture}[ node distance=2cm, every node/.style={draw, circle} ] \node (A) {A}; \node (B) [right=of A] {B}; \node (C) [below=of A] {C}; \draw[->] (A) -- (B); \draw[->] (A) -- (C); \draw[->] (B) -- (C); \end{tikzpicture} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from tikz-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-10/page-1.svg)
## Tables### booktabsProfessional table formatting.```latex booktabs-package.tex theme=\{null} \usepackage{booktabs} \begin{table}[htbp] \centering \caption{Professional table} \begin{tabular}{lcc} \toprule Item & Quantity & Price \\ \midrule Apples & 5 & \$2.50 \\ Oranges & 3 & \$1.80 \\ Bananas & 6 & \$3.00 \\ \midrule Total & 14 & \$7.30 \\ \bottomrule \end{tabular} \end{table} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from booktabs-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-11/page-1.svg)
### arrayEnhanced array and tabular environments.```latex array-package.tex theme=\{null} \usepackage{array} % New column types \newcolumntype{C}{>{\centering\arraybackslash}X} \newcolumntype{R}{>{\raggedleft\arraybackslash}X} % Advanced tables \begin{tabular}{>{\bfseries}l c r} \hline Bold Header & Center & Right \\ \hline Row 1 & Data & Values \\ Row 2 & More & Data \\ \hline \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from array-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-12/page-1.svg)
### longtableTables spanning multiple pages.```latex longtable-package.tex theme=\{null} \usepackage{longtable} \begin{longtable}{lcc} \caption{Long table spanning pages} \\ \toprule Column 1 & Column 2 & Column 3 \\ \midrule \endfirsthead \multicolumn{3}{c}{{\tablename\ \thetable{} -- continued}} \\ \toprule Column 1 & Column 2 & Column 3 \\ \midrule \endhead \midrule \multicolumn{3}{r}{{Continued on next page}} \\ \endfoot \bottomrule \endlastfoot % Table content Data & More & Values \\ % ... many rows \end{longtable} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from longtable-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-13/page-1.svg)
## Bibliography and Citations### biblatexModern bibliography management.```latex biblatex-package.tex theme=\{null} \usepackage[style=authoryear,backend=biber]{biblatex} \addbibresource{references.bib} % Citation commands \cite{key} % (Author, Year) \parencite{key} % (Author, Year) \textcite{key} % Author (Year) \citeauthor{key} % Author \citeyear{key} % Year \footcite{key} % Footnote citation \fullcite{key} % Full citation % Multiple citations \parencite{key1,key2,key3} % Bibliography \printbibliography ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### natbibTraditional bibliography package.```latex natbib-package.tex theme=\{null} \usepackage[authoryear,round]{natbib} % Citation styles \citet{key} % Author (Year) \citep{key} % (Author, Year) \citealt{key} % Author Year \citealp{key} % Author, Year \citeauthor{key}% Author \citeyear{key} % Year % With page numbers \citep[p.~25]{key} \citep[see][p.~25]{key} % Bibliography \bibliographystyle{plainnat} \bibliography{references} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
## Lists### enumitemCustomizable lists.```latex enumitem-package.tex theme=\{null} \usepackage{enumitem} % Customized itemize \begin{itemize}[label=\textbullet, itemsep=0pt] \item First item \item Second item \end{itemize} % Customized enumerate \begin{enumerate}[label=(\alph*), start=3] \item Third item (c) \item Fourth item (d) \end{enumerate} % Inline lists \begin{enumerate*}[label=(\roman*)] \item One \item Two \item Three \end{enumerate*} % Description lists \begin{description}[style=nextline] \item[Long term] Description on next line \item[Short] Inline description \end{description} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Code and Verbatim### listingsCode listings with syntax highlighting.```latex listings-package.tex theme=\{null} \usepackage{listings} \usepackage{xcolor} % Configure style \lstset{ language=Python, basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green}, stringstyle=\color{red}, numbers=left, numberstyle=\tiny, breaklines=true, frame=single } % Inline code \lstinline{print("Hello")} % Code block \begin{lstlisting}[caption=Python example] def fibonacci(n): if n <= 1: return n return fibonacci(n-1) + fibonacci(n-2) \end{lstlisting} % External file \lstinputlisting[language=C]{code.c} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### mintedAdvanced syntax highlighting.```latex minted-package.tex theme=\{null} \usepackage{minted} % Inline code \mintinline{python}{print("Hello")} % Code block \begin{minted}[linenos,bgcolor=gray!10]{python} def quicksort(arr): if len(arr) <= 1: return arr pivot = arr[len(arr) // 2] left = [x for x in arr if x < pivot] middle = [x for x in arr if x == pivot] right = [x for x in arr if x > pivot] return quicksort(left) + middle + quicksort(right) \end{minted} % External file \inputminted{javascript}{script.js} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.\
### verbatimEnhanced verbatim environments.```latex verbatim-package.tex theme=\{null} \usepackage{verbatim} % Basic verbatim \begin{verbatim} Raw text with $special% characters& \end{verbatim} % Comment out sections \begin{comment} This entire section is commented out and will not appear in the output. \end{comment} % Verbatim input from file \verbatiminput{file.txt} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from verbatim-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-19/page-1.svg)
## Fonts and Typography### fontspecModern font selection (XeLaTeX/LuaLaTeX).```latex fontspec-package.tex theme=\{null} \usepackage{fontspec} % Set main fonts \setmainfont{Times New Roman} \setsansfont{Arial} \setmonofont{Courier New} % Font features \setmainfont[ Ligatures=TeX, Numbers=OldStyle ]{Minion Pro} % Custom font families \newfontfamily\myfont{Comic Sans MS} {\myfont This text uses Comic Sans} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.\
### microtypeTypography refinements.```latex microtype-package.tex theme=\{null} \usepackage{microtype} % Automatic improvements: % - Character protrusion % - Font expansion % - Kerning adjustments % - Tracking adjustments % Manual adjustments \textls[200]{Letter spaced text} \microtypesetup{expansion=false} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from microtype-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-21/page-1.svg)
## Cross-references### hyperrefHyperlinks and PDF features.```latex hyperref-package.tex theme=\{null} \usepackage{hyperref} % Configuration \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, citecolor=green, pdfauthor={Author Name}, pdftitle={Document Title}, pdfsubject={Subject}, pdfkeywords={keyword1, keyword2} } % Usage \href{https://example.com}{Link text} \url{https://example.com} \nolinkurl{https://example.com} % Internal links \hyperref[label]{text} \autoref{label} % Automatic reference type ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
### cleverefIntelligent cross-referencing.```latex cleveref-package.tex theme=\{null} \usepackage{cleveref} % Better references \cref{eq:equation} % Equation (1) \Cref{fig:figure} % Figure 1 \cref{sec:section} % Section 2.1 % Multiple references \cref{eq:1,eq:2,eq:3} % Equations (1) to (3) \cref{fig:a,fig:b} % Figures 1 and 2 % Custom names \crefname{algorithm}{algorithm}{algorithms} \Crefname{algorithm}{Algorithm}{Algorithms} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is part of a multi-pass cross-reference or bibliography workflow. A trustworthy final page requires the surrounding project and its auxiliary files, so this standalone code box documents the workflow without claiming a complete rendered result.\
## Specialized Packages### siunitxScientific units and numbers.```latex siunitx-package.tex theme=\{null} \usepackage{siunitx} % Numbers \num{123456.789} % 123,456.789 \num{1.23e-4} % 1.23 × 10⁻⁴ % Units \si{\meter\per\second} % m/s \si{\kilo\gram} % kg \si{\degree\celsius} % °C % Numbers with units \SI{9.81}{\meter\per\second\squared} % 9.81 m/s² \SI{25}{\degree\celsius} % 25 °C % Ranges \SIrange{10}{20}{\celsius} % 10 °C to 20 °C \numrange{1.2}{3.4} % 1.2 to 3.4 % Tables \begin{tabular}{S[table-format=3.2]} \toprule {Values} \\ \midrule 1.23 \\ 45.67 \\ 890.12 \\ \bottomrule \end{tabular} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from siunitx-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-24/page-1.svg)
### algorithm2eAlgorithm pseudocode.```latex algorithm2e-package.tex theme=\{null} \usepackage[ruled,vlined]{algorithm2e} \begin{algorithm}[H] \SetAlgoLined \KwData{Array $A$ of $n$ elements} \KwResult{Sorted array $A$} \For{$i \leftarrow 1$ \KwTo $n-1$}{ $key \leftarrow A[i]$\; $j \leftarrow i-1$\; \While{$j \geq 0$ \KwAnd $A[j] > key$}{ $A[j+1] \leftarrow A[j]$\; $j \leftarrow j-1$\; } $A[j+1] \leftarrow key$\; } \caption{Insertion Sort} \label{alg:insertion-sort} \end{algorithm} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### mhchemChemical formulas and equations.```latex mhchem-package.tex theme=\{null} \usepackage{mhchem} % Chemical formulas \ce{H2O} % Water \ce{CaCl2} % Calcium chloride \ce{H2SO4} % Sulfuric acid % Chemical equations \ce{2H2 + O2 -> 2H2O} \ce{CaCO3 + 2HCl -> CaCl2 + H2O + CO2} % Reaction arrows \ce{A <=>> B} % Equilibrium \ce{A ->[catalyst] B} % Catalyst \ce{A ->[\Delta] B} % Heat % States of matter \ce{H2O(l)} % Liquid \ce{NaCl(s)} % Solid \ce{CO2(g)} % Gas \ce{Na+(aq)} % Aqueous ```
Rendered output Open zoomable preview: Compiled PDF page 1 from mhchem-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-26/page-1.svg)
## Layout and Formatting### multicolMultiple column layouts.```latex multicol-package.tex theme=\{null} \usepackage{multicol} % Two-column text \begin{multicols}{2} This text will be formatted in two columns. LaTeX automatically balances the columns. \end{multicols} % Three columns with separator \begin{multicols}{3}[\section{Three Column Section}] Content in three columns with a section header. \end{multicols} % Column break \begin{multicols}{2} First column content. \columnbreak Second column content. \end{multicols} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicol-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-27/page-1.svg)
### setspaceLine spacing control.```latex setspace-package.tex theme=\{null} \usepackage{setspace} % Document-wide spacing \singlespacing \onehalfspacing \doublespacing \setstretch{1.5} % Local spacing \begin{spacing}{1.8} This paragraph has 1.8 line spacing. \end{spacing} \begin{singlespace} This paragraph is single-spaced. \end{singlespace} \begin{doublespace} This paragraph is double-spaced. \end{doublespace} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from setspace-package.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/learn-reference-packages-28/page-1.svg)
### parskipParagraph spacing without indentation.```latex parskip-package.tex theme=\{null} \usepackage{parskip} % Automatically sets: % - \parindent to 0pt % - \parskip to appropriate spacing % - Adjusts list environments % Manual control \setlength{\parskip}{1em} \setlength{\parindent}{0pt} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Package Management Tips### Loading Order> [!WARNING] > > **Important package loading order:** > > 1. **Font encoding**: `inputenc`, `fontenc` > 2. **Language**: `babel`, `polyglossia` > 3. **Fonts**: `lmodern`, `fontspec` > 4. **Math**: `amsmath`, `amssymb`, `mathtools` > 5. **Graphics**: `graphicx`, `tikz` > 6. **Tables**: `booktabs`, `longtable` > 7. **Bibliography**: `biblatex`, `natbib` > 8. **Cross-references**: `cleveref`, `hyperref` (load last)### Common Conflicts```latex example.tex theme=\{null} % Avoid these combinations: % \usepackage{subfigure} % Old package % \usepackage{subcaption} % Use this instead % \usepackage{cite} % Basic citations % \usepackage{natbib} % Use this for advanced citations % \usepackage{hyperref} % \usepackage{cleveref} % Load cleveref AFTER hyperref ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
```latex example.tex theme=\{null} % Recommended safe order: \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{lmodern} \usepackage{microtype} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{booktabs} \usepackage[style=authoryear]{biblatex} \usepackage{hyperref} \usepackage{cleveref} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Quick Reference### Most Used Packages> [card] Essential > > `amsmath` `graphicx` `hyperref` `geometry` `babel`> [card] Typography > > `microtype` `setspace` `parskip` `fontspec` `lmodern`> [card] Tables > > `booktabs` `array` `longtable` `multirow` `tabularx`> [card] Bibliography > > `biblatex` `natbib` `cite` `apacite` `chicago`> [card] Math > > `amssymb` `amsthm` `mathtools` `siunitx` `physics`> [card] Code > > `listings` `minted` `verbatim` `algorithm2e` `pseudocode`## Deep-Dive Guides- [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) - [Natbib guide](/learn/latex/bibliography/natbib-guide) - [Choosing citation styles](/learn/latex/bibliography/choosing-citation-styles) - [Table of contents](/learn/latex/document-structure/table-of-contents) - [Glossaries and acronyms](/learn/latex/document-structure/glossaries) - [Indexes](/learn/latex/document-structure/indexes) - [Hyperlinks](/learn/latex/document-structure/hyperlinks) - [Align and multline environments](/learn/latex/mathematics/align-and-multline-environments) - [Operators and spacing](/learn/latex/mathematics/operators-and-spacing) - [Fractions and binomials](/learn/latex/mathematics/fractions-binomials) - [Plotting with pgfplots](/learn/latex/figures/plotting-with-pgfplots) - [Language setup pages](/learn/latex/languages/french)***> [!NOTE] > > **Need help choosing packages?** Check our [Package Management Guide](/learn/latex/package-management) for recommendations based on document type and field.## Start in LaTeX Cloud Studio> [card] Open in LaTeX Cloud Studio > > Write, compile, and iterate directly in your browser.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=reference_packages_open_app)> [card] Start from Article Template > > Use a ready-made template, then adapt it to your content.[Open](/templates/article) # LaTeX Symbols List: search and copy math symbols, Greek letters, arrows Source: https://resources.latex-cloud-studio.com/learn/reference/symbols Complete LaTeX symbols list with Greek letters, arrows, operators, and set notation. Built for quick search and copy, not long explanations. This page is the searchable **LaTeX symbols list**. Use it when you need to find a command quickly and paste it into your document. > [!NOTE] > > **Use this page for**: fast lookup and copy-paste. > > **Need explanation instead?** Use the [mathematical symbols guide](/learn/latex/mathematics/symbols) for package notes, usage patterns, and symbol categories. ## Use This Page When | You need... | Best page | | - | - | | A fast symbol lookup table | This page | | A list you can search with `Ctrl+F` | This page | | Help choosing between similar math symbols | [Mathematical symbols guide](/learn/latex/mathematics/symbols) | | Package and usage notes | [Mathematical symbols guide](/learn/latex/mathematics/symbols) | ## Quick Navigation Jump to any section: * [Greek Letters](#greek-letters) - α, β, γ, δ, ε... * [Mathematical Operators](#mathematical-operators) - ∑, ∏, ∫, ∂... * [Arrows](#arrows) - →, ←, ↔, ⇒, ⇐... * [Set Theory](#set-theory) - ∈, ∉, ⊂, ⊃, ∪, ∩... * [Logic Symbols](#logic-symbols) - ∧, ∨, ¬, ∀, ∃... * [Calculus](#calculus) - ∇, ∆, ∂, ∫, ∮... * [Special Characters](#special-characters) - ∞, ∅, ℵ, ℘... ## Contents 1. [Greek letters](#greek-letters) 2. [Arrows](#arrows) 3. [Miscellaneous symbols](#miscellaneous-symbols) 4. [Binary Operation/Relation Symbols](#binary-operationrelation-symbols) 5. [Further reading](#further-reading) ## Greek letters ### Lowercase and Uppercase Greek Letters | Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **α** A | `\alpha` `A` | **ν** N | `\nu` `N` | | **β** B | `\beta` `B` | **ξ** **Ξ** | `\xi` `\Xi` | | **γ** **Γ** | `\gamma` `\Gamma` | o O | `o` `O` | | **δ** **Δ** | `\delta` `\Delta` | **π** **Π** | `\pi` `\Pi` | | **ε** **ϵ** E | `\epsilon` `\varepsilon` `E` | **ρ** **ϱ** P | `\rho` `\varrho` `P` | | **ζ** Z | `\zeta` `Z` | **σ** **Σ** | `\sigma` `\Sigma` | | **η** H | `\eta` `H` | **τ** T | `\tau` `T` | | **θ** **ϑ** **Θ** | `\theta` `\vartheta` `\Theta` | **υ** **Υ** | `\upsilon` `\Upsilon` | | **ι** I | `\iota` `I` | **φ** **φ** **Φ** | `\phi` `\varphi` `\Phi` | | **κ** K | `\kappa` `K` | **χ** X | `\chi` `X` | | **λ** **Λ** | `\lambda` `\Lambda` | **ψ** **Ψ** | `\psi` `\Psi` | | **μ** M | `\mu` `M` | **ω** **Ω** | `\omega` `\Omega` | > [!TIP] > > **Note**: Uppercase Greek letters that look identical to Latin letters (like Alpha → A, Beta → B) are simply typed as regular capital letters. ## Arrows | Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **←** | `\leftarrow` | **⇐** | `\Leftarrow` | | **→** | `\rightarrow` | **⇒** | `\Rightarrow` | | **↔** | `\leftrightarrow` | **⇔** | `\Leftrightarrow` | | **↑** | `\uparrow` | **⇑** | `\Uparrow` | | **↓** | `\downarrow` | **⇓** | `\Downarrow` | | **↕** | `\updownarrow` | **⇕** | `\Updownarrow` | | **↦** | `\mapsto` | **⟼** | `\longmapsto` | | **↗** | `\nearrow` | **↘** | `\searrow` | | **↙** | `\swarrow` | **↖** | `\nwarrow` | | **↪** | `\hookrightarrow` | **↩** | `\hookleftarrow` | ## Miscellaneous symbols | Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **∞** | `\infty` | **∀** | `\forall` | | **∃** | `\exists` | **∄** | `\nexists` | | **∅** | `\emptyset` | **∅** | `\varnothing` | | **∇** | `\nabla` | **∂** | `\partial` | | **√** | `\surd` | **⊤** | `\top` | | **⊥** | `\bot` | **ℵ** | `\aleph` | | **ℶ** | `\beth` | **ℷ** | `\gimel` | ## Binary Operation/Relation Symbols | Symbol | LaTeX | Symbol | LaTeX | | :-: | :- | :-: | :- | | **×** | `\times` | **÷** | `\div` | | **±** | `\pm` | **∓** | `\mp` | | **∪** | `\cup` | **∩** | `\cap` | | \**\** | `\setminus` | **⊂** | `\subset` | | **⊃** | `\supset` | **⊆** | `\subseteq` | | **⊇** | `\supseteq` | **∈** | `\in` | | **∉** | `\notin` | **∋** | `\ni` | | **≤** | `\leq` | **≥** | `\geq` | | **∼** | `\sim` | **≈** | `\approx` | | **≡** | `\equiv` | **≠** | `\neq` | ## Practice in LaTeX Cloud Studio > [card] Try symbols in the editor > > Copy the commands you need, paste them into a document, and check the rendered result immediately. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=reference_symbols_open_app) > [card] See the online LaTeX editor > > Review the editor workflow on the [online LaTeX editor](https://www.latex-cloud-studio.com/online-latex-editor?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=reference_symbols_online_editor) page before starting a project with these symbols. ## Further reading For more comprehensive symbol references and advanced usage: > [card] Mathematical Expressions > > Learn how to write complex mathematical expressions [Open](/learn/latex/mathematics/mathematical-expressions) > [card] Advanced Mathematics > > Explore advanced mathematical typesetting [Open](/learn/latex/mathematics/advanced-math) > [card] Chemistry Notation > > Chemical formulas and reactions [Open](/learn/latex/specialized-notation/chemistry) > [card] Physics Symbols > > Physics notation and equations [Open](/learn/latex/specialized-notation/physics) > [!NOTE] > > **Need more symbols?** The comprehensive `amssymb` and `amsfonts` packages provide hundreds of additional mathematical symbols. Simply add `\usepackage{amssymb}` to your preamble. # AI Features Source: https://resources.latex-cloud-studio.com/platform/ai-features AI-assisted workflows in LaTeX Cloud Studio, including error fixing, inline edits, and document-aware writing assistance. > [!WARNING] > > **Status:** Beta\ > **Last reviewed:** March 8, 2026\ > **Applies to:** Pro and AI-enabled workspaces\ > **Canonical workflow docs:** [Troubleshooting](/product/troubleshooting), [Editor & AI Assistance](/product/editor-and-ai-assistance) LaTeX Cloud Studio includes AI-assisted workflows for debugging, editing, and writing support. These workflows are designed to stay inside the editor and preserve human review. ## Current AI Workflows ### AI-assisted error fixing Use AI-assisted fixes when the compiler output is correct but hard to interpret quickly. * explain common LaTeX failures in clearer language * propose targeted fixes * keep changes reviewable before you accept them ### Inline AI editing Use inline AI when you want help with: * rewriting prose while preserving LaTeX structure * grammar and clarity improvements * localized code-aware edits inside a document ### Document-aware assistance The AI workflows are designed to preserve: * citation keys * LaTeX commands and environments * mathematical content where rewriting would be unsafe ## Safety Model > [!NOTE] > > AI suggestions are intended to be inspected, not blindly trusted. Treat them as proposed edits and recompile after each accepted change. * edits should be reviewable before final acceptance * you remain responsible for the final source of truth * recovery paths such as version history and export remain important for risky changes ## What Is Not Claimed Here * no promise of fully autonomous end-to-end document writing * no promise that every suggestion is production-ready without review * no claim that every future AI workflow is already generally available ## Where To Go Next > [card] Troubleshooting > > Use the product workflow for compiler failures, AI-assisted fixes, and rollback. [Open](/product/troubleshooting) > [card] Editor & AI Assistance > > See how AI fits into the broader editor workflow. [Open](/product/editor-and-ai-assistance) # Cloud Compilation System Source: https://resources.latex-cloud-studio.com/platform/cloud-compilation LaTeX compilation in the cloud. Fast PDF generation, intelligent error handling, and complete TeX Live distribution with 4,000+ packages. LaTeX Cloud Studio's cloud compilation system provides fast PDF generation with intelligent error handling and access to the complete TeX Live distribution. Compile your documents without installing anything locally.> [!NOTE] > > **No Installation Required**: Access over 4,000 packages and all major LaTeX engines directly in your browser.## Compilation Features### Cloud-Based ProcessingCompile your documents without local installation:> [card] Fast Compilation > > Optimized compilation for quick turnaround> [card] Intelligent Caching > > Caching system helps reduce compilation times> [card] 4,000+ Packages > > Access the complete TeX Live distribution> [card] Cloud Infrastructure > > Compile from any device with a browser### Live PreviewSee your changes as you work:```latex example.tex theme=\{null} % Type this: \section{New Section} Hello world! % Click compile to see your PDF % No local LaTeX installation needed ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/platform-cloud-compilation-01/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=platform_cloud_compilation)### Compilation OptimizationThe system includes optimizations for better performance:- **Caching** - Assets cached to speed up subsequent compilations - **Multiple engines** - Choose pdfLaTeX, XeLaTeX, or LuaLaTeX - **Full package support** - Over 4,000 packages available## Complete TeX Live Distribution### Full Package AvailabilityAccess the entire TeX ecosystem without installation:> [tab] Standard Packages > > ````latex example.tex theme=\{null} > % All standard packages available immediately: > \usepackage{amsmath, amssymb} % Mathematics > \usepackage{graphicx} % Graphics > \usepackage{booktabs} % Professional tables > \usepackage{hyperref} % Hyperlinks > \usepackage{geometry} % Page layout > \usepackage{fancyhdr} % Headers/footers > \usepackage{listings} % Code listings > \usepackage{tikz} % Diagrams and drawings > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Specialized Packages > > ````latex example.tex theme=\{null} > % Specialized packages for different fields: > \usepackage{mhchem} % Chemistry formulas > \usepackage{siunitx} % SI units > \usepackage{algorithm2e} % Algorithms > \usepackage{musicography} % Music notation > \usepackage{genealogytree} % Family trees > \usepackage{chemfig} % Chemical structures > \usepackage{circuitikz} % Circuit diagrams > \usepackage{forest} % Linguistic trees > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] Font Packages > > ````latex example.tex theme=\{null} > % Extensive font support: > \usepackage{lmodern} % Latin Modern > \usepackage{times} % Times Roman > \usepackage{palatino} % Palatino > \usepackage{helvet} % Helvetica > \usepackage{courier} % Courier > \usepackage{mathpazo} % Palatino math > \usepackage{mathptmx} % Times math > \usepackage{fourier} % Fourier fonts > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````> [tab] International > > ````latex example.tex theme=\{null} > % Language and localization: > \usepackage[english]{babel} > \usepackage[spanish]{babel} > \usepackage[french]{babel} > \usepackage[german]{babel} > \usepackage[russian]{babel} > \usepackage{polyglossia} % XeLaTeX/LuaLaTeX > \usepackage{arabxetex} % Arabic text > \usepackage{xeCJK} % Chinese/Japanese/Korean > ```\
\Expected effect\ > \> \\\[!NOTE] > \> > \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
> ````### Universal Font SupportComprehensive font compatibility:- **System fonts** - Access to all standard system fonts - **LaTeX fonts** - Complete collection of LaTeX font families - **Custom fonts** - Upload and use your own font files - **Automatic font mapping** - Intelligent substitution for missing fonts - **Unicode support** - Full Unicode character set coverage### Package ManagementZero-configuration package management:> [!NOTE] > > **No Installation Required**: Over 4,000 packages pre-installed and ready to use. Simply add `\usepackage{packagename}` and start using it immediately.## Multiple Compilation Engines### Supported CompilersChoose the best engine for your document:```latex example.tex theme=\{null} % Fast compilation, wide compatibility % Best for: Most documents, quick compilation % Supports: PDF output, most packages \documentclass{article} \begin{document} Standard LaTeX document \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/platform-cloud-compilation-06/page-1.svg)
```latex example.tex theme=\{null} % Unicode support, system fonts % Best for: Multi-language documents, custom fonts % Supports: Unicode, system fonts, advanced typography \documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman} \begin{document} Unicode-enabled document with system fonts \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/platform-cloud-compilation-07/page-1.svg)
```latex example.tex theme=\{null} % Advanced features, Lua scripting % Best for: Complex documents, advanced typography % Supports: Lua scripting, microtype, advanced features \documentclass{article} \usepackage{luacode} \begin{document} Advanced document with Lua capabilities \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with LuaLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/platform-cloud-compilation-08/page-1.svg)
```latex example.tex theme=\{null} % Traditional workflow % Best for: Legacy documents, specific workflows % Supports: DVI output, traditional PostScript workflow \documentclass{article} \begin{document} Traditional LaTeX workflow \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/platform-cloud-compilation-09/page-1.svg)
### Engine SelectionAutomatic and manual engine selection:- **Smart detection** - System chooses optimal engine based on document content - **Manual override** - Select specific engine when needed - **Project settings** - Set default engine for entire project - **Per-file settings** - Different engines for different files in same project## Intelligent Error Handling### Real-time Error DetectionCatch errors before compilation:> [card] Syntax Highlighting > > Live syntax checking highlights errors as you type> [card] Error Prevention > > Auto-completion prevents common syntax errors> [card] Bracket Matching > > Visual indicators for matching braces and environments> [card] Reference Validation > > Real-time checking of labels and citations### Enhanced Error MessagesClear, actionable error reporting:```latex example.tex theme=\{null} % Your code: \begin{itemize} \item First item \item Second item % Missing \end{itemize} % Traditional LaTeX error: ! LaTeX Error: \begin{itemize} on input line 1 ended by \end{document}. % Cloud Studio enhanced error: ❌ Line 3: Missing \end{itemize} 💡 Suggestion: Add \end{itemize} before \end{document} 🔧 Quick Fix: Click to automatically add missing \end{itemize} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt is structurally incomplete and cannot be compiled honestly as a standalone document. It shows document-boundary syntax rather than a visible page result.\
### Error RecoveryIntelligent error recovery strategies:- **Partial compilation** - Generate PDF even with minor errors - **Error isolation** - Identify specific problematic sections - **Fallback strategies** - Alternative approaches when compilation fails - **Progressive enhancement** - Start with basic output, add features incrementally## Advanced Compilation Features### Custom Build ScriptsDefine complex compilation workflows:```yaml Build Configuration theme=\{null} # .latexmkrc equivalent in Cloud Studio compilation: engine: pdflatex bibliography: biber index: makeindex # Custom build steps pre_compile: - python generate_data.py - scripts/process_figures.sh post_compile: - scripts/generate_preview.py - python check_output.py ``````latex Conditional Compilation theme=\{null} % Environment-specific compilation \usepackage{ifthen} \newboolean{draft} \setboolean{draft}{true} % Set in compilation settings \ifthenelse{\boolean{draft}}{ \usepackage[draft]{graphicx} % Fast draft mode \usepackage{showframe} % Show layout guides }{ \usepackage{graphicx} % Full quality images \usepackage{microtype} % Fine typography } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.\
### Bibliography ProcessingAutomated bibliography compilation:- **BibTeX support** - Classic bibliography processing - **Biber support** - Modern bibliography engine with full Unicode - **Automatic detection** - System detects and uses appropriate processor - **Multiple bibliography styles** - Support for all standard and custom styles### Index and Glossary GenerationAutomatic processing of indices and glossaries:```latex example.tex theme=\{null} % Indices \usepackage{makeidx} \makeindex \index{term} % Automatically processed \printindex % Glossaries \usepackage{glossaries} \makeglossaries \gls{term} % Automatically processed \printglossaries ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
## Output Management### Multiple Output FormatsGenerate various output formats:> [card] PDF Output > > High-quality PDF with embedded fonts and hyperlinks> [card] DVI Output > > Traditional DVI format for specialized workflows> [card] PostScript > > PostScript output for professional printing> [card] HTML Export > > Web-friendly HTML conversion with LaTeX math support### Quality ControlEnsure output quality:- **Font embedding** - All fonts embedded for portability - **Hyperlink preservation** - Clickable links in PDF output - **Bookmark generation** - PDF bookmarks from document structure - **Metadata inclusion** - Author, title, keywords in PDF metadata### Download and SharingFlexible output delivery:```latex example.tex theme=\{null} % Output options: % 📄 Download PDF (primary output) % 📁 Download source files (ZIP archive) % 🔗 Share PDF link (temporary URL) % 📧 Email PDF attachment % ☁️ Save to cloud storage (Google Drive, Dropbox) ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Performance Monitoring### Compilation AnalyticsTrack compilation performance:- **Compilation time tracking** - Monitor document complexity impact - **Resource usage** - Memory and CPU utilization per compilation - **Error frequency** - Track and improve error rates over time - **Package usage** - Understand which packages affect performance### Optimization RecommendationsAutomated performance suggestions:> [!TIP] > > **Performance Tips** the system provides: > > * **Package optimization** - Suggests lighter alternatives for heavy packages > * **Image optimization** - Recommends format and size improvements > * **Structure suggestions** - Proposes document organization improvements > * **Caching strategies** - Identifies opportunities for better caching## Best Practices### Optimizing Compilation Speed```latex example.tex theme=\{null} % Use draft mode during editing \documentclass[draft]{article} \usepackage[draft]{graphicx} % Faster image processing % Optimize packages \usepackage{microtype} % Load only when needed \usepackage{hyperref} % Load last % Structure for incremental compilation \includeonly{chapter1,chapter2} % Compile only specific chapters ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.\
```latex example.tex theme=\{null} % Split large documents \include{chapter1} \include{chapter2} \include{chapter3} % Use external processing for complex elements \input{generated_table.tex} % Generated by external script \includegraphics{plot.pdf} % Generated by R/Python ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Error PreventionBest practices for error-free compilation:1) **Use consistent environments** - Always close what you open 2) **Validate references** - Check labels and citations regularly 3) **Test incrementally** - Compile frequently during writing 4) **Use standard packages** - Stick to well-tested package combinations 5) **Handle special characters** - Properly escape special LaTeX characters## Getting Started1) **Create or open a document** - Compilation happens automatically 2) **Choose compilation engine** - Use default pdfLaTeX or select alternative 3) **Add packages as needed** - All packages available without installation 4) **Monitor compilation output** - Check for errors and warnings in real-time 5) **Download your PDF** - High-quality output ready immediately***> [!NOTE] > > **Need help with compilation errors?** Check our [Error Troubleshooting Guide](/learn/latex/basics/errors) for solutions to common issues. # Collaboration Source: https://resources.latex-cloud-studio.com/platform/collaboration Shared editing, comments, project access, and collaborative workflows in LaTeX Cloud Studio. > [!NOTE] > > **Status:** Live for shared editing, invitations, comments, and version-backed recovery\ > **Last reviewed:** November 13, 2026\ > **Applies to:** Shared projects. The owner needs Pro to invite; collaborators can be on Free.\ > **Canonical workflow docs:** [Collaboration, Comments & History](/product/collaboration-comments-and-history), [Account & Settings](/product/account-and-settings) LaTeX Cloud Studio supports collaborative document work without forcing teams to pass files around manually. ## What Teams Can Use Today * shared project editing * owner and editor access control * comments attached to files and lines * replies to existing comments * version history for recovery and review ## Collaboration Principles ### Keep one canonical project Avoid parallel copies when a shared project can carry the conversation. ### Use comments for review Comments are the cleanest way to request changes without losing the current source state. ### Use version history for recovery When a draft goes sideways, compare against an earlier state instead of guessing which manual edit caused the regression. ## Current Access Model | Role | Recommended use | | - | - | | Owner | Project ownership, invitations, final access control | | Editor | Active drafting, editing, responding to comments | ## Not Available > [!WARNING] > > Commenter-only or viewer-only roles, formal suggestion mode, and admin-level collaboration controls are not available. ## Where To Go Next > [card] Collaboration, Comments & History > > Canonical workflow details for invitations, comments, and active roles. [Open](/product/collaboration-comments-and-history) > [card] Troubleshooting > > Pair collaborative editing with version-backed recovery. [Open](/product/troubleshooting) # Security & Privacy Source: https://resources.latex-cloud-studio.com/platform/security-privacy Public security and privacy overview for LaTeX Cloud Studio, including where project data is stored and which enterprise controls are not available. > [!NOTE] > > **Status**: Live public security and privacy posture. SSO, audit logs, and admin controls are not available. > > **Last reviewed**: November 13, 2026 LaTeX Cloud Studio is built around privacy-first document handling, EU-hosted project data, and owner-controlled project access. ## Public Commitments > [card] Privacy-First AI > > User documents are not used to train AI models. > [card] EU-Hosted Project Data > > Project data, including uploaded files and compiled PDFs, is stored on EU-hosted infrastructure: the database and file storage in Ireland and the LaTeX compiler in Prague. The web application and AI model providers may process requests outside the EU. The service is designed for GDPR obligations. > [card] Protected Project Access > > Project access and collaboration are designed around explicit permissions rather than public-by-default sharing. > [card] Encryption and Recovery > > Connections are encrypted in transit (HTTPS). Version history keeps earlier versions of project files. There are no customer-facing audit logs. ## Enterprise Boundary * Not available: SSO, SAML, organization accounts, customer-facing audit logs, and an admin console. * Available: per-person Free and Pro plans and owner-controlled project access. See [Enterprise & Admin Overview](/product/enterprise-admin-overview). ## Canonical Product Docs * [Account & Settings](/product/account-and-settings) * [Collaboration, Comments & History](/product/collaboration-comments-and-history) * [GitHub Sync, Import & Export](/product/github-sync-import-export) * [Enterprise & Admin Overview](/product/enterprise-admin-overview) # Account & Settings Source: https://resources.latex-cloud-studio.com/product/account-and-settings Manage your LaTeX Cloud Studio profile, editor preferences, compile defaults, theme, and account-level settings. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Applies to**: All signed-in users LaTeX Cloud Studio includes a dedicated settings area for personal preferences and account-level controls. ## Available Today * Profile editing for your display name * Theme switching with light, dark, and system modes * Default compile engine preferences * Syntax highlighting color preferences * AI usage statistics in account settings * Subscription status visibility from settings ## What You Can Configure | Area | Available now | | - | - | | Profile | Name and account identity synced with authentication | | Theme | Light, dark, system | | Editor defaults | Preferred compile engine | | Syntax colors | Package names, imported files, commands, environment names | | Subscription | Plan status and usage context | | AI usage | Usage stats surfaced in settings | ## Account Flow 1. Open LaTeX Cloud Studio. 2. Open the account settings page from the app. 3. Update profile details or editor defaults. 4. Save changes to persist them to your account profile. ## Notes on Security * Authentication is handled through the current access flow used by the app. * Enterprise SSO and admin provisioning are not available. Each person signs in with their own account. * Privacy and data-handling principles are covered in [Security & Privacy](/platform/security-privacy). * What exists for teams and institutions is covered in [Enterprise & Admin Overview](/product/enterprise-admin-overview). ## Related Pages * [Editor & AI Assistance](/product/editor-and-ai-assistance) * [Collaboration, Comments & History](/product/collaboration-comments-and-history) * [Troubleshooting](/product/troubleshooting) * [Open the App and Configure Settings](/product/tasks/sign-in-and-configure-settings) # AI Research Agent Source: https://resources.latex-cloud-studio.com/product/ai-research-agent Use the LaTeX Cloud Studio AI research agent to find literature, expand from accepted sources, pressure-test evidence, and support citation workflows inside one project. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: April 12, 2026\ > **Applies to**: Research workspace and literature-discovery workflows Use the AI research agent when the manuscript needs external literature discovery beyond the current project files. ## What The Research Agent Does Today The current research workspace is built for literature work inside the project, not for a detached chat session. The public workflow supports research actions such as: * finding papers for a section or research question * building initial source memory for a project * expanding from accepted sources to newer or related work * looking for counterarguments, limitations, or follow-up papers * moving strong sources toward bibliography and citation handoff ## Common Research Moves ### Start from the draft Use the research workspace when a section needs stronger evidence, newer literature, or a clearer related-work base. ### Start from accepted sources Once a project already has accepted sources, the workflow can expand from that set instead of restarting from a blank search. This is useful when you want: * newer follow-up work * closely related evidence * stronger alternatives * counterarguments that challenge the current source set ### Move sources toward citation The research workflow is not only for discovery. It is also part of the handoff into bibliography and manuscript work. That makes the research agent more useful than a generic paper search tool. It stays connected to accepted sources and citation readiness inside the project. ## What Stays Visible In The Workflow The research workspace is designed around reviewable evidence handling rather than a black-box answer. Expect the workflow to revolve around concepts such as: * candidate sources * accepted sources * project memory * why this source * source import status for the knowledge base * bibliography handoff for accepted evidence ## How To Use It Well 1. Add the core project papers to the [Knowledge Base](/product/knowledge-base?utm_source=resources\&utm_medium=inline_reference\&utm_campaign=research_workflow\&utm_content=ai_research_agent_doc) first when you already have a starting set. 2. Run research from a section, claim, or accepted source set instead of from a vague topic alone. 3. Accept the strongest sources deliberately. 4. Use the result as evidence support for the manuscript, not as an excuse to skip source review. 5. Move accepted sources toward bibliography and citation workflows once they are good enough to keep. ## What This Page Does Not Promise * It does not claim a fully automatic literature review that should be trusted without review. * It does not claim that every surfaced paper is equally verified. * It does not claim that the agent replaces source evaluation, methodology judgment, or citation checking. * It does not claim that every future research-control idea is already public and shipped. ## Related Pages * [Knowledge Base](/product/knowledge-base) * [Editor & AI Assistance](/product/editor-and-ai-assistance) * [Projects, Files & Templates](/product/projects-files-and-templates) * [Writing a Research Paper in LaTeX](/learn/latex/how-to/writing-research-paper) ## Start in LaTeX Cloud Studio > [card] Open in LaTeX Cloud Studio > > Open the app and run literature discovery inside the same project as the draft. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=cta\&utm_campaign=research_workflow\&utm_content=ai_research_agent_open_app) > [card] Writing a Research Paper in LaTeX > > Use the broader paper-writing guide when you need the surrounding manuscript workflow. [Open](/learn/latex/how-to/writing-research-paper?utm_source=resources\&utm_medium=related_guide\&utm_campaign=research_workflow\&utm_content=ai_research_agent_doc) # Collaboration, Comments & History Source: https://resources.latex-cloud-studio.com/product/collaboration-comments-and-history Share projects, invite editors, work with comments, track presence, and restore previous versions in LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live core collaboration workflows\ > **Last reviewed**: November 13, 2026\ > **Applies to**: Shared projects in the editor LaTeX Cloud Studio supports real-time collaboration, project invites, comments, and file-level history. ## Live Collaboration Capabilities * Invite collaborators by email address from project settings (project owner on Pro) * Project roles for **owner** and **editor** * Presence and live collaboration indicators in active projects * Comments panel with edit, delete, and reply flows * File version history and diffs * Manual labels and snapshots for recovery workflows ## Plan and Access Notes > [!NOTE] > > Inviting collaborators is a Pro feature of the project owner. Invited collaborators can join and edit on the Free plan. > > * A shared project does not count toward the collaborator's own project limit. > * AI features follow each person's own plan, also inside a shared project. > * If the owner downgrades to Free, existing collaborators keep access, but the owner cannot send new invitations. ## How Collaboration Works Today ### Share a project 1. Open the project. 2. Open project settings and go to the collaborators section. 3. Enter the editor's email address and select **Invite**. 4. Monitor active members and pending invitations from project settings. The invited person accepts the invitation while signed in with that email address. A Free account is enough. After accepting, the project opens in the editor. ### Leave comments * Add comments in the editor workflow. * Review them in the comments panel. * Edit, delete, or reply to your own comments when needed. ### Recover work * Open the version-history workspace for file diffs and restore actions. * Use snapshots or labeled versions to mark milestones before risky edits. ## What Is Not Canonical Here * This page does **not** document public viewer/commenter-only roles as the main app permission model. * Threaded review systems, suggestion mode, and broader roadmap collaboration concepts remain separate from the canonical live workflow described here. ## Related Pages * [Editor & AI Assistance](/product/editor-and-ai-assistance) * [GitHub Sync & Import/Export](/product/github-sync-import-export) * [Troubleshooting](/product/troubleshooting) * [Invite Collaborators and Use Comments](/product/tasks/invite-collaborators-and-use-comments) * [Recover with History and Snapshots](/product/tasks/recover-with-history-and-snapshots) # Editor & AI Assistance Source: https://resources.latex-cloud-studio.com/product/editor-and-ai-assistance Learn the LaTeX Cloud Studio editor layout, live preview, inline AI assistance, proofreading, comments, and search workflows. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Applies to**: Active projects in the editor This page covers the current editor workflow exposed by the app, including file editing, PDF preview, AI assistance, and search. ## Core Editor Layout The editor workspace includes: * File tree and project navigation * Main code editor * PDF preview * Compilation output and problems * Search across the current project * Snapshots dialog and version-history access ## AI Features Available Today The app currently exposes AI assistance in the editor, including: * Inline AI editing and generation flows * Proofreading-oriented AI actions * AI-assisted problem fixing flows for compilation issues * Workflow suggestions based on file content patterns > [!WARNING] > > Pages under `/platform/ai-features` describe broader roadmap items. Use this page as the canonical reference for what is available in the app today. ## Common Workflows ### Fix a LaTeX problem 1. Compile your project. 2. Open the problems/output area. 3. Review the failing line or error. 4. Use the available AI-assisted fix flow or correct the source manually. 5. Recompile and verify the PDF output. ### Use inline AI 1. Place the cursor in the file you want to edit. 2. Trigger the inline AI action from the editor workflow. 3. Review the proposed change. 4. Accept or reject the suggestion. ### Search the project Use the project search workflow to jump to files and optionally scroll to specific lines. ## What This Page Does Not Promise * It does not treat all roadmap AI ideas as live. * It does not claim citation database integrations are public and fully documented. * It does not claim a separate suggestion-mode review system beyond the currently shipped editor workflows. ## Related Pages * [Knowledge Base](/product/knowledge-base) * [AI Research Agent](/product/ai-research-agent) * [Projects, Files & Templates](/product/projects-files-and-templates) * [Collaboration, Comments & History](/product/collaboration-comments-and-history) * [Troubleshooting](/product/troubleshooting) * [Use Inline AI and Search](/product/tasks/use-inline-ai-and-search) * [Recover with History and Snapshots](/product/tasks/recover-with-history-and-snapshots) # Enterprise Access & Onboarding Source: https://resources.latex-cloud-studio.com/product/enterprise-access-and-onboarding How a team or institution starts using LaTeX Cloud Studio today with individual accounts and shared projects. No SSO or organization setup. > [!NOTE] > > **Status**: No enterprise onboarding program\ > **Last reviewed**: November 13, 2026\ > **Primary audience**: Institutions, labs, and teams evaluating LaTeX Cloud Studio LaTeX Cloud Studio has no enterprise onboarding program, SSO, or organization setup. A team works with individual accounts and shared projects. ## How a Team Gets Started 1. Each person creates their own account. The Free plan is enough to join and edit shared projects. 2. The person who owns a project upgrades to Pro, because inviting collaborators requires Pro. 3. The owner opens project settings and invites each collaborator by email address. 4. Each collaborator accepts the invitation while signed in with that email address. A shared project does not count toward a collaborator's own project limit. AI features follow each person's own plan. ## What to Expect | Topic | Today | | - | - | | Identity | Each person signs in with their own account. No SSO or SAML. | | Ownership | Each project has one owner, who invites and removes collaborators. | | Organization controls | None. There is no organization account or admin console. | | Billing | Per person. There is no team plan or central billing. | ## Questions For security and privacy questions, start with [Security & Privacy](/platform/security-privacy). For anything else, use the contact page on the [LaTeX Cloud Studio website](https://www.latex-cloud-studio.com/contact). # Enterprise & Admin Overview Source: https://resources.latex-cloud-studio.com/product/enterprise-admin-overview What LaTeX Cloud Studio offers teams and institutions today. Per-person Free and Pro plans, owner-controlled project access, no SSO or admin console. > [!NOTE] > > **Status**: No organization or admin features\ > **Last reviewed**: November 13, 2026 LaTeX Cloud Studio has no organization accounts, team plans, or admin console. Teams and institutions use the same per-person Free and Pro plans as everyone else. ## What Exists Today * **Per-person plans**: each person has a Free or Pro account and signs in with it. * **Project-level access**: the project owner invites collaborators from project settings and can remove them at any time. * **Plan rule for sharing**: the owner needs Pro to invite collaborators. Invited collaborators can join and edit on the Free plan. * **One collaborator role**: every collaborator can edit. There are no viewer-only or commenter-only roles. * **Version history**: earlier versions of project files can be compared and restored. ## Not Available * SSO, SAML, or SCIM provisioning * Organization or workspace accounts, central billing, or an admin console * Customer-facing audit logs * Viewer-only or commenter-only roles ## Related Pages > [card] Enterprise Access & Onboarding > > How a team or institution gets started with individual accounts and shared projects. [Open](/product/enterprise-access-and-onboarding) > [card] Enterprise Security & Governance > > What you can tell a security or procurement review today, and what is not available. [Open](/product/enterprise-security-and-governance) # Enterprise Security & Governance Source: https://resources.latex-cloud-studio.com/product/enterprise-security-and-governance What LaTeX Cloud Studio supports for security and governance reviews today, and which enterprise controls are not available. > [!NOTE] > > **Status**: Public security posture; no enterprise governance controls\ > **Last reviewed**: November 13, 2026\ > **Primary docs**: [Security & Privacy](/platform/security-privacy) Use this page to answer security and governance questions from an institution or business review. ## What Is Supported Today * User documents are not used to train AI models. * Project data, including uploaded files and compiled PDFs, is stored on EU-hosted infrastructure. * The service is designed for GDPR obligations. * Connections are encrypted in transit (HTTPS). * Project access is controlled by the project owner. Collaborators have one role, editor. * Version history keeps earlier versions of project files for comparison and restore. ## Not Available > [!WARNING] > > * Customer-facing audit logs > * Organization-wide controls or an admin console > * SSO, SAML, or SCIM provisioning > * Viewer-only or commenter-only roles ## Related Pages * [Enterprise & Admin Overview](/product/enterprise-admin-overview) * [Enterprise Access & Onboarding](/product/enterprise-access-and-onboarding) * [Security & Privacy](/platform/security-privacy) # Feature Availability Source: https://resources.latex-cloud-studio.com/product/feature-availability Public availability matrix for LaTeX Cloud Studio features, including AI workflows, collaboration, imports, recovery, templates, and enterprise access. > [!NOTE] > > **Purpose**: This page is the public status matrix for the marketing site and docs. > > **Last reviewed**: March 2026 > > **Legend**: `Live` = publicly available now, `Beta` = available with evolving rollout or UX, `Planned` = not yet publicly available. | Area | Status | Notes | Canonical docs | | - | - | - | - | | AI error explanation and guided fixes | Live | AI-assisted compile and problem-resolution workflows are publicly positioned as available. | [Editor & AI Assistance](/product/editor-and-ai-assistance) | | Inline rewriting and proofreading | Live | Available as AI-assisted writing help in the editor. | [Editor & AI Assistance](/product/editor-and-ai-assistance) | | Live collaboration presence | Live | Active collaborators and shared editing presence are part of the current product surface. | [Collaboration, Comments & History](/product/collaboration-comments-and-history) | | Line-level comments and replies | Live | Comments exist today; full suggestion-mode review workflows are not public yet. | [Collaboration, Comments & History](/product/collaboration-comments-and-history) | | Version history and snapshots | Live | File versions and project snapshots are available for recovery workflows. | [Collaboration, Comments & History](/product/collaboration-comments-and-history) | | Template-based project creation | Live | Templates and template-backed project creation are available. | [Projects, Files & Templates](/product/projects-files-and-templates) | | ZIP import and ZIP download | Live | ZIP-based project transfer is the current public migration path. | [GitHub Sync, Import & Export](/product/github-sync-import-export) | | GitHub repository import | Live | GitHub import is available as a project creation workflow. | [GitHub Sync, Import & Export](/product/github-sync-import-export) | | Direct Overleaf account connection/import | Planned | Current public migration guidance uses ZIP export from Overleaf, not account-to-account linking. | [Projects, Files & Templates](/product/projects-files-and-templates) | | Zotero or Mendeley direct integration | Planned | No public self-serve integration docs yet. Use BibTeX-based workflows for now. | [GitHub Sync, Import & Export](/product/github-sync-import-export) | | Suggestion mode / track changes | Planned | Line comments are live; full suggestion-style review remains outside the public product docs surface. | [Collaboration, Comments & History](/product/collaboration-comments-and-history) | | Enterprise SSO | Beta | Enterprise rollout exists, but onboarding is sales-assisted rather than self-serve. | [Account & Settings](/product/account-and-settings) | | Audit and organization controls | Beta | Security/admin capabilities exist for enterprise rollout, but public self-serve admin docs are still limited. | [Account & Settings](/product/account-and-settings) | ## Guidance for Content and Marketing Teams * Link to this page whenever a comparison, solution, or feature page makes a capability claim. * Do not describe `Planned` items as if they are available in self-serve product workflows. * If a feature is `Beta`, say whether it is public, gated, or sales-assisted. ## Related Pages * [Product docs overview](/product) * [GitHub Sync, Import & Export](/product/github-sync-import-export) * [Collaboration, Comments & History](/product/collaboration-comments-and-history) * [Account & Settings](/product/account-and-settings) # GitHub Sync, Import & Export Source: https://resources.latex-cloud-studio.com/product/github-sync-import-export Connect GitHub, import repositories, push and pull changes, and export projects from LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live GitHub integration and project transfer workflows\ > **Last reviewed**: March 8, 2026\ > **Applies to**: Users working with repository-backed or portable projects LaTeX Cloud Studio includes GitHub account connection, repository import, export, and sync workflows in the current app. ## Available Today * Connect a GitHub account * Import a repository as a project * Export a project to GitHub * Push local project changes to GitHub * Pull remote changes from GitHub * Handle sync conflicts during push/pull flows ## Portable Project Transfers Outside the GitHub workflow, you can also: * Upload a ZIP archive to start from an existing project * Export a project as a ZIP for backup or migration ## Recommended Use Cases | Goal | Best workflow | | - | - | | Start from an existing repository | GitHub import | | Back up a project for transfer | ZIP export | | Keep a repo and editor in sync | GitHub push/pull | | Move a project from another editor | ZIP upload or GitHub import | ## Migration Guidance > [!WARNING] > > This page intentionally avoids claiming a public direct Overleaf account connection. If your source project lives elsewhere, export it first and then import via ZIP or GitHub. ## Related Pages * [Projects, Files & Templates](/product/projects-files-and-templates) * [Collaboration, Comments & History](/product/collaboration-comments-and-history) * [Troubleshooting](/product/troubleshooting) * [Connect GitHub and Run Sync](/product/tasks/connect-github-and-run-sync) # Product Docs Overview Source: https://resources.latex-cloud-studio.com/product/index Canonical product documentation for LaTeX Cloud Studio. Start here for account settings, editor workflows, knowledge base, research agent, collaboration, GitHub sync, and troubleshooting. > [!NOTE] > > **Status**: Live product documentation > **Last reviewed**: April 12, 2026 > **Scope**: Public app capabilities verified against the current product codebase Use this section for app-specific workflows and feature behavior. The rest of the docs site focuses on LaTeX learning content, templates, and reference material. If you need the product-level marketing overview instead of workflow docs, start with the main [Features page](https://www.latex-cloud-studio.com/features). If you are evaluating privacy-sensitive AI writing tools, use the [OpenAI Prism alternative comparison](https://www.latex-cloud-studio.com/alternatives/openai-prism). ## What This Section Covers > [card] Account & Settings > > Profile setup, theme preferences, compile engine defaults, AI usage stats, and account-level security context. [Open](/product/account-and-settings) > [card] Editor & AI Assistance > > Editor layout, live preview, inline AI, proofreading, problem fixing, and project search. [Open](/product/editor-and-ai-assistance) > [card] Knowledge Base > > Store project PDFs, extracted text, and reusable source context close to the manuscript. [Open](/product/knowledge-base?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=product_overview) > [card] AI Research Agent > > Find literature, expand from accepted sources, and move strong evidence toward citation workflows. [Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=product_overview) > [card] Projects, Files & Templates > > Create projects, upload files, import ZIPs, use templates, and manage project structure. [Open](/product/projects-files-and-templates) > [card] Collaboration, Comments & History > > Invites, owner/editor roles, comments, presence, version history, and snapshots. [Open](/product/collaboration-comments-and-history) > [card] GitHub Sync & Import/Export > > Import repositories, connect GitHub, push and pull changes, and export projects. [Open](/product/github-sync-import-export) > [card] Troubleshooting > > Compilation, access, sync, and editor recovery issues with practical next steps. [Open](/product/troubleshooting) ## Task Guides > [card] Open the App and Configure Settings > > Open LaTeX Cloud Studio and set your profile, theme, compile defaults, and editor preferences. [Open](/product/tasks/sign-in-and-configure-settings) > [card] Start a Project and Import Files > > Create a blank project, start from a template, or migrate an existing LaTeX project with ZIP or GitHub. [Open](/product/tasks/start-a-project-and-import-files) > [card] Use Inline AI and Search > > Rewrite, proofread, fix errors, and jump through project files without leaving the editor. [Open](/product/tasks/use-inline-ai-and-search) > [card] Run Research Inside The Project > > Use the knowledge base and research workspace together when a section needs external literature and grounded citation support. [Open](/product/ai-research-agent?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=product_tasks) > [card] Invite Collaborators and Use Comments > > Add editors, leave comments, and run review discussions in a shared project. [Open](/product/tasks/invite-collaborators-and-use-comments) > [card] Connect GitHub and Run Sync > > Import repositories, connect branches, and push or pull project changes safely. [Open](/product/tasks/connect-github-and-run-sync) > [card] Recover with History and Snapshots > > Roll back bad edits and restore a stable project state after risky changes. [Open](/product/tasks/recover-with-history-and-snapshots) ## Trust Signals * Product pages in this section describe **current, public behavior** only. * Planned features remain in roadmap-oriented pages such as `/platform/ai-features`. * When pricing or access level matters, pages call it out explicitly instead of implying universal availability. * Research-workflow pages keep the same terms the app uses: knowledge base, accepted sources, project memory, and citation handoff. ## Start Here * New user: [Getting Started with LaTeX Cloud Studio](/getting-started/cloud-studio) * Existing user: [Editor & AI Assistance](/product/editor-and-ai-assistance) * Research workflow: [Knowledge Base](/product/knowledge-base?utm_source=resources\&utm_medium=inline_reference\&utm_campaign=research_workflow\&utm_content=product_overview) and [AI Research Agent](/product/ai-research-agent?utm_source=resources\&utm_medium=inline_reference\&utm_campaign=research_workflow\&utm_content=product_overview) * Team workflow: [Collaboration, Comments & History](/product/collaboration-comments-and-history) * Repository workflow: [GitHub Sync & Import/Export](/product/github-sync-import-export) # Knowledge Base Source: https://resources.latex-cloud-studio.com/product/knowledge-base Use the LaTeX Cloud Studio knowledge base to keep project PDFs, extracted text, and reusable source context inside one manuscript project. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: April 12, 2026\ > **Applies to**: Project-level source management and reusable AI context Use the knowledge base when a project needs stable source memory instead of one-off uploads and disconnected browser tabs. ## What The Knowledge Base Is For The knowledge base gives a project its own source layer. Use it to: * keep relevant papers and source PDFs inside the same project as the manuscript * reuse extracted text as project-aware AI context * review what sources are already available before running more research * keep source handling closer to the draft, bibliography, and comments workflow ## What You Can Add Today The current public add-resource flow accepts **PDF documents**. That covers common research inputs such as: * journal papers * preprints * book chapters * technical reports * scanned reference documents > [!WARNING] > > The current public knowledge-base upload flow is PDF-only. Do not present notes, web links, or arbitrary file types as generally available upload paths unless the product UI changes. ## What The Workspace Exposes Inside the knowledge base workflow, the project can expose: * a searchable list of project sources * file name and title metadata * processing state for uploaded resources * extracted text when text extraction is available * source search across the current project collection This makes the knowledge base useful as more than file storage. It becomes a reusable project context layer for AI-assisted work. ## How It Fits Into The Research Workflow The strongest use of the knowledge base is not storage by itself. It is the handoff between source memory and manuscript work. Typical flow: 1. Upload the core papers or reports for the project. 2. Use the knowledge base as the first source layer for project-aware AI context. 3. Run the research workspace when you need follow-up literature beyond the uploaded set. 4. Accept the strongest sources into project memory. 5. Move accepted evidence toward bibliography and citation workflows in the manuscript. ## What This Page Does Not Promise * It does not claim support for arbitrary non-PDF upload types. * It does not claim that every external research result is silently imported into the project. * It does not claim that source storage alone verifies the quality of a citation or argument. ## Related Pages * [AI Research Agent](/product/ai-research-agent) * [Editor & AI Assistance](/product/editor-and-ai-assistance) * [Projects, Files & Templates](/product/projects-files-and-templates) * [Writing a Research Paper in LaTeX](/learn/latex/how-to/writing-research-paper) ## Start in LaTeX Cloud Studio > [card] Open in LaTeX Cloud Studio > > Open a project and build the source set where the manuscript work actually happens. [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=cta\&utm_campaign=research_workflow\&utm_content=knowledge_base_open_app) > [card] Writing a Research Paper in LaTeX > > See how the knowledge base fits into drafting, bibliography, and citation work. [Open](/learn/latex/how-to/writing-research-paper?utm_source=resources\&utm_medium=related_guide\&utm_campaign=research_workflow\&utm_content=knowledge_base_doc) # Projects, Files & Templates Source: https://resources.latex-cloud-studio.com/product/projects-files-and-templates Create projects, use templates, upload files, import ZIP archives, and manage project structure in LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Applies to**: Project creation and file-management workflows LaTeX Cloud Studio supports multiple ways to start a project and manage its files once you are inside the editor. ## Start a Project You can currently start work by: * Creating a blank project * Starting from a documentation template * Uploading an existing LaTeX project * Importing a ZIP archive * Importing a GitHub repository through the GitHub flow ## File Management Inside a project you can: * Organize files and folders * Upload source files and assets * Search project contents * Open version history and snapshots * Export project contents as a ZIP when you need a portable backup ## Templates The public docs currently expose starter templates for: * [Article](/templates/article) * [Thesis](/templates/thesis) * [CV](/templates/cv) * [Presentation](/templates/presentation) ## Migration Notes > [!WARNING] > > This public docs set does **not** currently document a direct "connect your Overleaf account" migration flow as a shipped capability. If you are moving an existing project today, use a ZIP-based transfer or GitHub where appropriate. ## Good Next Steps * Research workflow: [Knowledge Base](/product/knowledge-base) and [AI Research Agent](/product/ai-research-agent) * New project flow: [Getting Started with LaTeX Cloud Studio](/getting-started/cloud-studio) * Team workflow: [Collaboration, Comments & History](/product/collaboration-comments-and-history) * Repository workflow: [GitHub Sync & Import/Export](/product/github-sync-import-export) * Task guide: [Start a Project and Import Files](/product/tasks/start-a-project-and-import-files) # Connect GitHub and Run Sync Source: https://resources.latex-cloud-studio.com/product/tasks/connect-github-and-run-sync Connect GitHub, import a repository, and use push or pull sync workflows in LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Primary docs**: [GitHub Sync & Import/Export](/product/github-sync-import-export) Use this task guide when your LaTeX project already lives in GitHub or you want repository-backed workflows. ## Connect GitHub 1. Open the GitHub connection flow from the app or project settings. 2. Authenticate your GitHub account. 3. Select the repository you want to connect or import. ## Import From GitHub 1. Choose the repository and branch. 2. Import the files into a new or existing project. 3. Compile immediately after import to verify the project shape. ## Push and Pull Changes ### Push 1. Review your local project state. 2. Enter a clear commit message. 3. Push the current project changes to GitHub. ### Pull 1. Select the correct branch. 2. Pull remote changes into the project. 3. Resolve conflicts if the sync workflow reports them. ## Safety Tips * Compile right after the first import. * Export a ZIP backup before risky pull operations. * Do not force sync unless you understand the conflict state. # Fix Build and Access Issues Source: https://resources.latex-cloud-studio.com/product/tasks/fix-build-and-access-issues Troubleshoot compilation failures, project access problems, invite issues, and stalled auth flows in LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Primary docs**: [Troubleshooting](/product/troubleshooting) Use this task guide when something blocks you from working normally in the app. ## Build Problems 1. Check the first real error in the compile output. 2. Confirm your main `.tex` file and file paths are correct. 3. Re-run the build after each targeted fix. 4. Use AI-assisted fixes when the problem is clear but tedious. ## Access Problems If the project does not open: * make sure you are signed in * retry the login flow if auth stalled * confirm the project still exists * confirm that you still have access ## Invite or Collaboration Problems * verify the project owner is sending the invite; only an owner on Pro can invite * check that the invited person signs in with the same email address the invite was sent to * collaborators do not need Pro: a Free account can accept the invite and edit ## GitHub Problems * reconnect GitHub if the token expired * confirm the selected branch * review conflict details before forcing any sync ## Recovery If the issue was caused by a bad edit, use [Recover with History and Snapshots](/product/tasks/recover-with-history-and-snapshots). # Invite Collaborators and Use Comments Source: https://resources.latex-cloud-studio.com/product/tasks/invite-collaborators-and-use-comments Invite editors, manage shared project access, and use comments for collaborative review in LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: November 13, 2026\ > **Primary docs**: [Collaboration, Comments & History](/product/collaboration-comments-and-history) Use this task guide when you want to move from solo editing to a shared project workflow. ## Invite an Editor 1. Open the project as the owner. Inviting collaborators requires Pro. 2. Open project settings and go to the collaborators section. 3. Enter the collaborator's email address. 4. Send the invite and confirm it appears in pending invitations or active members. ## Accept an Invitation 1. Sign in with the email address the invitation was sent to. A Free account is enough. 2. Open the invitation and accept it. 3. The shared project opens in the editor. It does not count toward your own project limit. ## Use Comments for Review 1. Open the file that needs discussion. 2. Add a comment at the relevant line. 3. Reply inside the thread if clarification is needed. 4. Edit or delete your own comments if the discussion changes. ## Current Access Model * `owner`: controls the project and invitations * `editor`: contributes directly to files and comments > [!WARNING] > > Public viewer/commenter-only roles and suggestion-mode review are not the canonical live workflow here. ## When Collaboration Fails * Recheck the email address * Confirm the owner is sending the invite * Confirm the project owner has Pro; the collaborator can be on Free * Use [Fix Build and Access Issues](/product/tasks/fix-build-and-access-issues) if access looks wrong # Recover with History and Snapshots Source: https://resources.latex-cloud-studio.com/product/tasks/recover-with-history-and-snapshots Restore earlier file or project states using version history, labels, and snapshots in LaTeX Cloud Studio. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Primary docs**: [Collaboration, Comments & History](/product/collaboration-comments-and-history), [Troubleshooting](/product/troubleshooting) Use this task guide when a project was changed in the wrong way and you need a safe rollback path. ## Recover a Single File 1. Open version history for the project or file. 2. Compare the current file with an earlier version. 3. Restore the older version if the change is clearly incorrect. ## Recover a Larger Project State 1. Open the snapshot or labeled-history workflow. 2. Find the last stable milestone. 3. Restore that checkpoint if multiple files were affected. ## Good Times to Create a Snapshot * before a large AI-assisted rewrite * before pulling major GitHub changes * before restructuring a long document * before collaborative review rounds ## Best Practice Use history for recovery, not as a substitute for formal approval workflows. # Open the App and Configure Settings Source: https://resources.latex-cloud-studio.com/product/tasks/sign-in-and-configure-settings Open LaTeX Cloud Studio, go to settings, and configure your theme, compile defaults, and profile preferences. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Primary docs**: [Account & Settings](/product/account-and-settings) Use this task guide when you want to get into the app quickly and set your personal defaults before deeper project work. ## Steps 1. Open LaTeX Cloud Studio with the current authentication flow. 2. Open the settings page from the app navigation. 3. Update your display name if needed. 4. Choose a theme: `light`, `dark`, or `system`. 5. Select your preferred default compile engine. 6. Adjust syntax highlighting colors if you use them heavily. 7. Confirm your subscription and AI usage information if that matters for your workflow. ## What You Should Expect * Your profile should be synchronized to the application after access is confirmed. * Saved settings should persist to your account. * If profile sync is temporarily delayed, refresh once and retry the settings page. ## If Something Goes Wrong * If you cannot access the app, see [Fix Build and Access Issues](/product/tasks/fix-build-and-access-issues). * If your project opens but your settings look wrong, revisit [Account & Settings](/product/account-and-settings). # Start a Project and Import Files Source: https://resources.latex-cloud-studio.com/product/tasks/start-a-project-and-import-files Create a new LaTeX Cloud Studio project, start from a template, or import existing files through ZIP upload or GitHub. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Primary docs**: [Projects, Files & Templates](/product/projects-files-and-templates), [GitHub Sync & Import/Export](/product/github-sync-import-export) Use this task guide when you need to create a fresh project or move an existing LaTeX project into the editor. ## Start From Scratch 1. Open the project creation flow. 2. Choose a blank project if you want full control from the first file. 3. Choose a template if you want a prebuilt structure for an article, thesis, CV, or presentation. ## Import Existing Work ### ZIP workflow 1. Export your project from the source tool as a ZIP archive. 2. Upload the archive into LaTeX Cloud Studio. 3. Verify that `main.tex`, images, `.bib`, `.cls`, and `.sty` files are present. 4. Compile once before making structural edits. ### GitHub workflow 1. Use the GitHub import flow when the project already lives in a repository. 2. Select the repository and branch. 3. Import the files and run a first compile. ## Important Boundary > [!WARNING] > > Direct account-to-account Overleaf import is not part of the current public workflow. Use ZIP export from Overleaf instead. ## Next Steps * Set up collaboration with [Invite Collaborators and Use Comments](/product/tasks/invite-collaborators-and-use-comments) * Connect repository sync with [Connect GitHub and Run Sync](/product/tasks/connect-github-and-run-sync) * Recover from import issues with [Fix Build and Access Issues](/product/tasks/fix-build-and-access-issues) * Need a public overview page for teammates or stakeholders? Use the migration guide on the website: [Migrate to LaTeX Cloud Studio](https://www.latex-cloud-studio.com/migrate) # Use Inline AI and Search Source: https://resources.latex-cloud-studio.com/product/tasks/use-inline-ai-and-search Use inline AI editing, proofreading, AI-assisted fixes, and project search inside the LaTeX Cloud Studio editor. > [!NOTE] > > **Status**: Live\ > **Last reviewed**: March 8, 2026\ > **Primary docs**: [Editor & AI Assistance](/product/editor-and-ai-assistance) Use this task guide when you want to edit faster without leaving the editor. ## Use Inline AI 1. Open the file you want to edit. 2. Place the cursor or select the relevant text. 3. Trigger the inline AI flow from the editor. 4. Ask for a rewrite, proofread, cleanup, or LaTeX-aware adjustment. 5. Review the proposed change before accepting it. 6. Recompile after accepting changes that affect document structure or syntax. ## Use AI for Build Problems 1. Compile the project first. 2. Read the first real error in the problems or output area. 3. Use the AI-assisted fix flow if the error is clear but tedious to correct manually. 4. Treat the fix as a proposal, not a silent mutation. ## Search the Project 1. Open the project search workflow. 2. Search for file names, labels, references, or repeated text. 3. Jump directly to matching files and lines. ## Best Practices * Use AI for reviewed edits, not blind mass changes. * Keep snapshots or version history handy before large rewrites. * Preserve bibliography and citation structure by reviewing changes carefully. # Troubleshooting Source: https://resources.latex-cloud-studio.com/product/troubleshooting Resolve common LaTeX Cloud Studio issues involving compilation, project access, GitHub sync, and editor recovery. > [!NOTE] > > **Status**: Live support guidance\ > **Last reviewed**: March 8, 2026\ > **Applies to**: Current app workflows Use this page to route issues to the right product area quickly. ## Compilation Problems Check these first: * Review the compilation output and reported line numbers * Confirm the selected compile engine matches your document needs * Look for missing braces, unclosed environments, or misspelled commands * Re-run the compile after applying fixes or AI-assisted edits For LaTeX-specific debugging help, use the broader [Troubleshooting Center](/learn/latex/troubleshooting/index). ## Access and Authentication Issues If a project will not open: * Confirm you are signed in * Retry the login flow if authentication stalls * Check whether the project exists and you still have access * Ask the project owner to confirm your invitation or role ## Collaboration Issues If invites or collaboration do not work as expected: * Verify the project owner is sending the invite; the owner needs Pro to invite * Confirm the collaborator signs in with the email address the invite was sent to * Collaborators can accept and edit on the Free plan; they do not need Pro * Reload the project if presence or comments look stale ## GitHub Sync Issues If repository sync fails: * Reconnect GitHub if the token or connection expired * Check the selected branch * Review any reported conflicts before forcing a sync * Fall back to ZIP export if you need an immediate portable copy ## Recovery Workflows When an edit goes wrong: * Open version history * Compare against a previous version * Restore a prior version or use a labeled snapshot ## Related Pages * [Editor & AI Assistance](/product/editor-and-ai-assistance) * [Collaboration, Comments & History](/product/collaboration-comments-and-history) * [GitHub Sync & Import/Export](/product/github-sync-import-export) * [Learn LaTeX Troubleshooting](/learn/latex/troubleshooting/index) * [Fix Build and Access Issues](/product/tasks/fix-build-and-access-issues) * [Recover with History and Snapshots](/product/tasks/recover-with-history-and-snapshots) # Article Templates Source: https://resources.latex-cloud-studio.com/templates/article Professional LaTeX article templates for academic papers, journals, and scientific publications. Copy-paste ready templates with examples. Professional article templates for academic papers, journal submissions, and scientific publications. All templates are ready to use - just copy the code and start writing your content.## Article template gallery[![First page of the basic article template compiled with pdfLaTeX: centered title, author and date, abstract, and numbered sections with a sample figure and table.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-article-basic/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=ae2d59bfa2dfac5e5750274226d29829)](#basic-article)Basic articleCourse assignments, short papers and preprints that need a title, abstract and numbered sections.[Open in editor](https://app.latex-cloud-studio.com/start?template=article-basic\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=article-basic)[View source](#basic-article)[![First page of the extended article template compiled with pdfLaTeX: title with two affiliated authors, abstract with keywords, introduction with a contribution list and a background section with a numbered equation.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-article-extended/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=34eb34eb879c3c3a4e8186fcf8506a20)](#extended-article)Extended articleResearch papers with several authors that need theorem environments, algorithms, code listings and appendices.[Open in editor](https://app.latex-cloud-studio.com/start?template=article-extended\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=article-extended)[View source](#extended-article)[![IEEE journal article compiled with pdfLaTeX: two-column IEEEtran layout with title, author block, abstract, index terms, numbered sections, a results table, references and an author biography.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-article-journal/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=802220a51a51af85bcee9a9440fd4ae9)](#ieee-journal-article)IEEE journal articleManuscripts for IEEE journals that use the two-column IEEEtran class.[Open in editor](https://app.latex-cloud-studio.com/start?template=article-journal\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=article-journal)[View source](#ieee-journal-article)[![First page of the lab report template compiled with pdfLaTeX: course name, experiment title, author, partner, instructor and date block, abstract with the measured result, and numbered objective, theory and procedure sections.](https://mintcdn.com/hirox-6fc9e3ca/Lci0movYyju9_b2-/images/rendered/template-lab-report/page-1.svg?fit=max\&auto=format\&n=Lci0movYyju9_b2-\&q=85\&s=9571f0de67198fd7842bf1442e992368)](#lab-report)Lab reportScience and engineering lab reports with a data table, a plotted fit, an uncertainty analysis and a raw-data appendix.[Open in editor](https://app.latex-cloud-studio.com/start?template=lab-report\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=lab-report)[View source](#lab-report)> [!NOTE] > > **Quick start**: Pick a template in the gallery and select **Open in editor**, or copy its complete source from [Template source code](#template-source-code).## Choose This Template When- You are writing a paper, report, assignment, or preprint - You need a clean article structure before moving to a publisher-specific class - You want a working starting point with sections, abstract, figures, tables, and bibliography## Start in LaTeX Cloud Studio> [card] Open the Editor > > Paste a template into the browser editor, compile it, and adapt the title block first.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=template_article_open_editor)> [card] Using Templates Guide > > Follow the template workflow if you need help adapting structure, bibliography, or figures.[Open](/learn/latex/how-to/using-templates)## How to Adapt These Templates1) Choose the target outlet (course submission, journal, or preprint). 2) Set document class options (`font size`, `paper size`, `onecolumn` or `twocolumn`). 3) Replace title block, author data, and abstract first. 4) Decide bibliography workflow early with [BibLaTeX guide](/learn/latex/bibliography/biblatex-guide) or [Natbib guide](/learn/latex/bibliography/natbib-guide). 5) Validate structure with [Sections and chapters](/learn/latex/document-structure/sections-and-chapters) and [Table of contents](/learn/latex/document-structure/table-of-contents).## Template source codeEach block below is the complete template. The preview above is page 1 of the PDF that the pinned TeX Live 2026 environment compiles from this exact source; expand the rendered output to see every page.### Basic articleCourse assignments, short papers and preprints that need a title, abstract and numbered sections.```latex article-basic.tex theme=\{null} % Basic Academic Article Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % A minimal template for academic papers and assignments. % Compile with pdfLaTeX. \documentclass[11pt,a4paper]{article} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb} \usepackage{graphicx} \usepackage{hyperref} \usepackage[margin=1in]{geometry} % Document metadata \title{Your Article Title Here} \author{Your Name\\ \textit{Your Institution}\\ \texttt{your.email@example.com}} \date{\today} \begin{document} \maketitle \begin{abstract} Write a brief summary of your article here (150-250 words). Include the main objectives, methodology, key findings, and conclusions. \textbf{Keywords:} keyword1, keyword2, keyword3 \end{abstract} \section{Introduction} Begin your article with context and motivation. Explain why this topic is important and what problem you're addressing. \section{Background} Provide necessary background information and review related literature. \section{Methodology} Describe your approach, methods, or experimental setup. \section{Results} Present your findings. You can include figures: \begin{figure}[h] \centering % \includegraphics[width=0.8\textwidth]{your-image.png} \caption{Description of your figure} \label{fig:example} \end{figure} And tables: \begin{table}[h] \centering \caption{Sample data table} \begin{tabular}{|l|c|c|} \hline \textbf{Item} & \textbf{Value 1} & \textbf{Value 2} \\ \hline Sample A & 10 & 20 \\ Sample B & 15 & 25 \\ \hline \end{tabular} \label{tab:example} \end{table} \section{Discussion} Analyze and interpret your results. \section{Conclusion} Summarize your key findings and contributions. \section*{Acknowledgments} Thank funding agencies and collaborators. % Bibliography \begin{thebibliography}{9} \bibitem{example2024} Author, A. B., \textit{Title of the Article}, Journal Name, vol. 10, pp. 123-145, 2024. \end{thebibliography} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-basic.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-article-basic/page-1.svg) Open zoomable preview: Compiled PDF page 2 from article-basic.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-article-basic/page-2.svg)
### Extended articleResearch papers with several authors that need theorem environments, algorithms, code listings and appendices.```latex article-extended.tex theme=\{null} % Extended Academic Article Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Full-featured template for academic papers. % Compile with pdfLaTeX. \documentclass[11pt,a4paper]{article} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,amsthm} \usepackage{graphicx} \usepackage{hyperref} \usepackage[margin=1in]{geometry} \usepackage{enumitem} \usepackage{cite} \usepackage{booktabs} \usepackage{subcaption} \usepackage{algorithm} \usepackage{algorithmic} \usepackage{listings} \usepackage{xcolor} % Hyperref setup \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, citecolor=blue } % Code listings setup \lstset{ basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green!60!black}, stringstyle=\color{orange}, numbers=left, numberstyle=\tiny\color{gray}, frame=single, breaklines=true } % Custom commands \newcommand{\R}{\mathbb{R}} \newcommand{\N}{\mathbb{N}} \newcommand{\Z}{\mathbb{Z}} % Theorem environments \theoremstyle{plain} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} % Metadata \title{Your Article Title Here} \author{ First Author\thanks{Department of Mathematics, University Name} \\ \texttt{first.author@email.com} \\ \and Second Author\thanks{Department of Physics, Another University} \\ \texttt{second.author@email.com} } \date{\today} \begin{document} \maketitle \begin{abstract} This abstract should summarize your article in 150-250 words. Include the main objectives, methodology, key findings, and conclusions. Make it self-contained so readers can understand your work without reading the full article. \textbf{Keywords:} keyword1, keyword2, keyword3, keyword4 \end{abstract} \section{Introduction} Begin your article with context and motivation. Explain why this topic is important and what problem you're addressing. Include relevant background information and cite previous work \cite{example2023}. State your main contributions clearly: \begin{itemize} \item First contribution \item Second contribution \item Third contribution \end{itemize} \section{Background and Related Work} Provide necessary background information and review related literature. \subsection{Theoretical Background} Explain key concepts and theories. For example, consider the equation: \begin{equation} E = mc^2 \label{eq:einstein} \end{equation} As shown in Equation \ref{eq:einstein}, energy and mass are related. \subsection{Previous Approaches} Discuss how others have approached this problem. \section{Methodology} \subsection{Problem Formulation} Clearly define your problem: \begin{definition} Let $X$ be a set and $f: X \to \R$ be a function. We say $f$ is \emph{continuous} if for every $\epsilon > 0$, there exists $\delta > 0$ such that... \end{definition} \subsection{Proposed Solution} Describe your approach in detail. \begin{theorem} Under conditions A and B, our method converges in $O(n \log n)$ time. \end{theorem} \begin{proof} The proof follows from standard arguments... \end{proof} \subsection{Algorithm} \begin{algorithm} \caption{Main Algorithm} \label{alg:main} \begin{algorithmic}[1] \REQUIRE Input data $X$ \ENSURE Result $Y$ \STATE Initialize parameters \WHILE{not converged} \STATE Update step \ENDWHILE \RETURN $Y$ \end{algorithmic} \end{algorithm} \section{Results and Discussion} \subsection{Experimental Setup} Describe your experiments, data, and evaluation metrics. \subsection{Results} Present your findings: \begin{table}[h] \centering \caption{Comparison of different methods} \label{tab:results} \begin{tabular}{@{}lccc@{}} \toprule \textbf{Method} & \textbf{Accuracy} & \textbf{Speed} & \textbf{Memory} \\ \midrule Baseline & 85.2\% & 1.0x & 100 MB \\ Our Method & \textbf{92.7\%} & 0.8x & 95 MB \\ State-of-art & 91.3\% & 0.5x & 150 MB \\ \bottomrule \end{tabular} \end{table} \subsection{Discussion} Analyze your results and discuss implications. \section{Conclusion} Summarize your key findings and contributions. Suggest future research directions. \section*{Acknowledgments} Thank funding agencies, collaborators, and anyone who helped. % Bibliography \begin{thebibliography}{9} \bibitem{example2023} Author, A. B., \textit{Title of the Article}, Journal Name, vol. 10, no. 2, pp. 123-145, 2023. \bibitem{book2022} Writer, C. D., \textit{Book Title}, Publisher, 2nd ed., 2022. \end{thebibliography} % Appendix \appendix \section{Additional Proofs} Include lengthy proofs here. \section{Code Listings} \begin{lstlisting}[language=Python] def algorithm(data): # Process data result = process(data) return result \end{lstlisting} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-extended.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-article-extended/page-1.svg) Open zoomable preview: Compiled PDF page 2 from article-extended.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-article-extended/page-2.svg) Open zoomable preview: Compiled PDF page 3 from article-extended.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-article-extended/page-3.svg)
### IEEE journal articleManuscripts for IEEE journals that use the two-column IEEEtran class.```latex article-journal.tex theme=\{null} % IEEE/ACM Journal Article Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Standard IEEE format for journal submissions. % Compile with pdfLaTeX. \documentclass[journal]{IEEEtran} % Essential packages \usepackage{amsmath,amssymb,amsfonts} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{cite} \usepackage{algorithmic} \usepackage{array} \usepackage{url} % Theorem-like environments used in the analysis section \newtheorem{theorem}{Theorem} % Correct bad hyphenation \hyphenation{op-tical net-works semi-conduc-tor} \begin{document} \title{Your Paper Title: Should Be Descriptive\\and Specific to Your Research} \author{First~Author,~\IEEEmembership{Member,~IEEE,} Second~Author,~\IEEEmembership{Senior Member,~IEEE,} and~Third~Author,~\IEEEmembership{Fellow,~IEEE}% \thanks{Manuscript received Month Day, Year; revised Month Day, Year.}% \thanks{First Author is with the Department of Electrical Engineering, University Name, City, State, Country (e-mail: first.author@university.edu).}% \thanks{Second Author is with Company Name, City, Country (e-mail: second@company.com).}% \thanks{Third Author is with Research Institute, City, Country.}} \markboth{IEEE Journal Name,~Vol.~XX, No.~X, Month~Year}% {Author \MakeLowercase{\textit{et al.}}: Your Paper Title} \maketitle \begin{abstract} This document provides a template for IEEE journal papers. The abstract should be approximately 150-250 words and should summarize the key contributions, methodology, and results of your work. It should be self-contained and provide readers with a clear understanding of what your paper is about without needing to read the full text. \end{abstract} \begin{IEEEkeywords} Keyword1, keyword2, keyword3, keyword4, keyword5. \end{IEEEkeywords} \section{Introduction} \IEEEPARstart{T}{his} document provides a template for IEEE journal papers. The introduction should provide background information and clearly state the contribution of your work. Use this paragraph format with a large first letter for the opening paragraph of the introduction. The remainder of this section discusses prior work and motivation. \subsection{Related Work} Discuss related work here, citing relevant papers \cite{ref1}, \cite{ref2}. \subsection{Contributions} The main contributions of this paper are: \begin{enumerate} \item First contribution \item Second contribution \item Third contribution \end{enumerate} \section{Problem Formulation} Define your problem precisely. Let $X \in \mathbb{R}^{n \times m}$ be the input data matrix. Our goal is to find $Y$ such that: \begin{equation} \min_{Y} \|X - AY\|_F^2 + \lambda \|Y\|_1 \label{eq:optimization} \end{equation} \section{Proposed Method} Describe your approach in detail. \subsection{Algorithm Overview} Provide a high-level description. \subsection{Theoretical Analysis} Present theoretical results. \begin{theorem} Under assumptions A1-A3, the proposed algorithm converges to a local minimum. \end{theorem} \begin{IEEEproof} The proof follows from standard convex optimization theory. \end{IEEEproof} \section{Experimental Results} \subsection{Experimental Setup} Describe datasets, baselines, and evaluation metrics. \subsection{Results} Present your results with tables and figures. \begin{table}[h] \centering \caption{Performance Comparison} \label{tab:results} \begin{tabular}{|l|c|c|c|} \hline \textbf{Method} & \textbf{Accuracy} & \textbf{F1 Score} & \textbf{Time (s)} \\ \hline Baseline & 0.82 & 0.79 & 10.5 \\ Method A & 0.85 & 0.83 & 8.2 \\ Ours & \textbf{0.91} & \textbf{0.89} & \textbf{6.7} \\ \hline \end{tabular} \end{table} \subsection{Discussion} Analyze and interpret your results. \section{Conclusion} Summarize your contributions and suggest future work. \section*{Acknowledgment} The authors would like to thank... \begin{thebibliography}{00} \bibitem{ref1} A. Author, ``Title of paper,'' \textit{IEEE Trans. Signal Process.}, vol. 65, no. 10, pp. 2500--2515, Oct. 2017. \bibitem{ref2} B. Writer and C. Researcher, ``Another paper title,'' in \textit{Proc. IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP)}, Calgary, AB, Canada, Apr. 2018, pp. 1234--1238. \end{thebibliography} % To add a portrait, upload photo.jpg and replace this environment with: % \begin{IEEEbiography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{photo}}]{First Author} \begin{IEEEbiographynophoto}{First Author} received the B.S. and M.S. degrees from University Name. He is currently pursuing the Ph.D. degree. His research interests include area 1, area 2, and area 3. \end{IEEEbiographynophoto} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from article-journal.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-article-journal/page-1.svg)
### Lab reportScience and engineering lab reports with a data table, a plotted fit, an uncertainty analysis and a raw-data appendix. The sample measures gravitational acceleration with a pendulum; replace the details block, the data and the plot coordinates with your own experiment.```latex lab-report.tex theme=\{null} % Lab Report Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Laboratory report with title block, abstract, method, results table, % plotted data with a linear fit, uncertainty analysis and references. % Compile with pdfLaTeX. Replace the pendulum experiment with your own. \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=2.5cm]{geometry} \usepackage{amsmath} \usepackage{siunitx} \usepackage{booktabs} \usepackage{caption} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage[hidelinks]{hyperref} \sisetup{separate-uncertainty=true} % ============================================ % REPORT DETAILS - edit these % ============================================ \newcommand{\coursename}{PHYS 1210 Introductory Mechanics Laboratory} \newcommand{\experiment}{Experiment 4: Measuring $g$ with a Simple Pendulum} \newcommand{\studentname}{Your Name} \newcommand{\partnername}{Lab Partner Name} \newcommand{\instructor}{Dr.\ Instructor Name} \newcommand{\labdate}{14 October 2026} \begin{document} % ============================================ % TITLE BLOCK % ============================================ \begin{center} {\small\scshape \coursename}\par \vspace{0.6em} {\Large\bfseries \experiment}\par \vspace{1em} \begin{tabular}{@{}rl@{}} Author: & \studentname \\ Partner: & \partnername \\ Instructor: & \instructor \\ Date performed: & \labdate \\ \end{tabular} \end{center} \begin{abstract} \noindent We measured the period of a simple pendulum at nine string lengths between \SI{0.20}{m} and \SI{1.00}{m} and determined the local gravitational acceleration from the slope of $T^2$ against $L$. A linear fit gives $g = \SI{9.82(3)}{m/s^2}$, which agrees with the accepted value of \SI{9.81}{m/s^2} within one standard uncertainty. The fitted intercept corresponds to an extra effective length of \SI{13(2)}{mm}, consistent with the radius of the pendulum bob. \end{abstract} % ============================================ % INTRODUCTION % ============================================ \section{Objective} Determine the gravitational acceleration $g$ from the length dependence of a pendulum's period, and estimate the uncertainty of the result. \section{Theory} For small amplitudes, a simple pendulum of length $L$ has the period \begin{equation} T = 2\pi\sqrt{\frac{L}{g}} . \label{eq:period} \end{equation} Squaring Equation~\eqref{eq:period} gives a linear relation between $T^2$ and $L$: \begin{equation} T^2 = \frac{4\pi^2}{g}\,L + b , \label{eq:linear} \end{equation} where the intercept $b$ absorbs a constant offset between the measured string length and the true distance from the pivot to the centre of mass. The slope $m$ of a straight-line fit therefore gives $g = 4\pi^2/m$. % ============================================ % METHOD % ============================================ \section{Apparatus and Procedure} \subsection{Apparatus} \begin{itemize} \item Steel bob, diameter \SI{25.4}{mm}, on a light nylon string \item Clamp stand with a fixed pivot \item Metre rule (resolution \SI{1}{mm}) \item Hand-held stopwatch (resolution \SI{0.01}{s}) \end{itemize} \subsection{Procedure} \begin{enumerate} \item Set the string length $L$, measured from the pivot to the top of the bob. \item Displace the bob by less than \ang{10} and release it without pushing. \item Time ten complete oscillations, starting the count at the second pass through the lowest point. \item Repeat the timing three times for each length. \item Repeat steps 1--4 for nine lengths from \SI{0.20}{m} to \SI{1.00}{m}. \end{enumerate} % ============================================ % RESULTS % ============================================ \section{Results} Table~\ref{tab:data} lists the mean of the three timings for each length. The period is $T = t_{10}/10$. \begin{table}[ht] \centering \caption{Mean time for ten oscillations and derived period.} \label{tab:data} \begin{tabular}{ S[table-format=1.2] S[table-format=2.2] S[table-format=1.3] S[table-format=1.3] } \toprule {$L$ (\si{m})} & {$t_{10}$ (\si{s})} & {$T$ (\si{s})} & {$T^2$ (\si{s^2})} \\ \midrule 0.20 & 9.24 & 0.924 & 0.854 \\ 0.30 & 11.18 & 1.118 & 1.251 \\ 0.40 & 12.94 & 1.294 & 1.674 \\ 0.50 & 14.38 & 1.438 & 2.068 \\ 0.60 & 15.69 & 1.569 & 2.463 \\ 0.70 & 16.88 & 1.688 & 2.848 \\ 0.80 & 18.06 & 1.806 & 3.263 \\ 0.90 & 19.16 & 1.916 & 3.672 \\ 1.00 & 20.19 & 2.019 & 4.076 \\ \bottomrule \end{tabular} \end{table} Figure~\ref{fig:fit} shows $T^2$ against $L$ with the least-squares line. \begin{figure}[ht] \centering \begin{tikzpicture} \begin{axis}[ width=0.78\textwidth, height=0.5\textwidth, xlabel={String length $L$ (\si{m})}, ylabel={$T^2$ (\si{s^2})}, xmin=0, xmax=1.1, ymin=0, ymax=4.6, grid=major, legend pos=north west, ] \addplot[only marks, mark=*, mark size=1.8pt, blue!70!black] coordinates { (0.20,0.854) (0.30,1.251) (0.40,1.674) (0.50,2.068) (0.60,2.463) (0.70,2.848) (0.80,3.263) (0.90,3.672) (1.00,4.076) }; \addlegendentry{Measured} \addplot[domain=0:1.1, samples=2, red!70!black, thick] {4.019*x + 0.052}; \addlegendentry{Fit: $T^2 = 4.019\,L + 0.052$} \end{axis} \end{tikzpicture} \caption{Squared period against string length with the linear fit.} \label{fig:fit} \end{figure} % ============================================ % ANALYSIS % ============================================ \section{Analysis} The least-squares fit gives a slope $m = \SI{4.019(12)}{s^2/m}$ and an intercept $b = \SI{0.052(8)}{s^2}$. From Equation~\eqref{eq:linear}, \begin{equation} g = \frac{4\pi^2}{m} = \SI{9.82(3)}{m/s^2}, \qquad \frac{\sigma_g}{g} = \frac{\sigma_m}{m} = 0.3\,\% . \end{equation} The intercept corresponds to an additional effective length $b/m = \SI{13(2)}{mm}$. This matches the bob radius of \SI{12.7}{mm}, because $L$ was measured to the top of the bob rather than to its centre. \section{Discussion} The result differs from the accepted value by \SI{0.01}{m/s^2}, which is less than one standard uncertainty. Reaction time when starting and stopping the stopwatch is the largest random error; timing ten oscillations reduces its effect on $T$ by a factor of ten. Amplitudes below \ang{10} keep the small-angle correction below \SI{0.2}{\percent}, which is smaller than the statistical uncertainty. A photogate would reduce the timing scatter further. \section{Conclusion} The slope of $T^2$ against $L$ gives $g = \SI{9.82(3)}{m/s^2}$, in agreement with the accepted value. Measuring the length to the centre of the bob would remove the intercept. % ============================================ % REFERENCES % ============================================ \begin{thebibliography}{9} \bibitem{taylor} J.~R. Taylor, \emph{An Introduction to Error Analysis}, 2nd ed. University Science Books, 1997. \bibitem{labmanual} Department of Physics, \emph{PHYS 1210 Laboratory Manual}, 2026 edition. \end{thebibliography} % ============================================ % APPENDIX % ============================================ \appendix \section{Raw Timing Data} \begin{table}[ht] \centering \caption{Three timings of ten oscillations for each length.} \begin{tabular}{ S[table-format=1.2] S[table-format=2.2] S[table-format=2.2] S[table-format=2.2] } \toprule {$L$ (\si{m})} & {Run 1 (\si{s})} & {Run 2 (\si{s})} & {Run 3 (\si{s})} \\ \midrule 0.20 & 9.23 & 9.27 & 9.23 \\ 0.30 & 11.19 & 11.16 & 11.20 \\ 0.40 & 12.95 & 12.91 & 12.95 \\ 0.50 & 14.38 & 14.39 & 14.37 \\ 0.60 & 15.60 & 15.75 & 15.73 \\ 0.70 & 16.97 & 16.83 & 16.83 \\ 0.80 & 18.03 & 18.06 & 18.10 \\ 0.90 & 19.16 & 19.20 & 19.13 \\ 1.00 & 20.21 & 20.21 & 20.15 \\ \bottomrule \end{tabular} \end{table} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from lab-report.tex Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-lab-report/page-1.svg) Open zoomable preview: Compiled PDF page 2 from lab-report.tex Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-lab-report/page-2.svg) Open zoomable preview: Compiled PDF page 3 from lab-report.tex Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-lab-report/page-3.svg)
## Scientific Report TemplateA shorter report skeleton with placeholder text and an external bibliography file, for technical reports that need more sectioning than a lab report.```latex scientific-report.tex theme=\{null} \documentclass[11pt,a4paper]{article} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{amsmath,amsfonts,amssymb} \usepackage{graphicx} \usepackage[margin=1in]{geometry} \usepackage{fancyhdr} \usepackage{siunitx} \usepackage{booktabs} \usepackage{caption} \usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} % Header and footer \pagestyle{fancy} \fancyhf{} \fancyhead[L]{Scientific Report} \fancyhead[R]{\today} \fancyfoot[C]{\thepage} % Title page information \title{\textbf{Scientific Report Title}\\ \large Subtitle or Course Information} \author{Student Name\\ Student ID: 123456789\\ \textit{Department of Science}\\ \textit{University Name}} \date{\today} \begin{document} % Title page \maketitle \thispagestyle{empty} \newpage % Table of contents \tableofcontents \newpage \section{Executive Summary} Provide a concise summary of the entire report, including objectives, methods, key findings, and conclusions. \section{Introduction} \subsection{Background} Provide relevant background information and context for your study. \subsection{Objectives} Clearly state the objectives of your investigation: \begin{enumerate} \item Primary objective \item Secondary objective \item Tertiary objective \end{enumerate} \section{Methodology} \subsection{Experimental Design} Describe your experimental approach and design. \subsection{Materials and Equipment} List all materials, chemicals, and equipment used: \begin{itemize} \item Material 1 (purity, supplier) \item Material 2 (specifications) \item Equipment: Model XYZ Spectrometer \end{itemize} \section{Results} \subsection{Experimental Data} Present your experimental data clearly and systematically. \begin{table}[htbp] \centering \caption{Experimental measurements} \label{tab:measurements} \begin{tabular}{@{}lSSS@{}} \toprule {Sample} & {Temperature (\si{\celsius})} & {Pressure (\si{\kPa})} & {Volume (\si{\mL})} \\ \midrule Sample 1 & 25.0 & 101.3 & 250.0 \\ Sample 2 & 30.0 & 98.7 & 275.5 \\ Sample 3 & 35.0 & 102.1 & 301.2 \\ \bottomrule \end{tabular} \end{table} \section{Discussion} Interpret your findings and relate them to your objectives. \section{Conclusion} Summarize your main findings and their significance. \bibliographystyle{plain} \bibliography{references} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from scientific-report.tex Page 1 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/templates-article-03/page-1.svg) Open zoomable preview: Compiled PDF page 2 from scientific-report.tex Page 2 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/templates-article-03/page-2.svg) Open zoomable preview: Compiled PDF page 3 from scientific-report.tex Page 3 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/templates-article-03/page-3.svg) Open zoomable preview: Compiled PDF page 4 from scientific-report.tex Page 4 of 4. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/templates-article-03/page-4.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=templates_article)## Template Features### Document Structure- Professional formatting with 11pt font on A4 paper - Proper margins and spacing - Automatic section numbering - Table of contents support (add `\tableofcontents`)### Mathematics Support- Full AMS math packages included - Theorem environments ready to use - Custom math commands defined### Bibliography- Two options: BibTeX or manual bibliography - Proper citation formatting - Hyperlinked references### Figures and Tables- Centered figures with captions - Professional table formatting - Cross-referencing support## Customization Guide### Changing Document Class Options```latex example.tex theme=\{null} % Two-column layout \documentclass[11pt,a4paper,twocolumn]{article} % Draft mode (shows overfull boxes) \documentclass[11pt,a4paper,draft]{article} % US Letter paper \documentclass[11pt,letterpaper]{article} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Adding More Packages```latex packages.tex theme=\{null} % For code listings \usepackage{listings} \usepackage{xcolor} % For better tables \usepackage{booktabs} \usepackage{multirow} % For subfigures \usepackage{subcaption} % For algorithms \usepackage{algorithm} \usepackage{algorithmic} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Custom Theorem Environments```latex theorems.tex theme=\{null} % Define custom environments \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newtheorem{note}[theorem]{Note} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Header and Footer Customization```latex headers.tex theme=\{null} \usepackage{fancyhdr} \pagestyle{fancy} % Clear default headers \fancyhf{} % Custom headers \fancyhead[L]{\small Your Article Title} \fancyhead[R]{\small \thepage} % Custom footers \fancyfoot[C]{\small Draft Version - \today} % Header line \renewcommand{\headrulewidth}{0.4pt} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
## Best Practices> [!TIP] > > **Structure Tips:** > > * Keep sections balanced in length > * Use subsections for better organization > * Number equations only when referenced > * Place figures and tables near their first reference### Writing Style1) **Abstract**: Make it self-contained and informative 2) **Introduction**: Start broad, then narrow to your specific problem 3) **Methodology**: Be detailed enough for reproduction 4) **Results**: Let data speak first, then interpret 5) **Conclusion**: No new information, only synthesis### Common Pitfalls to Avoid> [!WARNING] > > * Don't use too many packages (conflicts can occur) > * Avoid manual spacing (`\\[1cm]` etc.) - use proper LaTeX spacing > * Don't hardcode references - use `\label` and `\ref` > * Check journal requirements for specific formatting## Advanced Features### Multi-column Sections```latex multicol.tex theme=\{null} \usepackage{multicol} \begin{multicols}{2} This text will be formatted in two columns. Great for saving space in certain sections. \end{multicols} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from multicol.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/templates-article-08/page-1.svg)
### Code Listings```latex code.tex theme=\{null} \usepackage{listings} \lstset{ language=Python, basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green}, numbers=left, numberstyle=\tiny, frame=single } \begin{lstlisting} def hello_world(): print("Hello, LaTeX!") return True \end{lstlisting} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Hyperlinks and Metadata```latex hyperref.tex theme=\{null} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, pdftitle={Your Article Title}, pdfauthor={Your Name}, pdfsubject={Subject}, pdfkeywords={keyword1, keyword2} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Choose a Starting Point- [Basic article](#basic-article) for assignments, papers, and preprints - [Extended article](#extended-article) for research papers with theorems, algorithms, and appendices - [IEEE journal article](#ieee-journal-article) for two-column IEEEtran manuscripts - [Lab report](#lab-report) for lab reports with data tables, a fitted plot and uncertainty analysis - [Scientific Report Template](#scientific-report-template) for structured reports with deeper sectioningUse the copy button on the selected code block, save the result as a `.tex` file, and compile it in your project.## Related Templates- [Thesis Template](/templates/thesis) - For dissertations and theses - [CV Template](/templates/cv) - For professional CVs and resumes - [Presentation Template](/templates/presentation) - For Beamer presentations***> [!NOTE] > > **Pro tip**: Save this template as `template.tex` in your projects folder. Copy it whenever you start a new article and customize as needed.Ready to write your article? Copy the template above and start writing! For more LaTeX tips, check our [writing guide](/learn/latex/how-to/articles). # LaTeX CV and Resume Templates Source: https://resources.latex-cloud-studio.com/templates/cv LaTeX CV and resume templates with compiled previews - modern, classic, two-column, tech, academic, minimal, executive and creative designs. These LaTeX CV and resume templates cover one-page job applications, technical and executive resumes, academic CVs and resumes, and design-led CVs. Every preview is page 1 of the PDF compiled from the template's full source on this page. **Open in editor** starts a new LaTeX Cloud Studio project from that template.## CV and resume template gallery[![Modern CV template compiled with pdfLaTeX: name and job title header, contact line, professional summary, experience, education, technical skills, certifications and languages.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-cv-modern/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=33d71602a5b4d3236d54b79eabf2fad0)](#modern-cv)Modern CVProfessionals in most industries who want a polished, conventional CV built on the moderncv class.[Open in editor](https://app.latex-cloud-studio.com/start?template=cv-modern\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=cv-modern)[View source](#modern-cv)[![Classic one-page resume compiled with pdfLaTeX: centered name and contact line, professional summary, dated experience bullet points, education, skills and certifications.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-resume-classic/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=a8d8a0605396fb361b96bec5ddf3d1e2)](#classic-one-page-resume)Classic one-page resumeJob applications with a strict one-page limit; single column and plain text, so applicant tracking systems can parse it.[Open in editor](https://app.latex-cloud-studio.com/start?template=resume-classic\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=resume-classic)[View source](#classic-one-page-resume)[![Two-column CV compiled with pdfLaTeX: dark sidebar with photo placeholder, contact details, skills and languages beside a main column with summary, experience, education, certifications and projects.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-cv-twocolumn/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=92d84f666e8366bec072f4fb9f8cdc5c)](#two-column-cv)Two-column CVApplications read by people, where a sidebar keeps contact details, skills and languages next to your experience.[Open in editor](https://app.latex-cloud-studio.com/start?template=cv-twocolumn\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=cv-twocolumn)[View source](#two-column-cv)[![First page of the tech resume compiled with pdfLaTeX: name with icon contact line, technical skills grouped by area, experience bullet points and open-source projects.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-resume-tech/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=c184285c0f9fb84503d5b6f6630f3010)](#tech-resume)Tech resumeSoftware engineers who want technical skills and projects ahead of a concise, single-column work history.[Open in editor](https://app.latex-cloud-studio.com/start?template=resume-tech\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=resume-tech)[View source](#tech-resume)[![First page of the academic CV compiled with pdfLaTeX: name and department contact block, research interests, education, academic appointments and a numbered publication list.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-cv-academic/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=17df8416dfe9221fe7a4b559808585f0)](#academic-cv)Academic CVFaculty, postdoc and PhD applications that list research interests, appointments and publications.[Open in editor](https://app.latex-cloud-studio.com/start?template=cv-academic\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=cv-academic)[View source](#academic-cv)[![One-page academic resume compiled with pdfLaTeX: researcher name and contact line with ORCID, summary, education with dissertation title, research experience bullet points, selected publications, skills table, awards and teaching.](https://mintcdn.com/hirox-6fc9e3ca/Lci0movYyju9_b2-/images/rendered/template-resume-academic/page-1.svg?fit=max\&auto=format\&n=Lci0movYyju9_b2-\&q=85\&s=f273e533bc92b97cc70eb8b242afd906)](#academic-resume)Academic resumePhD graduates, postdocs and faculty applying for industry research roles, fellowships or grants that ask for a one-page resume instead of a full CV.[Open in editor](https://app.latex-cloud-studio.com/start?template=resume-academic\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=resume-academic)[View source](#academic-resume)[![Minimal resume compiled with pdfLaTeX: placeholder name and contact line followed by plain experience, education, skills, projects and certifications sections.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-resume-minimal/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=7699b6f3a03dce1e2d74fb1a976b428b)](#minimal-resume)Minimal resumeAnyone who wants a neutral, single-column structure with placeholders to fill in quickly.[Open in editor](https://app.latex-cloud-studio.com/start?template=resume-minimal\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=resume-minimal)[View source](#minimal-resume)[![First page of the executive resume compiled with pdfLaTeX: name and role header, executive summary, key achievements and professional experience with leadership bullet points.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-resume-executive/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=edc805f1dd0500189619919d3c77109e)](#executive-resume)Executive resumeSenior managers and executives whose two-page resume leads with an executive summary and key achievements.[Open in editor](https://app.latex-cloud-studio.com/start?template=resume-executive\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=resume-executive)[View source](#executive-resume)[![Creative CV compiled with pdfLaTeX: red header with name and role, left column with profile, expertise, tool skill bars and awards, right column with experience, education and selected projects.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-cv-creative/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=c6e1f5c4229b8f142bfa25afa6add928)](#creative-cv)Creative CVDesigners and other creative roles where a colored header, skill bars and selected projects suit the application.[Open in editor](https://app.latex-cloud-studio.com/start?template=cv-creative\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=cv-creative)[View source](#creative-cv)> [!NOTE] > > **Quick start**: Pick a template in the gallery and select **Open in editor**, or copy its complete source from [Template source code](#template-source-code).## Choose This Template When- You need an ATS-friendly resume for job applications - You want an academic CV with publications, teaching, and awards - You want a clean starting point that is easier to adapt than building a layout from scratch## Start in LaTeX Cloud Studio> [card] Open the Editor > > Paste one template into the editor, then rewrite the summary and experience bullets before changing the design.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=template_cv_open_editor)> [card] CV and Resume Guide > > Use the workflow guide for role-specific structure, academic sections, and resume-length decisions.[Open](/learn/latex/how-to/cv-resume)## How to Adapt for Job Applications1) Pick one template and keep total length role-appropriate (often one page for resumes). 2) Rewrite summary and bullet points to reflect measurable impact. 3) Tailor skills and keywords to each job description. 4) For academic paths, expand publications and teaching sections. 5) Use the companion [CV and resume guide](/learn/latex/how-to/cv-resume).## Template source codeEach block below is the complete template. The preview above is page 1 of the PDF that the pinned TeX Live 2026 environment compiles from this exact source; expand the rendered output to see every page.### Modern CVProfessionals in most industries who want a polished, conventional CV built on the moderncv class.```latex cv-modern.tex theme=\{null} % Modern Professional CV Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Requires the moderncv package. Compile with pdfLaTeX. % Theme options: casual, classic, banking, oldstyle, fancy % Color options: blue, orange, green, red, purple, grey, black \documentclass[11pt,a4paper,sans]{moderncv} % Modern CV theme \moderncvstyle{banking} \moderncvcolor{blue} % Character encoding \usepackage[utf8]{inputenc} \usepackage[scale=0.85]{geometry} % Personal Information \name{John}{Smith} \title{Senior Software Engineer} \address{123 Tech Street}{San Francisco, CA 94105}{USA} \phone[mobile]{+1~(555)~123~4567} \email{john.smith@email.com} \homepage{www.johnsmith.com} \social[linkedin]{johnsmith} \social[github]{johnsmith} % Photo (optional) - uncomment to add % \photo[70pt][0.4pt]{picture} \begin{document} \makecvtitle \section{Professional Summary} Experienced software engineer with 8+ years developing scalable web applications. Expert in Python, JavaScript, and cloud technologies. Proven track record of leading teams and delivering high-impact projects on time and within budget. \section{Experience} \cventry{2020--Present}{Senior Software Engineer}{Tech Corp}{San Francisco, CA}{}{ \begin{itemize} \item Led development of microservices architecture serving 10M+ users daily \item Reduced API response time by 40\% through optimization and caching strategies \item Mentored team of 5 junior developers and conducted code reviews \item Technologies: Python, Django, React, AWS, Docker, Kubernetes \end{itemize} } \cventry{2018--2020}{Software Engineer}{StartupXYZ}{San Francisco, CA}{}{ \begin{itemize} \item Built RESTful APIs and real-time features using Node.js and Socket.io \item Implemented CI/CD pipeline reducing deployment time by 60\% \item Collaborated with product team to deliver features improving user retention by 25\% \end{itemize} } \cventry{2016--2018}{Junior Developer}{Digital Agency}{Los Angeles, CA}{}{ \begin{itemize} \item Developed responsive websites for 20+ clients using modern frameworks \item Maintained and optimized existing codebases \end{itemize} } \section{Education} \cventry{2012--2016}{Bachelor of Science in Computer Science}{University of California}{Berkeley, CA}{GPA: 3.8/4.0}{ Dean's List: Fall 2014, Spring 2015 } \section{Technical Skills} \cvitem{Languages}{Python, JavaScript, Java, C++, SQL} \cvitem{Frameworks}{Django, React, Node.js, Express, Spring Boot} \cvitem{Databases}{PostgreSQL, MongoDB, Redis, MySQL} \cvitem{Cloud/DevOps}{AWS, Docker, Kubernetes, CI/CD, Terraform} \section{Certifications} \cvitem{2023}{AWS Certified Solutions Architect - Professional} \cvitem{2022}{Google Cloud Professional Cloud Developer} \section{Languages} \cvitemwithcomment{English}{Native}{} \cvitemwithcomment{Spanish}{Professional Working Proficiency}{} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cv-modern.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-cv-modern/page-1.svg)
### Classic one-page resumeJob applications with a strict one-page limit; single column and plain text, so applicant tracking systems can parse it.```latex resume-classic.tex theme=\{null} % Classic One-Page Resume Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % ATS-friendly resume design. Compile with pdfLaTeX. % Perfect for US job applications. \documentclass[11pt,letterpaper]{article} \usepackage[margin=0.75in]{geometry} \usepackage{enumitem} \usepackage{hyperref} \usepackage[T1]{fontenc} % Disable page numbers \pagestyle{empty} % Custom commands \newcommand{\resumeSection}[1]{ \vspace{2mm} {\large\textbf{#1}} \vspace{1mm} \hrule \vspace{2mm} } \newcommand{\resumeSubheading}[4]{ \vspace{1mm} \begin{tabular*}{\textwidth}[t]{l@{\extracolsep{\fill}}r} \textbf{#1} & #2 \\ \textit{#3} & \textit{#4} \\ \end{tabular*} \vspace{-2mm} } \newcommand{\resumeItem}[1]{ \item{#1} } \begin{document} % Header \begin{center} {\LARGE\textbf{Jane Doe}} \\ \vspace{2mm} Seattle, WA | (555) 987-6543 | jane.doe@email.com | linkedin.com/in/janedoe | github.com/janedoe \end{center} \resumeSection{PROFESSIONAL SUMMARY} Results-driven Marketing Manager with 6+ years of experience driving growth through data-driven strategies. Proven track record of increasing brand awareness by 150\% and generating \$2M+ in revenue through integrated campaigns. Expert in digital marketing, content strategy, and team leadership. \resumeSection{EXPERIENCE} \resumeSubheading {Marketing Manager}{Seattle, WA} {TechStart Inc.}{Mar 2021 -- Present} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \resumeItem{Led cross-functional team of 8 to launch product rebrand, resulting in 45\% increase in brand recognition} \resumeItem{Developed and executed digital marketing strategy increasing website traffic by 200\% and leads by 150\%} \resumeItem{Managed \$1.5M annual marketing budget, optimizing spend to achieve 3:1 ROI across all channels} \resumeItem{Implemented marketing automation workflows improving lead nurturing efficiency by 60\%} \end{itemize} \resumeSubheading {Senior Marketing Specialist}{Portland, OR} {Digital Solutions Co.}{Jun 2019 -- Feb 2021} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \resumeItem{Created content strategy resulting in 300\% increase in organic search traffic over 18 months} \resumeItem{Managed social media presence across 5 platforms, growing followers by 10K+ and engagement by 85\%} \resumeItem{Collaborated with sales team to develop materials contributing to \$500K in new business} \end{itemize} \resumeSubheading {Marketing Coordinator}{San Francisco, CA} {StartupABC}{Aug 2017 -- May 2019} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \resumeItem{Coordinated 20+ marketing campaigns from conception to execution} \resumeItem{Wrote compelling copy for websites, emails, and advertisements} \resumeItem{Assisted in organizing 5 industry events with 200+ attendees each} \end{itemize} \resumeSection{EDUCATION} \resumeSubheading {Bachelor of Arts in Marketing}{Seattle, WA} {University of Washington}{Sep 2013 -- Jun 2017} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \resumeItem{GPA: 3.7/4.0 | Dean's List: 4 semesters} \end{itemize} \resumeSection{SKILLS} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \resumeItem{\textbf{Marketing:} SEO/SEM, Content Marketing, Email Marketing, Social Media, PPC, Marketing Automation} \resumeItem{\textbf{Analytics:} Google Analytics, Tableau, Excel, SQL, A/B Testing, Data Visualization} \resumeItem{\textbf{Tools:} HubSpot, Salesforce, Mailchimp, Hootsuite, Adobe Creative Suite, WordPress} \end{itemize} \resumeSection{CERTIFICATIONS} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \resumeItem{Google Analytics Certified (2023) | HubSpot Content Marketing Certified (2022)} \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from resume-classic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-classic/page-1.svg)
### Two-column CVApplications read by people, where a sidebar keeps contact details, skills and languages next to your experience.```latex cv-twocolumn.tex theme=\{null} % Two-Column CV Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Modern CV with sidebar design. Compile with pdfLaTeX. \documentclass[11pt,a4paper]{article} \usepackage[margin=0.5in]{geometry} \usepackage{xcolor} \usepackage{fontawesome5} \usepackage{tikz} \usepackage{enumitem} \usepackage{hyperref} % Colors \definecolor{sidebar}{RGB}{45,55,72} \definecolor{maintext}{RGB}{45,55,72} \definecolor{accent}{RGB}{66,153,225} % No page numbers \pagestyle{empty} \begin{document} \noindent \begin{tikzpicture}[remember picture,overlay] \fill[sidebar] (current page.north west) rectangle ([xshift=6.5cm]current page.south west); \end{tikzpicture} \noindent \begin{minipage}[t]{0.32\textwidth} \color{white} \vspace{0pt} % Photo placeholder \begin{center} \begin{tikzpicture} \clip (0,0) circle (1.5cm); \fill[white!30] (0,0) circle (1.5cm); \node at (0,0) {\Large\faUser}; \end{tikzpicture} \end{center} \vspace{5mm} % Name \begin{center} {\Large\textbf{JOHN DOE}}\\ \vspace{2mm} {\small Software Engineer} \end{center} \vspace{5mm} % Contact \section*{\color{white}\faAddressCard\ CONTACT} \hrule \vspace{3mm} {\small \faPhone\ +1 (555) 123-4567\\[2mm] \faEnvelope\ john.doe@email.com\\[2mm] \faMapMarker*\ San Francisco, CA\\[2mm] \faLinkedin\ linkedin.com/in/johndoe\\[2mm] \faGithub\ github.com/johndoe } \vspace{5mm} % Skills \section*{\color{white}\faCogs\ SKILLS} \hrule \vspace{3mm} {\small \textbf{Languages}\\ Python, JavaScript, Go, SQL\\[3mm] \textbf{Frameworks}\\ React, Django, Node.js\\[3mm] \textbf{Tools}\\ Docker, AWS, Git, K8s\\[3mm] \textbf{Databases}\\ PostgreSQL, MongoDB, Redis } \vspace{5mm} % Languages \section*{\color{white}\faLanguage\ LANGUAGES} \hrule \vspace{3mm} {\small English - Native\\ Spanish - Fluent\\ Mandarin - Basic } \vspace{5mm} % Interests \section*{\color{white}\faHeart\ INTERESTS} \hrule \vspace{3mm} {\small Open Source\\ Machine Learning\\ Cloud Architecture\\ Technical Writing } \end{minipage} \hfill \begin{minipage}[t]{0.62\textwidth} \color{maintext} \vspace{0pt} % Summary \section*{\color{accent}\faBriefcase\ PROFESSIONAL SUMMARY} \vspace{-2mm} \hrule \vspace{3mm} Experienced software engineer with 6+ years building scalable web applications. Expert in cloud architecture, microservices, and full-stack development. Passionate about clean code and mentoring junior developers. % Experience \section*{\color{accent}\faBuilding\ EXPERIENCE} \vspace{-2mm} \hrule \vspace{3mm} \textbf{Senior Software Engineer} \hfill 2021 -- Present\\ \textit{Tech Corp, San Francisco} \begin{itemize}[leftmargin=*, itemsep=0mm] \item Led team of 5 engineers developing microservices \item Reduced API latency by 40\% through optimization \item Implemented CI/CD pipelines for 20+ services \end{itemize} \vspace{3mm} \textbf{Software Engineer} \hfill 2019 -- 2021\\ \textit{StartupXYZ, San Francisco} \begin{itemize}[leftmargin=*, itemsep=0mm] \item Built full-stack features using React and Node.js \item Designed and implemented RESTful APIs \item Mentored 2 junior developers \end{itemize} \vspace{3mm} \textbf{Junior Developer} \hfill 2017 -- 2019\\ \textit{Digital Agency, Los Angeles} \begin{itemize}[leftmargin=*, itemsep=0mm] \item Developed responsive websites for clients \item Maintained and optimized existing codebases \end{itemize} % Education \section*{\color{accent}\faGraduationCap\ EDUCATION} \vspace{-2mm} \hrule \vspace{3mm} \textbf{B.S. Computer Science} \hfill 2013 -- 2017\\ \textit{UC Berkeley}\\ GPA: 3.8/4.0 | Dean's List % Certifications \section*{\color{accent}\faCertificate\ CERTIFICATIONS} \vspace{-2mm} \hrule \vspace{3mm} AWS Solutions Architect Professional \hfill 2023\\ Certified Kubernetes Administrator \hfill 2022\\ Google Cloud Professional Developer \hfill 2021 % Projects \section*{\color{accent}\faCode\ PROJECTS} \vspace{-2mm} \hrule \vspace{3mm} \textbf{Open Source Contributor} -- Kubernetes\\ {\small Contributed to core scheduler improvements} \vspace{2mm} \textbf{Real-time Collaboration Tool}\\ {\small Built WebSocket-based document editor (React, Node.js)} \end{minipage} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cv-twocolumn.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-cv-twocolumn/page-1.svg)
### Tech resumeSoftware engineers who want technical skills and projects ahead of a concise, single-column work history.```latex resume-tech.tex theme=\{null} % Tech Resume Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % ATS-friendly resume for software engineering roles. % Compile with pdfLaTeX. \documentclass[11pt,letterpaper]{article} \usepackage[margin=0.6in]{geometry} \usepackage{enumitem} \usepackage{hyperref} \usepackage[T1]{fontenc} \usepackage{fontawesome5} % Disable page numbers \pagestyle{empty} % Custom commands \newcommand{\resumeSection}[1]{ \vspace{3mm} {\large\textbf{#1}} \vspace{1mm} \hrule \vspace{2mm} } \newcommand{\resumeSubheading}[4]{ \vspace{1mm} \begin{tabular*}{\textwidth}[t]{l@{\extracolsep{\fill}}r} \textbf{#1} & #2 \\ \textit{#3} & \textit{#4} \\ \end{tabular*} \vspace{-2mm} } \newcommand{\project}[2]{ \vspace{1mm} \begin{tabular*}{\textwidth}[t]{l@{\extracolsep{\fill}}r} \textbf{#1} & \textit{#2} \\ \end{tabular*} \vspace{-2mm} } \begin{document} % Header \begin{center} {\LARGE\textbf{Alex Chen}} \\ \vspace{2mm} \faPhone\ (555) 123-4567 \quad \faEnvelope\ alex.chen@email.com \quad \faLinkedin\ linkedin.com/in/alexchen \quad \faGithub\ github.com/alexchen \end{center} \resumeSection{TECHNICAL SKILLS} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-1mm] \item \textbf{Languages:} Python, JavaScript/TypeScript, Java, Go, SQL, C++ \item \textbf{Frontend:} React, Next.js, Vue.js, HTML5, CSS3, Tailwind CSS \item \textbf{Backend:} Node.js, Django, FastAPI, Spring Boot, GraphQL, REST APIs \item \textbf{Databases:} PostgreSQL, MongoDB, Redis, Elasticsearch, DynamoDB \item \textbf{Cloud/DevOps:} AWS (EC2, S3, Lambda, ECS), Docker, Kubernetes, Terraform, CI/CD \item \textbf{Tools:} Git, Linux, Nginx, Apache Kafka, RabbitMQ, Datadog, New Relic \end{itemize} \resumeSection{EXPERIENCE} \resumeSubheading {Senior Software Engineer}{San Francisco, CA} {Tech Giant Inc.}{Jan 2022 -- Present} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item Architected and implemented microservices handling 50K+ requests/second with 99.99\% uptime \item Reduced infrastructure costs by 35\% (\$200K annually) through container optimization and auto-scaling \item Led migration from monolith to microservices architecture, improving deployment frequency by 10x \item Mentored 4 junior engineers through code reviews, pair programming, and technical design sessions \item Implemented real-time data pipeline processing 100TB+ daily using Apache Kafka and Spark \end{itemize} \resumeSubheading {Software Engineer}{Seattle, WA} {Cloud Startup Co.}{Jun 2019 -- Dec 2021} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item Built full-stack features using React and Node.js, serving 500K+ monthly active users \item Designed RESTful APIs and GraphQL schemas improving frontend data fetching efficiency by 60\% \item Implemented automated testing (90\% coverage) and CI/CD pipelines reducing deployment time by 70\% \item Optimized PostgreSQL queries and implemented caching, reducing average response time from 500ms to 50ms \end{itemize} \resumeSubheading {Software Engineering Intern}{Mountain View, CA} {Big Tech Company}{May 2018 -- Aug 2018} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item Developed internal tool using Python and React, adopted by 200+ engineers company-wide \item Implemented ML-based anomaly detection system reducing false alerts by 45\% \end{itemize} \resumeSection{PROJECTS} \project{Open Source Contribution -- Kubernetes}{2023} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item Contributed 5 PRs to Kubernetes core, fixing scheduler bugs and improving documentation \item Implemented new feature for pod affinity rules, merged into v1.28 release \end{itemize} \project{Real-time Collaboration Platform}{2022} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item Built WebSocket-based collaborative document editor supporting 100+ concurrent users \item Tech stack: React, Node.js, Socket.io, Redis, PostgreSQL, deployed on AWS ECS \end{itemize} \resumeSection{EDUCATION} \resumeSubheading {Bachelor of Science in Computer Science}{Berkeley, CA} {University of California, Berkeley}{Aug 2015 -- May 2019} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item GPA: 3.85/4.0 | Relevant Coursework: Algorithms, Operating Systems, Distributed Systems, ML \end{itemize} \resumeSection{CERTIFICATIONS} \begin{itemize}[leftmargin=*, labelindent=0pt, itemsep=-0.5mm] \item AWS Solutions Architect Professional (2023) | Certified Kubernetes Administrator (2022) \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from resume-tech.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-tech/page-1.svg) Open zoomable preview: Compiled PDF page 2 from resume-tech.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-tech/page-2.svg)
### Academic CVFaculty, postdoc and PhD applications that list research interests, appointments and publications.```latex cv-academic.tex theme=\{null} % Academic CV Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Comprehensive template for academic positions. % Compile with pdfLaTeX. \documentclass[11pt,a4paper]{article} \usepackage[margin=1in]{geometry} \usepackage{hyperref} \usepackage{enumitem} \begin{document} % Header \begin{center} {\LARGE\textbf{Dr. Sarah Johnson}} \\ \vspace{3mm} Department of Computer Science \\ University of Excellence \\ 123 Academic Way, Boston, MA 02115 \\ Phone: (555) 123-4567 | Email: sjohnson@university.edu \\ Web: www.cs.university.edu/\textasciitilde sjohnson | ORCID: 0000-0000-0000-0000 \end{center} \section*{Research Interests} Machine Learning, Natural Language Processing, Deep Learning, AI Ethics, Computational Linguistics, Neural Networks \section*{Education} \textbf{Ph.D. in Computer Science}, Massachusetts Institute of Technology, 2018 \\ \textit{Dissertation:} ``Deep Learning Approaches for Natural Language Understanding'' \\ \textit{Advisor:} Prof. John Smith \textbf{M.S. in Computer Science}, Stanford University, 2014 \\ \textit{Thesis:} ``Statistical Methods in Machine Translation'' \textbf{B.S. in Computer Science}, \textit{Magna Cum Laude}, UC Berkeley, 2012 \\ \textit{GPA:} 3.9/4.0 \section*{Academic Appointments} \textbf{Assistant Professor}, University of Excellence, 2019--Present \\ Department of Computer Science \textbf{Postdoctoral Researcher}, MIT CSAIL, 2018--2019 \\ Advisor: Prof. Jane Doe \section*{Publications} \subsection*{Peer-Reviewed Journal Articles} \begin{enumerate}[leftmargin=*] \item Johnson, S., Smith, J., \& Doe, J. (2023). ``Transformer-based Models for Cross-lingual Understanding.'' \textit{Journal of Artificial Intelligence Research}, 75, 123-145. \item Johnson, S. \& Lee, K. (2022). ``Ethical Considerations in Large Language Models.'' \textit{AI \& Society}, 37(3), 567-582. \item Johnson, S. (2021). ``Attention Mechanisms in Neural Machine Translation: A Survey.'' \textit{Computational Linguistics}, 47(2), 234-267. \end{enumerate} \subsection*{Conference Proceedings} \begin{enumerate}[leftmargin=*, resume] \item Johnson, S., et al. (2023). ``Few-shot Learning for Low-resource Languages.'' In \textit{Proceedings of ACL 2023}, pp. 1234-1245. \item Johnson, S. \& Wang, L. (2022). ``Robust NLP Systems for Domain Adaptation.'' In \textit{Proceedings of NeurIPS 2022}, pp. 567-578. \end{enumerate} \section*{Grants and Funding} \textbf{NSF CAREER Award}, ``Advancing Multilingual NLP,'' \$500,000, 2022--2027 \\ \textit{Role:} Principal Investigator \textbf{Google Faculty Research Award}, ``AI for Social Good,'' \$75,000, 2021 \\ \textit{Role:} Principal Investigator \section*{Teaching Experience} \textbf{University of Excellence} (2019--Present) \begin{itemize}[leftmargin=*] \item CS 521: Machine Learning (Graduate) - Fall 2023, Fall 2022 \item CS 321: Introduction to AI (Undergraduate) - Spring 2023, Spring 2022 \item CS 622: Advanced NLP (Graduate) - Fall 2021 \end{itemize} \section*{Awards and Honors} \begin{itemize}[leftmargin=*] \item Best Paper Award, ACL 2023 \item Outstanding Teaching Award, University of Excellence, 2022 \item MIT Presidential Fellowship, 2014--2018 \end{itemize} \section*{Service} \textbf{Editorial Boards:} Associate Editor, Journal of AI Research (2021--Present) \textbf{Program Committees:} ACL (2020--2023), NeurIPS (2021--2023), ICML (2022--2023) \textbf{University Service:} Graduate Admissions Committee (2020--Present) \section*{Selected Invited Talks} \begin{itemize}[leftmargin=*] \item ``The Future of Multilingual AI,'' Keynote at EMNLP 2023, Singapore \item ``Ethics in NLP,'' Google AI Research, Mountain View, CA, 2022 \item ``Deep Learning for Languages,'' MIT CSAIL Seminar Series, 2021 \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cv-academic.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-cv-academic/page-1.svg) Open zoomable preview: Compiled PDF page 2 from cv-academic.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-cv-academic/page-2.svg)
### Academic resumePhD graduates, postdocs and faculty applying for industry research roles, fellowships or grants that ask for a one-page resume instead of a full CV. It keeps research experience, three selected publications and skills on one page; the [academic CV](#academic-cv) above lists every publication, grant and talk.```latex resume-academic.tex theme=\{null} % Academic Resume Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % A one-page resume for researchers: PhD candidates, postdocs and faculty % applying for industry research roles, fellowships or grants that ask for % a short resume instead of a full academic CV. It keeps research % experience, selected publications and skills on a single page. % Compile with pdfLaTeX. \documentclass[10pt,letterpaper]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=0.7in]{geometry} \usepackage{enumitem} \usepackage{titlesec} \usepackage[hidelinks]{hyperref} \pagestyle{empty} \setlength{\parindent}{0pt} \setlist[itemize]{leftmargin=1.2em, topsep=2pt, itemsep=1pt, parsep=0pt} % Section headings: small caps with a rule underneath \titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\vspace{-0.6em}\rule{\textwidth}{0.4pt}] \titlespacing*{\section}{0pt}{10pt}{6pt} % \entry{Role or degree}{Dates}{Institution}{Location} \newcommand{\entry}[4]{% \textbf{#1}\hfill #2\\ \textit{#3}\hfill \textit{#4}\par} \begin{document} % ============================================ % HEADER - replace with your details % ============================================ \begin{center} {\LARGE\bfseries Dr.\ Maya Okafor}\\[4pt] Postdoctoral Researcher, Atmospheric Chemistry\\[2pt] Denver, CO \,|\, (555) 214-7781 \,|\, \href{mailto:maya.okafor@example.edu}{maya.okafor@example.edu} \,|\, ORCID 0000-0000-0000-0000 \,|\, \href{https://github.com/mokafor-example}{github.com/mokafor-example} \end{center} \section{Summary} Atmospheric chemist with five years of research in aerosol measurement and air-quality modelling. Led field campaigns with a team of six, built the open-source data pipeline used by three partner labs, and published eight peer-reviewed papers. Seeking an applied research role in environmental monitoring. \section{Education} \entry{Ph.D., Atmospheric Science}{2021}{Example State University}{Boulder, CO} Dissertation: \textit{Wildfire smoke ageing and its effect on urban ozone}. Advisor: Prof.\ Daniel Reyes. \smallskip \entry{B.Sc., Chemistry, summa cum laude}{2016}{Example College}{Madison, WI} \section{Research Experience} \entry{Postdoctoral Researcher}{2021 -- present}{Example Air Quality Laboratory}{Denver, CO} \begin{itemize} \item Designed a low-cost sensor network of 40 stations; calibration against reference monitors reduced PM$_{2.5}$ bias from 32\% to 6\%. \item Wrote the Python pipeline that processes 2 million readings a day for three partner laboratories. \item Co-wrote a successful \$420{,}000 proposal for a two-year smoke exposure study. \end{itemize} \smallskip \entry{Graduate Research Assistant}{2016 -- 2021}{Example State University}{Boulder, CO} \begin{itemize} \item Ran four airborne and ground-based field campaigns, including instrument setup, flight planning and data quality control. \item Built a box model of smoke chemistry that reproduced observed ozone within 10\% across 14 smoke events. \end{itemize} \section{Selected Publications} \begin{itemize} \item \textbf{Okafor, M.}, Lin, T., and Reyes, D. (2025). Calibrating low-cost particle sensors in wildfire smoke. \textit{Journal of Atmospheric Measurement}, 18, 2101--2117. \item \textbf{Okafor, M.} and Reyes, D. (2023). Ozone production in aged smoke plumes over urban areas. \textit{Journal of Air Quality Research}, 12, 455--471. \item Patel, S., \textbf{Okafor, M.}, and Chen, W. (2022). An open data pipeline for distributed air-quality networks. \textit{Environmental Data Methods}, 4, 88--102. \end{itemize} Full list of 8 publications: ORCID profile or personal website. \section{Skills} \begin{tabular}{@{}p{0.2\textwidth}p{0.75\textwidth}@{}} \textbf{Methods} & Aerosol mass spectrometry, sensor calibration, chemical box modelling, field campaign design \\ \textbf{Computing} & Python (pandas, xarray), R, SQL, Git, Linux, high-performance computing \\ \textbf{Writing} & Grant proposals, peer review for 5 journals, technical reports for public agencies \\ \end{tabular} \section{Awards and Teaching} \begin{itemize} \item Early Career Researcher Award, Regional Air Quality Conference, 2024 \item Graduate Teaching Fellow, Introduction to Atmospheric Chemistry (3 semesters) \end{itemize} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from resume-academic.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-academic/page-1.svg)
### Minimal resumeAnyone who wants a neutral, single-column structure with placeholders to fill in quickly.```latex resume-minimal.tex theme=\{null} % Minimal Resume Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Clean, no-frills design. ATS-friendly. % Compile with pdfLaTeX. \documentclass[11pt,letterpaper]{article} \usepackage[margin=0.75in]{geometry} \usepackage{enumitem} \usepackage[T1]{fontenc} % No page numbers \pagestyle{empty} % Minimal styling \setlength{\parindent}{0pt} \setlist[itemize]{leftmargin=*, itemsep=0pt, topsep=0pt} \begin{document} % Header \begin{center} {\Large\textbf{Your Name}}\\[2mm] City, State | (555) 123-4567 | email@example.com | linkedin.com/in/yourname \end{center} \vspace{3mm} % Experience \textbf{\large EXPERIENCE} \hrule \vspace{3mm} \textbf{Job Title} \hfill Company Name\\ \textit{Location} \hfill \textit{Month Year -- Present} \begin{itemize} \item Achievement or responsibility with quantifiable results \item Another accomplishment demonstrating your impact \item Key project or initiative you led or contributed to \end{itemize} \vspace{2mm} \textbf{Previous Job Title} \hfill Previous Company\\ \textit{Location} \hfill \textit{Month Year -- Month Year} \begin{itemize} \item Quantifiable achievement showing your impact \item Another accomplishment with specific results \item Relevant experience for target position \end{itemize} \vspace{2mm} \textbf{Earlier Job Title} \hfill Earlier Company\\ \textit{Location} \hfill \textit{Month Year -- Month Year} \begin{itemize} \item Key accomplishment or responsibility \item Another relevant achievement \end{itemize} \vspace{4mm} % Education \textbf{\large EDUCATION} \hrule \vspace{3mm} \textbf{Degree Name} \hfill University Name\\ \textit{Major/Concentration} \hfill \textit{Graduation Year}\\ GPA: X.XX (if notable) | Relevant coursework, honors, or activities \vspace{4mm} % Skills \textbf{\large SKILLS} \hrule \vspace{3mm} \textbf{Technical:} Skill 1, Skill 2, Skill 3, Skill 4, Skill 5\\ \textbf{Tools:} Tool 1, Tool 2, Tool 3, Tool 4\\ \textbf{Languages:} English (Native), Spanish (Fluent) \vspace{4mm} % Projects (Optional) \textbf{\large PROJECTS} \hrule \vspace{3mm} \textbf{Project Name} \hfill \textit{Year}\\ Brief description of the project, technologies used, and your role or accomplishments. \vspace{2mm} \textbf{Another Project} \hfill \textit{Year}\\ Description highlighting key features and your contributions. \vspace{4mm} % Certifications (Optional) \textbf{\large CERTIFICATIONS} \hrule \vspace{3mm} Certification Name -- Issuing Organization \hfill Year\\ Another Certification -- Issuing Organization \hfill Year \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from resume-minimal.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-minimal/page-1.svg)
### Executive resumeSenior managers and executives whose two-page resume leads with an executive summary and key achievements.```latex resume-executive.tex theme=\{null} % Executive Resume Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Professional template for senior positions. % Compile with pdfLaTeX. \documentclass[11pt,letterpaper]{article} \usepackage[margin=0.75in]{geometry} \usepackage{enumitem} \usepackage[T1]{fontenc} \usepackage{xcolor} % Colors \definecolor{darkblue}{RGB}{0,51,102} % No page numbers on first page \pagestyle{plain} \setlength{\parindent}{0pt} \begin{document} % Header \begin{center} {\LARGE\textbf{\color{darkblue}MICHAEL JOHNSON}}\\[3mm] {\large Chief Technology Officer}\\[3mm] San Francisco, CA | (555) 123-4567 | michael.johnson@email.com\\ linkedin.com/in/michaeljohnson | Portfolio: michaeljohnson.com \end{center} \vspace{5mm} % Executive Summary {\large\textbf{\color{darkblue}EXECUTIVE SUMMARY}} \vspace{1mm} \hrule \vspace{3mm} Visionary technology executive with 15+ years of experience driving digital transformation and building high-performing engineering organizations. Proven track record of scaling startups from seed to acquisition and leading enterprise technology initiatives. Expert in cloud architecture, AI/ML, and building products that delight millions of users. \vspace{2mm} \textbf{Key Achievements:} \begin{itemize}[leftmargin=*, itemsep=0pt] \item Led technology strategy for \$500M acquisition by Fortune 100 company \item Built and scaled engineering team from 5 to 150+ across 4 countries \item Launched platform serving 10M+ daily active users with 99.99\% uptime \item Reduced infrastructure costs by \$5M annually through cloud optimization \end{itemize} \vspace{4mm} % Professional Experience {\large\textbf{\color{darkblue}PROFESSIONAL EXPERIENCE}} \vspace{1mm} \hrule \vspace{3mm} \textbf{Chief Technology Officer} \hfill 2020 -- Present\\ \textbf{TechScale Inc.} | San Francisco, CA\\[2mm] Lead technology strategy and engineering operations for Series C startup (\$100M raised). \begin{itemize}[leftmargin=*, itemsep=1pt] \item Architected microservices platform processing 1B+ events daily with sub-100ms latency \item Built engineering organization from 20 to 85 engineers across US and Europe \item Established engineering culture with OKRs, achieving 95\% on-time delivery rate \item Led successful SOC 2 Type II certification and GDPR compliance initiatives \item Implemented AI-powered features increasing user engagement by 45\% \end{itemize} \vspace{3mm} \textbf{VP of Engineering} \hfill 2016 -- 2020\\ \textbf{DataFlow Systems} (Acquired by MegaCorp for \$500M) | Seattle, WA\\[2mm] Directed engineering for enterprise data platform serving Fortune 500 clients. \begin{itemize}[leftmargin=*, itemsep=1pt] \item Grew engineering team from 15 to 80 engineers during hypergrowth phase \item Led technical due diligence process resulting in successful acquisition \item Reduced customer churn by 30\% through platform reliability improvements \item Established data science team delivering \$10M+ annual revenue in new features \end{itemize} \vspace{3mm} \textbf{Senior Engineering Manager} \hfill 2012 -- 2016\\ \textbf{BigTech Corporation} | Mountain View, CA\\[2mm] Managed core platform team for consumer product with 50M+ users. \begin{itemize}[leftmargin=*, itemsep=1pt] \item Led 25-person team across 3 locations delivering critical infrastructure \item Architected real-time messaging system handling 1M+ messages per second \item Mentored 5 engineers promoted to senior and staff levels \end{itemize} \vspace{4mm} % Education & Credentials {\large\textbf{\color{darkblue}EDUCATION \& CREDENTIALS}} \vspace{1mm} \hrule \vspace{3mm} \textbf{Master of Business Administration} | Stanford Graduate School of Business | 2015\\ \textbf{Bachelor of Science, Computer Science} | MIT | 2008 | \textit{Magna Cum Laude} \vspace{2mm} \textbf{Board Positions:} TechStartup Inc. (Advisory Board), Code.org (Technical Advisor)\\ \textbf{Speaking:} AWS re:Invent, Google Cloud Next, TechCrunch Disrupt \vspace{4mm} % Core Competencies {\large\textbf{\color{darkblue}CORE COMPETENCIES}} \vspace{1mm} \hrule \vspace{3mm} \begin{tabular}{@{}p{0.48\textwidth}p{0.48\textwidth}@{}} $\bullet$ Technology Strategy \& Roadmapping & $\bullet$ M\&A Technical Due Diligence \\ $\bullet$ Engineering Organization Building & $\bullet$ Cloud Architecture (AWS, GCP, Azure) \\ $\bullet$ Product Development Leadership & $\bullet$ AI/ML Strategy \& Implementation \\ $\bullet$ Agile Transformation & $\bullet$ Security \& Compliance \\ \end{tabular} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from resume-executive.tex Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-executive/page-1.svg) Open zoomable preview: Compiled PDF page 2 from resume-executive.tex Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-resume-executive/page-2.svg)
### Creative CVDesigners and other creative roles where a colored header, skill bars and selected projects suit the application.```latex cv-creative.tex theme=\{null} % Creative CV Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % For design-oriented and creative roles. % Compile with XeLaTeX or LuaLaTeX for custom fonts. \documentclass[11pt,a4paper]{article} \usepackage[margin=0.6in]{geometry} \usepackage{xcolor} \usepackage{tikz} \usepackage{fontawesome5} \usepackage{enumitem} \usepackage{hyperref} % Colors \definecolor{primary}{RGB}{231,76,60} \definecolor{secondary}{RGB}{52,73,94} \definecolor{lightgray}{RGB}{245,245,245} \definecolor{darkgray}{RGB}{100,100,100} % No page numbers \pagestyle{empty} % Custom section command \newcommand{\cvsection}[1]{% \vspace{4mm}% {\color{primary}\large\textbf{#1}}% \vspace{1mm}% \par% } \begin{document} % Header with background \begin{tikzpicture}[remember picture,overlay] \fill[primary] (current page.north west) rectangle ([yshift=-4cm]current page.north east); \end{tikzpicture} \vspace{-2cm} \begin{center} \color{white} {\Huge\textbf{EMMA CREATIVE}}\\[3mm] {\Large Graphic Designer \& Brand Strategist}\\[3mm] {\small \faPhone\ +1 (555) 987-6543 \quad \faEnvelope\ emma@creative.design \quad \faGlobe\ emmacreative.com }\\[2mm] {\small \faDribbble\ dribbble.com/emma \quad \faBehance\ behance.net/emmacreative \quad \faInstagram\ @emma.creative } \end{center} \vspace{1.5cm} \color{secondary} % Two column layout \noindent \begin{minipage}[t]{0.35\textwidth} \cvsection{ABOUT ME} Creative designer with 8+ years crafting memorable brand experiences. I blend strategic thinking with artistic vision to create designs that connect with audiences and drive business results. \cvsection{EXPERTISE} \textbf{Brand Identity}\\ {\small Logo design, visual systems, brand guidelines} \vspace{2mm} \textbf{Digital Design}\\ {\small Web/app UI, social media, digital ads} \vspace{2mm} \textbf{Print Design}\\ {\small Packaging, editorial, marketing collateral} \vspace{2mm} \textbf{Motion Graphics}\\ {\small Animated logos, video graphics, presentations} \cvsection{TOOLS} \begin{tikzpicture} % Each row sits 0.75cm below the previous one: tool name above, level bar below. \foreach \tool/\level [count=\row from 0] in {Adobe Creative Suite/95, Figma/90, Sketch/85, After Effects/80, Cinema 4D/70} { \node[anchor=south west, inner sep=0pt] at (0,{-0.75*\row}) {\small \tool}; \fill[lightgray] (0,{-0.75*\row-0.25}) rectangle (4,{-0.75*\row-0.1}); \fill[primary] (0,{-0.75*\row-0.25}) rectangle ({4*\level/100},{-0.75*\row-0.1}); } \end{tikzpicture} \cvsection{AWARDS} {\color{primary}\faAward} \textbf{Awwwards SOTD} (2023)\\ {\small Interactive portfolio design} \vspace{2mm} {\color{primary}\faMedal} \textbf{ADC Gold Cube} (2022)\\ {\small Brand identity for TechStartup} \vspace{2mm} {\color{primary}\faTrophy} \textbf{D\&AD Pencil} (2021)\\ {\small Packaging design excellence} \end{minipage} \hfill \begin{minipage}[t]{0.6\textwidth} \cvsection{EXPERIENCE} \textbf{Senior Brand Designer} \hfill 2021 -- Present\\ {\color{darkgray}\textit{Creative Agency NYC}} \begin{itemize}[leftmargin=*, itemsep=0pt, topsep=2pt] \item Lead designer for Fortune 500 clients including Nike, Spotify, and Airbnb \item Developed brand identity systems generating \$2M+ in new business \item Mentored team of 4 junior designers \item Art directed photo shoots and video productions \end{itemize} \vspace{3mm} \textbf{Brand Designer} \hfill 2018 -- 2021\\ {\color{darkgray}\textit{Design Studio Co.}} \begin{itemize}[leftmargin=*, itemsep=0pt, topsep=2pt] \item Created 50+ brand identities for startups and SMBs \item Designed packaging for products sold in 10,000+ retail locations \item Managed client relationships from concept to delivery \end{itemize} \vspace{3mm} \textbf{Junior Designer} \hfill 2016 -- 2018\\ {\color{darkgray}\textit{Boutique Design Firm}} \begin{itemize}[leftmargin=*, itemsep=0pt, topsep=2pt] \item Supported senior designers on major accounts \item Created social media content and digital marketing materials \end{itemize} \cvsection{EDUCATION} \textbf{BFA Graphic Design}\\ {\color{darkgray}Rhode Island School of Design | 2016}\\ {\small Cum Laude | Dean's List all semesters} \cvsection{SELECTED PROJECTS} \begin{tikzpicture} \node[fill=lightgray, rounded corners, inner sep=8pt] at (0,0) { \begin{minipage}{0.9\textwidth} \textbf{TechStartup Rebrand} {\color{darkgray}| 2023}\\ {\small Complete brand overhaul increasing brand recognition by 200\%} \end{minipage} }; \end{tikzpicture} \vspace{2mm} \begin{tikzpicture} \node[fill=lightgray, rounded corners, inner sep=8pt] at (0,0) { \begin{minipage}{0.9\textwidth} \textbf{Eco Packaging Line} {\color{darkgray}| 2022}\\ {\small Sustainable packaging design for organic food brand} \end{minipage} }; \end{tikzpicture} \vspace{2mm} \begin{tikzpicture} \node[fill=lightgray, rounded corners, inner sep=8pt] at (0,0) { \begin{minipage}{0.9\textwidth} \textbf{Music Festival Identity} {\color{darkgray}| 2021}\\ {\small Visual identity for 50,000+ attendee annual festival} \end{minipage} }; \end{tikzpicture} \end{minipage} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from cv-creative.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-cv-creative/page-1.svg)
## Customization Tips### Color Schemes```latex colors.tex theme=\{null} % For moderncv \moderncvcolor{blue} % Professional \moderncvcolor{green} % Fresh \moderncvcolor{orange} % Creative \moderncvcolor{red} % Bold % Custom colors \definecolor{customblue}{RGB}{0,102,204} \definecolor{customgray}{RGB}{100,100,100} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Font Options```latex fonts.tex theme=\{null} % Modern fonts \usepackage{lmodern} \usepackage{helvet} % Helvetica \usepackage{charter} % Charter % Sans-serif for modern look \renewcommand{\familydefault}{\sfdefault} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Adding Icons```latex icons.tex theme=\{null} \usepackage{fontawesome5} % Usage examples \faPhone\ (555) 123-4567 \faEnvelope\ email@example.com \faLinkedin\ linkedin.com/in/yourname \faGithub\ github.com/yourname \faGlobe\ www.yourwebsite.com ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## ATS Optimization Tips> [!WARNING] > > **Essential for ATS Compatibility:** > > * Use standard section headings (Experience, Education, Skills) > * Avoid tables, columns, or complex formatting for main content > * Use standard fonts (Arial, Times New Roman, Calibri) > * Save as .docx after creating PDF for online applications > * Include keywords from job description### Keyword Optimization```latex example.tex theme=\{null} % Include relevant keywords naturally \section{Technical Skills} \begin{itemize} \item Programming: Python (Expert), Java (Proficient), SQL (Proficient) \item Frameworks: Django, React, Spring Boot \item Tools: Git, Docker, Kubernetes, AWS \end{itemize} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from example.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/templates-cv-07/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=templates_cv)## Design Variations- Use the [Modern CV](#modern-cv) for a polished multi-section profile. - Use the [Classic one-page resume](#classic-one-page-resume) or the [Minimal resume](#minimal-resume) for concise applications and ATS-friendly scanning. - Use the [Tech resume](#tech-resume) or the [Executive resume](#executive-resume) when skills or leadership results lead the application. - Use the [Academic CV](#academic-cv) for publications, appointments, and research experience. - Use the [Two-column CV](#two-column-cv) or the [Creative CV](#creative-cv) when people, not parsing software, read the first version.Start with the closest structure, copy its complete code block, and adapt typography only after the content is complete.## Best Practices> [!TIP] > > **Content Tips:** > > 1. **Quantify achievements**: Use numbers and percentages > 2. **Action verbs**: Start bullets with strong verbs (Led, Developed, Increased) > 3. **Relevance**: Tailor content to each job application > 4. **Consistency**: Use consistent formatting and tense > 5. **Proofread**: Zero tolerance for typos in CVs/resumes### Length Guidelines- **Entry Level**: 1 page maximum - **Mid-Career**: 1-2 pages - **Senior/Executive**: 2-3 pages - **Academic CV**: No limit (include all publications)### Section Order1) **Contact Information** 2) **Summary/Objective** (optional) 3) **Experience** (or Education if recent grad) 4) **Education** 5) **Skills** 6) **Additional Sections** (Certifications, Projects, etc.)## Compilation Tips```bash theme=\{null} # Basic compilation pdflatex cv.tex # For moderncv (compile twice) pdflatex cv.tex pdflatex cv.tex # With bibliography pdflatex cv.tex bibtex cv pdflatex cv.tex pdflatex cv.tex ```## Related Resources- [Article Template](/templates/article) - For academic publications - [Thesis Template](/templates/thesis) - For dissertations - [CV/Resume Guide](/learn/latex/how-to/cv-resume) - Tips for writing effective CVs***> [!NOTE] > > **Remember**: Your CV/resume is a marketing document, not an autobiography. Focus on achievements and value you bring to employers.Ready to create your perfect CV or resume? Choose a template above and customize it to highlight your unique qualifications! # Presentation Templates Source: https://resources.latex-cloud-studio.com/templates/presentation Professional LaTeX Beamer templates for academic presentations, conference talks, and lectures. Ready-to-use presentation templates. Create stunning presentations with LaTeX Beamer. These templates provide professional slides for academic talks, conference presentations, and lectures.## Presentation template gallery[![Title slide of the basic Beamer presentation in the Madrid theme, compiled with pdfLaTeX: blue title bar with presentation title and subtitle, author, institute and date.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-presentation-basic/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=a66e3034fbb1481cc41eb236962e9f0e)](#basic-academic-presentation)Basic academic presentationSeminar talks, lectures and progress reports that need a title slide, an outline and simple content frames.[Open in editor](https://app.latex-cloud-studio.com/start?template=presentation-basic\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=presentation-basic)[View source](#basic-academic-presentation)[![Title slide of the conference Beamer presentation in the CambridgeUS theme with the beaver color theme, compiled with pdfLaTeX: paper title, two authors, university and conference name.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-presentation-conference/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=e25a233f0f5cc52d311698339ecc23c8)](#conference-talk)Conference talkTimed conference talks that present the motivation, method, results and conclusion of one paper.[Open in editor](https://app.latex-cloud-studio.com/start?template=presentation-conference\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=presentation-conference)[View source](#conference-talk)> [!NOTE] > > **Quick start**: Pick a template in the gallery and select **Open in editor**, or copy its complete source from [Template source code](#template-source-code).## Choose This Template When- You need Beamer slides for a class, seminar, defense, or conference talk - You want a working slide structure with title, agenda, content, and results sections - You prefer adapting a complete deck instead of assembling frames one by one## Start in LaTeX Cloud Studio> [card] Open the Editor > > Paste the Beamer file into the editor, compile it, and replace the title and first three frames before changing the theme.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=template_presentation_open_editor)> [card] Presentation Workflow Guide > > Use the full guide for Beamer structure, slide pacing, and talk-specific editing decisions.[Open](/learn/latex/how-to/presentations)## How to Adapt for Talks1) Select a theme that matches your audience (course, internal review, conference). 2) Keep one core message per slide and reduce text density. 3) Move long equations and proofs to backup slides. 4) Add charts and diagrams early with [Plotting with pgfplots](/learn/latex/figures/plotting-with-pgfplots) and [TikZ diagrams](/learn/latex/how-to/tikz-diagrams). 5) Use the presentation workflow guide: [How to create presentations](/learn/latex/how-to/presentations).## Template source codeEach block below is the complete template. The preview above is page 1 of the PDF that the pinned TeX Live 2026 environment compiles from this exact source; expand the rendered output to see every page.### Basic academic presentationSeminar talks, lectures and progress reports that need a title slide, an outline and simple content frames.```latex presentation-basic.tex theme=\{null} \documentclass[aspectratio=169]{beamer} \usetheme{Madrid} \usecolortheme{default} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,graphicx} \title{Your Presentation Title} \subtitle{Project Update} \author{Your Name} \institute{Your Team or Institution} \date{\today} \setbeamertemplate{footline}[frame number] \begin{document} \frame{\titlepage} \begin{frame}{Outline} \tableofcontents \end{frame} \section{Introduction} \begin{frame}{Context} \begin{itemize} \item Problem statement \item Why this matters \item What changed since last review \end{itemize} \end{frame} \section{Results} \begin{frame}{Key Results} \begin{itemize} \item Metric A improved by 18\% \item Latency reduced by 22\% \item Error rate down to 1.1\% \end{itemize} \end{frame} \section{Next Steps} \begin{frame}{Plan} \begin{enumerate} \item Stabilize release candidate \item Expand test coverage \item Roll out to production \end{enumerate} \end{frame} \begin{frame}{Q\&A} \centering \Large Thank you \end{frame} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from presentation-basic.tex Page 1 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-basic/page-1.svg) Open zoomable preview: Compiled PDF page 2 from presentation-basic.tex Page 2 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-basic/page-2.svg) Open zoomable preview: Compiled PDF page 3 from presentation-basic.tex Page 3 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-basic/page-3.svg) Open zoomable preview: Compiled PDF page 4 from presentation-basic.tex Page 4 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-basic/page-4.svg) Open zoomable preview: Compiled PDF page 5 from presentation-basic.tex Page 5 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-basic/page-5.svg) Open zoomable preview: Compiled PDF page 6 from presentation-basic.tex Page 6 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-basic/page-6.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?template=presentation-basic\&utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=templates_presentation)### Conference talkTimed conference talks that present the motivation, method, results and conclusion of one paper.```latex presentation-conference.tex theme=\{null} \documentclass[aspectratio=169]{beamer} \usetheme{CambridgeUS} \usecolortheme{beaver} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,booktabs,graphicx} \title{Conference Paper Title} \author{Author One \and Author Two} \institute{University Name} \date{Conference 2026} \begin{document} \frame{\titlepage} \begin{frame}{Contributions} \begin{itemize} \item New method for structured document generation \item Better quality-speed tradeoff than baseline \item Public reproducible implementation \end{itemize} \end{frame} \begin{frame}{Method} \begin{equation*} \hat{y} = f_\theta(x, c) \end{equation*} \begin{itemize} \item Context-aware objective \item Lightweight inference path \item Robust evaluation protocol \end{itemize} \end{frame} \begin{frame}{Results} \begin{table} \centering \begin{tabular}{lcc} \toprule Method & Accuracy & Runtime \\ \midrule Baseline & 91.2\% & 1.00x \\ Proposed & 94.8\% & 0.82x \\ \bottomrule \end{tabular} \end{table} \end{frame} \begin{frame}{Conclusion} \begin{itemize} \item Improved quality and efficiency \item Works across multiple domains \item Future work: online adaptation \end{itemize} \end{frame} \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from presentation-conference.tex Page 1 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-conference/page-1.svg) Open zoomable preview: Compiled PDF page 2 from presentation-conference.tex Page 2 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-conference/page-2.svg) Open zoomable preview: Compiled PDF page 3 from presentation-conference.tex Page 3 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-conference/page-3.svg) Open zoomable preview: Compiled PDF page 4 from presentation-conference.tex Page 4 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-conference/page-4.svg) Open zoomable preview: Compiled PDF page 5 from presentation-conference.tex Page 5 of 5. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-presentation-conference/page-5.svg)
## Lecture Slides TemplateDesigned for educational presentations and lectures.```latex lecture-slides.tex theme=\{null} \documentclass[aspectratio=43,12pt]{beamer} % Educational theme \usetheme{Warsaw} \usecolortheme{beaver} % Packages \usepackage[utf8]{inputenc} \usepackage{amsmath,amsfonts,amssymb} \usepackage{graphicx} \usepackage{enumerate} \usepackage{listings} % Code listing setup \lstset{ basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green!60!black}, numbers=left, numberstyle=\tiny, frame=single } % Course information \title{Lecture Topic: Advanced Concepts} \subtitle{Course Name - Week X} \author{Professor Name} \institute{University Name\\Department} \date{Academic Year} \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame}{Today's Agenda} \tableofcontents \end{frame} \section{Learning Objectives} \begin{frame}{What You'll Learn Today} By the end of this lecture, you will be able to: \begin{enumerate} \item Understand the core concepts of [topic] \item Apply [method] to solve problems \item Analyze [specific cases] \item Evaluate the effectiveness of different approaches \end{enumerate} \vspace{1em} \begin{center} \textbf{Active participation encouraged!} \end{center} \end{frame} \section{Review} \begin{frame}{Quick Review: Previous Lecture} \begin{itemize} \item<1-> Key concept 1: [Brief reminder] \item<2-> Key concept 2: [Brief reminder] \item<3-> Important formula: $E = mc^2$ \item<4-> Practical application: [Example] \end{itemize} \onslide<5->{ \begin{block}{Question} Can anyone recall why this matters for today's topic? \end{block} } \end{frame} \section{New Material} \begin{frame}{Core Concept: [Topic Name]} \begin{definition} A [concept] is defined as [formal definition]. \end{definition} \begin{example} Consider the case where [specific example]: \begin{equation} f(x) = ax^2 + bx + c \end{equation} Here we can see that [explanation]. \end{example} \end{frame} \begin{frame}{Step-by-Step Process} \begin{enumerate} \item<1-> \textbf{Step 1}: Identify the problem type \begin{itemize} \item<2-> Look for key indicators \item<2-> Check boundary conditions \end{itemize} \item<3-> \textbf{Step 2}: Apply the appropriate method \begin{itemize} \item<4-> Use formula X for case A \item<4-> Use formula Y for case B \end{itemize} \item<5-> \textbf{Step 3}: Verify the solution \begin{itemize} \item<6-> Check units and reasonableness \item<6-> Compare with known results \end{itemize} \end{enumerate} \end{frame} \begin{frame}[fragile]{Code Example} \begin{lstlisting}[language=Python] def solve_problem(data): """ Solve the problem using our method """ # Step 1: Preprocess data processed = preprocess(data) # Step 2: Apply algorithm result = algorithm(processed) # Step 3: Post-process final_result = postprocess(result) return final_result \end{lstlisting} \begin{itemize} \item Clean, modular code structure \item Each step clearly separated \item Easy to debug and modify \end{itemize} \end{frame} \section{Examples} \begin{frame}{Worked Example 1} \textbf{Problem}: Given [specific problem statement] \pause \textbf{Solution}: \begin{align} \text{Step 1: } & \quad [mathematical step] \\ \text{Step 2: } & \quad [mathematical step] \\ \text{Step 3: } & \quad [final result] \end{align} \pause \begin{alertblock}{Key Insight} Notice how we used [specific technique] to simplify the problem. \end{alertblock} \end{frame} \begin{frame}{Your Turn: Practice Problem} \begin{block}{Problem} Try to solve: [problem statement] \end{block} \vspace{1em} Take 3 minutes to work on this individually, then we'll discuss solutions. \pause \vspace{1em} \begin{center} \textit{[Time for student work]} \end{center} \pause Who would like to share their approach? \end{frame} \section{Applications} \begin{frame}{Real-World Applications} \begin{columns} \begin{column}{0.5\textwidth} \textbf{Industry Applications:} \begin{itemize} \item Manufacturing optimization \item Financial modeling \item Medical diagnostics \item Environmental monitoring \end{itemize} \end{column} \begin{column}{0.5\textwidth} \textbf{Research Applications:} \begin{itemize} \item Scientific computing \item Data analysis \item Machine learning \item Simulation studies \end{itemize} \end{column} \end{columns} \vspace{1em} \begin{exampleblock}{Case Study} Company X used this approach to improve efficiency by 30\%. \end{exampleblock} \end{frame} \section{Summary} \begin{frame}{Key Takeaways} \begin{enumerate} \item \textbf{Concept}: [Main concept learned] \item \textbf{Method}: [Primary method or technique] \item \textbf{Application}: [How to apply it] \item \textbf{Benefits}: [Why it's useful] \end{enumerate} \vspace{1em} \begin{center} \textbf{Remember}: Practice makes perfect! \end{center} \end{frame} \begin{frame}{Next Week} \begin{itemize} \item Reading assignment: Chapter X, sections Y-Z \item Problem set due: Friday by 5 PM \item Next topic: [Preview of next lecture] \end{itemize} \vspace{1em} \begin{block}{Office Hours} Available for questions: \begin{itemize} \item Tuesday 2-4 PM \item Thursday 10-12 PM \item By appointment \end{itemize} \end{block} \end{frame} \begin{frame}[standout] Questions? \vspace{2em} Thank you for your attention! \end{frame} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Template Features> [!TIP] > > **Presentation tips:** > > 1. **Keep slides simple** - Maximum 6-7 bullet points per slide > 2. **Use visual hierarchy** - Important points should stand out > 3. **Include animations sparingly** - Use `\pause` and `\onslide` for emphasis > 4. **Prepare backup slides** - Use `\appendix` for additional material > 5. **Practice timing** - Academic talks: 1-2 minutes per slide## Customization Options### Themes and Colors```latex themes.tex theme=\{null} % Popular themes \usetheme{Madrid} % Professional \usetheme{Berlin} % Academic \usetheme{metropolis} % Modern (requires package) \usetheme{Frankfurt} % Compact % Color themes \usecolortheme{default} \usecolortheme{beaver} % Red \usecolortheme{dolphin} % Blue \usecolortheme{orchid} % Purple % Custom colors \definecolor{mycolor}{RGB}{25,25,112} \setbeamercolor{structure}{fg=mycolor} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Aspect Ratios```latex aspect-ratios.tex theme=\{null} % 16:9 widescreen (modern projectors) \documentclass[aspectratio=169]{beamer} % 4:3 traditional (older projectors) \documentclass[aspectratio=43]{beamer} % 16:10 (some laptops) \documentclass[aspectratio=1610]{beamer} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.\
### Advanced Features```latex advanced.tex theme=\{null} % Progress bar \usepackage{tikz} \setbeamertemplate{headline}{ \begin{beamercolorbox}[wd=\paperwidth,ht=4pt,dp=0pt]{structure} \pgfmathsetmacro{\progress}{\insertframenumber/\inserttotalframenumber} \begin{tikzpicture}[overlay,remember picture] \fill[structure.fg] (0,0) rectangle (\progress\paperwidth,4pt); \end{tikzpicture} \end{beamercolorbox} } % Custom footline \setbeamertemplate{footline}{ \hfill\insertframenumber/\inserttotalframenumber\hspace{1em}\vspace{1em} } ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Quick Reference### Essential Commands| Command | Purpose | Example | | - | - | - | | `\frame{}` | Create slide | `\frame{\titlepage}` | | `\begin{frame}{Title}` | Frame with title | `\begin{frame}{Introduction}` | | `\pause` | Pause between items | `Item 1 \pause Item 2` | | `\onslide<2->{}` | Show from slide 2 | `\onslide<2->{Text}` | | `\only<1>{}` | Show only on slide 1 | `\only<1>{Special text}` |### Blocks and Environments```latex blocks.tex theme=\{null} % Information blocks \begin{block}{Title} Content goes here \end{block} \begin{alertblock}{Warning} Important information \end{alertblock} \begin{exampleblock}{Example} Example content \end{exampleblock} % Columns \begin{columns} \begin{column}{0.5\textwidth} Left column \end{column} \begin{column}{0.5\textwidth} Right column \end{column} \end{columns} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
***> [!NOTE] > > **Next**: Create professional [CV templates](/templates/cv) for resumes and academic CVs, or explore [Article templates](/templates/article) for academic writing. # LaTeX Thesis & Dissertation Template Source: https://resources.latex-cloud-studio.com/templates/thesis Comprehensive LaTeX templates for PhD dissertations and Master's theses. Includes all necessary components for academic submissions. Professional templates for writing your thesis or dissertation. These templates comply with most university requirements and include all necessary components for a complete academic document.## Thesis template gallery[![Title page of the master's thesis template compiled with pdfLaTeX: thesis title, Master of Science degree statement, field of study, author, department and date.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-thesis-masters/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=167cfd0832f87bb3ba1aefc818dcc2fb)](#master-of-science-thesis)Master of Science thesisMaster's students who need front matter, chapters, theorem environments and appendices in a report-class thesis.[Open in editor](https://app.latex-cloud-studio.com/start?template=thesis-masters\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=thesis-masters)[View source](#master-of-science-thesis)[![Title page of the PhD dissertation template compiled with pdfLaTeX: dissertation title and subtitle, degree statement for a Doctor of Philosophy, university name, author and date.](https://mintcdn.com/hirox-6fc9e3ca/-rDYEjRIqX7WmKq3/images/rendered/template-dissertation/page-1.svg?fit=max\&auto=format\&n=-rDYEjRIqX7WmKq3\&q=85\&s=3f336425187c0899efe6b4efbb282f11)](#phd-dissertation)PhD dissertationDoctoral candidates writing a book-length dissertation with front matter, many chapters and appendices.[Open in editor](https://app.latex-cloud-studio.com/start?template=dissertation\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=dissertation)[View source](#phd-dissertation)[![Title page of the undergraduate thesis template compiled with pdfLaTeX: university and department, thesis title, Bachelor of Science statement, author, student ID, supervisor and date.](https://mintcdn.com/hirox-6fc9e3ca/zMNSdjyym5zNBpdB/images/rendered/template-thesis-undergrad/page-1.svg?fit=max\&auto=format\&n=zMNSdjyym5zNBpdB\&q=85\&s=adb4e1009da94d4ae1e07638c1e49310)](#undergraduate-thesis)Undergraduate thesisBachelor's theses and capstone projects that need a title page, contents and sections but no chapters.[Open in editor](https://app.latex-cloud-studio.com/start?template=thesis-undergrad\&utm_source=resources\&utm_medium=template_gallery\&utm_campaign=docs_templates\&utm_content=thesis-undergrad)[View source](#undergraduate-thesis)> [!NOTE] > > **Quick start**: Pick a template in the gallery and select **Open in editor**, or copy its complete source from [Template source code](#template-source-code).## Choose This Template When- You need chapters, front matter, appendices, and a long-document structure - Your department expects a thesis or dissertation layout instead of a short article format - You want a starting point for bibliography, lists of figures, and large-project organization## Start in LaTeX Cloud Studio> [card] Open the Editor > > Start with the thesis file, compile early, and adjust title page, margins, and bibliography settings first.[Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=template_thesis_open_editor)> [card] Large Document Workflow > > Use the large-document guide when you split chapters, references, and appendices across files.[Open](/learn/latex/how-to/large-documents)## How to Adapt for Your University1) Check your official thesis formatting guide first. 2) Set margin, line spacing, and front matter requirements in the preamble. 3) Align chapter naming and numbering with department policy. 4) Choose bibliography rules early using the [Bibliography hub](/learn/latex/bibliography). 5) Use structure guides for large projects from the [Document Structure hub](/learn/latex/document-structure) and [Managing large documents](/learn/latex/how-to/large-documents).## Template source codeEach block below is the complete template. The preview above is page 1 of the PDF that the pinned TeX Live 2026 environment compiles from this exact source; expand the rendered output to see every page.### Master of Science thesisMaster's students who need front matter, chapters, theorem environments and appendices in a report-class thesis.```latex thesis-masters.tex theme=\{null} % Master's Thesis Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Template for Master's degree theses. % Compile with pdfLaTeX. \documentclass[12pt,a4paper]{report} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,amsthm} \usepackage{graphicx} \usepackage{hyperref} \usepackage[margin=1.25in]{geometry} \usepackage{setspace} % Line spacing \onehalfspacing % Theorem environments \theoremstyle{plain} \newtheorem{theorem}{Theorem}[chapter] \newtheorem{lemma}[theorem]{Lemma} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \begin{document} % ============================================ % TITLE PAGE % ============================================ \begin{titlepage} \begin{center} \vspace*{1cm} \textbf{\LARGE Title of Your Thesis} \vspace{1.5cm} A Thesis\\ Submitted in Partial Fulfillment of the Requirements\\ for the Degree of\\ \textbf{Master of Science}\\ in\\ \textbf{Your Field of Study} \vfill by\\ \textbf{Your Full Name} \vspace{1cm} Department of Your Department\\ University Name\\ Month Year \end{center} \end{titlepage} % ============================================ % ABSTRACT % ============================================ \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract} Write your abstract here (150-300 words). Summarize your research problem, methodology, key findings, and conclusions. \textbf{Keywords:} keyword1, keyword2, keyword3 % ============================================ % ACKNOWLEDGMENTS % ============================================ \chapter*{Acknowledgments} \addcontentsline{toc}{chapter}{Acknowledgments} I would like to thank my supervisor, Professor Name, for guidance and support throughout this project. % ============================================ % TABLE OF CONTENTS % ============================================ \tableofcontents \listoffigures \listoftables % ============================================ % MAIN CONTENT % ============================================ \chapter{Introduction} \label{ch:intro} \section{Background} Provide context for your research topic. \section{Problem Statement} Define the specific problem you are addressing. \section{Objectives} \begin{enumerate} \item Objective 1 \item Objective 2 \item Objective 3 \end{enumerate} \section{Thesis Structure} Describe how your thesis is organized. \chapter{Literature Review} \label{ch:lit} \section{Theoretical Framework} Review relevant theories and concepts. \section{Previous Research} Discuss related work in the field. \chapter{Methodology} \label{ch:method} \section{Research Design} Describe your approach. \section{Data Collection} Explain how data was gathered. \section{Analysis Methods} Detail your analytical techniques. \chapter{Results} \label{ch:results} \section{Main Findings} Present your results with figures and tables. \begin{table}[h] \centering \caption{Summary of results} \begin{tabular}{|l|c|c|} \hline \textbf{Measure} & \textbf{Before} & \textbf{After} \\ \hline Metric 1 & 50\% & 75\% \\ Metric 2 & 60\% & 85\% \\ \hline \end{tabular} \end{table} \chapter{Discussion} \label{ch:discuss} \section{Interpretation} Explain what your results mean. \section{Limitations} Acknowledge the limitations of your study. \chapter{Conclusion} \label{ch:conclude} \section{Summary} Summarize your key findings. \section{Recommendations} Provide recommendations based on your research. \section{Future Work} Suggest directions for future research. % ============================================ % BIBLIOGRAPHY % ============================================ \begin{thebibliography}{99} \addcontentsline{toc}{chapter}{References} \bibitem{ref1} Author, A. (2023). Title of article. \textit{Journal Name}, 10(2), 100-120. \bibitem{ref2} Writer, B. (2022). \textit{Book Title}. Publisher. \end{thebibliography} % ============================================ % APPENDICES % ============================================ \appendix \chapter{Additional Data} Include supplementary materials here. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from thesis-masters.tex Page 1 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-1.svg) Open zoomable preview: Compiled PDF page 2 from thesis-masters.tex Page 2 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-2.svg) Open zoomable preview: Compiled PDF page 3 from thesis-masters.tex Page 3 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-3.svg) Open zoomable preview: Compiled PDF page 4 from thesis-masters.tex Page 4 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-4.svg) Open zoomable preview: Compiled PDF page 5 from thesis-masters.tex Page 5 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-5.svg) Open zoomable preview: Compiled PDF page 6 from thesis-masters.tex Page 6 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-6.svg) Open zoomable preview: Compiled PDF page 7 from thesis-masters.tex Page 7 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-7.svg) Open zoomable preview: Compiled PDF page 8 from thesis-masters.tex Page 8 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-8.svg) Open zoomable preview: Compiled PDF page 9 from thesis-masters.tex Page 9 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-9.svg) Open zoomable preview: Compiled PDF page 10 from thesis-masters.tex Page 10 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-10.svg) Open zoomable preview: Compiled PDF page 11 from thesis-masters.tex Page 11 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-11.svg) Open zoomable preview: Compiled PDF page 12 from thesis-masters.tex Page 12 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-12.svg) Open zoomable preview: Compiled PDF page 13 from thesis-masters.tex Page 13 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-13.svg) Open zoomable preview: Compiled PDF page 14 from thesis-masters.tex Page 14 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-14.svg) Open zoomable preview: Compiled PDF page 15 from thesis-masters.tex Page 15 of 15. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-masters/page-15.svg)
### PhD dissertationDoctoral candidates writing a book-length dissertation with front matter, many chapters and appendices.```latex dissertation.tex theme=\{null} % PhD Dissertation Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Comprehensive template for doctoral dissertations. % Compile with pdfLaTeX. Run BibTeX/Biber for bibliography. \documentclass[12pt,oneside]{book} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,amsthm} \usepackage{graphicx} \usepackage{hyperref} \usepackage[margin=1.5in]{geometry} \usepackage{setspace} \usepackage{tocloft} \usepackage{appendix} % Line spacing (double spacing for most universities) \doublespacing % Chapter title formatting \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge} \titlespacing*{\chapter}{0pt}{0pt}{40pt} % Theorem environments \theoremstyle{plain} \newtheorem{theorem}{Theorem}[chapter] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \begin{document} % ============================================ % TITLE PAGE % ============================================ \begin{titlepage} \begin{center} \vspace*{1cm} \textbf{\LARGE Title of Your Dissertation}\\ \vspace{0.5cm} \large Subtitle if Applicable \vfill A Dissertation\\ Presented to the Faculty of the Graduate School\\ of\\ \textbf{University Name}\\ in Partial Fulfillment\\ of the Requirements for the Degree\\ \textbf{Doctor of Philosophy} \vfill by\\ \textbf{Your Full Name}\\ Month Year \end{center} \end{titlepage} % ============================================ % COPYRIGHT PAGE % ============================================ \clearpage \thispagestyle{empty} \vspace*{\fill} \begin{center} Copyright \copyright\ 2024 by Your Name\\ All Rights Reserved \end{center} \vspace*{\fill} \clearpage % ============================================ % ABSTRACT % ============================================ \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract} This abstract should summarize your entire dissertation in 150-350 words. Include the research problem, methodology, key findings, and main conclusions. \textbf{Keywords:} keyword1, keyword2, keyword3, keyword4, keyword5 % ============================================ % DEDICATION % ============================================ \chapter*{Dedication} \addcontentsline{toc}{chapter}{Dedication} \begin{center} \textit{To my family, for their unwavering support} \end{center} % ============================================ % ACKNOWLEDGMENTS % ============================================ \chapter*{Acknowledgments} \addcontentsline{toc}{chapter}{Acknowledgments} I would like to express my deepest gratitude to my advisor, Professor Name, for invaluable guidance throughout this journey. % ============================================ % TABLE OF CONTENTS % ============================================ \tableofcontents \listoffigures \addcontentsline{toc}{chapter}{List of Figures} \listoftables \addcontentsline{toc}{chapter}{List of Tables} % ============================================ % MAIN CONTENT % ============================================ \mainmatter \chapter{Introduction} \label{ch:introduction} \section{Background and Motivation} Begin with the broader context of your research area. \section{Problem Statement} Clearly define the specific problem your dissertation addresses. \section{Research Questions} \begin{enumerate} \item Research Question 1 \item Research Question 2 \item Research Question 3 \end{enumerate} \section{Contributions} \begin{itemize} \item \textbf{Contribution 1}: Brief description \item \textbf{Contribution 2}: Brief description \item \textbf{Contribution 3}: Brief description \end{itemize} \section{Dissertation Organization} Chapter \ref{ch:literature} reviews relevant literature... \chapter{Literature Review} \label{ch:literature} \section{Theoretical Background} Review fundamental theories and concepts. \section{Related Work} Discuss how others have approached similar problems. \chapter{Methodology} \label{ch:methodology} \section{Research Design} Describe your overall research approach. \section{Theoretical Framework} Present any theoretical models you've developed. \begin{definition} A \emph{key concept} is defined as... \end{definition} \begin{theorem} Under conditions X and Y, the following holds... \end{theorem} \begin{proof} We proceed by induction... \end{proof} \chapter{Results} \label{ch:results} \section{Experimental Setup} Describe your experimental environment and parameters. \section{Main Results} Present your findings with figures and tables. \begin{table}[h] \centering \caption{Comparison of different approaches} \label{tab:comparison} \begin{tabular}{|l|c|c|c|} \hline \textbf{Method} & \textbf{Metric 1} & \textbf{Metric 2} & \textbf{Metric 3} \\ \hline Baseline & 0.75 & 0.82 & 0.69 \\ Our Method & \textbf{0.89} & \textbf{0.91} & \textbf{0.85} \\ \hline \end{tabular} \end{table} \chapter{Discussion} \label{ch:discussion} \section{Interpretation of Results} Explain what your results mean. \section{Limitations} Honestly discuss the limitations of your study. \chapter{Conclusion} \label{ch:conclusion} \section{Summary of Contributions} Recapitulate your main contributions. \section{Future Work} Suggest directions for future research. % ============================================ % BIBLIOGRAPHY % ============================================ \begin{thebibliography}{99} \addcontentsline{toc}{chapter}{References} \bibitem{author2023} Author, A. B. (2023). \textit{Title of the Article}. Journal Name, 42(3), 123-145. \bibitem{book2022} Writer, C. D. (2022). \textit{Book Title}. Publisher Name. \end{thebibliography} % ============================================ % APPENDICES % ============================================ \appendix \chapter{Additional Proofs} \label{app:proofs} Include lengthy mathematical proofs here. \chapter{Implementation Details} \label{app:implementation} Provide code snippets or technical details. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from dissertation.tex Page 1 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-1.svg) Open zoomable preview: Compiled PDF page 2 from dissertation.tex Page 2 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-2.svg) Open zoomable preview: Compiled PDF page 3 from dissertation.tex Page 3 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-3.svg) Open zoomable preview: Compiled PDF page 4 from dissertation.tex Page 4 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-4.svg) Open zoomable preview: Compiled PDF page 5 from dissertation.tex Page 5 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-5.svg) Open zoomable preview: Compiled PDF page 6 from dissertation.tex Page 6 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-6.svg) Open zoomable preview: Compiled PDF page 7 from dissertation.tex Page 7 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-7.svg) Open zoomable preview: Compiled PDF page 8 from dissertation.tex Page 8 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-8.svg) Open zoomable preview: Compiled PDF page 9 from dissertation.tex Page 9 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-9.svg) Open zoomable preview: Compiled PDF page 10 from dissertation.tex Page 10 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-10.svg) Open zoomable preview: Compiled PDF page 11 from dissertation.tex Page 11 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-11.svg) Open zoomable preview: Compiled PDF page 12 from dissertation.tex Page 12 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-12.svg) Open zoomable preview: Compiled PDF page 13 from dissertation.tex Page 13 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-13.svg) Open zoomable preview: Compiled PDF page 14 from dissertation.tex Page 14 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-14.svg) Open zoomable preview: Compiled PDF page 15 from dissertation.tex Page 15 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-15.svg) Open zoomable preview: Compiled PDF page 16 from dissertation.tex Page 16 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-16.svg) Open zoomable preview: Compiled PDF page 17 from dissertation.tex Page 17 of 17. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-dissertation/page-17.svg)
### Undergraduate thesisBachelor's theses and capstone projects that need a title page, contents and sections but no chapters.```latex thesis-undergrad.tex theme=\{null} % Undergraduate Thesis Template % LaTeX Cloud Studio - https://www.latex-cloud-studio.com % % Simple template for undergraduate research projects. % Compile with pdfLaTeX. \documentclass[12pt,a4paper]{article} % Essential packages \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb} \usepackage{graphicx} \usepackage{hyperref} \usepackage[margin=1in]{geometry} \usepackage{setspace} \usepackage{fancyhdr} % Line spacing \onehalfspacing % Header setup \pagestyle{fancy} \fancyhf{} \fancyhead[R]{\thepage} \renewcommand{\headrulewidth}{0pt} \begin{document} % ============================================ % TITLE PAGE % ============================================ \begin{titlepage} \begin{center} \vspace*{2cm} {\Large\textbf{UNIVERSITY NAME}}\\ \vspace{0.5cm} {\large Department of Your Department} \vspace{2cm} {\LARGE\textbf{Title of Your Undergraduate Thesis}} \vspace{2cm} A Thesis Submitted in Partial Fulfillment\\ of the Requirements for the Degree of\\ \textbf{Bachelor of Science}\\ in\\ \textbf{Your Major} \vfill by\\ \textbf{Your Full Name}\\ Student ID: 12345678 \vspace{1cm} Supervisor: Professor Name \vspace{1cm} Month Year \end{center} \end{titlepage} % ============================================ % ABSTRACT % ============================================ \newpage \section*{Abstract} \addcontentsline{toc}{section}{Abstract} Write your abstract here (200-300 words). Briefly describe your research question, methodology, results, and conclusions. \textbf{Keywords:} keyword1, keyword2, keyword3 % ============================================ % ACKNOWLEDGMENTS % ============================================ \newpage \section*{Acknowledgments} \addcontentsline{toc}{section}{Acknowledgments} I would like to thank my supervisor, Professor Name, for their guidance and support throughout this project. I also thank my family and friends for their encouragement. % ============================================ % TABLE OF CONTENTS % ============================================ \newpage \tableofcontents \newpage \listoffigures \listoftables % ============================================ % MAIN CONTENT % ============================================ \newpage \section{Introduction} \label{sec:intro} \subsection{Background} Provide context for your research topic. Explain why this topic is important and relevant. \subsection{Research Question} State your research question or hypothesis clearly: \textit{``What is the relationship between X and Y?''} \subsection{Objectives} List your specific objectives: \begin{enumerate} \item To investigate... \item To analyze... \item To evaluate... \end{enumerate} \subsection{Report Structure} Section \ref{sec:lit} reviews the relevant literature. Section \ref{sec:method} describes the methodology. Section \ref{sec:results} presents the results. Section \ref{sec:discuss} discusses the findings. Section \ref{sec:conclude} concludes the thesis. \section{Literature Review} \label{sec:lit} Review relevant studies and theories related to your topic. Organize by themes or chronologically. \subsection{Theme 1} Discuss the first theme from the literature. \subsection{Theme 2} Discuss the second theme. \subsection{Summary} Summarize the key points and identify gaps in the literature. \section{Methodology} \label{sec:method} \subsection{Research Design} Describe your overall approach (e.g., quantitative, qualitative, experimental). \subsection{Data Collection} Explain how you collected your data: \begin{itemize} \item Data source \item Sample size \item Collection method \end{itemize} \subsection{Analysis Method} Describe how you analyzed your data. \section{Results} \label{sec:results} Present your findings objectively. \subsection{Finding 1} Describe your first main finding. \begin{table}[h] \centering \caption{Summary of Results} \label{tab:summary} \begin{tabular}{|l|c|c|} \hline \textbf{Category} & \textbf{Count} & \textbf{Percentage} \\ \hline Category A & 45 & 45\% \\ Category B & 35 & 35\% \\ Category C & 20 & 20\% \\ \hline \textbf{Total} & 100 & 100\% \\ \hline \end{tabular} \end{table} \subsection{Finding 2} Describe your second main finding. \section{Discussion} \label{sec:discuss} \subsection{Interpretation} Explain what your results mean in the context of your research question. \subsection{Comparison with Literature} Compare your findings with previous studies. \subsection{Limitations} Acknowledge the limitations of your study: \begin{itemize} \item Limitation 1 \item Limitation 2 \end{itemize} \section{Conclusion} \label{sec:conclude} \subsection{Summary} Summarize your key findings. \subsection{Recommendations} Provide recommendations based on your research. \subsection{Future Research} Suggest directions for future research. % ============================================ % REFERENCES % ============================================ \newpage \section*{References} \addcontentsline{toc}{section}{References} \begin{enumerate} \item Author, A. (2023). Title of article. \textit{Journal Name}, 10(2), 100-120. \item Writer, B. (2022). \textit{Book Title}. Publisher. \item Researcher, C., \& Colleague, D. (2021). Conference paper title. In \textit{Proceedings of Conference Name} (pp. 50-60). \end{enumerate} % ============================================ % APPENDICES % ============================================ \newpage \appendix \section{Appendix A: Survey Questions} Include any supplementary materials here. \section{Appendix B: Raw Data} Include additional data tables or figures. \end{document} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from thesis-undergrad.tex Page 1 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-1.svg) Open zoomable preview: Compiled PDF page 2 from thesis-undergrad.tex Page 2 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-2.svg) Open zoomable preview: Compiled PDF page 3 from thesis-undergrad.tex Page 3 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-3.svg) Open zoomable preview: Compiled PDF page 4 from thesis-undergrad.tex Page 4 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-4.svg) Open zoomable preview: Compiled PDF page 5 from thesis-undergrad.tex Page 5 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-5.svg) Open zoomable preview: Compiled PDF page 6 from thesis-undergrad.tex Page 6 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-6.svg) Open zoomable preview: Compiled PDF page 7 from thesis-undergrad.tex Page 7 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-7.svg) Open zoomable preview: Compiled PDF page 8 from thesis-undergrad.tex Page 8 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-8.svg) Open zoomable preview: Compiled PDF page 9 from thesis-undergrad.tex Page 9 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-9.svg) Open zoomable preview: Compiled PDF page 10 from thesis-undergrad.tex Page 10 of 10. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. [Open SVG](/images/rendered/template-thesis-undergrad/page-10.svg)
## University-Specific Formatting### Page Setup Options```latex formatting.tex theme=\{null} % US Letter with 1" margins \usepackage[letterpaper,margin=1in]{geometry} % A4 with custom margins \usepackage[a4paper,left=1.5in,right=1in,top=1in,bottom=1in]{geometry} % Double spacing (most common requirement) \usepackage{setspace} \doublespacing % Page numbers at bottom center \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0pt} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
### Front Matter Components```latex frontmatter.tex theme=\{null} % Approval Page \chapter*{Approval Page} \thispagestyle{empty} \begin{center} This dissertation by YOUR NAME has been approved by:\\ \vspace{2cm} \rule{0.5\textwidth}{0.4pt}\\ Committee Chair Name, Ph.D.\\ \vspace{1cm} \rule{0.5\textwidth}{0.4pt}\\ Committee Member Name, Ph.D.\\ \vspace{1cm} \rule{0.5\textwidth}{0.4pt}\\ External Examiner Name, Ph.D.\\ \vspace{2cm} Date: \rule{0.3\textwidth}{0.4pt} \end{center} % Declaration of Originality \chapter*{Declaration of Originality} I hereby declare that this thesis is my own work and effort... ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Chapter Organization### Using Separate Files```latex main-modular.tex theme=\{null} % main.tex \documentclass[12pt]{book} % ... preamble ... \begin{document} % Front matter \include{frontmatter/titlepage} \include{frontmatter/abstract} \include{frontmatter/acknowledgments} \tableofcontents \listoffigures \listoftables % Main chapters \include{chapters/introduction} \include{chapters/literature} \include{chapters/methodology} \include{chapters/results} \include{chapters/discussion} \include{chapters/conclusion} % Back matter \printbibliography \include{appendices/appendixA} \include{appendices/appendixB} \end{document} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Chapter File Example```latex chapter-introduction.tex theme=\{null} % chapters/introduction.tex \chapter{Introduction} \label{ch:introduction} \section{Background} Content here... \section{Motivation} More content... % Note: Don't include \begin{document} in chapter files ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Bibliography Management### Using BibLaTeX (Recommended)```latex biblatex-setup.tex theme=\{null} % In preamble \usepackage[style=apa,backend=biber]{biblatex} \addbibresource{references.bib} % Where you want the bibliography \printbibliography[heading=bibintoc] ```\
\Expected effect\ \> \\\[!NOTE] \> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.\
### Sample Bibliography File```bibtex references.bib theme=\{null} @article{smith2023, author = {Smith, John and Doe, Jane}, title = {Revolutionary Findings in Field X}, journal = {Journal of Important Research}, volume = {42}, number = {3}, pages = {123--145}, year = {2023}, doi = {10.1234/jir.2023.42.3.123} } @book{johnson2022, author = {Johnson, Sarah}, title = {Comprehensive Guide to Topic Y}, publisher = {Academic Press}, year = {2022}, edition = {3rd}, address = {New York, NY} } @inproceedings{lee2023, author = {Lee, Kevin and Wang, Lisa}, title = {Novel Approach to Problem Z}, booktitle = {Proceedings of the International Conference}, pages = {456--467}, year = {2023}, organization = {IEEE} } ```## Common Thesis Elements### Equations and Theorems```latex math-elements.tex theme=\{null} % Numbered equation \begin{equation} \label{eq:main} f(x) = \int_0^\infty g(t) e^{-xt} dt \end{equation} % Multi-line equation \begin{align} H(X) &= -\sum_{i=1}^n p_i \log p_i \\ &= \mathbb{E}[-\log p(X)] \end{align} % Theorem with proof \begin{theorem}[Convergence] \label{thm:convergence} Under assumptions A1-A3, the algorithm converges to the global optimum with probability 1. \end{theorem} \begin{proof} Let $\epsilon > 0$ be arbitrary... \end{proof} ```
Rendered output Open zoomable preview: Compiled PDF page 1 from math-elements.tex Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper. [Open SVG](/images/rendered/templates-thesis-07/page-1.svg)
**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=templates_thesis)### Algorithms```latex algorithms.tex theme=\{null} \usepackage{algorithm} \usepackage{algorithmic} \begin{algorithm} \caption{Main Processing Algorithm} \label{alg:main} \begin{algorithmic}[1] \REQUIRE Input data $X$ \ENSURE Processed result $Y$ \STATE Initialize parameters $\theta$ \WHILE{not converged} \STATE $\theta \leftarrow \text{UpdateStep}(\theta, X)$ \IF{$\|\theta - \theta_{old}\| < \epsilon$} \STATE \textbf{break} \ENDIF \ENDWHILE \RETURN $Y = f(X, \theta)$ \end{algorithmic} \end{algorithm} ```\
\Expected effect\ \> \\\[!NOTE] \> \> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.\
## Formatting Tips> [!TIP] > > **Essential Formatting Guidelines:** > > 1. Check your university's specific requirements early > 2. Use consistent formatting throughout > 3. Number all pages except title page > 4. Include page numbers in TOC for all sections > 5. Ensure figures and tables are referenced in text > 6. Keep one backup version before major changes### Common Requirements| Element | Common Requirement | | - | - | | Font | Times New Roman 12pt | | Spacing | Double spaced | | Margins | 1" all sides (or 1.5" left for binding) | | Page Numbers | Bottom center or top right | | Chapter Titles | Bold, centered, or flush left | | Citations | Consistent style throughout |## Troubleshooting> [!WARNING] > > **Common Issues:** > > * **Missing references**: Run BibTeX/Biber between LaTeX compilations > * **Incorrect numbering**: Clear auxiliary files and recompile > * **Overfull hboxes**: Adjust text or use `\sloppy` in problematic paragraphs > * **Figure placement**: Use `[htbp]` for flexible positioning## Compilation Workflow```bash theme=\{null} # For BibLaTeX pdflatex thesis.tex biber thesis pdflatex thesis.tex pdflatex thesis.tex # For traditional BibTeX pdflatex thesis.tex bibtex thesis pdflatex thesis.tex pdflatex thesis.tex ```## Additional Resources> [card] Citation Styles > > Guide to different citation formats[Open](/learn/latex/bibliography-citations)> [card] Figure Best Practices > > Creating publication-quality figures[Open](/learn/latex/figures/inserting-images)> [card] Table Guidelines > > Professional table formatting[Open](/learn/latex/tables/creating-tables)Writing your thesis as a student? See how [LaTeX Cloud Studio for students](https://www.latex-cloud-studio.com/solutions/students?utm_source=resources\&utm_medium=related_product\&utm_campaign=docs_to_website\&utm_content=thesis_template_students) supports theses, lab reports, and assignments.***> [!NOTE] > > **Final Tip**: Start writing early, even if just outlines. LaTeX makes it easy to reorganize content as your thesis evolves. Focus on content first, formatting second.Good luck with your thesis! Remember to take regular breaks and celebrate small victories along the way. # LaTeX Cloud Studio vs TeXstudio - Cloud vs Desktop Comparison Source: https://resources.latex-cloud-studio.com/vs/texstudio Compare LaTeX Cloud Studio and TeXstudio. Cloud-based vs desktop LaTeX editor comparison covering features, collaboration, and ease of use. Choosing between a cloud-based and desktop LaTeX editor depends on your workflow, collaboration needs, and preferences. This comparison helps you decide between LaTeX Cloud Studio (cloud) and TeXstudio (desktop). > [!NOTE] > > **Quick Summary**: LaTeX Cloud Studio offers zero-installation cloud editing with real-time collaboration, while TeXstudio provides a powerful desktop experience with offline capabilities and deep customization. ## Quick Comparison Table | Feature | LaTeX Cloud Studio | TeXstudio | | :- | :-: | :-: | | **Installation** | None required | Local install | | **Platform** | Any browser | Windows, Mac, Linux | | **Collaboration** | ✓ Real-time | Manual sharing | | **Offline Work** | ◐ Planned | ✓ Full offline | | **Auto-save** | ✓ Cloud sync | Local only | | **Cost** | Free tier + Premium | Free (open source) | | **Compilation** | Cloud servers | Local TeX installation | | **AI Features** | ✓ Built-in | Not available | ## When to Choose LaTeX Cloud Studio > [card] Team Collaboration > > Work together in real-time without file sharing hassles > [card] Multiple Devices > > Access your documents from any computer with a browser > [card] No Setup Required > > Start writing immediately without installing LaTeX distributions > [card] AI Assistance > > Get intelligent error detection and writing suggestions ### Benefits of Cloud-Based Editing **Zero Configuration** * No TeX distribution installation (MiKTeX, TeX Live) * No package management headaches * Always up-to-date packages * Works on any device with a browser **Seamless Collaboration** * Real-time editing with collaborators * No file versioning conflicts * Easy sharing with link-based access * Perfect for advisors reviewing student work **Automatic Backups** * Every change saved automatically * Full version history * No risk of losing work * Access from anywhere ## When to Choose TeXstudio > [card] Offline Work > > Full functionality without internet connection > [card] Deep Customization > > Extensive configuration and macro support > [card] Large Projects > > Handle massive documents with local resources > [card] Privacy Sensitive > > Keep all documents on your local machine ### Benefits of Desktop Editing **Offline Capabilities** * Work anywhere without internet * No latency in compilation * Local file management * Complete data privacy **Customization** * Extensive keyboard shortcuts * Custom macros and snippets * Configurable interface * Integration with external tools **Performance** * Utilizes local hardware * No upload/download overhead * Fast compilation for large projects * Direct PDF viewer integration ## Feature Comparison ### Editor Experience **LaTeX Cloud Studio:** * Modern, clean interface * Syntax highlighting * Auto-completion * Integrated PDF preview * AI-powered error detection * Real-time collaboration cursor **TeXstudio:** * Highly configurable interface * Advanced syntax highlighting * Extensive auto-completion * Built-in PDF viewer with synctex * Grammar checking integration * Macro recording and playback ### Compilation **LaTeX Cloud Studio:** * Cloud-based compilation * No local installation needed * All major engines (pdfLaTeX, XeLaTeX, LuaLaTeX) * Intelligent caching for speed * Always latest packages **TeXstudio:** * Requires local TeX installation * Full control over compilation * Any TeX engine supported * Custom build profiles * Direct access to logs ### Collaboration **LaTeX Cloud Studio:** * Real-time multi-user editing * See collaborators' cursors * Project sharing via links * Permission management * Comments and track changes (coming soon) **TeXstudio:** * Single-user editing * File sharing via email/cloud storage * Git integration possible * No built-in collaboration ## Migration Guide ### From TeXstudio to LaTeX Cloud Studio 1. Export your project folder as a ZIP 2. Upload to LaTeX Cloud Studio 3. Verify package compatibility 4. Invite collaborators ### From LaTeX Cloud Studio to TeXstudio 1. Download project as ZIP 2. Install TeX distribution locally 3. Open in TeXstudio 4. Install any missing packages > [!TIP] > > **Best of Both Worlds**: Some users use LaTeX Cloud Studio for collaborative projects and TeXstudio for offline personal work. Both can work with the same source files. ## Pricing Comparison | Plan | LaTeX Cloud Studio | TeXstudio | | :- | :-: | :-: | | **Free** | Generous limits, basic AI | Full features (open source) | | **Premium** | Extended features, priority support | N/A (free software) | > [!NOTE] > > TeXstudio is free and open source software. LaTeX Cloud Studio offers a free tier with premium options for advanced features. ## Who Should Choose What? ### Choose LaTeX Cloud Studio if you: * Work on multiple devices * Collaborate with others regularly * Want zero-setup LaTeX experience * Need AI-powered assistance * Prefer automatic cloud backups ### Choose TeXstudio if you: * Work primarily offline * Need deep customization * Handle very large documents * Prefer complete local control * Already have TeX installed ## Frequently Asked Questions > [accordion] Can I use both editors? > > Yes! Your LaTeX source files work in any editor. Many users use LaTeX Cloud Studio for collaboration and TeXstudio for offline work. > [accordion] Which is faster for compilation? > > For typical documents, both are fast. TeXstudio may be faster for very large projects since it uses local resources. LaTeX Cloud Studio uses intelligent caching to speed up subsequent compiles. > [accordion] Do I need to install anything for LaTeX Cloud Studio? > > No. LaTeX Cloud Studio runs entirely in your browser. For TeXstudio, you need both the editor and a TeX distribution (MiKTeX or TeX Live). > [accordion] Which has better collaboration features? > > LaTeX Cloud Studio has built-in real-time collaboration. TeXstudio requires external tools like Git for collaboration. ## Get Started > [card] Try LaTeX Cloud Studio > > Start writing in your browser - no installation needed [Open](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=card\&utm_campaign=docs_open_app\&utm_content=vs_texstudio_try_app) > [card] Download TeXstudio > > Get the free desktop editor for your platform [Open](https://www.texstudio.org/) *** > [!NOTE] > > **Need Help Deciding?** Consider starting with LaTeX Cloud Studio's free tier to experience cloud-based editing, then decide if desktop features are necessary for your workflow.