LaTeX (usually pronounced /ˈlɑːtɛk/, LAH-tek) is a popular typesetting tool which linguists use to create documents like handouts, journal articles, theses, books and even presentation slides.
If you are starting out in linguistics, I think it’s definitely worth exploring LaTeX. Setting up LaTeX requires some time and effort upfront, but will save you lots of time in the long run and produce stunningly beautiful output.
I give some reasons why you should use LaTeX and tips on how to get started. (In particular, I highly recommend using the LaTeX editor LyX. Read on to find out more.)
I also include some tips on how to create presentation slides and type Chinese characters and hanyu pinyin.
Why use LaTeX?
Here are 10 reasons why linguists should use LaTeX:
- Drawing syntactic trees. If you work on syntax, you’ll want an easy way to include professional-looking syntactic trees in your documents. You can use an online syntax tree generator like this, but you’ll eventually want a tool that can draw arrows between nodes in a syntax tree, boxes around subtrees, phase boundaries and other annotations.
- Typing semantic denotations and other formulas. If you work on semantics, you’ll want to have an easy way to type double square brackets and other symbols in your documents. You’ll definitely need a good tool if you want to include syntactic trees inside the aforementioned double square brackets.
(In case you were looking for how to type semantic denotation brackets:- If you’re using Microsoft Office, copy the symbols here ⟦ ⟧ and paste them into your document.
- If you’re already using LaTeX, add
\usepackage{stmaryrd}to your preamble and use the commands$\llbracket... \rrbracket$in math mode.)
- Automatic example numbering. As a linguist, you’re going to have to include many numbered examples. LaTeX makes sure the numbers are in running order. No need to number examples by hand or check them manually.
- Easy cross-referencing. Once you’ve included your examples, you’re going to have to reference these examples in your text (e.g. “Consider the minimal pair in (8) and (9)”). This is easy to do with LaTeX. Just slap a label onto your example and insert a cross-reference to that label.
- Multilingual glosses. As someone who works on Mandarin Chinese, all my examples need to include word-by-word glosses and translations. This is typically done in Microsoft Word by using spaces, tabs or borderless tables. There is no way I’m going to do this by hand. The solution in LaTeX is much less fiddly. (Tip: The Leipzig Glossing Rules are standard in the field.)
- Automatic citations and bibilographies. I insert a citation in my text, and all my citations appear in a bibliography at the end. I can download a style sheet for a top journal like Linguistic Inquiry so that my bibliography is formatted just like it is in that journal.
- Automatic hyperlinks. And I don’t mean just for URLs. Click on a cross-reference to jump to the relevant chapter, page or example. Click on a citation to jump to the bibliography entry. Click on a footnote mark to jump to the footnote.
- Commenting out sections. You can include large chunks of text that won’t appear in the final PDF. Great when you’re working on a draft and want to delete something but also want to keep it just in case.
- Create presentation slides from your documents. You can create presentation slides using LaTeX too! This means that you don’t have to transfer your material from Microsoft Word to Microsoft PowerPoint. For example, I don’t have to resize my Mandarin Chinese example sentences by hand when transferring them from a document to a presentation deck. LaTeX takes care of it for me.
- Work with large documents in smaller chunks. If you’re writing a dissertation, you can write each chapter in a smaller document, then string them together into the final product.
Which LaTeX editor should I use?
If you have to choose one LaTeX editor, I would recommend Overleaf (https://www.overleaf.com/).
- Overleaf is an online editor, so you don’t need to download or install any software to get started.
- You and your coauthors can edit the same document in real time, e.g. while on a Zoom call.
- You may have access to premium features if you (or one of your collaborators) are affiliated with an institution.
- The downside of Overleaf is that you actually have to learn to write LaTeX.
For all of my solo projects, however, I much prefer using LyX (https://www.lyx.org/).
- LyX is more like a word processing tool like Microsoft Word or LibreOffice Writer, so you can create simple documents without any LaTeX code.
- You can focus on what you are trying to express instead of writing code to italicise text, insert bullet points, create a simple table, etc.
- The downside of LyX is that you have to spend some time upfront setting it up on your computer.
How do I get started with LaTeX?
To get started with Overleaf, go to https://www.overleaf.com/ and sign up for an account.
To get started with LyX:
- Download and install TeX Live. The instructions should be easy to follow, but the installation could take a few hours.
- Download and install LyX. You should install TeX Live before installing LyX.
For both Overleaf and LyX:
- Set up a reference management system (RMS) if you don’t already have one! I use Zotero (https://www.zotero.org/). Add your references to your RMS.
- Export your references to a file (typically a .bib file). Upload this file to your project in Overleaf or save it (preferably) in the same directory as your .lyx file for LyX.
- Download a bibliography style file and save it in the same place as your .bib file. You can use the unified style sheet for linguistics (unified.bst) or a style sheet for a top journal like Linguistic Inquiry (linquiry2.bst).
How do I learn LaTeX?
Whatever you do, do not start writing LaTeX from scratch!
- Create your first document using a template. Both Overleaf and LyX offer a range of templates.
If you are using LyX, you can download my LyX template. It shows you how to include syntactic trees, semantic denotations, automatic example numbering, cross-referencing and multilingual glosses. - Refer to an online reference. Overleaf has an excellent guide for beginners. Pay attention to the distinction between commands like
\textbf{...}and environments like\begin{center} ... \end{center}. - If you’re unsure, search for answers on the Internet. You’re likely to find one on Stack Exchange.
How do I create presentation slides using LaTeX?
You will need to create a new document using a Beamer template. You can use a default template, or look online to see if your institution has a template. (For example, UCL has a Beamer template on Overleaf, and it is also available for download if you want to use it in LyX.)
Important: multilingual examples created with the covington package can sometimes cause issues in your Beamer slides, which are called “frames”. To get around this issue, you should always use fragile frames instead of regular frames: \begin{frame}[fragile] ... \end{frame}. To create fragile frames in LyX, go to the Environment choice box at the top-left corner and select “FragileFrame”.
How do I type Chinese characters and hanyu pinyin in LaTeX?
As someone who works on Mandarin Chinese, here is the setup I use to type Chinese characters and hanyu pinyin without any additional markup or special packages.
- I use XeTeX. In LyX, go to Document → Settings → Fonts and select the checkbox “Use non-TeX fonts (via XeTeX/LuaTeX)”).
- I include the following in my preamble (you may need to download the relevant fonts):
\usepackage{fontspec}\usepackage{xeCJK}\setCJKmainfont{SimSun}\setmainfont{Libertinus Serif} - To type pinyin, I like using TypeIt (https://pinyin.typeit.org/).
- Sometimes, journals don’t display pinyin correctly. In that case, I revert to
\={a}for ā,\'efor é,\v{\i}for ǐ,\`ofor ò,\v{ü}for ǚ, etc.
