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

learn more… | top users | synonyms

38
votes
6answers
3k views

Writing readable LaTeX

Lets say I have the following LaTeX code \subsection{Convex sets} A set \( \mathcal{S} \) in \( \mathbb{R}^n \) is said to be convex if \[ \mathbf{x}_1, \mathbf{x}_2 \in \mathcal{S} \implies \lambda ...
7
votes
2answers
199 views

Using the correct indefinite article with acronyms and their full forms

I am using the acronym package so as to automatically expand acronyms when they are first used. For example, I can simply type \ac{RMS}, and LaTeX automatically expands this to "Resource Management ...
8
votes
4answers
272 views

What is the easiest way to generate a compact bibliography?

In a beamer presentation I want to use the \nocite{*} macro, so all entries in the bib file will be included, regardless whether I actually cited an entry or not. However, this yields a rather long ...
1
vote
0answers
60 views

What are the recommended tools (other than LaTex) for academicians and professionals? [closed]

I am not sure if this sort of question is allowed or not, but I thought it was better to try than not. The reason I am asking this here is because I want the answer from the sort of person who uses ...
55
votes
6answers
2k views

How bad for TeX is omitting braces {}, even if the result is the same?

Sometimes writing braces and omitting them produces the same result: \tilde{\psi} \mathrm{e}^{\mathrm{i} \pi} vs \tilde \psi \mathrm e^{\mathrm i \pi} Or (taken from Werner's comment below) ...
38
votes
2answers
45k views

Which dot character to use in which context?

Wikipedia lists several dot characters in Unicode. These are the ones that are ambiguous to me: interpunct, middle dot (·) · · U+00B7 "midpoint (in typography)" ...
36
votes
4answers
8k views

When should I use non-breaking space?

DEK gained a reputation of painting red the draft dissertations of his students, taking particular note of incidents when they omitted a non-breaking space that should have been included. I have this ...
18
votes
2answers
2k views

subfigure and subfig packages deprecated

I was using the subfigure package to align multiple small images in a document. However, WikiBooks states that "the subfigure and subfig packages are deprecated and shouldn't be used any more" ...
25
votes
5answers
8k 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 ...
23
votes
3answers
10k views

standard order for bold+italic?

It's a small, small matter, but when something has to be made both bold and italic, is there any reason to prefer \textbf{\textit{text}} over \textit{\textbf{text}} ?
4
votes
1answer
54 views

Improve legibility in a siunitx table

I am a rather basic user of LaTeX, so please be kind. ;) I am using the siunitx package to align numbers on tables, and this is a rather similar question to this one: Centering table column titles ...
2
votes
1answer
62 views

How to separate definitions from the following text?

Using the definition theorem style from amsthm does not enable the reader to separate between text that belongs to the definition and the text following it. Example: \documentclass{scrbook} ...
4
votes
2answers
110 views

Manipulate a LaTeX2e counter with LaTeX3

I have some expl3 code where I want to manipulate a counter which is defined by a package using LaTeX2e code. If I want to manipulate the counter foo, I could either mixing up LaTeX2e code with ...
4
votes
1answer
56 views

Commenting out all blank lines not TeXnically necessary?

This is a follow-up to this question on commenting out empty lines vs. \noindent. Given that I have now begun commenting out lines surrounding environments like this: \documentclass{article} ...
17
votes
2answers
326 views

Difference between commenting out empty lines and \noindent?

My question is similar to this one but I understand the behavior described there and am interested in best practices in cases like the following. Typically, when ending an environment like quote in ...
5
votes
1answer
136 views

What is the right way to cite @inproceedings with biblatex?

What is the right way to cite @inproceedings with biblatex? More specifically, many computer science proceedings paper citations seem to use book titles like "Proceedings of the 28th Annual ACM/IEEE ...
4
votes
1answer
111 views

Is there a preferred capitalization style for reference types in BibTeX/biblatex?

When looking at examples of reference lists, I've seen three capitalization styles used for reference types in .bib files: @misc @Misc @MISC I notice the all-lowercase style appears to be the most ...
4
votes
1answer
29 views

Custom Compilation Messages

Is there a way to create custom compilation messages? For example \msg{Compiling Chapter 1} \input{chapter1.tex} \msg{Finished chapter compilation}
63
votes
3answers
10k 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?
0
votes
0answers
38 views

Practically, where to put \index?

I use vim-latex. For the sake of SyncTeX, I usually format my paragraphs into separate lines, using a customized gqip. I used to put \index after the term to be indexed, as suggested here. For ...
17
votes
1answer
7k views

typesetting modulus operator, as in remainder

Is there a standard way to typeset the modulus operator (as in arithmetic remainder)? The percent sign (%) is often used by programming languages and mathematicians tend to use mod, but because of the ...
4
votes
0answers
34 views

Is there a good reason to define helper macros second? [duplicate]

As a mathematician, my training is to define my terms before I use them. As a computer programmer, I recognize that there are sometimes good reasons to call a method/function/procedure before its full ...
8
votes
3answers
384 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 ...
11
votes
2answers
246 views

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 ...
36
votes
4answers
2k views

How does your mind bend \expandafter to its will?

Expansion is often cited as one of the most arcane aspects of TeX, more akin to witchcraft than to something easily picked up by the newcomer. There are many great questions and great answers about ...
2
votes
1answer
56 views

Best practive for managing the same bibliography files across several machines?

If you are/have using/used the same bibliography files across several machines (say a laptop and a desktop machine) of yours... How did you solve the problem of consistency? With a version control ...
4
votes
0answers
111 views

Fonts: Is there any scientific proof about the choice? [closed]

It is common knowledge that the more you work with TeX, the more likely you are to make changes in the basic format so as to fit it in your needs. Of course, one of the most important things that ...
5
votes
2answers
143 views

What packages are useful for (secondary school) teachers?

I'm trying to bring LaTeX to some of my colleague-teachers (in secondary schools, pupils 12->18 years old). They all seem quite reluctant to change. So I'm trying to collect some quick-win ...
8
votes
3answers
215 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 ...
52
votes
4answers
3k 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 ...
53
votes
4answers
40k views

“(” or “\left(” parentheses?

What is the difference between ( and \left( in LaTeX? Sometimes, when the content is small, it does not seem to matter which pair I use. What is the best practice when it comes to which parentheses ...
14
votes
3answers
318 views

Does LaTeX allow for namespaces to eliminate the risk of package clashes?

I often get conflicts between distinct sty files, due to things as simple as variable names. The latest one was between proof.sty (which permits to more proofs automatically to the appendix) and ...
55
votes
3answers
3k views

Are there any coding style guidelines for LaTeX?

I have been using LaTeX for a long time now, but still all my document files look a bit messy. Now I want to get rid of this bad habit and get some order into my code. That is why I am wondering ...
3
votes
2answers
123 views

Simplify how I write my address in documents

Often when writing letters and articles, I need to print my address at the beginning or end of the document. I do this in the following ugly way: \documentclass{article} \begin{document} \noindent My ...
5
votes
3answers
116 views

When to break lines? [duplicate]

I am very new to LaTeX. A newline in the input file does not mean anything to LaTeX. An empty line in the input file means a new paragraph. Trouble is, when I view my sources with different text ...
4
votes
1answer
102 views

Difference between renewing commands before and after \begin{document}

I was wondering what could be reasons for differences when I redefine control sequences in the preamble or after \begin{document}? For example, this code typesets abcd when compiled by any of ...
20
votes
1answer
171 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 ...
29
votes
3answers
8k views

Why not use vertical lines ('|') in a tabular?

My question is a follow-up to the answer to a follow-up question, to be found here. ;) I'd like to know why one would advise against using vertical lines (via |) in a tabular (i.e. in ...
6
votes
4answers
446 views

How is the spirit of LaTeX different from writing in MS-Word? [closed]

I am learning the use of LaTeX by porting an 12-page LibreOffice Writer file to a set of pdflatex input files. The ability to separate the source in different files and later generate a single output ...
3
votes
1answer
90 views

Way to remember LaTeX commands

I'm new to LaTeX but have already read so much about it. Now, as I write my first long document, I notice that my head can't process all of this new information ;) For example creating a float - and I ...
3
votes
1answer
56 views

Legend on every page

This is both a style question as well as a latex question: What is the preferred method of providing a legend for about 30 figures having a similar or the same legend in a thesis? Is it desirable ...
3
votes
0answers
33 views

Multiple \usepackage vs comma separated package names [duplicate]

What, if anything, is the difference between \usepackage{foo,bar} and \usepackage{foo} \usepackage{bar}
0
votes
1answer
85 views

Why is scaling text evil?

The TikZ & PGF manual says that It is possible to transform nodes, but, by default, transformations do not apply to nodes. The reason is that you usually do not want your text to be scaled ...
29
votes
2answers
745 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 ...
3
votes
0answers
128 views

Typesetting programming packages/libraries in LaTeX

When referring to programming packages/libraries (such as matplotlib for example) within a LaTeX document should one typeset it to denote it as a package/library name? Such as using \texttt{}?
11
votes
1answer
150 views

Code improvement on a title page design

I am designing a new title page to post in the topic Showcase of beautiful title page done in TeX but am having some issues with the code I wrote. I don't like and I know it can be improved. In ...
16
votes
3answers
1k views

How to typeset the symbols for charged particles?

Maybe this question will seem trivial, but I was wondering how you people typeset symbols for charged particles? I was thinking here in particular about the electron, the proton and the neutron. This ...
96
votes
4answers
34k 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 ...
22
votes
2answers
399 views

Multi-line options with the `\usepackage` command

When including a package using the \usepackage command that has a lot of options, are there: Any restrictions on how the options can be split across multiple lines? Any best practices for formatting ...
5
votes
1answer
93 views

Library of reusable equations

I want to do something that sounds simple. I want to create an external file where I will store my equations. Then I would like to be able to these equations and input them in a document without ...