Questions tagged [best-practices]

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

For example, it is widely accepted that there is value in separating commands that govern formatting from the document content — this is an example of a goal that is sometimes impractical to apply, and further best practices provide guidance on how to manage the cases where it is not practicable.

Likewise, when writing macros for packages or modules intended for use by others, it is a long-established best practice to use the @ character for internal macro names, which are not used directly in regular documents, so that users do not have to pay attention to the package internals.

759 questions
70
votes
6 answers

When should \cdot be used to indicate multiplication?

Is this purely personal style, or are the generally accepted guidelines? Clearly, when dealing with numbers either $2 \cdot 2$ or $2 \times 2$ is needed, but within formulae where an absence of an operator implies multiplication, when should a \cdot…
62
votes
13 answers

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 that because it is a typesetting language and…
Jeel Shah
  • 3,794
62
votes
21 answers

Do you use TeX for writing your thesis or only for its composition?

I would like to submit my university thesis composited in TeX. But I am not sure what is the best practise in the writing stage so I would like to ask you - do you write your thesis in a TeX editor or do you use some other text editor/program (MS…
jnemecz
  • 859
  • 9
  • 15
45
votes
2 answers

How to typeset a file path?

I would like to properly typeset a file path, e.g. C:\Program Files\Some program\bin\executable.exe The first problem I encountered was that LaTeX tries to treat \Program as a command. I tried escaping it with another backslash which created a…
alisianoi
  • 597
31
votes
2 answers

Order of subscript and superscript

If a mathematical symbol has both subscript and superscript, is there a best practice which should come first? I have seen both, for example $\sum_{t=0}^3$ and $\sum^3_{t=0}$. AFAIK they give identical output. Personally, I find the first version…
15
votes
1 answer

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 looks more natural and readable.
Alice
  • 153
15
votes
2 answers

Best way to avoid repeating expressions

I'm writing a text where I repeatedly speak of particular expressions which compose more complex expressions which I also repeatedly speak of (more specifically I'm writing a text with logical and set theoretic expressions). If I put my simple…
N.N.
  • 36,163
14
votes
1 answer

Best practice: LaTeX constants for possibly changing repeatedly used symbol

Say I'm writing a long document and I want to use the letter $n$ to stand for dimension e.g. in $\mathbb R^n$ all over the paper. Late in the writing process I realize that I want $n$ to stand for something else and decide I want to use $m$ instead.…
Philip
  • 743
  • 5
  • 13
14
votes
1 answer

Best Practice (Packages) for a Standard Technical Article With Math and Figures

I am interested in your opinion regarding the recommend packages for a standard technical document (Engineering, Physics). I normally use the following header: \documentclass{article} % Basic Packages for Encoding (Input AND Output) and Langauge…
13
votes
4 answers

How do I tell which version of a command to use?

So LaTeX has a lot of commands that do very similar things. Often this is a result of some of these being old. For example: $x^2$ vs \(^2\); As I understand it, the second example is the more modern version and should be used when possible. Other…
Canageek
  • 17,935
12
votes
1 answer

Writing documents easily editable by non-proficient LaTeX users

We often produce documents that will have to be edited by others who are not as proficient at LaTeX than us, and not as keen to spend time learning. It may be that such documents will persist for a long time after we lose responsibility for…
dbmag9
  • 1,411
12
votes
1 answer

Best Practice for creating user-defined command names

I want to let the users of a package define the name of command into which some unique content will be stuffed, so that they can then recall that content using the command name that they prefer. Is it a better practice to make them provide me a…
9
votes
1 answer

Is There Any Reason to Put Braces for Argument-less Commands (e.g. \int{})

Is there an reason/advantage for writing the integration (and other argumentless commands) as: \int{xdx} instead of \int xdx? I can see the first one gives a more comprehensible code, but are there any other reasons?
jak123
  • 4,252
  • 5
  • 26
  • 49
8
votes
4 answers

Short version of \emph and non standard code

The question regarding short version of \emph yielded brand new options for me and I should add impressive ones. However, the method suggested there results with non-standard code on the one hand but more readable on the other. I have two follow up…
Dror
  • 22,613
7
votes
0 answers

Modern Idiomatic LaTeX

Following up on this answer by @egreg and this question specifically on LaTeX3, where can I find some reasonable documentation or discussion on writing modern idiomatic LaTeX for composing documents? Ideally something with LaTeX3 in mind (i.e.,…
1
2 3 4