Questions tagged [best-practices]

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

Filter by
Sorted by
Tagged with
3 votes
1 answer
110 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 ...
meide's user avatar
  • 1,133
4 votes
1 answer
99 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{...
meide's user avatar
  • 1,133
11 votes
2 answers
560 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 ...
user134824's user avatar
5 votes
1 answer
251 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,...
User23456234's user avatar
  • 1,611
0 votes
1 answer
65 views

best practise when combining standalone tex-files with latxmk

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: \...
Cube's user avatar
  • 357
1 vote
1 answer
49 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 ...
GBR6000's user avatar
  • 38
0 votes
0 answers
59 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 ...
Tobard's user avatar
  • 1,189
1 vote
1 answer
107 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 ...
RJH's user avatar
  • 11
1 vote
1 answer
83 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 `{...
Atom's user avatar
  • 513
3 votes
0 answers
132 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 ...
lukeflo's user avatar
  • 1,483
1 vote
0 answers
27 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 ...
Alex Shpilkin's user avatar
0 votes
2 answers
69 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....
lukeflo's user avatar
  • 1,483
2 votes
1 answer
94 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 ...
Giannis Tsagkaropoulos's user avatar
0 votes
1 answer
50 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 ...
Οὖτις's user avatar
  • 2,877
0 votes
1 answer
54 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 ...
pyridoxal_trigeminus's user avatar
3 votes
1 answer
126 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 ...
Saptam's user avatar
  • 127
1 vote
0 answers
66 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 ...
Jayzin's user avatar
  • 11
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 \...
Enlico's user avatar
  • 2,562
0 votes
0 answers
75 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 ...
sam wolfe's user avatar
  • 265
11 votes
1 answer
370 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 ...
Matthias's user avatar
  • 634
2 votes
1 answer
359 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 ...
Bubaya's user avatar
  • 2,247
2 votes
1 answer
67 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 ...
Alexey's user avatar
  • 2,037
0 votes
0 answers
43 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, ...
crmdgn's user avatar
  • 2,608
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 ...
Anna's user avatar
  • 327
1 vote
1 answer
122 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 ...
Hjokvilla's user avatar
0 votes
2 answers
1k 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 ...
MulticolMetallurgist's user avatar
0 votes
2 answers
331 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" ...
Jan Joswig's user avatar
0 votes
1 answer
96 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 ...
Suuuehgi's user avatar
  • 887
7 votes
0 answers
396 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? ...
gaelicWizard's user avatar
9 votes
2 answers
207 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 ...
Ulrich Diez's user avatar
  • 27.5k
9 votes
1 answer
160 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 ...
Ulrich Diez's user avatar
  • 27.5k
3 votes
0 answers
112 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, ...
pyridoxal_trigeminus's user avatar
4 votes
2 answers
922 views

Is it okay to do $\bf Text$?

For a math report, we often use name of a category in bold letters, ie, Set. Out of laziness, i found that just writing $\bf Set$ seems to do the trick without apparent side effects. Is this okay to ...
Carla only proves trivial prop's user avatar
1 vote
0 answers
56 views

How to know what variant expl3 functions to provide in a package?

This question stems from a bug report to my package, pdfoverlay. The function in question is: \cs_new_protected:Nn \pdfoverlay_set_pdf:n { \file_if_exist:nTF { #1 } { \str_gset:Nn \...
David Purton's user avatar
  • 25.6k
1 vote
0 answers
169 views

How to achieve cross-referencing in glossary entries properly?

Usually, I define some glossary entries fields (as name, text, symbol fields) by another glossary entry like below (the compressor_motor entry is define with the compressor entry): \newglossaryentry{...
zetyty's user avatar
  • 769
1 vote
1 answer
138 views

Aligning multiline formula to the right of equal sign

I would like to align a multiline formula to the right of an equal sign, as suggested by the AMS Style Guide (see below screenshot from p. 118). I am not able to reproduce the same behavior. Here is ...
Matteo Raffaelli's user avatar
4 votes
1 answer
129 views

A Non-Uniformly Spaced Display of \ldots. is Produced When Using Fontspec

Consider the following code which I compile with Lualatex: \documentclass{book} %\usepackage{fontspec} \begin{document} \LARGE Some words\ldots. % ellipsis and period without fontspec %Some words\...
DDS's user avatar
  • 8,491
4 votes
2 answers
345 views

Which environment should I use to align my equations to the left?

I would like to know the "best" environment to align equations to the left. I already use fleqn at the beginning of my document and $\begin{aligned} ... \end{aligned}$ when I write equations ...
IsaKEKW's user avatar
  • 535
6 votes
1 answer
1k views

Best practices for typesetting pseudocode

I need to typeset the pseudocode of several pieces of code in latex. I found in this answer a good overview of the three main packages available to render pseudocode. In the following I will adopt the ...
Sirion's user avatar
  • 245
5 votes
1 answer
260 views

Command hooks vs package hooks, which is better?

In designing hook interfaces for my package. I found out that I have two methods of defining hooks: \documentclass{article} \begin{document} \section*{Method 1: Use Command Hooks} \...
L.J.R.'s user avatar
  • 10.6k
0 votes
0 answers
15 views

How to get different counting lables for different grouped pictures?

I was thing something along these lines: blabla picture of a gold fish Fish 1: gold fish blabla picture of a dog Mammal 1: dog blabla picture of a shark Fish 2: shark blabla picture of a horse Mammal ...
user3284214's user avatar
2 votes
2 answers
121 views

Table best practice - how to combine multiple semi related tables

What is the best practice when it comes to tables that semi-correlate context-wise? I've got the problem, that currently the tables take a large space from my work, but are also required. What would ...
Lukas S's user avatar
  • 131
1 vote
0 answers
88 views

Current best practices for cross-reference packages

Until now, I have only used the hyperref packages for cross references. Occasionally, someone mentioned other packages like varioref, cleverref or zref, which offer superior functionality compared to ...
marv's user avatar
  • 2,069
0 votes
0 answers
41 views

When to use tabularx vs. tabular? [duplicate]

As mentioned in the title, I was wondering if anyone can point me to a guide on when to use tabularx and when to use tabular (or tabular*). Based on my limited knowledge and posts like LaTeX tables ...
Kourosh's user avatar
5 votes
1 answer
152 views

Removing math italic correction: Should kern stay outside or go inside of subscript field?

Sometimes it is desirable to remove the automatic italic correction appended after a math object (e.g., any ordinary math letter, the integral sign, etc.) while in math mode. Applications include: ...
Ruixi Zhang's user avatar
  • 9,503
1 vote
1 answer
889 views

Why I can't use \unit command in siunitx?

Most of the time I work with siunitx package I need to specify only units like: "give the answer in psia". For achieving this every time I try with \unit{\watt} (W for example) but it ...
Eduardo Jiménez's user avatar
2 votes
1 answer
94 views

How to use str_foldcase in the preamble without generating a missing begin document error

Edit Thanks to @PhelypeOleinik for pointing out the problem wasn't the \str_foldcase itself but the switch statement bodies trying to typeset text before the document has begun. The cognitive overload ...
Doc Octal's user avatar
  • 369
1 vote
0 answers
46 views

What could go wrong with putting a tikzmark node around an existing box just before unboxing it?

I've an idle thought on how to use the dastardly tikzmark TikZ library to put nodes around pre-packaged boxes, specifically (but not limited to) the boxes that the awesome AMSMath packages use when ...
Andrew Stacey's user avatar
1 vote
2 answers
94 views

best practices for passing arguments to commands or macros

I implemented some commands/macros recently and I'm thinking about reducing the number of arguments given to a command/macro. Basically, until now I have created some macros with xparse or \cs_new:N ...
Luc Armand's user avatar
6 votes
2 answers
841 views

How to decide if a comma or punctuation between math mode content should be inside math mode or in text mode?

Which of the two is the preferred way of writing LaTeX code that has punctuation between math mode content? Example 1: Therefore the solutions to the given equation are \( 2 \), \( 4 \), \( 6 \), \( 8 ...
Lone Learner's user avatar
  • 3,206

1
2 3 4 5
16