A "best practice" is a technique or approach that TeXnicians recognize as giving better results than other approaches.
119
votes
8answers
4k 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 $ ... $?
77
votes
5answers
3k 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 ...
70
votes
3answers
5k 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 ...
69
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:
...
65
votes
5answers
2k 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 ...
64
votes
4answers
17k 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 ...
53
votes
2answers
14k 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 ...
52
votes
3answers
55k 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 ...
50
votes
12answers
6k 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 ...
50
votes
11answers
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 ...
50
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 ...
49
votes
3answers
6k 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?
49
votes
3answers
3k 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 ...
48
votes
2answers
717 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 ...
47
votes
21answers
3k 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 ...
47
votes
5answers
2k 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 ...
46
votes
6answers
1k 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)
...
42
votes
2answers
5k 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 ...
42
votes
1answer
356 views
Is it always best practice to not include text punctuation in inline math mode?
It has been pointed out on this site, e.g. here by egreg, that text punctuation doesn't belong to the formula in inline math. I've been following this practice for a long time, so I write for all ...
41
votes
11answers
2k views
How to practice LaTeX?
With many programming languages, you have the opportunity of practicing the language by doing problems or developing programs that will do certain things. With LaTeX, however, you can't exactly do ...
40
votes
5answers
4k 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 ...
40
votes
4answers
5k 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 ...
39
votes
3answers
4k 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 ...
39
votes
4answers
19k 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 ...
39
votes
1answer
5k 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 ...
38
votes
5answers
931 views
Why use a package to typeset units?
I've seen a lot of posts about different packages for typesetting units and their relative strengths and weaknesses. Most posts seem to agree that the siunitx package is the most up to date package, ...
38
votes
3answers
4k 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:
...
37
votes
3answers
2k 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 ...
35
votes
3answers
778 views
Advantages and disadvantages of fully expandable macros
As I currently understand them, fully-expandable macros are analogous to pure/effect-free functions in functional programming. Correspondingly, things that are not expandable, such as \def, are ...
35
votes
6answers
1k 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 ...
34
votes
1answer
530 views
What is the advantage of using $f^\prime$ instead of $f'$?
Although the two outputs look quite similar, what is the advantage of using $f^\prime$ instead of $f'$?
By the way, here is my code:
\documentclass‎{article‎}‎
\begin{document}‎‎‎
\[‎ ‎f^‎\prime ...
34
votes
3answers
968 views
Who *doesn't* use e-TeX?
I was just browsing the new questions and noticed egreg's recent answer, in which he uses a certain extension from e-TeX and cautions the reader that it is not compatible with Knuth TeX. And so I ...
33
votes
2answers
1k views
When to use \par and when \\
What is the difference between \par and \\ and when should I use \par instead of \\?
33
votes
2answers
747 views
List of higher-level LaTeX commands corresponding to TeX commands
Since LaTeX is a format built on top of TeX, it surely has several high level abstractions that perform similarly to TeX commands, with some added error-handling functionality, for example. I always ...
32
votes
6answers
3k 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? ...
31
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 ...
31
votes
2answers
426 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 ...
31
votes
3answers
1k views
How to properly typeset all forms of punctuation used in English-language documents?
English documents tend to use these types of punctuation:
periods
apostrophes
brackets of various kinds
colons and semicolons
commas
dashes and hyphens
ellipsis
exclamation and question marks
...
31
votes
2answers
2k views
Styleguide for LaTeX similar to the Google styleguides?
Even though I don't work at Google, the Google Styleguides have been very helpful for me in adopting consistent, readable style conventions for my code. Unfortunately, there is no Google Styleguide ...
31
votes
1answer
619 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 ...
31
votes
2answers
430 views
Best practice for index construction — recommendations and references
I'm about to embark on something I've never done (at any rate, seriously) before: preparing an index for a ~200-page document. I have started, but I get the feeling "something's wrong".
I know that I ...
30
votes
7answers
866 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 ...
30
votes
6answers
2k 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 ...
30
votes
4answers
547 views
What's the folk-lore on automatic testing of TeX programming?
Say you write a macro or a package, which goes through the usual course of software life-cycle. How would you define a set of tests, and have this set run automatically to make sure that changes to ...
30
votes
2answers
1k 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 ...
28
votes
3answers
837 views
Why use .sty files?
Why is it preferable to put inclusions of commonly used packages and user defined commands in a .sty file instead of putting them in an ordinary .tex file?
28
votes
4answers
899 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? ...
28
votes
3answers
969 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?
28
votes
3answers
1k views
Teaching LaTeX and friends
Similar questions on how to teach LaTeX have been posted here already, but I would like to give them a slightly different touch:
Has anybody experience with teaching LaTeX in relation with other ...
27
votes
4answers
976 views
References for learning how to check for typesetting problems
The following thread discusses a number of tasks one must accomplish to finish up a document: What are the finishing touches you put to a document?
Did the original author of TeX make such small ...

