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

learn more… | top users | synonyms

5
votes
1answer
71 views

Should I use \documentclass[12pt]{article} with \Large or \documentclass{article} with \LARGE?

So, I'm working on making some cards, and they need to have nice, large, clear text. So I've set the text to be \LARGE. Then I was thinking, am I doing bad things to the font by over-enlarging it? It ...
13
votes
1answer
4k views

Use of \midrule in booktabs table

Are there any formal guidelines/suggestions on the use of \midrule inside a booktabs table with just rows of identically formatted data? The booktabs manual is very specific about vertical rules, ...
6
votes
1answer
273 views

How to format mathematical and programming variables in text?

I am describing an algorithm in a journal paper. In this algorithm I have a few variables. I gave them the same names as in my source code (C++ source of the algorithm, not LaTeX source). So I have ...
8
votes
1answer
221 views

Gobble optional arguments

You can use \@gobble, for instance, to restrict the usage of a macro like: \documentclass{article} \makeatletter \newcommand*{\cmd}[1]{% #1 \global\let\cmd\@gobble } \makeatother \begin{document} ...
7
votes
1answer
3k views

Typesetting chemical element names

What is the 'best' package for typesetting names of chemical element? (I don't need anything but the names of the chemical elements.) Assume I want to typeset ``The dissociation of a AgBr ...
5
votes
2answers
137 views

How to buffer the extreme value of f(x) to draw a line representing a range of f(x)?

Please consider the following animation. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \def\f{x^2-x-6} \psset{unit=3,algebraic} \def\Atom#1{% ...
24
votes
2answers
21k views

subfigure and subfig packages deprecated

I was using the subfigure package to align multiple small images in a document. However, WikiBooks states that "the subfigure and subfig packages are deprecated and shouldn't be used any more" ...
8
votes
1answer
1k views

Math mode horizontal space difference between \ (backslash) and \; (backslash semicolon) and what to use for multiplication

In this code: \documentclass{article} \begin{document} \begin{equation} c = a b \end{equation} \end{document} I would like to insert a space between 'a' and 'b' (as opposed to \cdot or \times). ...
18
votes
4answers
675 views

Is there any difference between quad in math mode and text mode?

Is there any difference between $a \text{\quad text\quad} b$ and $a \quad \text{text} \quad b$? I cannot see the difference as shown in the following figure. If there is no difference, which one ...
6
votes
1answer
311 views

Is there another style to make an \underbrace in big braces look elegant?

I don't think the following equation looks good because of the existence of the \underbrace. \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage{amsmath} \begin{document} \[ ...
0
votes
0answers
49 views

Improve command definition to avoid possible break

The following defines my MWE: \documentclass{article} \usepackage{amsmath} \usepackage{totcount} \newcounter{totalpoints} \regtotcounter{totalpoints} \newcommand{\shcpoint}[1]{% ...
9
votes
1answer
357 views

What are your best practices to compile only a part of the document or presentation (or how do you prepare the big ones)?

I see that there a number of questions (A, B, C, D, E) on best practices, none of them answer the issue I am going to talk about. We all need to prepare large documents (or slides) from time-to-time. ...
6
votes
1answer
84 views

What is faster? To \RequirePackage{foo} or to check if the user has actually request it and \Require it if so?

I'm asking this because the package lineno has a thing that leaves a lot of commands in the .aux file (see here)... and I'm not sure if I should \newcommand these to empty or if I should just load the ...
33
votes
2answers
473 views

What are the standards of TeX/LaTeX coding in order to obtain robust packages?

I have posted several questions ultimately involving various aspects of robustness, that have arisen in the context of other questions in risk of clouding the main point of the question in each case. ...
9
votes
1answer
2k views

How to typeset LaTeX code inside a Table environment?

I wanted to typeset LaTeX code directly into my document, but without it doing something, i.e., I just want to show my code in the output. Now, I know there is the verbatim environment for code, as ...
127
votes
43answers
10k 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 ...
10
votes
6answers
407 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
2k 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
519 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
366 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 ...
5
votes
1answer
292 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
381 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
131 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
193 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
316 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
793 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
182 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
283 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
212 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
167 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 ...
6
votes
1answer
182 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
86 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 ...
11
votes
4answers
1k 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
119 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
350 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
689 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. ...
33
votes
2answers
1k 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 ...
18
votes
2answers
334 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 ...
4
votes
1answer
183 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
180 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 ...
14
votes
1answer
255 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
326 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 ...
10
votes
2answers
577 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
302 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 ...
8
votes
2answers
402 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
344 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
289 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
755 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 ...
11
votes
1answer
751 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) ...
8
votes
2answers
338 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} ...