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
0 votes
2 answers
44 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 ...
user avatar
0 votes
2 answers
45 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" ...
user avatar
1 vote
1 answer
74 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 ...
user avatar
  • 783
5 votes
0 answers
154 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? ...
user avatar
9 votes
2 answers
172 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 ...
user avatar
  • 22.9k
9 votes
1 answer
118 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 ...
user avatar
  • 22.9k
3 votes
0 answers
73 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, ...
user avatar
3 votes
2 answers
526 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 ...
user avatar
1 vote
0 answers
49 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 \...
user avatar
  • 23.5k
0 votes
0 answers
31 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{...
user avatar
1 vote
1 answer
67 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 ...
user avatar
  • 335
3 votes
2 answers
112 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\...
user avatar
  • 4,765
4 votes
2 answers
242 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 ...
user avatar
  • 189
5 votes
1 answer
335 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 ...
user avatar
  • 235
5 votes
1 answer
164 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} \...
user avatar
  • 7,517
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 ...
user avatar
2 votes
2 answers
64 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 ...
user avatar
  • 21
1 vote
0 answers
49 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 ...
user avatar
  • 1,609
0 votes
0 answers
29 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 ...
user avatar
4 votes
1 answer
74 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: ...
user avatar
  • 9,268
1 vote
1 answer
184 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 ...
user avatar
2 votes
1 answer
65 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 ...
user avatar
  • 129
1 vote
0 answers
42 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 ...
user avatar
1 vote
2 answers
60 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 ...
user avatar
6 votes
2 answers
558 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 ...
user avatar
  • 2,887
4 votes
1 answer
93 views

Proof environments inside statements - is it harmful or is it OK?

I discovered that a student of mine uses constructs like \begin{theorem} ...a statement... \begin{proof} ...proof of that statement... \end{proof} \end{theorem} My first reaction was ...
user avatar
6 votes
2 answers
630 views

Difference between \footnote and the pair \footnotemark and \footnotetext

Note: DG's answer is the practical solution for the problem, but I recommend you to also see David Carlisle's answer since it talks about the problem. I searched about this for a while, but I couldn'...
user avatar
  • 462
8 votes
2 answers
677 views

LaTeX Convention for displaymath

I'm interested in where the convention for using the backslash-bracket (\[ ... \]) for math display environments originates. I really can't stand slash-bracket notation because most people write it on ...
user avatar
1 vote
2 answers
78 views

math operator spacing when used with delimiter modifiers such as \left \right, \big \Big etc

