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

learn more… | top users | synonyms

119
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 ...
9
votes
6answers
319 views

Create association lines between characters

I intend to create "association lines" between characters, where the start of the line is one or more characters inside a word, and the end of the line is a single character. Something like this ...
5
votes
1answer
250 views

What is the right way to cite @inproceedings with biblatex?

What is the right way to cite @inproceedings with biblatex? More specifically, many computer science proceedings paper citations seem to use book titles like "Proceedings of the 28th Annual ACM/IEEE ...
5
votes
2answers
331 views

Plotting R boxplots with pgfplots

I use quite a number of boxplots in my writing, and have chosen pgfplots as my plotting solution for a number of reasons (one of which is the benefit of having the data to build the plot in the tex ...
27
votes
1answer
290 views

Best practice for fixing a clash between packages without altering the .sty files?

Here is another casualty of TeX's flat namespace and another reason to start using LaTeX3... I noticed today that the algorithm2e and keystroke packages clash. More specifically, they both define a ...
4
votes
1answer
209 views

What is the right way to indent your source code?

This is probably a really basic question: When I write code, I want to achieve a logical and readable structure of the lines, where I can see which brace closes which brace. \begin{equation} ...
6
votes
4answers
280 views

Is there a better way to check divisibility in LaTeX?

I want to draw a trimmed ruler, for example, from 2.3cm to 3.9cm where the distance between two consecutive marks is 1mm. I have difficulty to efficiently check whether or not the counter is a ...
5
votes
1answer
113 views

How to get proper spacing when typesetting an expression such as $f\left(\frac{y}{2}\right)

I am trying to typeset the value of a function $f$ for $x = \frac{y}{2}$ (or something other which requires more vertical space). To get properly sized parentheses I tried: f\left(\frac{y}{2}\right) ...
4
votes
2answers
189 views

Macro names with one single figure like \2, a bad practice?

I know that it is not recommended to use macros like \H0 since it contains non-letters characters. However, what about the macro names like \2 with only one figure, which are allowed without trouble ...
5
votes
2answers
273 views

mdframed label multiply defined (with listings and paracol)

I use three packages (in a latex "book" document) to display source files (not only tex and sometimes loaded from external files) and their outputs (sometimes loaded from external files) side by side. ...
21
votes
4answers
752 views

Cleaning my TeX-code

I've recently finished my first paper written in LaTeX. I've gone through the code and tried to clean up and make it more reasonable - this is quite a challenge. I don't want you to actually ...
6
votes
2answers
168 views

Should I use a space or a new line after a period?

After a period in a .tex file, within a paragraph, should I use a space or a new line? I.e. like this: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec rhoncus vestibulum metus ut ...
11
votes
2answers
267 views

“Well-formed” LaTeX?

Some "commands" in LaTeX are stand-alone. For example \documentclass{...} or \textemdash. Some others have closing "commands". For example, \begin{document} and \end{document}, or \begin{equation} ...
10
votes
1answer
198 views

Why is it discouraged to use starred sectioning commands?

I'm currently considering to use \section* to add a nomenclature. Unfortunately I can't find the exact answer, but I've read on stackexchange that using starred versions of sectioning commands is ...
4
votes
1answer
144 views

Putting the \chapter in main .tex file or inside included files?

My question is this: What is the usual way of making chapters when working with large .tex files? Do you put \chapter{Chapter 1} inside the main .tex file, or in the included files? What is the ...
5
votes
1answer
172 views

The difference between $\alpha _1$ and $\alpha_1$

Many people would edit my $\alpha _1$ into $\alpha_1$, do you know whether there are any reasons for the default space? Which is better? Since I generate the .tex by Mathematica, the spaces are ...
0
votes
1answer
78 views

referring terms in the glossary [closed]

I am using LaTeX to write my thesis. To define new terms and its definition, I have used the glossary as separate chapter at the end of thesis. I use \gls command to refer the terms defined in ...
12
votes
4answers
608 views

How to properly typeset multiletter quantities, e.g. Re or Nu (Reynolds, Nusselt numbers)

Is there a canonical way to typeset such quantities in equations and inline math? \documentclass{article} \begin{document} $Re$, $Nu$ are clearly not an option. $\mathit{Re}$, $\mathit{Nu}$ appear ok ...
4
votes
0answers
113 views

The use of enumerated options [closed]

I am not sure what would be the best-practice approach to type setting an observation that has an enumerate list. For instance, consider: \documentclass{article} \usepackage{enumitem} ...
6
votes
3answers
265 views

How to keep tables readable in code

What is the best practice for creating and updating tables in Latex? I am using Texmaker but I find it hard to update a table like adding entries or adding a column. I have to count entries which is ...
3
votes
1answer
481 views

Good general LaTeX style practice

I just created my first document in LaTeX (a resume) and while I'm familiar with good practices in programming, I'm not familiar with what constitutes good practices in a markup language like LaTeX. ...
30
votes
2answers
858 views

What is good practice when preparing a book for printing?

I'm writing my thesis using Latex and nearing its completion I'm beginning to worry about the quality of the hardcopy. I'm curious about what should be taken into consideration when preparing a ...
17
votes
2answers
285 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 ...
0
votes
0answers
133 views

Select colors to avoid dithering when printing document

I have some listings and some portions of text, that need (or at least i want them to have) a colored background. At the moment i'm using blue!5, which gives a nice color on the screen, but has the ...
4
votes
1answer
152 views

lots of overfull boxes in a custom subsection navigation with multicols

I hope this is not too localized... I need a vertical subsection navigation where the subsection names only consists in numbers (1, 2, 3, etc.) printed in a three columns layout. I managed to obtain ...
4
votes
3answers
150 views

What should be the right width of an image for each document-classes?

I would like to print good images in A4 document (300 or 600 dpi). Using an external software,I have to merge differents big images to create a bigger one so I have to resize it with the same software ...
13
votes
1answer
201 views

What practices are there regarding the use or avoidance of “internal” TeX or LaTeX commands?

What practices are there regarding the use or avoidance of "internal" TeX or LaTeX commands? (About "command" vs "macro", there is some discussion in this TeX.SX answer, though I don't know whether ...
4
votes
1answer
217 views

What are the generally accepted guidelines for adjusting \linespread to avoid extra spreading from inline math?

General Background I am just starting to think about typesetting and LaTeX in anything close to a serious manner, and am getting lots of questions that perhaps are appropriate for this site, but ...
9
votes
3answers
453 views

How should I typeset the physical dimensions of quantities?

As an example: The Newton's Law gives F=ma vs. dim F=MLT^{-2} My question is: Should I typeset the "MLT" in \mathit shape? You can contrast ...
3
votes
0answers
225 views

How to manage a central bibtex file which plays nice with (TexMaker's) auto-complete?

I want to keep a single central bibtex file that is shared across all my machines. My approach has been to set up a local tex-tree in a dropbox folder, and just store the file there. So far this has ...
6
votes
2answers
322 views

Using a negative space \! to differentiate between functions and products

In Physics, I often have functions like f(x), but also multiplications like y(-x). I would like my math to be easy to understand, so I am looking for a way to suggest function calls and ...
5
votes
1answer
206 views

Best practice regarding graphics size

Whenever I make graphs from R to be included in Latex, I find myself scuttling back and forth between R to specify the size of the output and Latex to play with the \includegraphics[scale=??]. It ...
31
votes
2answers
265 views

What are the best practices for programmatic interaction between LaTeX3 and LaTeX2e?

I'm thoroughly enjoying using LaTeX3 for programming my LaTeX stuff and the more I use it, the easier it gets and the more I shudder at returning to LaTeX2e or even pure TeX! But every now and again ...
2
votes
1answer
464 views

Compound fractions (i.e., “mixed numbers”) look bad in displaystyle

I find that in display mode, fractions that represent simple rational numbers look way too big. For instance, consider this case: $$ a = \frac12(b+c) $$ The fraction gets inordinately large ...
10
votes
1answer
615 views

Unsung Heros - PSTricks, TikZ, pgfplots,

While watching presentations (mostly made with beamer) at my university I noticed, most people here use LaTeX to create there presentations which is really nice. (not just for the health of my eyes) ...
7
votes
2answers
221 views

Finding the depth of nesting in a macro call

Is there a general way to find the depth of a macro evaluation? For example, consider the following script, \documentclass{beamer} \usepackage{mathtools} \usepackage{calc} \begin{document} ...
7
votes
1answer
161 views

auto-pst-pdf or pdftricks2?

When I compile a LaTeX documents containing PSTricks code, I normally use the package auto-pst-pdf, but recently I found pdftricks2. Should I use auto-pst-pdf or pdftricks2 and what are the ...
4
votes
2answers
209 views

Inheriting from beamer

I'm trying to write (my first) document class which will be an extension of beamer. In particular I want this class to produce the slides that I like. One of the things that I want is to have a ...
24
votes
3answers
2k views

What is the difference between unicode-math and mathspec?

I'm currently typesetting my lecture notes for classical electrodynamics using the tufte-book class and XeLaTeX. This is my first time using XeLaTeX and so I stumbled upon the two packages ...
3
votes
1answer
99 views

Difference between bibliography management styles

There are two ways that I've seen people including their bibliographies. The first is without including any package: % Document: \bibliographystyle{ieeetr} \bibliography{<file>} And the ...
5
votes
1answer
457 views

Quotation marks: Is there any difference between \grqq/\glqq and “` / ”'?

I am currently employed at university to proof-read lecture notes. This means I read quite a lot of text and correct language errors / wrong references to tables / images, but I also try to improve ...
8
votes
2answers
117 views

Line breaking with `and/or` + babel

I have continuously come up with the problem of overfull hboxes because sometimes I write and/or in my papers. For example, this phrase: To design and implement a biofeedback system for alerting ...
16
votes
2answers
339 views

Should I make a package or class for my usual preamble, or include it in every document?

This TeX.SE thread is a good resource for how to make your usual preamble into a package or document class. I would like to know why I should do that. What are the pros and cons of doing so, as ...
11
votes
2answers
192 views

What is the best practice for arithmetic operations specially for package/class writing?

There are some possibilities to execute arithmetic operations inside a package or class. TeX TeX supports \advance, \multiply or \divide to execute arithmetic operations. However the syntax is more ...
42
votes
1answer
1k views

On the basics of writing to & reading from auxiliary files (.aux, .toc, etc.)

Some actions (such as generating the Table of Contents) require two passes of the TeX compiler: during the first pass, some data get written to an auxiliary file, only to be retrieved during the ...
31
votes
1answer
1k views

Best practice for writing comments in LaTeX documents

I would like to find out about recommended practices when using comments in LaTeX documents. Some programming languages are quite clear about how to use comments in source code: for instance, [here] ...
10
votes
5answers
2k views

Best practice for typesetting quantifiers?

When I work with quantifiers I noted that are very close to the other symbols and the result does not look good, for example $\exists a\in\mathbb{R}\exists b\in\mathbb{R}\forall c\in\mathbb{R}\forall ...
6
votes
1answer
122 views

How to remove the white space on the top of the following table?

How to remove the white space on the top of the following table? \documentclass[preview,border=0pt,varwidth]{standalone} \usepackage[table]{xcolor} \usepackage{array} \usepackage{longtable} ...
16
votes
3answers
262 views

Defining Extensible macros

Question: For a macro that has only one parameter, are there any issues with defining it as follows: \NewDocumentCommand{\MyMacro}{% s% #1 = starred variant (*** unused as of yet ...
8
votes
3answers
445 views

Parallel lines on a grid and circle best practices?

I am a TeX/LaTeX noob, but I am learning rapidly. I am about to attempt to draw the following figure using LaTeX/TeX/TikZ I already have a, (I think) good working knowledge of how to draw circles, ...