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

learn more… | top users | synonyms

11
votes
2answers
266 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
193 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
136 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
170 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
74 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
495 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
112 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
243 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
417 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. ...
29
votes
2answers
793 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
240 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
123 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
146 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 ...
3
votes
3answers
137 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
191 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
194 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
419 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
194 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
290 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
172 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
263 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
362 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
559 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
187 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
152 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
201 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 ...
23
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
90 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
369 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
327 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
179 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 ...
41
votes
1answer
806 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 ...
30
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] ...
9
votes
5answers
1k 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
115 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
242 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
412 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, ...
3
votes
2answers
481 views

Table layout: cells with short and long text

I've been fiddling with a table layout where some cells contain very little text while others may need multiple lines, and I can't seem to get it readable and nice-looking. MWE: ...
4
votes
1answer
44 views

Vertical alignment of the `aligned` environment in table cells

I think most people will agree that the vertical alignment in the table cells below is less than ideal--especially if I want to remove the \cmidrule to be more in line with accepted "best practices" ...
11
votes
1answer
312 views

Organizing images for multiple latex files

This is kind of a soft question. In my work, I generate a lot of images (graphs with data, sketches of the experimental system, etc..) which I later use in various latex files (papers, beamer ...
14
votes
0answers
700 views

Best practice for typesetting physical quantities using siunitx [closed]

Consider the following example. Code \documentclass{article} \usepackage{amsmath} \usepackage[ locale=DE, output-product=\cdot, product-units=single % I use this option a lot in the document, ...
2
votes
0answers
44 views

How to throw an error and abort the compilation for the following scenario? [duplicate]

Objectives: I want to throw exceptions (or error messages) when the following illegal code is invoked. \const[c,any]{temp}{\f[\i]} \const[others]{temp}{\f[\i]} Minimal Working Example: I cannot ...
7
votes
2answers
173 views

How to parse optional arguments without keyval?

The current implementation only supports rounding with the specified digits in the optional arguments. \documentclass{beamer} \usepackage{multido} \usepackage{pstricks} \usepackage[nomessages]{fp} % ...
1
vote
1answer
127 views

What causes this error? [closed]

After seeing Herbert's answer, apparently this problem should not occur if I realized the first row of the following code should be \documentclass{beamer}. Problems often come from not knowing what I ...
4
votes
1answer
100 views

How to implement a constant declarating macro to behave differently in preamble and pspicture?

The example below is extremely trivial just to illustrate the problem in the simplest way. \documentclass{beamer} \usepackage[nomessages]{fp} % constants declarator \def\LoadConstants{}% to load ...
7
votes
2answers
755 views

Is usage of \ell instead of l in math mode best practice?

Is usage of \ell instead of l in math mode best practice?
5
votes
1answer
176 views

Best practice for typesetting Knuth's up-Arrow notation

What's the best practice to typeset Knuth's up-Arrow notation? \uparrow and \upuparrow are relation symbols (according to unimath-symbols.pdf). But in Knuth's up arrow notation, these should be a ...
5
votes
2answers
963 views

Professional slashbox alternative

Suppose I have the following table which lists conversion rules, where rows denote the input and columns denote the output type (so, for example, the conversion int8_t -> int16_t would use b, while ...
47
votes
12answers
3k 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 ...