I noticed that using any delimiter modifiers like \left( \right) or \big( \Big( etc after a math operator like \cos inserts a small horizontal space. This question suggests that one simply not use ...
user avatar
  • 1,587
2 votes
2 answers
83 views

Aligning multiline formula: Break within fences and AMS style

I have a rather long formula and I would like to align it in accordance with AMS Style Guide (see below screenshot from page 119). I am not able to reproduce this behavior. Here is a minimal working ...
user avatar
  • 335
5 votes
2 answers
215 views

How can I add line breaks to the end of a macro?

I want to simplify the writing of this content, which should appear tabulated. I've written two macros to indent and colored ℣ and ℟. And I want to avoid having to always write \par at the end of each ...
user avatar
  • 423
1 vote
0 answers
51 views

What's a good way to add a non tex table from external file?

I'm seeking for your advice and ideas regarding a way to add all my tables in the pdf file as non tex files. The goal is to make it harder (much harder) for someone to edit the way the tables look in ...
user avatar
  • 153
2 votes
3 answers
223 views

Should I use cdots or ldots for an enumerated product?

What would be typografically right? a_1 \cdot a_2 \cdots a_n or a_1 \cdot a_2 \cdot \ldots \cdot a_n
user avatar
  • 385
3 votes
1 answer
60 views

Should you use bibtex entries from the source?

I wish to cite this article. A bibtex entry can be downloaded directly, which is as follows: @inbook{Kleinhenz2017, author = {Julie E. Kleinhenz and Aaron Paz}, title = {An {ISRU} propellant ...
user avatar
  • 155
1 vote
2 answers
128 views

siunitx: share the same value with two different units

If I have two different constants share the same value at some condition, what is the better way to aesthetically present this information than typing the two units after each other? For example, I ...
user avatar
  • 8,759
3 votes
1 answer
83 views

How do I add the value of a token list with braces in LaTeX?

In my LaTeX3 code, I frequently find myself wanting to add the value of one token list (or other variable) to another but surrounded by braces (a common use case is where I'm constructing a command to ...
user avatar
9 votes
1 answer
2k views

Can I temporarily disable the @@ replacement in LaTeX3?

I'm trying to write my L3 packages using good practice, which I understand involves using @@ in defining command and variable names which then get replaced by the module name (Section 3.2.2 in texdoc ...
user avatar
2 votes
1 answer
56 views

Is this the best way to label the lanthanides using chemnum?

I want to label a series of compounds with the lanthanides, i.e. 10la and I'm using the chemnum package. The manual gives some hints about this, saying you could do \newcmpdcounterformat{arabic}{\@...
user avatar
  • 17.3k
0 votes
1 answer
570 views

Templates or tutorials for creating a title page

I am relatively new to Latex. I am writing my thesis in Latex, which has been (as you know) so much more convenient than a word processor. I am using \documentclass[oneside,11pt]{book} along with the ...
user avatar
  • 1,137
7 votes
1 answer
408 views

Is it bad practice to replace a^{-1} with a user-defined command?

I've recently started doing my homework in LaTeX, so I'm still very new to this world. One of the things I don't very much like doing is typing out ^{-1} everytime I want the inverse of something, so ...
user avatar
  • 185
0 votes
1 answer
311 views

Best practises: How to write the category R-mod

What are the best practises for writing the category R-mod of modules over the ring R? Importantly, how should I write the dash? Is a text mode dash my only option, or is there a math mode workaround? ...
user avatar
  • 10.9k
0 votes
0 answers
67 views

LaTeX exercises

Recently I've learning more about LaTeX and I would like to know where can I found exercises and documents to replicate in order to improve my skills.
user avatar
2 votes
2 answers
65 views

What is the best approach to align equations in order to organize common terms in a equation? (aligned vs array) [closed]

This question is about opinions and experiences of users. What is the best approach to align equations in order to organize common terms in a equation? What is preferable in the particular case ...
user avatar
  • 2,822
7 votes
0 answers
227 views

Redefining Commands: Safety and Best Practices

There's plenty of questions on this site about redefining specific commands, but I couldn't find a more general, comprehensive question about the safety and best practices of redefining commands in ...
user avatar
  • 1,944
9 votes
3 answers
1k views

Best practice for plots (pgfplots, gnuplot, etc.)

I am writing a fairly large article with a lot of different plots. They range from simple ones like abs(x) or x^2 to high-polynomials with their first and second derivative, and nonlinearities (...
user avatar
  • 268
12 votes
1 answer
595 views

Reasons not to use \newcommand{{...}} (with double curly braces)

Which are the reasons not to always use \newcommand{\stuffa}{{STUFF}} instead of \newcommand{\stuffb}{STUFF}? In which cases would the former be a bad idea? The reason I am considering doing this is ...
user avatar
  • 599
1 vote
1 answer
218 views

Correct spacing rules for functions in math mode

I have a question about spacing in math mode. Suppose you have a document that contains many times the nabla symbol. I have read in different answers in this website that it is advisable to write \...
user avatar
  • 335
4 votes
1 answer
148 views

including logos with different colors

I would like to set up a package with some logos for titles and fancy headers and the like. The key problem that I have at this point is that it should be possible to get the logo in different colors. ...
user avatar
3 votes
1 answer
94 views

How to know when to use \left( and \right) and when not to?

How to decide when \left( and \right) are necessary? Here is my code that shows various ways to format the same formulae: \documentclass{article} \begin{document} Example 1.1: \[ \frac12 \left( p +...
user avatar
  • 2,887
1 vote
2 answers
107 views

Is it better to use Asymptote in-document vs compiling separately?

I write files with a fair amount of Asymptote in them and I have developed the habit of writing the asy code in a separate file, rendering it as a pdf (usually; sometimes it's a different format), and ...
user avatar
  • 178

1
2 3 4 5
15