I’m setting up a new laptop and figured it was a good chance to document setting up SublimeText for LaTeX, as quasi follow up to my recent post about live LaTeXing. However, installing LaTeX can be hard, and configuring the SublimeText package LaTeXTools to work with LaTeX has the potential to be hard (often just works, but if not, can be confusing), and I won’t write about those parts, because they are better documented elsewhere. So this is simply the easy part (configuring SublimeText) to try to remove a barrier from those who might be looking to switch.
- Install a LaTeX distribution for your OS. I’m unable to document this; personally, I just google and hope.
- Download and install SublimeText 3. Version 3 is in beta, but I’ve found it to extremely stable.
Install PackageControl by typing
ctrl+`in a SublimeText window to bring up a console bar at the bottom of the window, and pasting in the code from the website. This is a package manager for SublimeText packages.
Make a symbolic link to the SublimeText user folder you keep in dropbox:
Just kidding! If you’re setting it up the first time, you probably don’t happen to have such a folder already. In that case, you can install packages as follows.
ln -s ~/Dropbox/SublimeText/User ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
- Open PackageControl. On macOS, this is by the menus SublimeText -> Preferences -> Package Control.
- Type install and enter, and PackageControl should load the available packages to install. Begin typing latextools and the package should come up; hitting enter will start the installation of LaTeXTools, which does most of the work of hooking up SublimeText to LaTeX.
- You can install other packages this way if you choose, modify keybindings by Settings -> Keybindings, create snippets by Tools -> Developer -> New Snippet, etc. You can also look at my keybindings here (OSX) or here (Windows)I actually use the colemak keyboard layout, so I had to translate those to qwerty. If you happen to use colemak too, then see here (OSX) or here (Windows) for the layouts.
, and my snippets here. These files can be copied directly into your SublimeText
Userfolder, which on macOS is located at
~/Library/Application\ Support/Sublime\ Text\ 3/Packages/Userby default.
- As hinted above, you store your settings in a folder you can sync, like in a Dropbox folder, and make a symlink at the default location for the SublimeText
Userfolder that points to it. SublimeText will follow the symlink and load your settings and packages from the synced folder! If you aren’t familiar with symlinks: they are great. https://www.howtogeek.com/ has guides for Mac OS, Windows, and Linux.
- With LaTeXTools installed, you should be able to compile .tex files from SublimeText by Tools -> Build (perhaps specifying the Build System as LaTeX in the Tools menu first). If this doesn’t work, you may need to change some settings in LaTeXTool’s settings to get them to play nicely. This can be very easy or very hard, and I don’t understand this process. LaTeXTools has pretty good documentation for each OS, however, so I refer you there.
- Once .tex files are compiling, the last step is to easily see the output. On macOS, they (LaTeXTools suggest installing Skim as the PDF reader because it syncs nicely with the document in SublimeText. It works pretty well, although Skim is a bit idiosyncratic. I would immediately hide the Contents pane, hide the Notes pane, and toggle the Toolbar (all options under View). They also have suggestions and configuration steps for setting up PDF viewers for each OS.
And that’s it!