Typevia
Workflow and Tools

Understanding the LaTeX Ecosystem

Before we dive into the installation process, it is essential to understand that LaTeX is not a single "program" like Microsoft Word. Instead, a local LaTeX setup consists of two main components:

  1. The Distribution (The Engine): This is the core software that contains the "engines" (like pdfLaTeX or XeLaTeX), fonts, and thousands of packages. It handles the actual work of turning your code into a PDF.
  2. The Editor (The Interface): This is where you write your code. While you could write LaTeX in a simple notepad, a dedicated LaTeX editor provides helpful features like syntax highlighting, auto-completion, and a "Compile" button.

Note: You must install a distribution before or alongside your editor for the system to work. Without a distribution, your editor is just a text editor that cannot produce PDFs.


Choosing the Right Distribution

Depending on your operating system, you have a few primary choices for your LaTeX distribution.

1. TeX Live (Windows, Linux, & macOS)

TeX Live is the international standard. It is comprehensive and includes almost every package available in the LaTeX world.

  • Pros: Extremely stable, updated annually, and compatible with all systems.
  • Cons: The full installation is very large (around 5–7 GB).

2. MiKTeX (Windows, macOS, & Linux)

MiKTeX is a popular alternative, particularly for Windows users.

  • Pros: Features an "install on-the-fly" system. If you use a package you haven't downloaded yet, MiKTeX will automatically download it for you.
  • Cons: Can occasionally have permission issues with automatic downloads on certain networks.

3. MacTeX (macOS Only)

MacTeX is essentially TeX Live bundled specifically for macOS users. It includes extra Mac-specific tools and is the recommended choice for Apple users.


Step-by-Step Installation

If you want a quick setup, choose MiKTeX. If you have plenty of disk space and want everything at once, choose TeX Live.

  1. Download: Visit miktex.org or tug.org/texlive.
  2. Run the Installer: For MiKTeX, choose the "Basic Installer."
  3. Settings: When asked "Install missing packages on the fly," set this to Yes. This prevents the system from interrupting you every time you use a new feature.
  4. Wait: TeX Live can take up to an hour to install; MiKTeX usually takes 10–15 minutes.
  1. Download: Go to tug.org/mactex and download the MacTeX.pkg file.
  2. Install: Run the package and follow the on-screen instructions.
  3. Note: This is a large file (approx. 5GB), so ensure you have a stable internet connection.

For Linux Users

Most Linux distributions include TeX Live in their official repositories.

  • Ubuntu/Debian: Run sudo apt install texlive-full in your terminal.
  • Fedora: Run sudo dnf install texlive-scheme-full.

Selecting and Configuring Your Editor

Once your distribution is installed, you need a place to write code. Here are the top recommendations for beginners:

  1. TeXstudio (Highly Recommended): An all-in-one editor that is very beginner-friendly. It features a built-in PDF viewer and comprehensive menus for inserting symbols.
  2. VS Code (Advanced): If you are already a programmer, you can use Visual Studio Code with the LaTeX Workshop extension.
  3. TeXworks: Often comes pre-installed with MiKTeX or MacTeX. It is very minimal but highly reliable.

Connecting the Editor to the Distribution

In most cases, if you install the distribution first, the editor will automatically find it. If you get an error saying "Command not found," check the editor's settings (usually under Options > Configure TeXstudio > Commands) to ensure the paths point to your distribution's folder.


Testing Your Installation

To ensure everything is working correctly, let's create a "Hello World" document. Open your editor, create a new file, and paste the following code:

\documentclass{article}

\begin{document}
Hello, world! This is my first local \LaTeX{} document.
\end{document}

How to Compile:

  1. Save the file as test.tex in a dedicated folder.
  2. Press the Build & View button (usually a green "Play" icon or the F5 key in TeXstudio).
  3. A PDF should appear on the right side of your screen.

Testing Package Installation

To ensure your distribution can download new features, try compiling this document which uses the amsmath package for mathematics:

\documentclass{article}
\usepackage{amsmath} % This package adds advanced math features

\begin{document}
Check out this equation:
\begin{equation}
    E = mc^2
\end{equation}
The \texttt{amsmath} package is working correctly!
\end{document}

Best Practices and Common Pitfalls

1. Create Dedicated Folders

When LaTeX compiles a document, it creates several auxiliary files (.aux, .log, .out, .gz). If you save your files on your Desktop, it will quickly become cluttered. Always create a new folder for every new project.

2. Update Your Packages Regularly

Like any software, LaTeX packages receive updates.

  • In MiKTeX: Open the "MiKTeX Console" and click "Check for updates."
  • In TeX Live: Use the "TeX Live Utility" (Mac) or "TLMgr" (Windows/Linux).

3. Avoid Spaces in Filenames

LaTeX can sometimes struggle with file paths that contain spaces (e.g., My Thesis Version 1.tex). It is a best practice to use underscores or hyphens instead: My_Thesis_V1.tex.

4. Handling Installation Errors

Note: If you get a "Permission Denied" error during installation, try running the installer as an Administrator (Windows) or using sudo (Linux).


Summary Checklist

  1. Install Distribution: TeX Live (All OS), MiKTeX (Windows), or MacTeX (macOS).
  2. Install Editor: TeXstudio is the best starting point for beginners.
  3. Configure: Ensure the editor "sees" the distribution.
  4. Test: Compile a simple "Hello World" document to verify the PDF engine.
  5. Update: Run the package manager to ensure you have the latest versions of everything.

Congratulations! You now have a fully functional professional typesetting environment on your computer.