# Getting started with latex
# LaTeX Editors
While you can create LaTeX documents using any editor and compiling using the console, there exist several plugins for widely used editors to simplify creating LaTeX documents, and there are specialized LaTeX editors. An exhaustive list of LaTeX editors (opens new window) is available on TeX.SE (opens new window) (the StackExchange site, dedicated to TeX, LaTeX & Friends).
The most widely used editors, according to this list, are:
- The Emacs (opens new window) editor with the AUCTeX (opens new window) extension.
- The Vim (opens new window) editor with the LaTeX-suite (opens new window) plugin.
- Texmaker (opens new window) – a specialized LaTeX IDE.
- TeXstudio (opens new window) – another LaTeX IDE.
- TeXworks (opens new window) – one more LaTeX IDE.
While experienced users of Emacs or Vim may want to stick to their editor (whose plugins provide a host of functionality unavailable elsewhere), a specialized IDE might be easier to install/use for beginners. The last three on the list have a preview function where one can see the results of the compilation of the document.
Additionally, there are online LaTeX tools that can be of use to beginners or people that must collaborate, e.g. ShareLaTeX (opens new window) and Overleaf (opens new window).
# Installation and Setup
You can choose between major distributions of LaTeX:
- TeX Live (opens new window) (Windows, Linux, and OS X), the standard, cross-platform distribution.
- MacTeX (opens new window) (Mac) A packaged version of TeX Live made for OS X with some Mac-specific tools
- MiKTeX (opens new window) (Windows) A separate distribution entirely that
All distributions are more or less equivalent in an ideal world. TeX Live has the advantage of being available on all platforms and thus has much better community support. MiKTeX can take advantage of Windows-specific features. For licensing reasons, MiKTeX will also distribute a few packages that TeX Live will not.
In all cases, the full install is recommended. Specifically, using MiKTeX's download-on-command feature will hang/crash many editors.
# Installation
# Windows (TeXLive)
- Download the most recent TeXLive
install-tl-windows.exe
from their website (opens new window). - Run
install-tl-windows.exe
and follow the instructions.
# Windows (MiKTeX)
- Download the most recent MiKTeX installer from their website (opens new window).
- Run the installer and follow the instructions.
# Mac OS X (TeXLive)
- Download the most recent MacTeX from their website (opens new window).
- Run
MacTeX.pkg
and follow the instructions.
# Linux (TeXLive)
Linux users have two options:
- Install via your distribution's package manager (usually several releases behind)
- Install from upstream (released yearly, updated often)
# Using Package Managers
- Arch Linux:
pacman -S texlive-most
- Debian/Ubuntu/Mint:
apt-get install texlive-full
- Fedora:
yum install texlive
Note that using this method means that you will be dependent on that package's maintainer for the distribution for updates. These packages will often be several releases behind the most recent distribution, often meaning critical updates will be missing. It's almost always best to install from upstream. Also note that the distribution's package manager will probably not recognize the direct installation and could try to install it when one installs other related support packages.
# Installing from Upstream
EXPORT PATH=/usr/local/texlive/YEAR/bin/PLATFORM:$PATH
where YEAR
is the four digit year (e.g. 2016
), and PLATFORM
is your platform (e.g. x86_64-linux
).
# Test Installation
The LaTeX installation is now complete. To test it, create a new file with your favorite text editor, name it test.tex
and add the following content:
Now, open the console or terminal, navigate to the folder where you saved test.tex
and run
(Note that your editor may have facilities to run this for you.)
This creates several new files, including test.pdf
. This is the output document, and looks like this:
Congratulations, you have successfully installed LaTeX, and created your first LaTeX document!
# Remarks
# LaTeX
# What is LaTeX?
LaTeX (pronounced lay-tech or lah-tekh) is a markup language for typesetting documents similar to how HTML is one for web sites.
LaTeX has advantages over What-You-See-Is-What-You-Get (WYSIWYG) editors such as Microsoft Word because with LaTeX you provide the content, and LaTeX takes care of the layout. Separation of content from typesetting results in documents that are consistently and beautifully formatted. Furthermore, because LaTeX markup is of plain text format (unlike more complex file formats produced by WYSIWYG editors, like .docx
), LaTeX files are lightweight and can be easily kept under version control (opens new window).
LaTeX documents are typically compiled to PDF files so that consistency in layout is retained across different viewers, and for printing.
LaTeX is especially popular in academic writing due to its rich support for typesetting equations, cross-referencing figures and tables, and citations and bibliographies.