Writing in LaTeX: 5 Bad Habits to Avoid

Overall, most academic papers are prepared in Microsoft
Word. But did you know that there’s another option? It’s
called LaTeX. For authors new to LaTeX, I’ll start with an
overview of how it works and the benefits it offers. Then,for authors who are already using LaTeX, I’ll give some tips
and tricks that I hope will be helpful for preparing your next
paper.
What is LaTeX? It’s a template system for typesetting documents. First, you prepare your manuscript in a “structured”
source file, where you specify a template to produce a typeset version of your paper.
Source + Template → Final Typeset Text
In this system, the content of your document is separated from its format. This means that the same source document can be compiled into different formats by simply specifying a different set of styles. For example, let’s look at one
document element—the section heading: \section{Introduction}. When you apply the journal template, thesection heading will be automatically put in the correct format. For instance:

SourceTemplateFinal Typeset Text
I. Introduction

IEEE Template[small caps, 10 pt, Times New Roman, Roman numerals]\section{Introduction}

INTRODUCTIONACS Template[all caps, 10.5 pt, Myriad Pro Light, unnumbered]

The formatting of the section headings is just one example. When you apply a LaTeX template, all the other document
elements will also be put into the correct format automatically. This includes the main text (e.g., single column or double column), the figure captions, the table titles, and the citations (e.g., superscript numerals1 or bracketed numbers[1]).
Another benefit of LaTeX is the ability to handle mathematical text easily. Instead of searching for a Greek letter in
Word and manually italicizing it, LaTeX lets you simply write $\delta$ for δ and $\Delta$ for Δ. You can also easily handle more complicated mathematical expressions and symbols that would be a challenge in Word or its built-in
equation editor.
LaTeX is a powerful tool for preparing documents, but a full introduction to the topic is beyond the scope of this article.
If you’d like to get started learning LaTeX, we offer a free mini course.

1You may copy and redistribute this text if nothing is added or removed, and if you retain the company name ThinkSCIENCE, Inc.
Copyright 2015 © ThinkSCIENCE, Inc. All rights reserved.

Nowadays, LaTeX is frequently used in many academic fields. Although the use of LaTeX is nearly universal among
academics in some subjects (particularly mathematics and computer science), few of us have had a formal class in its
use. Because little formal training on LaTeX is given, most authors look to existing texts to see how to produce the desired effects. Such texts are readily available. For example, the arXiv e-print server hosts more than 1,000,000 papers,and LaTeX source can be downloaded for a large proportion of these.
Although this type of imitative learning has allowed widespread adoption of LaTeX, it has also resulted in certain
techniques being copied so many times that it is not clear to authors that they are bad habits. In the remainder of thismonth’s article, I’ll describe these bad habits and show you what to do instead.

Bad Habit 1: Using “math mode” to produce italics

This is probably the most common bad habit, and rises to the level of mistake. In LaTeX, variables in mathematicalexpressions are rendered in italics, so $name$ will produce n a m e . This is subtly different than name: the space between the letters in the first reflects that it’s being typeset as the product n·a·m·e.

Do This Instead: When you want italicized text, use \textit{text to be italicized}.
Bad Habit 2: Using the wrong kind of quotation markTo allow complete control over rendering, LaTeX offers a variety of styles for quotation marks. Typically, you’ll want
the “inverted commas” style (sometimes called “smart quotes”). However, using the inverted commas produced byword processing software is not guaranteed to produce the correct output, and using straight quotes (so-called “dumbquotes”) is not either. If you’re not careful, it’s very easy to end up with right quotation marks on the left side of a word,”like this”.

Do This Instead: Use the ` character for a left inverted comma and the ' character for a right inverted comma. To
produce double quotes, simply repeat the characters, ``like this''.

SourceFinal Typeset Text

"Text"”Text”

Here, straight quotation marks are used in the source, resulting in a backwards quotation mark in the final text.

``Text''“Text”

However, here repeated ` and ' characters are used, and the final text displays correctly.

Bad Habit 3: Writing very long mathematical expressions without any spaces

In contrast with the previous types of bad habits, it will often be clear when this one is causing a problem, because thetext will extend past the end of the line. By default, LaTeX does not insert line breaks into mathematical expressions.
As a consequence, a very long expression will run past the end of the line.

Do This Instead: Switch out of math mode for non-mathematical punctuation (commas are a particularly easy place

to overlook doing this). For example, writing “We have 12 variables ($a$, $b$, $c$, $d$, $e$, $f$, $g$, $h$, $i$,$j$, $k$, $m$).” will result in correct line breaks and correct typesetting of the commas. Writing, instead, “We have 12variables $(a,b,c,d,e,f,g,h,i,j,k, m).$ will typeset the commas, parentheses, and period as math symbols
and prevent the line from breaking when it needs to.

2You may copy and redistribute this text if nothing is added or removed, and if you retain the company name ThinkSCIENCE, Inc.
Copyright 2015 © ThinkSCIENCE, Inc. All rights reserved.

Bad Habit 4: Writing out your citations in full

A disciplined writer can achieve the correct output even when writing out citations in full, but this requires much morework than using one of the citation and reference packages available. When maintaining a reference list by hand, it isnecessary to ensure that the references are in the correct order (e.g., order of citation or alphabetically by first author),that all references are cited, and that all citations refer to a source listed as a reference.

Do This Instead: Use a citation package and a reference manager. I recommend the natbib citation package.

When using this, you have access to the \citet and \citep commands so that you can distinguish between“ThinkSCIENCE (2015)” and “(ThinkSCIENCE, 2015)” without needing to write names out by hand. There are several
popular reference managers (see a comparison) that can output to BiBTeX (the format used by the natbib citationpackage).

Bad Habit 5: Writing commands to describe the look, rather than the meaning

LaTeX doesn’t always have the look that we want. For example, the default is to display vector symbols as having anarrow on top, but some journals specify that vectors should be written as a bold upright letter instead.

Do This Instead: Use the \renewcommand and \newcommand commands to achieve the look you want for aparticular type of item. For example, \renewcommand{\vec}[1]{\mathbf{#1}} will cause vectors (written withthe \vec command) to appear as bold upright letters, rather than with arrows across the top.* If you decide that you’drather have arrows, or if the journal requires arrows instead, you can update all of your vectors by changing only oneline. As an added benefit, it will be easier to see what you intend if your commands are mostly to express the meaning, rather than the style, of your words.
Special Use for This Tip: You can use commands to automatically switch between “Fig.” and “Figure” and to
make other changes of this type.

SummaryAuthors are asked to shoulder an increasing amount of the burden of typesetting and copyediting for academic publishing. On the one hand, this is extra uncompensated work for authors. On the other hand, it gives authors a chance
to have more control over the final look and feel of the paper. A typesetting system such as LaTeX can simplify thisprocess. Many users find that once LaTeX is mastered, it is faster than Word for producing beautiful texts.
If you’d like our help in converting a document to LaTeX, as some computer science conferences require, in typesetting a book, or in learning to use LaTeX, please contact us. We’re happy to help authors, publishers, and institutions
with this.

*This is effective for Roman letters, but Greek letters require special handling.

3You may copy and redistribute this text if nothing is added or removed, and if you retain the company name ThinkSCIENCE, Inc.
Copyright 2015 © ThinkSCIENCE, Inc. All rights reserved.