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

learn more… | top users | synonyms

49
votes
5answers
12k views

Should I \mathrm the d in my integrals?

When writing an integral, it seems like something should be done to separate the "d", as in \int f(x) dx, so as not to confuse it with a variable. I've seen it left as-is, bolded, and straightened. ...
6
votes
0answers
45 views

Should expl3 code be used in packages intended to be compatible with multiple formats?

Maybe this question is just not a good idea in general, but, I'm curious. This could make package development simpler for some in the future. (Of course, this would not be forced on any package ...
9
votes
6answers
2k views

How do I get function argument parenthesis to position correctly?

I'm having trouble with the appearance of parentheses representing function arguments. They appear to far away from the function name. For example the code ...
8
votes
1answer
368 views

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 ...
2
votes
1answer
46 views

Same pgfplots within standalone for usage in elsarticle and revtex4-1

Suppose I have created a plot with pgfplots for a scientific paper. However, for usual reasons the targeted journal is not certain. Possibly the plot has to be adjusted to match different journals ...
7
votes
1answer
3k 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 ...
4
votes
2answers
118 views

‘Correct’ way of writing a function?

So for all these years, I have been writing a function f(x) as $\mathop{f}(x)$. But now that I begin to think about a correct way of writing a function, what should it be? Is it f(x) or ...
115
votes
6answers
57k 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 ...
65
votes
5answers
10k 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: ...
8
votes
1answer
400 views

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 ...
13
votes
2answers
175 views

Which packages should I recommend to postgraduates in different academic disciplines?

I'm preparing a list of package recommendations for an intermediate workshop on LaTeX. I avoided providing such a list at the introductory workshop as the tendency is to then add packages without ...
21
votes
2answers
5k views

How to properly typeset footnotes/superscripts after punctuation marks?

I find the spacing of footnote marks after punctuation marks quite unsatisfactory, especially with sans serif fonts and compared to the spacing after letters. Example follows: I came up with a ...
14
votes
2answers
245 views

How to define a wrapper to a command that takes an optional argument?

What is the proper way to define a wrapper to a command which takes an optional argument (such as \chapter)? I mean a wrapper, not a clone, such that we can inject code into the wrapper without ...
8
votes
2answers
314 views

Is this sacrificial command a good idea?

