•  CV

Teaching (OTIS)


  •  Problems
  •  ELMO
  •  USEMO
  •  For beginners


Twitch Solves ISL

  •  Discord


  •  Mentors


  •  EGMO book
  •  Napkin (v1.5)
  •  Course notes


  •  FAQ's
  •  Rec letters

Buy Me a Coffee at ko-fi.com


Return to FAQ Index.

These are FAQ's about LaTeX.

Before anything else, I need to define some terms. You can think of LaTeX workflow as having three components:

  1. A text editor that you type your content into, like gedit, Sublime, Vim, or Emacs.
  2. A LaTeX compiler (aka LaTeX distribution) that converts the source into a PDF. See question L-9 for recommendations.
  3. A PDF viewer, the same one you use for normally viewing PDF's. See question L-12 for recommendations.

What you need to know right now is that these three components are disjoint. Some text editors may let you invoke a compiler directly, and others may be designed specifically for LaTeX editing, but it is a mistake to confuse the editor with the compiler. Any text editor will work with any compiler will work with any PDF viewer.

L-1. I don't know anything. Where do I start?

Read Wikibooks, it's really comprehensive. Also, this tutorial is good too.

L-2. What about online LaTeX editors like Overleaf?

I think it's better long-term to install LaTeX on your computer. This speeds up compilation and lets you use your favorite choice of editor and viewer, rather than the one specified on Overleaf. In addition, using Overleaf can cause version issues, especially with Asymptote.

I mostly use Overleaf in cases where I need to collaborate on a simple document and my collaborators do not know how to use Git or Dropbox.

L-3. Your documents are pretty, can I use your formatting?

Yes, it's contained in the style file evan.sty. Attribution is required in source versions only, and not mandated in PDF output (though still appreciated). Check the license that appears.

You should either copy-paste the 600-ish lines of code into a text file, or else click "Raw" and save the file.

L-4. How do I use a custom style file like evan.sty?

Check Google.

L-5. How do I get the colored boxes and section headers with evan.sty?

Pass the sexy option to the package (see source code for more detailed breakdown of options).

L-6. What package did you use to typeset your CV?

I use moderncv.

L-7. How do you get the LaTeX to auto-compile?

Use latexmk with the -pvc flag, and a PDF viewer that does not "lock" the PDF file from being written (Adobe reader does not work).

To fit latexmk into the framework we described, it is a "wrapper script" that calls the compiler for you.

L-8. What do you use to typeset geometry diagrams?

I use Asymptote. It integrates well with LaTeX, but the setup takes some work.

Essentially, there are 3 steps required for this:

  1. When you run PDFLaTeX on, say, example.tex with one diagram, it will generate example-1.asy.
  2. You need to then run the Asymptote binary on example-1.asy to generate example-1.pdf.
  3. The diagram example-1.pdf then gets incorporated when you run PDFLaTeX again.

You can run this by hand each time, or if you use latexmk you can automate this process. See the LaTeX usage page.

L-9. Can I see some example source code?

Yes, go to Olympiad page and to download TeX source. (The geometry handouts will have diagrams.) You can also look at Napkin source code.

L-10. Which LaTeX distribution do you recommend?

MikTeX, MacTeX, and TeX Live for Windows, Mac, Linux, respectively.

L-11. Which text editor do you use?

I use Vim with LaTeX Suite. But that is a pretty advanced setup, so if you are a beginner, it may be overwhelming to learn Vim and LaTeX at the same time.

Note that a text editor does not need to be specific to LaTeX, any source code editor will work.

L-12. Which PDF viewer do you use?

Zathura. Evince and Skim are also good.

L-13. How did you get randomized hint order in your geometry textbook?

It's a bit of a hack, but here is demo code.

L-14. How do you live-TeX your notes so quickly?

The main contributing factors are:

  • My typing speed is quite high, at around 650 characters per minute.
  • Vim (see L-11) is fast.
  • Several additional custom keyboard shortcuts specifically for TeX, see the vim folder in my dotfiles.
  • I have conceal enabled in Vim, so I can read my source code more easily.
  • I use latexmk to auto-compile (L-8).

I have been using Vim and LaTeX since I was a teenager, so I am quite proficient with both.

L-15. How did you integrate your problem database with LaTeX?

I wrote my own database software in Python.

L-16. What's the best way to learn new things in LaTeX?

Two things:

  • Read the source code of other people;
  • Search on Google and tex.SE.

L-17. How can I look up a symbol?

Use Detexify.

L-18. How can I have space between my paragraphs?

You can use \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}. You can also add \setlength{\parindent}{0pt} to suppress indents.

But don't do this, it looks terrible. Indents are a better way of separating paragraphs.

L-19. What do you use for slideshows (e.g. on Twitch stream)?


L-20. How do you get LaTeX on Wordpress blog?

I use this Python2 script. Not that elegant but works.

L-21. My code doesn't work / I want to do X, what should I do?

Prepare a minimal working example and ask on tex.SE.

Last modified: Tue Apr 27 11:30:38 2021.