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

learn more… | top users | synonyms

67
votes
2answers
11k 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 ...
63
votes
3answers
10k 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?
141
votes
8answers
6k 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 $ ... $?
41
votes
2answers
2k 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 ...
48
votes
4answers
10k 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 ...
96
votes
4answers
34k 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 ...
30
votes
6answers
6k 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 ...
15
votes
3answers
3k 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 ...
62
votes
12answers
9k 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 ...
78
votes
3answers
7k 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 ...
56
votes
3answers
5k 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 ...
94
votes
5answers
4k 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 ...
61
votes
6answers
2k 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 ...
37
votes
4answers
1k 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? ...
51
votes
4answers
6k 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: ...
29
votes
3answers
8k 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 ...
55
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 ...
54
votes
4answers
40k 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 ...
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) ...
37
votes
6answers
4k 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? ...
23
votes
3answers
6k 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 ...
115
votes
3answers
225k 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 ...
57
votes
5answers
3k 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 ...
36
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 ...
14
votes
4answers
3k 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
2k 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 ...
12
votes
1answer
2k 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 ...
10
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 ...
81
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 ...
71
votes
2answers
30k 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 ...
73
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: ...
96
votes
38answers
7k 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 ...
42
votes
3answers
7k 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 ...
38
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 ...
42
votes
6answers
2k 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 ...
35
votes
2answers
1k 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 ...
5
votes
1answer
1k 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 ...
59
votes
12answers
2k 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 ...
45
votes
5answers
8k 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 ...
48
votes
2answers
6k views

When to use \par and when \\

What is the difference between \par and \\ and when should I use \par instead of \\?
37
votes
3answers
5k 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?
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 ...
10
votes
2answers
488 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 ...
13
votes
2answers
3k 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 ...
17
votes
2answers
223 views

When to use a regular .initial key or a .store in key?

The excellent pgfkeys package provides, among others, two kinds of keys: regular "value-centric" keys that can be declared with /.initial, and "macro-centric" keys are declared with /.store in. Here ...
56
votes
2answers
1k views

Detecting unused packages in LaTeX document

I have quite a bad habit of copy-and-pasting my packages from one LaTeX document to another. Is there any way we can detect unused packages (i.e. \usepackage commands) so that they can be removed from ...
36
votes
4answers
8k views

When should I use non-breaking space?

DEK gained a reputation of painting red the draft dissertations of his students, taking particular note of incidents when they omitted a non-breaking space that should have been included. I have this ...
55
votes
1answer
8k 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 ...
55
votes
21answers
4k views

Do you use TeX for writing your thesis or only for its composition?

I would like to submit my university thesis composited in TeX. But I am not sure what is the best practise in the writing stage so I would like to ask you - do you write your thesis in a TeX editor or ...