I have this command: \newcommand{\name}[1]{\edef\name{#1}} You first call it as in \name{Don} and afterwards you can refer to Don using \name. Is this an accetable way to express a constant that ...
5
votes
2answers
468 views

Plotting R boxplots with pgfplots

I use quite a number of boxplots in my writing, and have chosen pgfplots as my plotting solution for a number of reasons (one of which is the benefit of having the data to build the plot in the tex ...
1
vote
0answers
40 views

What are the “best practices” when writing a thesis in Latex? [duplicate]

I am starting to write my master thesis in latex. So far I have only written article-like texts, so this is my first big document. I would like to start with some good general good practices. ...
10
votes
1answer
723 views

Typography and style - good choices for font styles in TikZ or pgfplots graphics?

When creating graphics or graphs with TikZ and/or pgfplots, one can put several commands to format the text to his likings. My question is: what are sound possibilities to format the elements in said ...
0
votes
1answer
35 views

How to Read/Edit tex files on an Ipad [duplicate]

I use LaTeX for writing books. I would like to extend my working environment and, I was wondering if it is possible to read (or much better - edit) tex files containing text only on an ipad? I know ...
5
votes
1answer
117 views

How can I make it easier to write LaTeX documents with elaborate mathematics?

I'm a severely visually handicapped student of mathematics. I wonder how I can speed up my latex document creation. I'm pasting below solution to a problem in a functional analysis book by Kreyszig. ...
2
votes
0answers
55 views

Policy to stress preferrable syntax

Question Assume someone wrote a LaTeX document using my package some time ago. I want to let him know that his code should be updated. The idea is to allow outdated syntax by the LaTeX compiler but ...
24
votes
2answers
20k 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" ...
6
votes
1answer
124 views

Best practice for biblatex, biber, utf8 files

I use biblatex and biber. I used to use bibtex. So, when I first started writing .bib files I would have entries like this: @article{descartes, Author = {Descartes, Ren{\'{e}}} Title = ...
3
votes
0answers
22 views

What is the best approach regarding .cfg files for the LaTeX graphics bundle?

The manual for the 'graphics' LaTeX bundle includes instructions for setting up the right conditions for the use of colour and the inclusion of graphics in documents. For example, on page 2, it says ...
2
votes
2answers
55 views

How to put information about the tool used to generate the document into the LaTeX file?

I am writing a tool which will (as one of its features) generate LaTeX documents from some input format. I would like to put an unobtrusive piece of information about the tool in the generated file ...
1
vote
0answers
45 views

Indexing the result of a lengthy matrix computation

this question relates to a problem about style or maybe convention. I have a matrix $M$ which is the result of a lengthy matrix computation (in my case: a long chain of matrix additions and ...
2
votes
1answer
78 views

Acronyms - Best practice to use during the text and create acronym page

I'm starting writing my PhD thesis in LaTeX however since I'm still at the beginning of the PhD I'm writing some pieces at the introduction, other at methods, sometimes the other way around. When I ...
65
votes
3answers
4k 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 ...
10
votes
1answer
178 views

Letterspacing via microtype vs fontspec (in LuaLaTeX)

I've just realised that I can get somewhat similar letterspacing effects using either the microtype or fontspec packages; for example: \documentclass{article} \usepackage{fontspec} ...
0
votes
0answers
27 views

Tex File naming convention [duplicate]

Is it possible to number tex files? I'm avoiding it now but, I would like to order a list of files (chapters in a book) so that each chapter is easy to find. Will this cause a problem? I have in mind: ...
161
votes
8answers
11k 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 $ ... $?
95
votes
2answers
19k views

Should \tikzset or \tikzstyle be used to define TikZ styles?

The PGF/TikZ manual states in section 12.4 Using Graphic Options, page 120 (v2.10), that TikZ styles can be set using: \tikzset{my style/.style={<tikz options>},...} However, in several ...
5
votes
1answer
73 views

what are pitfalls when using doi as bibtexkey?

A very common scheme for bibtexkeys is FirstauthornameYYYY like Bohr1922. This scheme is not well suited for collaborating in teams because of collisions (Bohr1922a vs. Bohr1922b if there were many ...
10
votes
2answers
138 views

How to implement common layouts instead of misusing tabular environments?

Note: My hope is that this can become a general resource for "use a list instead" comments. If you have suggestions for improvement, please let me know. I often see comments such as This ...
15
votes
1answer
144 views

Customizing names of auxiliary file: safe practices?

I maintain a package (morewrites) which requires a temporary auxiliary file to function (written and read right away). This auxiliary file is currently named \jobname.mw, and a user has asked me to ...
4
votes
1answer
88 views

Color functional groups in chemfig syntax

I want to color simple functional groups in organic molecules using the chemfig package. I've come up with a solution that achieves what I want (MWE), but I find it very cumbersome. I thought it could ...
6
votes
1answer
58 views

Define \keys_filter:nnnN without modifying core functions

I would like to define a function \keys_filter:nnnN which would do the very same thing as \keys_set_filter:nnnN but without the setting. I realized that the setting is realized by a core function ...
18
votes
3answers
4k views

What is the preferable setup for MiKTeX to keep all packages up-to-date easily?

By default, MiKTeX is set up for all users to the folder C:\Program Files\MiKTeX 2.9 However, packages added on-the-fly go to the folder C:\Users\CurrentUser\AppData\Roaming\MiKTeX\2.9 (in case of ...
1
vote
0answers
27 views

How to put some "\usepackage''s into one package? [duplicate]

Since I learnt to use LaTeX 1 month ago, I have never used other software. But every time I begin to write a latex file, I will have to type: \documentclass{article} \usepackage{geometry} ...
3
votes
2answers
126 views

What is the best way to encode diacritical marks with the default input encoding?

Suppose, I want to write a word with diacritical marks, say fïbęj, and I cannot use Unicode or similar but instead I have to keep maximum compatibility for all sorts of situations. If I am not very ...
1
vote
0answers
44 views

Best attitude regarding \newtheorem? [closed]

In amsthdoc, the documentation of amsthm, it is written: It is natural to handle [lemmas, propositions, axioms, corollaries, conjectures, definitions, remarks, and so forth] as LATEX environments, ...
2
votes
1answer
116 views

How to backup custom fonts and packages

I'm about to format my computer but I have installed a lot of TeX fonts and some useful TeX packages. I'd like to backup them, especially the fonts, because it took me a long long time to install but ...
12
votes
2answers
217 views

Assertions in Latex

I am writing a long latex document and use many macros for defining mathematical symbols. I would like to ensure that there is no clash in the notation. For example, something like ...
3
votes
1answer
220 views

Usage of mathbb versus mathds

Blissfully unaware of mathds for years I have used $\mathbb{Z},\mathbb{Q}$ and so on. No one has complained but is there a best practice on choosing between mathbb and mathds for these? There has ...
4
votes
2answers
196 views

How to organize large documents in small nested folders

Preamble I am writing a large document and I would like to keep it well structured not only in terms of source code (I am aware of commands like \input and include, as well as the standalone ...
45
votes
4answers
1k views

Who *doesn't* use e-TeX?

I was just browsing the new questions and noticed egreg's recent answer, in which he uses a certain extension from e-TeX and cautions the reader that it is not compatible with Knuth TeX. And so I ...
2
votes
1answer
43 views

Command containing babel shorthand not expanding [duplicate]

Greetings to the distinguished gathering of TeXperts! My problem is: if a macro is defined with a babel shorthand containing the quote mark (") as an active character, it does not expand when ...
47
votes
2answers
7k views

What is the advantage of using $f^\prime$ instead of $f'$?

Although the two outputs look quite similar, what is the advantage of using $f^\prime$ instead of $f'$? By the way, here is my code: \documentclass‎{article‎}‎ \begin{document}‎‎‎ \[‎ ‎f^‎\prime ...
128
votes
43answers
9k views

What are the most common mistakes that beginners of (La)TeX and Friends make?

I want to collect the most common mistakes, misconceptions, pitfalls, etc that (La)TeX and Friends users make. Please one answer for each mistake, misconception, pitfall, etc. I am only interested in ...
2
votes
1answer
99 views

Pretty Printing is not pretty at PythonTeX ?

I try make LaTeX document with PythonTeX and this my MWE : \documentclass{article} \usepackage{pythontex} \begin{document} \section{Perhitungan Pangkat} \paragraph{} SymPy dapat melakukan ...
2
votes
0answers
91 views

Is \aa or å preferred?

This question is about all the non-ascii characters, å is only as an example. I know you can type the character å two ways: \usepackage[utf8]{inputenc} ... Some text with a speciål character. or ...