384

The most common mistake is spending too long on TeX coding and not getting the document written.


189

Here are some common, non-esoteric mistakes I help people fix on a regular basis: Ending each and every paragraph in the document with \\ (or even \\[10pt]) instead of a blank line. Ignoring warnings and errors until there's hundreds of them, and the new material isn't getting typeset at all. "Why can't I format my file? I have to finish chapter 2 by ...


178

\par is a TeX primitive and is the same as a blank line (except in special environments such as verbatim where the usual rules don't apply). It ends horizontal mode, causes TeX to break the horizontal text into lines placed on the current vertical list, and exercises the page breaker which may possibly cause the next page to be shipped out. \\ is different ...


127

Someone on pgf-users list writes to T Tantau : I suggest keeping the old syntax, \tikzstyle{my style}=[some options,...] since it is much easier to read and understand. The new syntax would be for the more "advanced" users and library writers. Answer of Till Tantau : I'm a bit undecided on this. First, for compatibility reasons \tikzstyle ...


120

TL;DR: ' is a shorthand for ^{\prime}. ' is defined in latex.ltx as active math character: \def\active@math@prime{^\bgroup\prim@s} {\catcode`\'=\active \global\let'\active@math@prime} \def\prim@s{% \prime\futurelet\@let@token\pr@m@s} \def\pr@m@s{% \ifx'\@let@token \expandafter\pr@@@s \else \ifx^\@let@token \expandafter\expandafter\...


103

When is it better to use \operatorname (or its wrapper \DeclareMathOperator) instead of \mathop? The answer is easy: always, unless you know precisely what's the behavior of \mathop. First of all, one must of course recall that \operatorname and \DeclareMathOperator are provided by the amsopn package, which is automatically loaded by amsmath, but is also ...


92

First of all: never use \include to load a file with personal definitions and packages to use. The choice is thus between \input and \usepackage; for the first it's better to use the extension .tex for the file, for the second .sty is mandatory. What are the pros of the latter solution? Many. For instance you can define options that can change the behavior ...


81

You can write to the aux file with \write\@auxout{hello} or \immediate\write\@auxout{hello2} or \protected@write\@auxout{}{hello3} Depending on requirements. \immediate\write writes to the specified file at that point, expanding the supplied tokens (like \edef) so fragile commands will do the wrong thing. \write does not write at that point it puts a ...


81

Not making enough use -- or (sadly all too frequently) not making hardly any use -- of the opportunities afforded by LaTeX to separate the content of a document from its visual appearance. In particular, too many attempts to engage in visual formatting at early to intermediate stages of writing a working paper, a technical note, or whatever. Addendum: The ...


77

Allow me to give an answer in the form of a practical anecdote: When I wrote my PhD dissertation in chemistry, each chapter had either been published in or was soon to be submitted to a peer-reviewed journal. Each chapter was written at a different time over the course of several years, and of course each journal had its own standards as to whether there ...


75

TeXies have a good chance of recognizing TeXed documents, especially if Computer Modern (or Latin Modern) is used. But assuming you want to convert Word-users and other heathens, figuratively speaking, you could use a colophon, a "brief description of publication or production notes relevant to the edition, in modern books usually located at the reverse of ...


74

Sorry, no, that is not true. Most journals do accept reasonable shortcuts: \newcommand*\NN{\mathbb{N}} % natural numbers \newcommand*\AAA{\mathcal{A}} % automaton \newcommand*\WWW{\mathring{W}^2_1} % Sobolev space 2,1,o \newcommand*\defined[1]{\emph{#1}} % used for defining new terms \DeclarePairedDelimiter\abs{\lvert}{\rvert} % proper absolute value ... ...


71

You can certainly load both the varioref and the cleveref with hyperref provided that you load them in the following order \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} They all play very nicely together. The varioref and cleveref weren't around when I did my thesis, but I'm working on a multi-chapter document at the moment in which I'...


71

DONT Read tutorials that advise best practices from the stone age. Especially german LaTeX tutorials advise something like this in the preamble: \usepackage[latin9]{inputenc} \usepackage[T1]{fontenc} Then i see a lot of people that are writing umlauts like this: \"u. Please forget this! DO In times of UTF8 use \usepackage[utf8]{inputenc} and you're done....


68

TikZ and its underlying engine PGF have a powerful built-in module pgfkeys. It can also be used as a standalone package (via \usepackage{pgfkeys}) to manipulate options for other purposes. No matter which command is used, therefore, every defined option goes to some instruction in the form of \pgfkeys{/key family/key/.subkey = {value list} } Since TikZ ...


66

All features of color are available by loading the xcolor package as well. I would say that you can always load the latter one since: You don't have to care which features are in which one. You surely satisfy all other packages relying on color/xcolor. Many package load it anyways (tikz to name the most important one), so you even don't have to load it ...


65

I think it is best not to compare the expandable/not expandable distinction to concepts from other languages. The main issues relating to expansion are really particular (some would say peculiar) to the execution model of TeX. TeX has two main modes of operation. All assignments and boxing operations happen (in "the stomach" in The TeXBook terminology) as ...


65

Not using version management for your document. I've introduced some colleagues to LaTeX, and the most common questions I get relate to how suddenly something doesn't compile and how it can be fixed yet, when I ask them about reverting to a previous version, they consequently say they never thought of putting their work into a version management system (...


64

Reading these answers, and comments to them, piqued my curiosity… Especially this sentence that Will Robertson wrote in his answer: [...] I usually consider 1em to be about the same size as the font size in points. It inspired me to investigate the actual behavior of TeX (or rather LaTeX). Since my findings could be of interest to those finding ...


64

I don't think writing the thesis in a word processor like Open/Libreoffice or Word and then transferring it to LaTeX would be a good idea. This approach would force you to do some things twice and to take care about lots of stuff that could get lost on the transfer. With LaTeX you have the ability to get a lot of things easily done while writing your text (...


64

(Please note that this answer has been revised to reflect issues raised in the comments.) unicode-math The unicode-math and mathspec packages have very different goals. The unicode-math package is designed to map math markup into unicode characters as supplied by real OpenType math fonts such as the Latin Modern Math, STIX, Asana Math. It also allows (as ...


62

As several people have said, the only way is to write and typeset documents in LaTeX. Calculating the first 30 primes might make you a better programmer, but it is doubtful if it will make you a better LaTeX user, since it is of dubious utility to solve a problem for which LaTeX is not the right solution. If you're not sure what to write: Do your homework, ...


59

Never use \\ to add space between paragraphs. This simple code: \documentclass{article} \begin{document} text\\ text \end{document} produces the message Underfull \hbox (badness 10000) in paragraph at lines 5--6 Besides clogging the console output and the .log file with warnings, using \\\par has real undesired effects when a page break occurs just ...


58

I came to this question thinking "yeah! Why?" but upon reading the currently extant comments and answer I have already changed my tune and am now tending the other way. What I realized, thinking about it and about my small interactions with this package, is that it provides much the same service within LaTeX as LaTeX (or even just TeX itself) provides for ...


57

there is absolutely no advantage to using \\ to end a paragraph, and in fact, a big disadvantage -- it doesn't actually end the paragraph; it only goes to a new line, and probably triggers an underfull line report in the log. there are only two ways to end a paragraph in "basic" text mode: a blank line, or \par. there are some (but few, and mostly obscure) ...


56

The LaTeX book consistently uses {} in all cases so all the examples use that form, you always see a^{2} even though everyone knows that a^2 works just as well and arguably improves the look of the source. When the command taking the argument is a macro and the argument is necessarily a single token, most people drop the brackets as a matter of course so \...


53

To start with a quote (from Wikibook): If a friend of yours wants to give you his/her template, it is a very nice gesture. Say Thanks, but no, Thanks. You won't believe how many strange stuff is in there without him/her even noticing it. All those are little tripwires that you don't want in your document. Unfortunately, the same is true for many templates ...


51

There are a few places in TeX where braces are a required part of the syntax but those are few. When it comes down to arguments then TeX accepts a single token without surounding braces so \mathrm i would work if "typeset". But try this: \newcommand\x{log} \tableofcontents \section{$\mathrm \x$} and you will get a subtle error in your output (but no ...


51

Addition 2018: The MiKTeX console In 2018 a new tool, the MiKTeX console, appeared which unifies all the three previously used tools (settings, package manager, update manager). You can check for updates, install new packages, add local roots and run most of the maintainance tasks with the console. Tabs to manage formats and languages have been added now ...


Only top voted, non community-wiki answers of a minimum length are eligible