LaTeX Overview and Install

When you need high-quality doc for very scientific journal

Page content

LaTeX is a software system for document typesetting (designing high-quality text page). The resulting document format in PDF probably will be looking better then if created with MS Word. Have a look! A feast for the eyes.

LaTex is pronounced as “LAH-tek” or “LAY-tek”.

Unlike WYSIWYG (What You See Is What You Get) word processors, LaTeX uses markup language to describe the content and layout of a document.

You see, it’s similar to Wikipedia’s markdown which is used in Hugo also

LaTeX in London

Document typesetting is the process of arranging words, symbols, and glyphs to create a document that is easy to read and visually appealing.

It’s a vital part of design that involves understanding various elements, including: Fonts, Font sizes, Line spacing, Kerning, Tracking, Leading, Punctuation, Scaling, and Justification.

LaTeX document example

Here’s a basic example of a LaTeX document:

\documentclass{article}

\usepackage[a4paper, , margin=1in]{geometry}
\usepackage{lipsum}

\title{My First Exciting LaTeX Document}
\author{Awesome Author}
\date{\today}

\begin{document}

\maketitle

\section{Introduction}

Yay! This is the LaTeX document!

\section{Body}

LaTeX is a powerful typesetting system used for producing
scientific and mathematical documents of high quality.
But not only that. High quality could be appreciated everywhere.
Right?

\section{Conclusion}

Creating documents with LaTeX is simple and fun.

\section{And a lipsum example}
\lipsum[1-2]

\end{document}

When compiled, this code will produce a formatted document with a title, author, date, and three sections. To compile Tex files to Pdf you can use TexWorks editor. It’s automatically installed as a part of TexLive system. Or VS Code extension LaTex Workshop.

Latex Document Example

It is actually not my first LaTex document :), but for demo purposes, let’s keep it like this. This example demonstrates the fundamental structure of a LaTeX document:

  1. The document class is declared using \documentclass{article}.
  2. The preamble contains metadata like title, author, and date.
  3. The actual content is enclosed within the document environment.
  4. Sections are created using the \section{} command.
  5. Usage of lipsum package (Autogenerated text example)

LaTeX Key features

Key features of LaTeX include:

  1. Separation of content and style: Authors focus on writing content while LaTeX handles formatting.
  2. High-quality typesetting: LaTeX produces professional-looking documents, especially for complex mathematical expressions.
  3. Consistency: It ensures uniform styling throughout the document.
  4. Portability: LaTeX files are plain text, making them highly portable across different platforms.
  5. Flexibility: It allows for fine-grained control over document layout.

LaTeX is widely used in academia for scientific documents, technical note-taking, and publications requiring complex multilingual materials. To create a LaTeX document, users write in plain text, using commands to define the document’s structure and style. The LaTeX system then processes this file to produce a formatted output, typically a PDF.

Install LaTex on Windows

On Windows there are two major LaTex systems available - TexLive and MiKTex

In addition to the system you might need dedicated editor, that knows how to call this system to convert .tex files to .pdf Some good editors for LaTeX are:

An of course you can use Notepad, Vim, or MS Word to edit .tex files - they are just usual text files with specific extension .tex. For coprehensive list of the editors please see the the list in the end of this article.

How to install TexLive on Windows

To install LaTeX Live on Windows, follow these steps:

  1. Download the LaTeX installer for windows:

  2. Run the installer:

    • Double-click the downloaded “install-tl-windows.exe” file.
    • If a security warning appears, select “Run”.
  3. Choose installation options:

    • In the installer window, click “Install” and then “Next”.
    • Select your preferred settings, such as installation directory and paper size.
  4. Begin installation:

    • Click “Install” to start the process.
    • The installer will download and install all necessary modules. This may take several hours depending on your internet connection.
  5. Complete the installation:

    • Once all modules are installed, click “Close”.
    • You can now access TeX Live from the Start Menu.

It might be better to download TexLive Full and install it offline. For an offline TexLive LaTeX installation using an ISO image:

  1. Download the TeX Live ISO from https://mirror2.sandyriver.net/pub/ctan/systems/texlive/Images/
  2. Open the ISO and run the “install-tl-windows.bat” file.

After installation, you can use the TeX Live Manager GUI to add or remove packages and keep your installation up to date.

How Install MiKTeX on Windows

