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
2answers
314 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
284 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
203 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
254 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
110 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
186 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
264 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
745 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
165 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
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
194 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
140 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
171 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
77 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
557 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
254 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
454 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
834 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
258 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
131 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
149 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
144 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
195 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
210 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
440 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
212 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
310 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
188 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
264 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
409 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
592 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
207 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
153 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
207 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
97 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
418 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
333 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
183 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
933 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
120 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
252 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
431 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
529 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
45 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
321 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 ...