Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [best-practices]

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

2
votes
1answer
34 views

What are the most commonly used colors for References and Cites?

Here's a little excerpt from the thesis I'm working on: The LaTeX template was provided by my university, and it defaulted to superscript brackets with blue numbers for cites and red for anything ...
2
votes
1answer
52 views

Software Architecture and xtemplate

When writing a package, there may be the situation that several things need to interact to make a complete product. When using xtemplate, I can define each part as an object. This means that the ...
1
vote
0answers
30 views

Making Environments Using xtemplate

The examples for xtemplate show how to make document commands, but I haven’t seen anything involving environments. If I were to define an environment using xtemplate, what would the best approach be? ...
2
votes
2answers
112 views

When writing a paper, is it more advisable to write $1/(2n)$ or $\frac{1}{2n}$ in line with text?

I have lots of doubts (questions) on how to best present my findings. I'm not sure if most writers use the horizontal $1/(2n)$ to keep the line narrow, or the vertical $\frac{1}{2n}$, which widens ...
4
votes
1answer
83 views

If a package is loaded automatically, should I still load it manually if I explicitly need its features?

Many packages are loaded as prerequisites by other packages that internally use some of this package’s features. If I need to use a specific package, and this packages is already loaded by another ...
3
votes
2answers
105 views

$x_1, \dotsc, x_n$ vs. $x_1$, $\dots$, $x_n$

For example, if I want to say something like Let x_1, ..., x_n be real numbers. should I use Let $x_1, \dotsc, x_n$ be real numbers. or Let $x_1$, $\dots$, $x_n$ be real numbers. Note that if ...
0
votes
0answers
32 views

Having a clean and organized Header (Using Texshop)

Good morning, I'd like to ask the following question about having a good and organized page in latex. I'm not very good because i just starte but I already wrote about 496 lines. Maybe i'm not ...
2
votes
0answers
88 views

Best Practices Compilation in Math Mode [closed]

I consider myself a relatively experienced latex user. I am looking for best practices for math mode in LaTeX. Looking around the exchange I couldn't find a post that captures this question broadly. ...
0
votes
0answers
40 views

best practice for consistent text snippets [duplicate]

In a book document I must assure that the same text (a few lines) appears at several places, despite editing. Using the text editor to include the same text snippet does not guarantee consistency in ...
7
votes
1answer
118 views

Package option vs setup command

Traditionally, LaTeX packages will use package options (I mean the options in \usepackage[...]{package}) for setup. However, I have noticed in some modern packages, e.g. siunitx, unicode-math, ctex, ...
3
votes
1answer
202 views

LaTeX convention how to indent source?