To install LaTeX on Windows, follow these steps:

  1. Download MiKTeX:

    • Visit the MiKTeX website (http://www.miktex.org/download)
    • Click the Download button under the Windows and Installer tabs
    • Save the file to a location you can easily find
  2. Run the MiKTeX installer:

    • Double-click the downloaded file to open it
    • Select “Run” if a security warning appears
    • Read and accept the license agreement
  3. Choose your settings:

    • Select “A4” as your preferred paper size
    • Choose your installation scope (private installation is recommended)
    • Select the installation directory (you can use the default)
  4. Configure package installation:

    • Choose how you want MiKTeX to handle missing packages:
      • “Ask me first” to confirm installation
      • “Always” to install without confirmation
      • “Never” to disallow installation of missing packages
  5. Begin installation:

    • Review your settings and click “Start”
    • Wait for the installation to complete (may take up to 15 minutes)
  6. Finish the installation:

    • Click “Close” to exit the installer
    • Delete the original installer file
  7. Install a LaTeX editor (optional but recommended):

    • Choose an editor like TeXstudio, TeXmaker, or Overleaf
    • Download and install your preferred editor

After installation, it’s recommended to open MiKTeX Console and check for updates to ensure you have the latest version.

LaTeX on Mac and Linux systems

To install LaTeX on Mac or Linux system please see TexLive howto page:


Common Latex Packages

LaTeX offers a wide range of packages that extend its functionality and provide additional features for document preparation. Here are some common LaTeX packages and their uses:

Mathematical Typesetting

amsmath: This package is essential for advanced mathematical typesetting. It provides:

  • Enhanced equation environments
  • New math symbols and operators
  • Improved alignment options for equations

amssymb: Complements amsmath by adding extra mathematical symbols and fonts.

Document Structure and Layout

geometry: Allows easy customization of page dimensions and margins. For example:

\usepackage[a4paper,top=3cm,bottom=3cm,outer=3cm,inner=3cm,heightrounded]{geometry}

fancyhdr: Enables customization of headers and footers on each page.

Tables and Figures

booktabs: Produces professional-looking tables with improved horizontal rules and spacing.

tabularx: Creates tables that match the width of the paragraph.

longtable: Allows tables to span multiple pages.

graphicx: Provides commands for including and manipulating graphics.

Text Formatting and Typography

microtype: Enhances the appearance of text through micro-typographic adjustments. It offers:

  • Character protrusion
  • Font expansion
  • Additional kerning
  • Adjustment of interword spacing

Code Listings

listings: Enables typesetting of source code with syntax highlighting for various programming languages.

Vector Graphics

PGF/TikZ: Powerful package for creating vector graphics programmatically. It’s useful for:

  • Drawing diagrams
  • Creating charts and plots
  • Illustrating mathematical concepts

Theorems and Proofs

amsthm: Provides environments for typesetting theorems, lemmas, and proofs.

ntheorem: An alternative to amsthm with more customization options.

Bibliography and Citations

natbib: Offers new citation styles and options, particularly useful for journalistic documents.

hyperref: Adds hyperlink capabilities to LaTeX documents.

cleveref: Enhances cross-referencing features, automatically formatting references based on their type.

By incorporating these packages, LaTeX users can significantly extend the functionality of their documents and improve their overall quality and appearance.

There are several popular LaTeX editors and tools available for writing and editing LaTeX code. These tools offer various features such as real-time collaboration, version control, syntax highlighting, and built-in PDF viewers to enhance productivity. Here is a list of some popular options:

Online Editors

  • Overleaf: Overleaf is an online LaTeX editor that provides real-time collaboration, version control, and hundreds of LaTeX templates 29.
  • ShareLaTeX: ShareLaTeX is another online LaTeX editor known for its ease of use and collaborative features 1.
  • Authorea: Authorea offers a platform for writing and editing LaTeX documents with additional functionalities like real-time collaboration and version control 1.

Offline Editors

  • TeXstudio: TeXstudio is a free, modern, and cross-platform LaTeX editor that operates on Windows, Mac, and Linux. It includes features like Unicode support and spell checking 2412.
  • TeXworks: TeXworks is known for its user-friendly interface and built-in viewer, making it one of the best options for Windows users 8.
  • Kile: Kile is a great LaTeX editor originally from the Linux/KDE community, offering a straightforward interface and various open-source libraries 1012.
  • TeXMaker: TeXMaker is a pretty good alternative to Kile, providing a robust set of features for LaTeX editing 10.
  • TeXStudio: TeXStudio is a cross-platform LaTeX editor that includes various tools and functionalities to enhance productivity 24121315.
  • LyX: LyX is an open-source editor compatible with Windows, macOS, and Linux OS. It supports the WYSIWYM (What You See Is What You Mean) writing approach with a simple GUI interface 11.

Specialized Editors

  • VimTeX: VimTeX is a file type and syntax plugin for Vim and Neovim that adds support for LaTeX editing. It offers features like document compilation support, auto-completion of citations, labels, commands, and more 67.
  • emacs + aucTeX: This combination provides a specialized environment for LaTeX editing with various tools to improve productivity 6.
  • Sublime Text + LaTeXTools: Sublime Text is a popular text editor that can be enhanced with the LaTeXTools plugin for better LaTeX support 15.

Integrated Development Environments (IDEs)

  • Visual Studio Code (VSCode): With the appropriate extensions, VSCode can become a powerful tool for writing and editing LaTeX code. Extensions like LaTeX Workshop provide features such as syntax highlighting, auto-completion, and document compilation 15.

These editors and tools cater to different needs and preferences, from simple text editing to advanced collaborative environments. Depending on your specific requirements, you can choose the one that best suits your workflow.