This page provides a brief guide to using LaTeX in Sublime Text on Mac. This guide covers setup, use and customization. LaTeX is a system for creating high-quality technical documents. Sublime Text is a smart text editor.
SETUP
You need three tools to use LaTeX in Sublime Text: MacTeX, LaTeXTools, and Skim. MacTeX contains the TeX-related programs and packages needed to use LaTeX on your Mac. LaTeXTools is a package used to build LaTeX documents. Skim is a PDF viewer used to view LaTeX documents.
Once LaTeX is setup in Sublime Text, it can be used to create LaTeX documents. To use LaTeX in Sublime Text, you need to create a file, set the syntax to LaTeX and build. You can make Sublime Text your default editor for LaTeX documents after creating your first file.
Use LaTeX:
Open Sublime Text
Press Command + N
Press Command + Shift + P
Search "Set Syntax: LaTeX"
Press Enter
Write your document using the LaTeX language
Build with Command + B
Make Sublime Text your default editor:
Save LaTeX code
Find the .tex file on your Mac
Hold Control and select the .tex file
Select "Get info"
Select "Sublime Text" from the "Open with" menu
Select "Change all"
Close window
SETTINGS
LaTeXTools can be customized by editing user settings. For example, when you build, Skim will open the PDF on the page associated with the position of your cursor in Sublime Text. You can turn this feature off:
Open Sublime Text
Select "Sublime Text" from the menu
Select "Preferences"
Select "Package Settings"
Select "LaTeXTools"
Open Sublime Text
Select "Settings - User"
Press Command + F
Search "forward_sync"
Change "true" to "false"
Save
SNIPPETS
Sublime Text can be customized with snippets. A snippet is a block of code that can be pasted by entering a predefined combination of keys. Snippets make writing LaTeX documents faster. The following steps will create and use a snippet called "preamble" containing a basic LaTeX article template:
Open Sublime Text
Select "Tools" from the menu
Select "Developer"
Select "New Snippet"
Replace the existing text with the following:
preambletext.tex.latex