I am new at LaTeX and I am asking myself at the moment if there is a convention how to indent the source code. For example: \begin{itemize} \item erstes Stichwort \item zweites Stichwort \end{...
1
vote
0answers
35 views

scalebox or new font switch to create specific font size?

I want to set a small portion of text in a font size not covered by the standard font switches and found two ways to do so: Define a new font switch: \newcommand\newfs{\fontsize{48}{60}\selectfont}, ...
0
votes
1answer
39 views

Correct hyphen/style to use in bullet lists

I have several lists in my thesis document that look like this: \begin{itemize}[nosep] \item 0x0000 - free cluster \item 0xFFFF - last cluster of the file (still including file data) \...
2
votes
1answer
78 views

What is the difference between url and xurl?

Like I understood adds xurl better line breaking to url. Right, or is one of it obsolete? When not, what should I use in which case? Thank you for your help and effort in advance!
1
vote
1answer
91 views

What is the difference between inputenc and inputenx?

Like I understood covers inputenx more cases as inputenc. Right, or is one of it obsolete? When not, what should I use in which case? I use pdfTeX version 3.14159265-2.6-1.40.19 (and MiKTeX). Thank ...
0
votes
1answer
49 views

My solution to small brackets and missing delimiter (. inserted) error

Problem: \begin{equation} \begin{split} S_{2(n+1)}^{(1)}=\frac{2}{\Gamma(n+1)}\int_{0}^{G}dxx^{2n+1}[-1+\\ +n_{1}(\frac{\pi}{\alpha})^{3/2}\sideset{}{'}\sum_{l}e^{-k_{l}^{2}a^{2}/...
0
votes
0answers
56 views

When (and why) to use manual kerning for mathematical content?

I recently asked here, a question about the choice of OpenType Unicode fonts for my PhD thesis. After considering the comments and answers to the question, I decided to use Libertinus for both text ...
5
votes
1answer
133 views

Should there be paragraph break between a leading text and itemized list?

What is the right convention for rendering itemized-lists? Is it like this without any paragraph break between the previous line and the list? \documentclass{article} \begin{document} There are 10 ...
9
votes
3answers
100 views

Any way to bundle some variables in an OOP-like object in LaTeX?

I would very much like to have one object encapsulate a bunch of data, and then pass that object to a function. For example, a figure might have an URL to a file, a caption, and a width. In Python, ...
5
votes
4answers
185 views

Unwanted spaces in user defined structures and the uses of % [duplicate]

This question arise from my recent activity on user defined commands of various kind. In the answer to a recently posed question, @egreg pointed out to me the importance of not forgetting a % after ...
4
votes
1answer
115 views

Manage full and short versions of a paper

Say you have written an article of 25 pages. It is pretty common that you submit a short version (12 pages) of your article to a conference and have the full version uploaded somewhere or attached as ...
2
votes
2answers
106 views

Proofs of several parts of a theorem or of equivalent definitions

Often in mathematical texts there are theorems which either consist of several parts or state several equivalent conditions. When proving the theorem you make an own paragraph for each part of the ...
0
votes
0answers
78 views

How to update my own packages?

At the moment I am starting to organize my documents a little bit better. For this reason I want to externalize some of my code into packages. Some of these are rather stable but some have to be ...
4
votes
1answer
238 views

Best Practice: always use \fussy for Drafts and \sloppy for Finals?

I use \documentclass{scrbook} along with \usepackage{microtype} and \usepackage{hyphenat} [adding new words as necessary] for superior typesetting. During edits, I see overfull boxes in the Draft ...
11
votes
1answer
260 views

Biblatex's bibmacros, bibliography drivers, formats - patch or redefine?

xpatch offers a series of patching commands specific to support patching of biblatex's bibmacros, bibliography drivers and field/names/list formats (not citation commands though, as far as I grasped). ...
1
vote
0answers
102 views

Best LaTeX practices for writing “N objects”, and so on [closed]

Q1: If I want to write in a mathematical article, the following sentence: Consider N real numbers $x_i$... Q2: Is it better practice to write "$N$" or simply "N"? Similarly, if one is writing: Let $...
0
votes
0answers
72 views

Should the comma betwen multiple elements of the same set be in math mode? [duplicate]

I often need to write statements like $a, b \in A$. Is this preferable to $a$, $b \in A$? I think there are arguments for both. Supporting the second: this is supposed to be shorthand for $a \in A$ ...
1
vote
2answers
252 views

Why does scaling not apply to node and how to correctly scale a node in TikZ? [duplicate]

The following code and its output shows that although the line drawn is scaled, the rectangle node is not scaled. \documentclass{article} \usepackage{tikz} \begin{document} \section*{Without Scaling}...
10
votes
1answer
499 views

Why should we use arrows.meta instead of arrows?

From the TikZ-PGF Manual, Section 16.1: Remark: The libraries arrows and arrows.spaced are deprecated. Use arrows.meta instead/additionally, which allows you to do all that the old libraries ...
1
vote
1answer
56 views

Standard way to read parameters from header in pgfplots

Suppose I have experimental data that I want to read from a file with parameters in the header. What is the standard way to read the parameters and make them available as tex macros. Consider the ...
4
votes
1answer
159 views

LaTeX3 document class: coffins versus LaTeX2e style

Context: I'm currently setting a small journal. For that I wrote a expl3-based document class. It's expected that articles start at the same height of the page every time (that also means the same ...
0
votes
1answer
71 views

Best practice to do a table and a longtable in landscape mode over the full width of the page [duplicate]

I would like to know what is the best practice to do a table and a longtable in landscape mode over the full width of the page by resizing automatically my columns. Indeed: I would like to use a ...
4
votes
2answers
357 views

Long table with X column for usage with glossaries

Question: I am searching for a way to use X columns in combination with multipage tables in a custom written glossary style. Update According to Nicola Talbot's comment, I have created the following ...
5
votes
1answer
75 views

What is the most elegant way to reference a named proposition using cross-references with cleveref and amsthm?

I have a document in which I have a named proposition, which I wish to reference by its acronym. Since it is named, it ought not be numbered. Still, I'd like to reference it using a cross-reference, ...
2
votes
2answers
95 views

writing newcommands, user interface advice request

I'd like to develop some good habits in LaTeX coding. I understand I'm in the novice category and I'm interested to hear advice. We have a legacy document header that was created by some MS Word ...
4
votes
1answer
307 views

How to make a header/footer-template for all classes?

I would like to create many documents that all have the same (and also respectively specific) header and footer, no matter which class they are (all of them probably custom classes). Also, creating ...
55
votes
8answers
4k views

Why should you avoid using (complex) templates?

This question is intended to be something reference-like to point users of complex templates they do not fully understand to. After having read What is a template? it should be clear what a template ...
3
votes
1answer
119 views

best practice: native table or inserted figure

I have a relatively small table of data I would like to insert into my thesis. Is it better to natively create a table, or to externally create the figure and insert it?
6
votes
1answer
116 views

Programming convention in LaTeX: top-to-bottom or bottom-to-top?

When writing a package, should one use the top-to-bottom approach or bottom-to-top? For example, the following two methods (in expl3 syntax) % Top-to-bottom \NewDocumentCommand \foo {m} { \...
3
votes
1answer
441 views

Aesthetically, which font should I use when I want to use Euler Math fonts?

So the question is of an aesthetics "best practice" type. I know that I shouldn't use Euler math fonts with the standard Computer Modern, and I'm struggling to find a suitable typeface where I can use ...
1
vote
1answer
155 views

Spacing between columns in the amsmath's cases environment

As most of you may already know, the amsmath package provides a cases environment. As the example in the user guide indicates, the typical usage of the environment is to construct a formula with ...
2
votes
1answer
93 views

Why prefer the letter @ in command names? [duplicate]

I am editing a class-file (extension .cls) created by several authors to format a thesis according to my university standards. In that file, there are many command (re)definitions. For example, the ...
7
votes
1answer
119 views

Token list vs control sequence in LaTeX3

In LaTeX3, should I use a token list or a (none argument) control sequence? For example, I need to use a macro for some format like \itshape, so which one is better? \tl_new:N \l__mydoc_format_tl \...
4
votes
1answer
451 views

Good practice rules for writing clean LaTeX?

Are there good practice rules for writing clean LaTeX? Something like PEP8 for Python. Examples: spaces or tabs (not a troll) ; how many columns before wrapping (80 for PEP8 compliant Python) ; ...
1
vote
0answers
78 views

What's a good way to describe algorithms without listing them? [closed]

Suppose there's some algorithm, piece of software code, or even a physical device computing a function, which I want to describe but not to list it or go into the details of its inner workings (so, I ...
1
vote
1answer
48 views

Is using this 'fit' environment a good idea?

I saw this example document here on the site defining the following environment: \newenvironment{fit}{% \begin{adjustbox}{% max width=\textwidth,% max totalheight=\textheight,% ...
4
votes
1answer
260 views

Command to add to the appendix

What would be an elegant way to add (in my case tables) to the appendix without leaving the part of the file in am working on? i.e. how should I define the \addtoappendix command in: Here is an ...
0
votes
1answer
154 views

Writing new classes with fontspec and polyglossia?

Let me get straight to it: when writing a new document class, should I load fontspec and other packages which require LuaLaTeX and XeLaTeX? Some context When I was taught to use LaTeX, some 10-odd ...
1
vote
2answers
208 views

What to do about \ldots in lists and ending a sentence?

Consider the following \documentclass{article} \begin{document} Let $X_1, X_2, \ldots$ be IID random variables. We also consider an independent set of coin flips $Y_1, Y_2,\ldots$. \end{document} ...
18
votes
1answer
166 views

Contributing to existing packages

This is something I've been considering for a while with respect to some code I've got that adds to acronym (nothing clever, just handling a few more use cases, it's almost all online here at tex.se). ...