Top four LaTeX mistakes


1) Quotes


The first “Yes” was written as




2) Differentials


The first integral was written as

 \int_0^1 f(x) \, dx

while the second forgot the , and was written as

 \int_0^1 f(x)  dx


The first was written as

dx , dy = r , dr \, d\theta

while the second was written as

dx  dy = r  dr  d\theta

3) Multi-letter function names


The first example above was written as

\log e^x = x

and the second as

log e^x = x


The first example was written

\sin 2u = 2 \sin u \cos u

and the second as

sin 2u = 2 sin u cos u

4) Failure to use math mode


The first sentence was written as


and the second as


Related posts:

Microsoft equation editor
Converting Excel tables to LaTeX
Typesetting music in LaTeX
Contrasting Word and LaTeX
Things that work best when you don’t notice them

40 thoughts on “Top four LaTeX mistakes

  1. I’d have to say the #1 LaTeX mistake is none of the above, but simply mismatching delimiters — whether it’s failing to match a parenthesis or other delimiter altogether, or matching it with the wrong kind. Example: frac{1}{x).

    I also am repeatedly guilty of forgetting to close off an environment properly, such as when I have nested enumerate environments (happens a lot to teachers who do this sort of thing for creating tests).

  2. I recommend typing closing delimiters immediately after opening delimiters, then backing up to fill in the content in between. I almost always work this way, unless there is very little content between the delimiters.

    I also recommend aligning LaTeX delimiters vertically, the way one would when writing C code, especially for delimiters like left( and right) that might have a lot of content inside.

  3. The “double-backtick-double-apostrophe solution” to (1) has always bothered me. It looks just as irritating and amateurish as the problem it ”solves”. It was fine for a time when curly quotes were exotic, but today it feels like a hack.

    A better way is to use real curly quotes. On the mac US keyboard layout, they’re option-[ and option-shift=[ (single quotes are under ]). I haven’t used windows in a while but the US-International keyboard layout used to be almost as usable as the mac layout.

    If you use Emacs, AUCTeX lets you use the inch-mark ” just as you would in word-processing software and contextually switches it to “ before text and ” after (” with a second press if you are talking about inches). The config group tex-quote lets you configure this behavior and more. The csquotes package is helpful if you use different languages with different quoting habits – your source can contain “” and the result in French for example be typeset using «».

    Is there any other TeX-authoring software that does this?

  4. mjm: Certainly some TeX-authoring software will fix the quotes for you. My impression is that nearly all TeX software will do this for you. That doesn’t mean the mistake isn’t still common. Maybe people using a general-purpose text editor rather than software (or context-sensitive mode) specialized for TeX.

  5. I’m guilty of #2, but I wasn’t writing a book or article either. Can you point me to a place to see this error “in the wild”?

  6. My own pet peeve is the incorrect use of the non-breaking space (the ~ character). I have seen countless times users putting a space before ~. For example, ‘in Section ~ref{sec:blah}, we see…’ instead of ‘in Section~ref{sec:blah}, we see…’. Or ‘John Smith ~cite{smith}’ instead of the correct ‘John Smith~cite{smith}’.

  7. The problem with putting “the real” curly quotes in a .tex source would be portability. Not all editors use UTF-8, you see?

    About differentials, aside the , spacing, I prefer to write the d uptight, so I usually define a newcoomand{ud}{mathrm{d}} and use it whenever I need a differential.

  8. Great list.

    I have my students write in Latex all the time. If I had to come up with my own list of mistakes my students make all the time I would definitely have included (3) and (4).

    Two others that I would add are to use the letter x instead of times, and the dual to your (4)—writing text in math mode. For example, {xin S: x>2 and x<4} (the "and" should be plain text).

  9. In my country we write quotes as ,,text” (here I used double comma and double apostrofe).

    Integrals should be written as “int_0^1f(x),mathrm{d}x” for the d to be not italics.

  10. Mario: One advantage of HTML over LaTeX in this context is that I assume browsers would render the HTML markup for quotes differently depending on the user’s locale.

  11. My biggest peeve is when people use math mode for italics. I’m currently reading Robert and Casella’s book’ Monte Carlo Methods in R, so I have to add using bit-mapped graphics (the graphics in that book are the worst I’ve ever seen in a book I’ve paid for).

    When I wrote my first book in LaTeX (The Logic of Typed Feature Structures), the good folks at Cambridge University Press gave me a clinic on typesetting, with everything from kerning to laying out bottoms of spreads to be even. Once you learn more about typesetting, almost everything out there looks terrible. Especially egregious is all the wasted white space in most docs, especially vertically; CUP’s LaTeX cleanup crew actually reduced the length of my book substantially by tightening everything up.

  12. Actually, the differential d should technically not be italics. I usually actually make a macro so that I can use mathrm{d} as dif or something. I have to say though, that sometimes I find it looks funny when it’s not italics though.

  13. Thanks for the overview. I was tempted once to write a similar article as nearly all of the above are glaring (at least to one who has a little interestin in typography). And many professors at our university, even those who wrote books, make at least a few of those errors. But I think asking a math professor to review her book for proper typography as an humble CS student is probably a bit … misplaced :-)

    Ian: That depends a little on regional typographic styles. I think in European countries it is commonly not italicized, in American typography it is, however.

  14. From item 4 I can conclude that differentials should be written as mathrm{d}, as long d is not a variable.

  15. When should I use math mode for isolated numerals? Ever?

    here?: “There are 27 objects”

    here?: “one of the objects has value 27″

  16. Andrew: In the latter case, I guess. It gets noticable when you use text figures instead of lining figures (which should be reserved for headings and tables).

  17. I hate the need to use “ . I use a plain editor to write my latex, and it looks ugly and unbalanced when you have “quote is here” on the page. Writing “quote is here’ ‘ has doubled the number of keystrokes. And if I’m cutting and pasting, often I have “quote is here” and I have to go through and manually change all the left quotes.

    Please, someone, write a package to fix this. Csquotes is not the solution, because it adds a huge number of necessary keystrokes and hurts readability of the raw latex code and doesn’t solve the cut-and-paste problem. All that is needed is something that goes through the latex document and whenever it finds the symbol ” (except if it’s being used in HTML) change it in the first instance to “ and in the second instance to ‘ ‘ as one step in the process of turning the input code into ps or pdf. I’d do it myself but I don’t know any programming languages.

  18. Strictly speaking indeed,

    There is an ISO standard relating to mathematics (although widely ignored?). The isomath package ( helps dramatically.

    The differential operator should be roman, and care should be taken with spacing.
    The constant ‘e’ should be in roman, as should all constants (excluding those whose values are experimentally determined, and therefore subject to change).

  19. Another common issue: after something shortened with a dot, the space gets too large. Like: Smith et al. show that ….
    looking like:
    Smith et al. show that ….
    The solution is:
    Smith et al. show that …..

  20. I’ve often wondered whether the differential lower-case ‘d’ should be written in Roman (like functions) rather than italic (like variables). Any ideas?

  21. Jeremy: I believe that is the European convention. My American eyes are accustomed to ‘d’ set in math italic.

  22. Jeremy: I think you’re right (but that may be because I’m Canadian). I was taught that the differential “d” should be written in Roman font type, not italicized. To each their own I guess.

  23. Brackets. Tiny little brackets on massive functions involving huge continued fractions.

    Don’t do this to yourselves. Your students will judge you for it.

  24. At #26 the way to get the straight ‘d’ is apparently operatorname{d}!y/operatorname{d}!x to give dy/dx in the form you ask.

  25. Thank you so much! You’ve just saved me looking really silly in my masters dissertation. My problem was with quotation marks. I’ve never known how to do that. Thank you for making it clear.

  26. Officialy, by far, my top LaTeX mistake is textt{}. So many ‘t’s that I get afraid of putting too much and end up putting too few. =P

  27. Pingback: Top LaTeX Mistakes
  28. Hi,
    Thank you very much for the useful information.
    I was looking for information how to write quotes.
    You have safe my day.

  29. I’ve just accessed this page for the first time (in Firefox 19.0, on Windows 7), and the backslashes in the LaTeX code for the examples aren’t appearing, so both log examples appear as:

    log e^x = x

    instead of the first one appearing as:

    \log e^x = x

  30. Thanks for letting me know! I’ve updated the post.

    I recently exported my content from one version of the blogging software and imported it into a new installation. Apparently the backslashes were lost in the export/import process and so I added them back in.

Comments are closed.