Stack Exchange Network

Stack Exchange network consists of 175 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.

4
votes
1answer
43 views

Is there a simple/elegant way to color atom groups in chemfig?

I have a lot of molecules to draw. For teaching purposes I need to color certain atoms or group of atoms. Due to alignment of the main chain, I'm using a | symbol after each atom on group, combined ...
3
votes
1answer
35 views

Effective way to plot values with a vast difference between them

Here's a nice simple bar graph. It's effective when the plotted values are in the same kind of ballpark, but when there's an outlier, it can put things out of wack. For instance, I want to plot some ...
0
votes
0answers
46 views

Commands vs keys/values for setting up a document: what an own document class should provide?

This question somehow extends the question "Package option vs setup command". I'm currently writing a class dedicated to students reports for both academic projects and internships. This class ...
1
vote
0answers
27 views

Package autonum breaks all references when used with thm-restate

I have the following LaTeX file \documentclass{article} \usepackage{thm-restate, autonum} \newtheorem{lem}{lemma} \begin{document} \begin{restatable}[Embedding lemma]{lem}{embedding} \label{lem:...
2
votes
1answer
22 views

tex4ebook (or tex4ht) doesn't treat newcommand and sub/supscript well in math mode

I found that tex4ebook (or tex4ht) doesn't treat well with subscripts or superscripts in \newcommand. For example, \documentclass{amsart} \newcommand\dotimes{{\otimes}^{\mathbb L}} \newcommand\...
1
vote
0answers
22 views

What are some differences between the exam class and the examdesign class?

The exam class and examdesign class are both intended for exam designing typesetting. What are some unique features of theirs? What are some advantages and disadvantages of one over the other?
9
votes
2answers
526 views

Better way to make this picture of sequence with arrows

I created this picture with very basic TikZ components and the code looks a bit messy, is there a more elegant way to do this? And secondly, is there a way to put dots at the stubs of the arrows in ...
3
votes
4answers
196 views

A universal method for left-hand alignment of a sequence of equalities

With this code \documentclass[a4paper,12pt]{article} \usepackage{mathtools, mathrsfs} %% Code for '\widebar' macro is courtesy of %% https://tex.stackexchange.com/a/60253 \makeatletter \let\save@...
2
votes
2answers
51 views

Derivatives specifying dependency of a function on its arguments

I want to write the partial derivative of a function, while making the parameters of that function explicit, like so: \dfrac{\partial f(x, y)}{\partial x} But this leads to an elongated horizontal ...
2
votes
1answer
121 views

Character choice for csquotes active quotes

We all know csquotes and the multiple facilities it provides for displaying quotations and related content. One feature I'm particularly fond of are the active quotes, using \MakeAutoQuote. That's ...
1
vote
3answers
60 views

Declaring option a4paper in \documentclass produces different margins than declaring it in \geometry

I have seen a similar question at a4paper, where should I declare it? In document class or geometry? and the selected answer there implies that there is no difference in whether we use \documentclass[...
3
votes
0answers
39 views

Pysub the entire document

In pythontex the pysub environment provides a nice syntax to refer to python variables (for example !{a}) inside your latex code. Suppose you have only one pythontex session in your document. Is ...
15
votes
0answers
329 views

Alternatives to the physics package

The physics package is useful A lot of my LaTeX documents make heavy use of the physics package. Aside from it overloading several standard commands (e.g. \sin, \abs, etc.), it also makes a few ...
0
votes
0answers
98 views

List of Best CTAN packages [duplicate]

Some of the packages of CTAN are really good but not discovered by many. I recently encountered one of the good ones, namely latexindent, and I thought that would be great if everyone introduces the ...
2
votes
0answers
50 views

Is it common practice to insert images at the top of a page? [closed]

This is not a question about how to insert images at the top, but rather asking whether or not this is common practice. The template I've received from my university automatically inserts figures at ...
5
votes
2answers
174 views

What would you include in a short “What is LaTeX and why should I use it?” presentation

I will give a short coffee lecture (15 minutes) on LaTeX at our institution. Something like: "What is LaTeX and why should I use it? Getting started and avoiding pitfalls." The presentation will ...
2
votes
1answer
68 views

tex4ht (or tex4ebook) is not compatible with ^\mathbb, _\mathfrak, etc

To export many mathematical articles and surveys to Kindle from the LaTeX source code, I am trying to use tex4ebook. It seems to me that I still need to hack many LaTeX codes to finish the compilation,...
1
vote
1answer
64 views

Inspiration of how to quote an e-mail correspondence

I am looking for a good way to typeset a e-mail correspondence (maybe including multiple levels of quotations). In an e-mail program this may look like this: this or this one I am not looking of ...
4
votes
3answers
111 views

Alignment of terms within align environment

The solutions below require up-to-date versions of LaTeX When I tried to run the solutions below on my own machine I was not able to reproduce their results, but still got unwanted offsets. ...
1
vote
2answers
135 views

How should I split/break up large LyX files?

I have a large LyX file that sometimes gets slow (the output PDF is over 1600 pages with figures, etc.). (Indeed, with LyX 2.3.x it is somehow unbearable and buggy for me, and so I have stuck with 2.2....
2
votes
1answer
68 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 ...
3
votes
0answers
102 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 ...
4
votes
1answer
72 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
136 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
91 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
142 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 ...
2
votes
0answers
177 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
43 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 ...
9
votes
1answer
137 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
259 views

LaTeX convention how to indent source? [closed]

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
48 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
114 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
177 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!
2
votes
1answer
139 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
82 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
67 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
139 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
143 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
191 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 ...
5
votes
1answer
131 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
177 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
83 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
257 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 ...
13
votes
1answer
363 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
139 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 $...
1
vote
2answers
475 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}...
11
votes
1answer
620 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
64 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
200 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
97 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 ...