A "best practice" is a technique or approach that TeXnicians recognize as giving better results than other approaches.

learn more… | top users | synonyms

75
votes
2answers
15k views

Should \tikzset or \tikzstyle be used to define TikZ styles?

The PGF/TikZ manual states in section 12.4 Using Graphic Options, page 120 (v2.10), that TikZ styles can be set using: \tikzset{my style/.style={<tikz options>},...} However, in several ...
67
votes
3answers
13k views

Does it matter if I use \textit or \it, \bfseries or \bf, etc

I typically use \textit{Some italicized text} while some of my colleagues use {\it Some other text} Should I bother changing one or the other, or does it matter?
42
votes
2answers
3k views

Why should the minimal class be avoided?

In a comment to my answer to Drawing a rectangle along the border of a circle, Peter Grill said that he read that the minimal class should not be used for a Minimal Working Example. I wonder why, and ...
151
votes
8answers
8k views

Are \( and \) preferable to dollar signs for math mode?

Along the lines of Why is \[ ... \] preferable to $$?, what reasons are there (if any) to favor \( ... \) over $ ... $?
56
votes
4answers
13k views

When not to use \ensuremath for math macro?

I have gotten into the habit of using \ensuremath around math components in every macro that I define, so that I can use the same macro inside and outside of math mode. But egreg's comments in ...
106
votes
6answers
45k views

utf8x vs. utf8 (inputenc)

I normally use \usepackage[utf8]{inputenc} for my latex document but on this site i saw a lot of code with \usepackage[utf8x]{inputenc}. What are the differences between the 2 options ? Is there one ...
36
votes
6answers
8k views

Footnotes in tables?

I would like to have footnotes in tables, but the \footnote command does not work inside a table environment. Googling one finds that this is a frequently asked question, at least in the UK. That ...
65
votes
6answers
3k views

How to keep up with packages and know which ones are obsolete?

I'm an on and off user of LaTeX so I'm not familiar with every package out there. Having said that, whenever I use LaTeX and need to accomplish a certain goal (i.e. generate a list of appendices), I ...
16
votes
3answers
4k views

What is the preferable setup for MiKTeX to keep all packages up-to-date easily?

