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

learn more… | top users | synonyms

0
votes
0answers
40 views

When to use \mathrm or \mathsf for math. operators? [on hold]

Looking at some source files one sees for instance \DeclareMathOperator{\tr} {\mathsf{tr}} for the trace of a linear map and \DeclareMathOperator{\rank} {\mathrm{rank}} for the rank of a ...
24
votes
6answers
2k views

What to decide before writing a math book?

Until now, I have only written short documents in LaTeX. Whenever I encounter a problem or an error, I google'd it, and copy-paste'd the package/newcommand to my code. I use the same beginning code ...
10
votes
4answers
442 views

What's the best practice way to test whether parameter is empty?

I have a macro that might work either in LaTeX or in plain TeX and I'd like to test whether one of its parameters, which presumably should be just text, is empty. Currently I do it this way: \bgroup \...
69
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 ...
5
votes
0answers
74 views

MikTeX Deployment for multiple users

We use mainly MikTeX/pdflatex 2.9. I'm wondering if the deployment scheme we have here is really the best. The way we deploy is as follows: Create a miktex 2.9 System with required packages for our ...
10
votes
3answers
1k views

Inline math or \textit for author defined math constants?

Wondering if people here have a thought on what the best practice is here (if it matters). I used to use baskerville (well, the baskervald package) as my main font and charter as my math font (since ...
6
votes
2answers
351 views

What are reasons to use BibTeX instead of Biblatex?

Given the rich set of features that Biblatex offers over BibTeX et al., one has to wonder why the latter is being used at all. Legacy code aside (which seems to be easy enough to adapt, anyway) the ...
1
vote
0answers
65 views

How to change typographic style when unicode characters are used instead of macros

When writing a manuscript or converting from other systems, I can come with Unicode characters for some punctuation marks: u'2026' for … (ellipsis) u'2014' for — (em-dash) u'00AB' for \guillemotleft ...
45
votes
6answers
12k views

Which figure type to use: pdf or eps?

Both are vector graphics (typically) and both can be imported painlessly into a pdflatex document (so let's say we ignore dvi for this question). What are the advantages and disadvantages of each? ...
2
votes
2answers
56 views

Latex how to call subsubsections in text

I am writing a large text using Latex, where I use chapters, sections, subsections, subsubsections and paragraphs. My problem is that I would like to write, in my text, something like "this is ...
1
vote
0answers
9 views

Change cleverefs conjunction for one reference

What is the best practice to use a different conjunction for a single reference with cleveref? Background: I would like to produce something like "Theorem~1, Lemma~2 and [external reference]". If I ...
5
votes
1answer
77 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. ...
89
votes
4answers
4k 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: \RequirePackage[l2tabu,...
135
votes
6answers
86k 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 ...
83
votes
3answers
22k 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
129 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$, $...
192
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
85 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 ...
22
votes
7answers
18k 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
58 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
102 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 ...
75
votes
12answers
17k 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 it......
17
votes
2answers
631 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
412 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
5k 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
134 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
213 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
855 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} \begin{document}...
70
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
433 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: \begin{gather*}...
83
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 ...
27
votes
1answer
12k 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
181 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
918 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 ...
42
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]{% \addtocounter{...
29
votes
3answers
919 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
54 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
412 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 of ...
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
525 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
101 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 [...] ...
78
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: \frac{\mathrm{lcm}(m,n)}{\...
3
votes
1answer
141 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 ...
44
votes
7answers
22k 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
106 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
133 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. ...