Questions tagged [best-practices]
A "best practice" is a technique or approach that TeXnicians recognize as giving better results than other approaches.
772 questions
3
votes
1
answer
71
views
Modern LaTeX practices/characters/Unicode
I'm working on generating a family genealogy using LaTeX, and would like to know the current recommended approach for diacritical marks.
Background: The .tex file is produced by Visual Basic code ...
3
votes
1
answer
100
views
How to extract a code listing correctly in .pdf from .dtx file, using package listings?
Question:
How to obtain the ideal result wrt. code listing, shown below, both as screenshot and simplified code?
How to add listings environment to DTX files doesn't seem to solve it for me.
What I ...
4
votes
3
answers
308
views
Improved a tree scheme in TikZ
Considering this MWE I ask kindly to have a best output for this scheme:
\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
grow=right, level 1/.style={sibling ...
1
vote
2
answers
75
views
An optimal and simple solution for a filled node on a pattern in TiKZ
What could be a better way to achieve a nicer pattern and have a white rectangle in node
X on top of the pattern in the foreground?
Here there is a MWE of the drawing.
\documentclass[12pt]{article}
\...
0
votes
0
answers
61
views
Best practices to include lots of tikz pictures in an overleaf project and avoiding compilation issues
I have a project on Overleaf with a lot of figures. These figures are created from csv files and use the tikzpicture environment. Here's an example:
\begin{tikzpicture}
\begin{axis}[
...
0
votes
1
answer
85
views
What symbol is commonly used to denote scaling product in LaTeX [closed]
In $1D$, scaling an object by a scalar $s$ produces the same quantity than "multiplying" (making copies). But that's not general in other dimensions. For example scaling a square by $s$, ...
3
votes
2
answers
86
views
Using plural for appendix if more than one
Consider the following code, which adds the plural word appendices rather than appendix, if there is more than one appendix. I have added Babel and German, just for testing and a google translation ...
2
votes
1
answer
80
views
How would you format to be cleaner and explain the steps better? Do I have any no no's in my latex?
How would you format this to be cleaner and explain the steps better? Do I have any no no's in my latex? Pretty much complete newbie in latex and want to start moving my notes into it but it seems ...
6
votes
2
answers
514
views
How to apply refactoring on Latex code?
How to apply refactoring on Latex code?
Questions here on refactoring most frequently state, the OP did or wanted to do some refactoring on Latex code, but struggled with some technicality. Though the ...
1
vote
0
answers
44
views
In a multiline equation, how to align from the right in a second-level split?
I have a long equation, where I want to divide the expression into 4 parts, 2 of which are & aligned, and the other two are child to the former, and should be aligned from the right.
I am nesting ...
14
votes
2
answers
2k
views
Is it bad style to write x^2, 2^\frac{1}{2} and 2^\sqrt{2}?
Is it considered bad style to write:
x^2, 2^\frac{1}{2} and 2^\sqrt{2} (without curly brackets around the superscript)
instead of:
x^{2}, 2^{\frac{1}{2}} and 2^{\sqrt{2}}?
The same for subscripts.
0
votes
0
answers
54
views
BibLaTex - Reference format for multiple ISSNs (print + digital)
What is the best / standard approach to creating a bibilography entry for a journal with print and digital editions (with an ISSN, and eISSN number, respectively). Should I create a new field for ...
5
votes
3
answers
431
views
Treatment of expl3 variables - registers versus macros
In expl3 some variables are implemented as TeX registers (dim, skip, muskip, int) while others are implemented as macros (tl, str, clist, fp, bitset, etc.)
(Relevant: interface3.pdf section "...
1
vote
0
answers
70
views
Good practises for writing equation-heavy thesis in LaTeX
I'm starting to write my PhD thesis in LaTeX using the yathesis documentclass for french thesis.
I will write lots of equations, with many different symbols and I like the idea of referencing them ...
1
vote
0
answers
45
views
Leave blank lines in expl3 packages for better code clarity
Leaving empty lines in the code of a package is usually not recommended. But for packages written with expl3 new lines, as spaces, are ignored.
So, could blank lines be safety used to aerate the code ...
1
vote
1
answer
170
views
What should go into file.def and what into file.bbx?
My biblatex styles bundle consists of a standard.bbx file and some .bbx, .cbx, .dbx and .lbx files (the bundle provides different citation styles; therefore standard.bbx contains common code of the ...
1
vote
1
answer
117
views
Braces in l3keys
In many cases, the braces surrounding values to keys in l3keys are omitted when defining keys, even when the keys themselves have n-,c-, or e-type arguments, which normally require braced arguments. ...
3
votes
0
answers
140
views
Best practices for setting package options mid-document
I am currently working on a package where the user can set the package options mid-document or within a local group. Currently, the user can do this via the user commands \set<package>keys or \...
3
votes
1
answer
177
views
"Label multiply defined" with new cross-referencing properties
When recording multiple different properties (see texdoc ltproperties-doc or online) for the same label, warnings are issued. I am not able to record all properties at the same time (some must be ...
4
votes
1
answer
125
views
Using the new cross-referencing properties
I'm looking into the new property system (see texdoc ltproperties-doc or online) but have an issue when referencing unknown labels.
\NeedsTeXFormat{LaTeX2e}[2023/11/01]
\documentclass{article}
\begin{...
11
votes
2
answers
590
views
Why are these sentences in Libertine so cramped and what can I do about it?
Recently I was writing a document in LaTeX using Linux Libertine. Overall I love this font, but I found a strange case of italicized text where there is almost no space between the word of and a ...
5
votes
1
answer
303
views
When should we use \cs_new...nopar?
I ask about some of the best practices for programming expl3 code.
Section 4 of interface3.pdf describes functions that define new control sequences that prohibit \par in their function parameters (#1,...
0
votes
2
answers
133
views
best practise when combining standalone tex-files with latxmk [duplicate]
I am currently not sure how to best define my workflow and would like some advice on how to best proceed. Maybe I am just overlooking something obvious.
Assuming the following tinker.tex file:
\...
1
vote
1
answer
56
views
What is the correct/best way to control the optional arguments of an environment so they can be easily edited later
Edit: I would like to know what the best practice is for creating a method to edit the desired optional arguments of all instances of an environment from one location.
Motivation:
So I'm using minted ...
0
votes
0
answers
72
views
Is it possible to compile without reloading every packages each time?
To compile my document (even a little one), my computer needs to load a lot of packages. During compilation (with pdflatex) I can see in the terminal that most of the compiling time is used to load ...
1
vote
1
answer
212
views
Should math papers be hand written before using LaTeX? [closed]
When I'm not writing a math paper, I write way faster by typing directly into a word processor. I form and revise sentences faster on the screen then I can on paper.
But typesetting math is slower ...
1
vote
1
answer
92
views
Is italic correction different in different fonts?
I am reading Knuth's The TeXbook and in Chapter 4, he talks about italic correction \/. He always uses it in the scope of the preceding font, for instance:
{\sl slanted\/} words
{\it italics\/} for
`{...
3
votes
0
answers
165
views
General (dis)advantages of ways to define new commands
I have a question about the many ways to define a new command.
I looked through the web and TeX.SE but couldn't find a complete answer (only some partly answers like, here, here, here, or here).
I ...
1
vote
0
answers
31
views
Citing articles in languages different from that of the journal
Journals in languages other than the current lingua franca of science will sometimes publish articles in a language other than their main one. For example, “Normierte Ringe” by Israel Gelfand (on ...
0
votes
2
answers
75
views
Which way to alter commands is more robust/sustainable
I have a general question. If I'm writing a .cls file (or a package file, as well), what's the best way to edit standard commands like \section which are defined by the used standard class or latex....
2
votes
1
answer
245
views
Tikz: Drawing "random" paths in TikZ
I am working on Graph Theory and I have to draw paths that seem quite random such as the ones on the 1st image. I have created the paths P,Q on the 2nd image using the code below.
However, it seems ...
0
votes
1
answer
51
views
Best way to indicate that some lines are left out
Assume I wrote a class myclass in Matlab with many properties and methods, and now I want to display
its most important properties (foo and bar),
the headers of its most important methods (myclass ...
0
votes
1
answer
80
views
Should one put nested exponents in-line, or displayed as an equation?
(I didn't immediately see this question already asked, but perhaps it has, since it seems an obvious question to me!)
This is more of a typographical/style/best-practices question, but I am wondering ...
3
votes
1
answer
181
views
How can we typeset a multi-line expression with both an equation number and a comment?
What is your favourite way of typesetting (multi-line) mathematical expression (with an equality or inequality symbol in the middle) that needs to have both a number and a comment? Here, a comment ...
1
vote
0
answers
72
views
Text in my included tikz grahics should have the same font size as my main text
I have a problem with the graphics and plots in my Latex document. I create all the plots and graphics with tikz in a seperate Latex standalone File, which produces pdf files.
Then I include these pdf ...
0
votes
0
answers
27
views
How to get the value of the document title? [duplicate]
In the attempt of reproducing the layout of a book, I need to use the title of the book in one of the headings. Specifically, using fancyhdr, I'd do something like this
\fancyhead[CE]{\scshape \...
0
votes
0
answers
119
views
Best practices for \cite and \citep
Imagine that \cite{webb2004oscillations}) and \citep{webb2004oscillations}) yield, respectively
Webb and Owen, 2004
(Webb and Owen, 2004)
When writing a paper, what is the best practice to cite this ...
12
votes
1
answer
424
views
Best practice for dtx workflow
I'm sorry, if this question isn't appropriate here, since it asks (at least partly) for opinions. However, there exists a "best-practices" tag, and I believe, the answer could be of public ...
2
votes
1
answer
644
views
Best practice: Add hand-written annotations during Beamer presentation
I prepare my presentations using Beamer, making also use of overlays.
Now, my slides contain a lot of illustrations/diagrams, which I'd like to draw into the slides during my presentation using my ...
2
votes
1
answer
78
views
"Best practices" for typesetting historical or etymological notes in a mathematical text [closed]
When including historical or etymological notes in a mathematical text, what are the good options for typesetting them? As remarks? As footnotes? As paragraphs? As something else?
I suppose that an ...
0
votes
0
answers
63
views
Should you use a single .bib file to generate various bibliographies?
I'm just getting comfortable with BibTex, and I have a question about best practices. It goes like this:
Say I'm teaching a course. I give out an introductory handout at the beginning of the course, ...
0
votes
0
answers
55
views
Prevent new command from eating following space [duplicate]
What is the proper way of preventing my new command from eating following space? I define it as follows:
\newcommand\ISPPA{I\textsubscript{SPPA}}
To use it in text as such:
the \ISPPA{} for bla bla
...
1
vote
1
answer
151
views
Listing something as table with one column
This is more a question on general design of something than a technical question. I want to list parameters that are used in a model. Since I have 7 parameters I think it wouldn't be readable if I ...
0
votes
2
answers
3k
views
Which symbols should be used as placeholders for letters and numerical digits? [closed]
I need to generally describe the syntax of random alphanumeric sequences, say ACW3920 or 39B0Q8, and discuss certain cases, e. g. the first two digits being letters, or the sequence ending with BA, 87 ...
0
votes
2
answers
579
views
Mixing two types of paragraphs
This is a general question about typesetting paragraphs. I was wondering if it is good (or acceptable) practice to mix two different kinds of paragraph skips in a document, e.g.
a "real" ...
0
votes
1
answer
101
views
Where do I find successor packages and task-related package recommendations? [closed]
As l2tabu already hasn't been updated in 6 years, is there any other place to get to know
which packages became obsolete / superseded by which ones / have been improved by which ones?
which packages ...
9
votes
2
answers
563
views
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? ...
9
votes
2
answers
226
views
expl3 - rules for toplevel-macro's argument specifications if toplevel-macro of function doesn't process arguments but calls internal macros that do
The file expl3.pdf - "The expl3 package and LaTeX3 programming" explains how expl3 functions should be named, according to the scheme
\⟨module⟩_⟨description⟩:⟨arg-spec⟩
or according to the ...
9
votes
1
answer
179
views
Expl3 - \cs_generate_variant:Nn / \exp_args:N... - Which method is preferable under which conditions?
If you need arguments preprocessed/expanded before TeX passes them to a macro, you can do two things in expl3:
Use \cs_generate_variant:Nn for generating a variant of the macro where the arguments ...
3
votes
0
answers
127
views
What are some practical approaches to generally improving fluency and range of knowledge/skills in TeX?
Excuse me if this question is better fitted for another SE, as it is somewhat more of a meta question, but still on-topic.
As a background, I'm an undergraduate Mathematics major in my final semester, ...