By default, MiKTeX is set up for all users to the folder C:\Program Files\MiKTeX 2.9 However, packages added on-the-fly go to the folder C:\Users\CurrentUser\AppData\Roaming\MiKTeX\2.9 (in case of ...
59
votes
2answers
12k views

When to use \par and when \\

What is the difference between \par and \\ and when should I use \par instead of \\?
68
votes
12answers
11k views

What are the advantages of using version control (git, CVS etc) in LaTeX documents

Why would I need to use version control with my LaTeX documents? I know people who do it, and I've seen questions about it on here and on SO, but I haven't understood what value there is to doing ...
85
votes
3answers
10k views

Which measurement units should one use in LaTeX?

There are various measurement units that one can use (such as pt, mm, in, em, ex etc.) for specifying lengths and heights. For font-based units (em and ex) the actual spacing will vary slightly ...
62
votes
3answers
6k views

Theorem packages: which to use, which conflict?

As far as I know, one can create theorem environments using any of amsthm, ntheorem, thmtools and probably more. How should I define my theorem environments? Is one package clearly superior? Which ...
104
votes
5answers
5k views

Best practice on organising your preamble

I am putting together a large document and my preamble is unwieldly and disorganised. What order does it make sense to load packages. Obviously, hyperref goes last, apart from things that have to go ...
57
votes
4answers
53k views

“(” or “\left(” parentheses?

What is the difference between ( and \left( in LaTeX? Sometimes, when the content is small, it does not seem to matter which pair I use. What is the best practice when it comes to which parentheses ...
38
votes
4answers
2k views

Naming LaTeX files: best practice?

What's the best practice for naming LaTeX files? I know R, Matlab, and Java all differ in their use of ., _, -, camel case, capitalization, etc. What do people generally use for naming LaTeX files? ...
60
votes
4answers
8k views

Is there a preference of when to use \text and \mathrm?

I'm unsure of when it is preferable to use \text versus \mathrm, is there some unwritten rule about the use of these? For example, I saw the following code in a math post: ...
13
votes
1answer
3k views

How should one maintain and update a MiKTeX installation?

Every once in a while after updating MiKTeX, the installation gets into an inconsistent state. This might be a problem with the packages (an example is described in this question), but sometimes ...
148
votes
3answers
281k views

“Correct” way to bold/italicize text?

Is either of these considered better/more readable/more "proper"/more conventional than the other for making text bold? If so, what is the reason? I like my text \textbf{bold} versus: I like my ...
55
votes
6answers
2k views

How bad for TeX is omitting braces {}, even if the result is the same?

Sometimes writing braces and omitting them produces the same result: \tilde{\psi} \mathrm{e}^{\mathrm{i} \pi} vs \tilde \psi \mathrm e^{\mathrm i \pi} Or (taken from Werner's comment below) ...
32
votes
3answers
12k views

Why not use vertical lines ('|') in a tabular?

My question is a follow-up to the answer to a follow-up question, to be found here. ;) I'd like to know why one would advise against using vertical lines (via |) in a tabular (i.e. in ...
25
votes
3answers
7k views

Is there a difference between \textit and \itshape?

I have only ever used \textit (and \emph for emphasized text), but have noticed that in some TeX examples, \itshape is used instead of \textit. Is there a difference between \textit and \itshape? If ...
57
votes
3answers
3k views

Are there any coding style guidelines for LaTeX?

I have been using LaTeX for a long time now, but still all my document files look a bit messy. Now I want to get rid of this bad habit and get some order into my code. That is why I am wondering ...
40
votes
1answer
2k views

Difference between ref, varioref and cleveref. Decision for a thesis

How can one make a quick decision what the best "ref" for a thesis in pdflatex with hyperref is? After a few hours reading I do not know more than ref is used by everyone who does not know about ...
39
votes
6answers
6k views

Which figure type to use: pdf or eps?

Both are vector graphics (typically) and both can be imported painlessly into a pdflatex document (so let's say we ignore dvi for this question). What are the advantages and disadvantages of each? ...
61
votes
5answers
4k views

What is best way to mention that a document has been typeset with TeX?

Is there any common way to mention that a document has been typeset by TeX? So non-TeXnicians (TeXperts) may become a little familiar with the TeX world. Update: It would be nice if one hero make a ...
82
votes
2answers
40k views

\emph or \textit

In the comments section of Does it matter if I use \textit or \it, I asked for a clarification of these points. The clarification has mostly been made, but it was requested that I turn this into a ...
40
votes
6answers
3k views

Writing readable LaTeX

Lets say I have the following LaTeX code \subsection{Convex sets} A set \( \mathcal{S} \) in \( \mathbb{R}^n \) is said to be convex if \[ \mathbf{x}_1, \mathbf{x}_2 \in \mathcal{S} \implies \lambda ...
15
votes
4answers
4k views

Working with templates

I have just read the wonderful article LaTeX templates and realized that I have tried to practice this approach but there is one technical aspect which I don't know how to tackle. I am talking about ...
34
votes
8answers
3k views

Why do people use unnecessary braces?

I often see people creating new macros where the macro token is surrounded by braces. For example, \newcommand{\foo}{foo} This is unnecessary and I find the extra braces make it harder to read. Why ...
11
votes
1answer
2k views

Enumerate/itemize without margins in table cell best practice

I want to use an itemize or enumerate list inside a table cell. For this there should be no margin around the list. My question is, what is best practice to do this? I found different solutions for ...
6
votes
1answer
2k views

Update TikZ/PGF on mac

the TeXLive 2012 distribution on my Mac is shipped with TikZ version 2.10 - I want to use (try) the CVS (most updated beta(?) version). Here's what I've done so far: Downloaded the the TDS package ...
120
votes
42answers
8k views

What are the most common mistakes that beginners of (La)TeX and Friends make?

I want to collect the most common mistakes, misconceptions, pitfalls, etc that (La)TeX and Friends users make. Please one answer for each mistake, misconception, pitfall, etc. I am only interested in ...
83
votes
5answers
3k views

What are the finishing touches you put to a document?

I'm curious about the finishing touches that people put to LaTeX documents. Are there any canonical or special things that people do in finalizing a document? What I do: Careful proofreading of ...
45
votes
6answers
3k views

Efficient ways to anonymize a document

Many academic journals practice double-blind peer review which means that the author is required to blind their document by removing any references that can reveal the author's identity. How can I ...
23
votes
1answer
10k views

How to properly code a TeX file, or at least avoid `badness 10000`

I'm coding a TeX file and although the .pdf is correctly rendered, I'm using "stone age" tools to code it. As some examples, I use \\ to leave a line space between two paragraphs, or \noindent in ...
77
votes
4answers
2k views

Techniques and packages to keep up with good practices

Question What techniques and packages are there to keep up with good practices? What I already know I already know of the following packages for this kind of purpose: ...
49
votes
5answers
11k views

Good practice on spacing

In various places, in passing, I've seen mention of various good practices regarding well-behaved spacing in LaTeX. For example, Dr. Who should really be written Dr.\ Who or Dr.~Who to get the right ...
42
votes
3answers
9k views

When to use bold, italics, small caps, typewriter etc.?

I'm a little confused on the purposes of each kind of text in LaTeX. I know the function of some of them, but sometimes people use each for different reasons. For example: \texttt is for code (no ...
62
votes
2answers
10k views

When should one use \begingroup instead of \bgroup?

Is there ever a case when the use of \begingroup is preferred to \bgroup? Obviously, \bgroup is necessary in cases where you need to have balanced braces and thus cannot use {, but when is it ...
49
votes
3answers
9k views

What is the difference of \mathop, \operatorname and \DeclareMathOperator?

One sees all kind of versions in source files for defining something like a limit etc. So my question is which one serves what purpose. Is there any "best practice" in chosing one over the other?
39
votes
4answers
7k views

Should I \mathrm the d in my integrals?

When writing an integral, it seems like something should be done to separate the "d", as in \int f(x) dx, so as not to confuse it with a variable. I've seen it left as-is, bolded, and straightened. ...
35
votes
2answers
2k views

Will cruft from a previous compile ever change the final look of my document

Ok, this has been bugging me for a while; Will cruft left over from a previous run of LaTeX ever change how my document looks? Would the following procedures ever give me different results: I ...
22
votes
3answers
1k views

Modifying .sty files?

Yesterday I did some changes in the layout of my TeX document. I couldn't accomplish the changes until I opened the .sty files and modified some of their code. I am sure this is not the best idea. For ...
6
votes
2answers
262 views

Fractions with large elements

What is best practice for typesetting fractions with large objects in the numerator and denominator? For example, fractions with limits, integrals, summations, etc... cause the expressions to look ...
62
votes
12answers
3k views

Best practices references

What resources (online or otherwise) exist that give good advice on best practices for TeX, etc.? I'm looking particularly for things that assume you already know TeX or LaTeX, and aim to help you ...
36
votes
7answers
2k views

Should I place \title, \author, \date in the preamble or after \begin{document}?

The motivation for this question Forgive me if this looks very basic to you but nobody has pointed out to me yet until now in a comment to a question that the \title command (and thus the other two ...
16
votes
2answers
3k views

Choosing font for bold small caps (or any other particular family+series+shape combination)

What is the best way (most proper and general solution) to get rid of the warning LaTeX Font Warning: Some font shapes were not available, defaults substituted. by explicitly setting which font ...
13
votes
2answers
4k views

What is the preferred way of defining a TikZ constant?

I'm drawing a TikZ figure and am going to need a couple of constant that I could easily change between compilations, e.g. a main radius, a proportion, a number of lines, etc. What is the preferred way ...
12
votes
2answers
582 views

Best way to part answers from solutions?

Now, if anyone could change the title into something better that would be great =) I am writing a rather long document, which contains plenty of integrals. I have a big list of integrals sorted in a ...