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

learn more… | top users | synonyms

2
votes
1answer
46 views

Visualize which \if this \fi associates to

For example, I use macros \ifbook and \ifslide. Because both can be closed by /fi, it's easy to lose track which /if* this particular /fi points to. They can be nested too, which makes things harder. ...
23
votes
1answer
9k views

How should one maintain and update a MiKTeX installation?

Every once in a while after updating MiKTeX, the installation gets into an inconsistent state. This might be a problem with the packages (an example is described in this question), but sometimes ...
34
votes
4answers
3k views

Most useful/important (La)TeX commands/environments

A friend of mine asked me why I use LaTeX instead of Word/OpenOffice/LibreOffice etc. (no, this is not going to be a question like 'Word vs. LaTeX') I showed him some of the showcases here on TeX.SX, ...
28
votes
3answers
733 views

When to use TeX vs LaTeX for package writing

So I got into the whole idea of learning plain TeX (or what I think is plain TeX) and it's been very fun and rewarding. I also started writing some macros/packages for my personal use for now. Since ...
1
vote
1answer
39 views

Solitary ü problem

I am writing an article in english using the LaTeX package by Acta Acustica for proper formatting corresponding to journal demands. In all the text there is only one umlaut ("Brüel & Kjaer ...
5
votes
2answers
249 views

Best Practice: Package for Mathematical Documents - amsmath and Beyond

I am aware that best practice questions are not always appreciated since there there's not "one size that fits all". I am going to give a LaTeX introduction for phd students at my company. All ...
21
votes
2answers
1k views

Best choice between using \\ or leaving space after each paragraph to end the paragraph

Here is the thing, I have always used a blank space between paragraphs in order to tell latex that there is a new paragraph. But there is someone I work with very often that keeps using \\ to break a ...
15
votes
1answer
482 views

productivity tools

I am using latex to write a mathematically dense document which has several hundred differential forms and products. There must be better ways than just typing out the whole equations line by line. ...
8
votes
2answers
84 views

How can I explain the concept of “separation of contents and presentation” to a “computer-illiterate” LaTeX user?

My friend is a grad student in mathematics and describes himself as being "computer-illiterate." He uses LaTeX to write papers but he writes (for example) a set is called $\mathit{regular}$ if [...] ...
73
votes
5answers
13k 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: ...
3
votes
1answer
122 views

Math command that works in text and math mode

The command \newcommand{\rsim}{\text{$\overset{r}{\sim}$ }} works in text and math mode. That said, the workaround looks somewhat ugly, as text mode and math mode are summoned for a single ...
41
votes
7answers
16k views

Footnotes in tables?

I would like to have footnotes in tables, but the \footnote command does not work inside a table environment. Googling one finds that this is a frequently asked question, at least in the UK. That ...
2
votes
1answer
94 views

Automatic style guide for LaTeX?

Is there some kind of automatic test to check for best practice according to some sort of style guide in LaTeX, or will there be any in near future? For python we have pep8, pyflakes, pyflint, and ...
3
votes
1answer
106 views

Hanging indentation of source code within sentence a la Vim-LaTeX-Box

I've recently been playing with the LaTex-Box plugin for Vim and noticed the layout of the source code on their Github page: What interests me is the 2-space hanging indent within each sentence. ...
3
votes
2answers
287 views

Is using \\[.5 \baselineskip] bad practice?

I've developed the habit of using \\[.5\baselineskip] to indicate that a part of a bigger argument ended in that line. I found this quite helpful to structure bigger arguments. By now, I start ...
3
votes
1answer
57 views

Which informations belong on every page [closed]

I finished my first thesis last summer and I was wondering: "What can I do better next time?". Since I'm a fan of simple styles, I thought about maybe removing content from the header (I placed the ...
27
votes
3answers
928 views

Should I load eTeX and/or fixltx2e by default

So, inspired by Fixing LaTeX2e I've been wondering: Should I be loading fixltx2e and/or eTeX by default? Typically I start my documents as %Page layout here \documentclass[letterpaper, ...
37
votes
6answers
27k views

How to best typeset “special” constants (complex unit i, Euler's number e,…)?

I'm trying to come up with a typographically appealing way to express "special" numbers such as the complex unit i = sqrt(-1) or Euler's number e. It has to be such that it cannot be confused with ...
1
vote
0answers
63 views

How to fill the calendar from an excel file

I am creating a calendar with marked dates of influential personalities births and deaths with one sentence of description like "the death of mr. XY in YEAR". The "input" is an Excel file containing ...
207
votes
3answers
373k 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 ...
14
votes
1answer
6k 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 ...
24
votes
3answers
524 views

Best Practice: Match different Journal specifications

In most cases one does not write papers for one journal exclusively. Changing your code to match all specifications takes a lot of afford and time. There is a wide variety of question referring to ...
2
votes
1answer
30 views

\bibentry producing dashes for authors with custom bst

I made a custom .bst file using makebst and chose the option for producing a long dash for repeated author names in the bibliography (option nmdash,nmd-3). (I'm using bibtex with natbib and ...
9
votes
1answer
68 views

\@ifnextchar breaks kerning when expanded

I've defined a macro for an initialism (abbreviation) with periods, making sure that an end-of-sentence period is not printed twice: \gp prints "G.P." and \gp. prints "G.P." Here's an M.W.E.: ...
79
votes
3answers
19k 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?
9
votes
1answer
134 views

Which one should be used: `newcommand` or `sbox`

Suppose I want to use an element numerous times, which is the best way to go at it (I chose a tikz-drawn arrow, because that is what made me think of the question, but I suppose it could be anything, ...
15
votes
1answer
443 views

Use of spaces for readability

Is there a reason to use the style like: \def\xx{foo} \let\yy = \xx instead of: \def \xx{foo} \let \yy = \xx I'm new to TeX, but everyone seems to prefer the former, while I think the latter ...
2
votes
1answer
50 views

How can I minimise errors arising from TikZ pictures involving too large dimensions?

What general strategies are available for minimising the occurrence of errors concerning too large dimensions in PGF/TikZ? The following is an example but I'm less interested in a fix for this ...
65
votes
12answers
4k 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 ...
1
vote
0answers
256 views

LaTeX vs InDesign [closed]

I've been using LaTeX for a while (even tough I'm far from being a pro), and I would like to ask expert users whether they prefer LaTeX or InDesign. Obviously, one is open source and the other not. ...
14
votes
3answers
637 views

align vs. equation: Which way is typograpically preferred?

The main differences between align and equation are the spaces and that align cannot be used with split, as far as I know. What would be, from a typographic point of view, the preferred practice? ...
21
votes
1answer
873 views

What date should I specify in the optional argument of \NeedsTeXFormat?

Subsection 4.1 of LaTeX2e for class and package writers contains the following passage: \NeedsTeXFormat {⟨format-name⟩} [⟨release-date⟩] This command tells TeX that this file should be ...
38
votes
2answers
1k 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 ...
66
votes
5answers
5k 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 ...
11
votes
2answers
300 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} ...
8
votes
3answers
744 views

Keeping the names of things consistent in LyX.

I'm documenting a software project using LyX and many of the "things" (classes, processes, etc.) that I'm describing don't yet have good names. As my understanding of these things improves, I want to ...
42
votes
2answers
4k 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 ...
1
vote
1answer
40 views

xparse command definition vs \newcommand [duplicate]

Maybe my question is too broad, but I'd really like to know: what is best to use (and why) between xparse command definition (e.g. \NewDocumentCommand) and LaTeX "standard" definitions (e.g. ...
2
votes
1answer
79 views

Proper way to linebreak

When not doing tables, it's \\ or to leave a blank line. I heard a few times that \\ should be avoided whenever possible. Thus, any doc with a bunch of different-line formulas would have lots of empty ...
3
votes
4answers
418 views

Beginning Thesis [closed]

I am a graduate student in statistics and am about to begin writing my thesis, having finished my analyses and theoretical work. I have used LyX in the past and am well versed in knitr and have some ...
1
vote
1answer
113 views

How to typeset a proof via structural induction

Structural induction differs from "mathmatical" induction in the number of cases: While mathmatical induction requires exactly two cases, structural induction may require many more. A proof via ...
10
votes
6answers
504 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
166 views

Empty/blank lines in LaTeX code

I hope this question is in order here although it rather asks for a "best practice" than for some "solution". I am wondering to what extent blank/empty lines in the code (I am using pdflatex) should ...
6
votes
4answers
312 views

Soft question - popularizing LaTeX for a class (of musicians)

I am afraid that this is close to be "off topic" of the site. If so, I will gladly close it. I need to popularize LaTeX for a class. There will be a special (non-optional) class about LaTeX basics to ...
3
votes
2answers
94 views

How to format long and large tables in a thesis?

In my master's thesis I have a lot of tables, large and long; what's the best practice to fit them ? It would be fine split the longer table in multiple pages? what about the larger ones? any ...
9
votes
2answers
135 views

Enforcing or encouraging use of the most up-to-date version of a class

Background I maintain a thesis class for my university. The class changes more frequently that I would like based on the whims of the university thesis office who clearly have little else to occupy ...
10
votes
2answers
336 views

Loading a font via package or fontspec

In Xe(La)TeX, what is the difference between loading a font via its package, i. e. \usepackage{tgpagella}, and loading it through fontspec (\fontspec{TeX Gyre Pagella}). When loaded with the package, ...
7
votes
2answers
360 views
16
votes
2answers
2k views

Best practice for getting “If not foo” conditionals

So, here are two ways you might set things up such that \dostuff is done when foo is false. The "new conditional" method If you know when foo is going to be set, then after that do: \newif\ifnotfoo ...
7
votes
3answers
4k views

Good LaTeX preambles for math thesis

Can someone provide me an example of a nice preamble to write a math thesis? I am currently using \documentclass[12pt]{article} \topmargin -15mm \textheight 24truecm \textwidth 16truecm ...