Getting started with LaTeX

There are many benefits to using LaTeX as an academic. This post aims to giving you resources on how to setup your coding environment. The aim is not a comprehensive review of LaTeX editors, but to give a starting point for novices, so apologies if your favorite editor is not included here.

Choosing a Starting Point: Online vs. Offline

There are many ways to setup your environment, and here I’ll layout the two major ways – desktop and cloud. and their pros and cons:

Cloud+ Does not require disk space or significant time to setup
+ Easily access your files from multiple operating systems with any reasonably modern browser
+ Many templates exists
+ Great for novices to get a feel for LaTeX
+ Great for creating simpler documents or singular images
+ Some blend features of WYSIWYG document creators, which is a nice scaffold for novices.
– Requires internet access for the entire duration of editing
– Sharing editing power with others requires a paid account, on a subscription basis.
– On the very rare occasions when the servers are down, you will not have access to your files
– Handling and breaking your document into multiple files can be a bit messy
– Privacy: Trusting sometimes sensitive text to be handled by a server not owned by you.
Code version control: compiling offline allows for you to update distributions of each component yourself, whereas the server sometimes gives minor bugs due to distribution bugs.
Desktop+ Entirely free and full control over your own files
+ Does not require internet access to create files unless you use a new package that requires download. (Likely by citing a new package you were looking on the internet and found out about it anyway.)
+ Custom libraries and style files “easy” to manage
+ Can set up your files on a cloud, and have full control over your backups
+ Can handle as many subfiles as you need to.
– Steeper learning curve in setup.
– Compiling time depends on the power of your machine. However, unless you’re running unix on a toaster, there’s not really an issue with modern machines now.
– Working with multiple editors will likely require GitHub, unless there’s one person who is in charge of translating more basic document files into LaTeX.
– Unforgiving in syntax during compile time

Based on what you’re building, you’d likely switch between cloud and desktop environments. Thus, I’ll recommend some specific ones below.

Choice as of November 2019: Offline editor I recommend TeXmaker. For online editor Overleaf, especially if I’m working on tiny projects like homework assignments and I’m not on my own computer.

Notable Online LaTeX Editors: Overleaf, Authorea and CoCalc

  • Overleaf v2: Great document editor site, one of the most popular. Overleaf hosts many templates as well as gives fairly comprehensive customer support. Result of the merger of Overleaf and ShareLaTeX, the site unfortunately is freemium. This popular website is used at the University of Illinois of Chicago, in the department of mathematics to handle creation of exams and exam keys. Also used extensively by my cohort at San Francisco State University for homework. Highly recommended to use their free solo accounts for learning LaTeX.
  • Authorea: “a platform to read, write, and publish research.” Mainly a good platform for collaboration between researchers who already know latex and those who are using other text editors. Main plus: they use Git for version control, which makes this very attractive for bigger teams working on long projects. They also have a stated goal of helping bring the power of professional typesetting using LaTeX to social sciences.
  • CoCalc: This is a great site for mathematicians and statisticians who enjoy open source programming philosophy. Aside from a full LaTeX compiler, they also handle SageMath worksheets, Jupyter notebooks, R and scientific Python. From my personal experience, this is a great place for learning all these formats. before beginning my master’s thesis, I wrote prototypical code here until dealing with lattice polytopes in dimensions higher than 3 made the server eventually hate me.
  • Codecogs: Basic editor for creating images of mathematical equations, useful for super quick creation, no more, no less.

Notable Offline LaTeX Editors

First, depending on your operating system, you should install a LaTeX compiler:

Then, choose a LaTeX editor. I’ve only included dependable editors that are usable across Windows, Mac as well as Linux, as that is important to me personally because I switch between Ubuntu and Windows depending on the task often.

  • TeXmaker: Install this and start coding! Texmaker is considered to be one of the best LaTeX editors for GNOME desktop environment. It presents a great user interface which results in a good user experience. It is also crowned to be one among the most useful LaTeX editor there is.
  • TeXstudio: A fork of TeXmaker, with more open philosophy to modification. This program allows for more customizability than TeXmaker. The learning curve is slightly higher, due to having more features.

Other notable editors (harder to use, but with great potential for power-users)

  • Sublime Text: Great tool if you’re using already familiar with sublime text as an editor for Python and other languages. Simply add on LaTeX plugin and set up autocomplete and snippets and you’re good to go. See: LaTeX Tools
  • Visual Studio Code: Similar remark to above. See: LaTeX Workshop.
  • VIM: Learning this editor is HARD, but the payoffs are great if you plan on being a high-functioning code producer one day. This is likely the most powerful editor on this list, and it’s my personal goal to integrate this editor into my workflow one day. (There’s an ongoing editor war, which I hope that my joke here won’t bring too much vitriol…) This editor exist in almost all Unix/Linux distributions by default, and is highly customizable, with a significantly different flow of editing from others. Power of snippets is super intense, and while the learning curve is sharp, the potential to generate massive amount of work with minimal keystrokes cannot be underestimated. Set up snippets, autocomplete and use a latex plugin and you’re golden. (This last sentence is a non-trivial amount of work.) See the following resources: vimtex, ultisnips, and vim-snippets. For a demonstration of the power of combining vim and latex see the following blog entries by Gilles Castel: 1, 2 and 3.
  • LyX: a WYSIWYM document editor, this program attempts to bridge the plaintext source code style of LaTeX and the WYSIWYG editors. In my humble opinion, this is not really a good place to start if you wish to do more than just math homework documents. In practice, using this program eventually hinders you from using the full power of LaTeX beyond the basic equation editing.

For a more comprehensive breakdown of editors, visit this wikipedia page.

Next in the series we will cover the basic structure of a latex document, and common resources to help you as you build your code.