.tex
source files into the final output format (usually PDF). Understanding the differences between compilers helps you choose the right tool for your project.
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:- Reads your source file (.tex)
- Processes all commands and content
- Generates output (PDF, DVI, etc.)
- Reports any errors or warnings
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
- Limited to 8-bit fonts
- No direct Unicode support
- Can’t use system fonts
- Most documents
- Academic papers
- When compatibility matters
- Beginning LaTeX users
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
- Slower compilation
- Some packages incompatible
- Larger file sizes
- Documents with special fonts
- Multilingual documents
- Non-Latin scripts
- Typography-focused work
LuaLaTeX (Programmable Power)
The newest engine with embedded Lua scripting. Pros:- Full Unicode support
- Lua scripting capability
- Modern font handling
- Microtype improvements
- Active development
- Slowest compilation
- Newest (less documentation)
- Some compatibility issues
- Complex programmatic documents
- Advanced typography
- When you need scripting
- Future-proof projects
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 Compiler
You can make your document adapt to different compilers:Font Selection by Compiler
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 Studio
LaTeX Cloud Studio makes compiler selection easy:- Automatic Detection: We analyze your document and suggest the best compiler
- Easy Switching: Change compilers in document settings
- Error Handling: Clear messages if packages need a different compiler
- Preconfiqured: All compilers are ready to use
Setting Compiler in Your Document
You can specify your preferred compiler using a magic comment:Troubleshooting Compiler Issues
Common compiler-related errors:
-
“Package requires XeLaTeX/LuaLaTeX”
- Switch to the appropriate compiler
- Or use alternative packages
-
“Unicode character not set up”
- Use XeLaTeX/LuaLaTeX for full Unicode
- Or add
\usepackage[utf8]{inputenc}
for pdfLaTeX
-
“Font not found”
- System fonts need XeLaTeX/LuaLaTeX
- Or use LaTeX font packages with pdfLaTeX
Migration Guide
From pdfLaTeX to XeLaTeX
Remove these packages:From XeLaTeX to pdfLaTeX
Replace font commands:Performance Tips
Speed up compilation:
- Use pdfLaTeX for drafts
- Switch to XeLaTeX/LuaLaTeX for final version
- Enable draft mode:
\documentclass[draft]{article}
- Compile only changed parts during writing
- Use LaTeX Cloud Studio’s incremental compilation
Quick Decision Chart
Summary
- Start with pdfLaTeX - It’s fast and compatible
- Switch to XeLaTeX - When you need fonts or languages
- Try LuaLaTeX - For advanced programmable documents
Next step: Learn about Paragraphs and new lines to structure your content effectively.