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
75 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. ...
88
votes
4answers
3k views

Techniques and packages to keep up with good practices

Question What techniques and packages are there to keep up with good practices? What I already know I already know of the following packages for this kind of purpose: ...
132
votes
6answers
81k views

utf8x vs. utf8 (inputenc)

I normally use \usepackage[utf8]{inputenc} for my latex document but on this site i saw a lot of code with \usepackage[utf8x]{inputenc}. What are the differences between the 2 options ? Is there one ...
82
votes
3answers
21k 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? Related: Is there any reason ...
6
votes
1answer
122 views

“$a, b$” vs. “$a$, $b$”

I have two questions. Would you use Let $x, y$ and $z$ be real numbers. or Let $x$, $y$ and $z$ be real numbers. ? Which one is better? Would you use For $x, y\in\mathbb R$ we have ... or For $x$, ...
190
votes
9answers
17k views

Are \( and \) preferable to dollar signs for math mode?

Along the lines of Why is \[ ... \] preferable to $$?, what reasons are there (if any) to favor \( ... \) over $ ... $?
7
votes
2answers
70 views

Fixing overfull \hbox with mdframed containing an equation

When creating a boxed environment with mdframed, I ran into an issue with a line with an equation, that also happens to be the first line of a definition. Is there a way to fix the problem ...
21
votes
7answers
17k views

How should imaginary numbers be typeset?

I've never had to typeset complex numbers before and I'm finding that I'm uncertain about what best-practices are. My question is really about typesetting just i. (Hence my title referring to ...
4
votes
0answers
55 views

How do I share a beamer theme?

While working on my thesis, I customized a beamer theme with the corporate design of my university. Now I would like to share it with other students so they don't need to bother with recreating a nice ...
4
votes
1answer
99 views

Robust commands

What is the primary reason to \protect new definitions or macros, or use \DeclareRobustCommand rather than just \def? (Assuming one does not redefine things by accident.) If it is primarily to do with ...
74
votes
12answers
16k views

What are the advantages of using version control (git, CVS etc) in LaTeX documents

Why would I need to use version control with my LaTeX documents? I know people who do it, and I've seen questions about it on here and on SO, but I haven't understood what value there is to doing ...
17
votes
2answers
620 views

How to format source to take advantage of VCS?

Building on What are good working practices for VCS with LaTeX documents?, are there best practices for formatting (La)TeX source files to take advantage of version-control systems? I keep my résumé ...
8
votes
1answer
403 views

How to wrap pictures in lists in theorems with formulas?

I want text to flow pictures. @Bernard adviced me this way of doing it with formulas and theorems. Thanks him, it works great in many cases better than any other variants I have ever seen. I have ...
57
votes
13answers
4k 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 ...
1
vote
1answer
119 views

Table formatting - Best practice to get professional and consistent looking short and long tables

General Understanding Basically, what I'm trying to do is streamline the entire process of creating tables for one or possibly a number of scientif papers. The ultimate objective would be to find ...
7
votes
3answers
206 views

Best practices in labeling (giving labels to equations, theorems, items, etc..)

Are there some Latex style guides with part dedicating to labeling? I want to use some persistent labeling scheme, but don't know any (except for uncertain one in my mind). What labeling scheme ...
58
votes
4answers
4k views

Defining custom commands is bad style?

I recently received this in a e-mail from my professor Good LaTeX style would preclude creating any of your own commands, counters, etc. (Most journals would reject submissions with user-defined ...
6
votes
4answers
824 views

How to make a Born square?

The Born square is supposed to look like this: My attempt looks close enough, but the code is a bit unreadable because of the liberal \multicolumn usage. \documentclass{article} ...
69
votes
4answers
2k views

Detecting unused packages in LaTeX document

I have quite a bad habit of copy-and-pasting my packages from one LaTeX document to another. Is there any way we can detect unused packages (i.e. \usepackage commands) so that they can be removed from ...
15
votes
4answers
408 views

“Evaluated at” bar for derivatives: \Bigr, \biggr, or \left…\right?

I'm trying to determine if there is a best practice for typesetting the "evaluated at" bar for derivatives. The three possibilities I'm thinking of are shown in the code excerpt below: ...
80
votes
6answers
4k views

How to keep up with packages and know which ones are obsolete?

I'm an on and off user of LaTeX so I'm not familiar with every package out there. Having said that, whenever I use LaTeX and need to accomplish a certain goal (i.e. generate a list of appendices), I ...
26
votes
1answer
11k 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 ...
5
votes
2answers
163 views

Using \big| and \right| versus \bigr\rvert and \right\rvert

Based on the answers to this question (about \bigl, \bigr, \big, etc.) and this question (about \lvert, \rvert, |, etc.), I would think that anytime one used a vert bar to delimit on the right they ...
35
votes
2answers
2k views

Finishing math with a period

I am new to this site and couldn't find this question after a quick search but it may have been asked before. This is possibly the most inconsequential issue one can have, but it has been bothering ...
19
votes
3answers
909 views

LaTeX cookbook?

Has anyone written, or is anyone working on, a LaTeX cookbook? Specifically, a guide to writing intermediate/advanced LaTeX macros and solutions to other common tasks? I found a handful of resources ...
40
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.SE, ...
1
vote
0answers
41 views

Open two tex files [closed]

I used to open two separate tex files, it's very useful, e.g. to cut and paste, compare, etc... When upgrading to El Capitan (I use a MAC) I cannot do that any more. When I try to open a second tex ...
2
votes
1answer
64 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]{% ...
28
votes
3answers
871 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 ...
2
votes
1answer
53 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
363 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 ...
23
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
516 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
94 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 [...] ...
76
votes
5answers
15k 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
137 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 ...
42
votes
7answers
19k 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
103 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
129 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
308 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
64 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 ...
28
votes
3answers
1k 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
31k 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
73 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 ...
226
votes
3answers
397k 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 ...
16
votes
1answer
7k 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
542 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
52 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
73 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.: ...
9
votes
1answer
145 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, ...