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

learn more… | top users | synonyms

3
votes
3answers
102 views

advanced search in tex files

Is there a way to perform advanced search queries within tex-files? What I mean by "advanced search query" is all queries that cannot be performed with only a single search term. For example, it is ...
6
votes
1answer
53 views

Package versioning and backward compatibility

The third major curse of computer programming is backward compatibility. You have to fix bugs which will unavoidably be found. Some syntax is not really a good idea, and has to be modified to be less ...
6
votes
6answers
1k views

PhD dissertation: templates vs scratch

I am still getting my feet wet with LaTeX (starting to read 'LaTeX for complete novices'). I have decided to use LaTeX for writing my dissertation. As I begin I was wondering if it would be better to ...
14
votes
1answer
208 views

What is the recommended way to respond to bug reports for font packages where the bug is caused by characters missing from fonts?

I received a bug report for ebgaramond-maths. Although the issue is clearly caused by my package in one sense, it is not clear to me whether there is anything which I should do about it beyond ...
2
votes
0answers
29 views

Adding prefix to TikZ node and coordinate names

This question is somewhat related to my search for a good practice to include TikZ stuff in my documents. Suppose a document (book) with a lot of formulas and equations which you have decorated with ...
4
votes
1answer
74 views

Strange preamble for a thesis or this is normal?

I have a somewhat strange template that I should use for submit my dissertation for the speciality. I put the code as a minimal working example for you to see: ...
2
votes
3answers
46 views

How to label my references so I know how to refer to them?

I’m currently writing my master thesis and I have a lot of papers to cite. I’m not able to find a good way of giving shortcuts (names) for the papers when I cite them. Can you recommend a naming ...
2
votes
0answers
62 views

Best practice for including standalone commented equations with tikz

I'm writing a document where there are some equations which I'm commenting with hf-tikz package. It needs two LaTeX compilations in order to get the right coordinates and to draw everything in the ...
11
votes
1answer
243 views

Demonic correspondence: Best practices when defining devils in TiKZ

tikzsymbols defines a series of symbols which can be used in text (or nested in larger pictures) and which can be customised in various ways e.g. scaling size, choice of colours etc. For example: ...
5
votes
3answers
121 views

In tikz, is it possible to define a node and set its position later?

I'm trying to draw a diagram and my code is getting too cluttered and difficult to read. For code style purposes, is it possible to define a node in one place and mess with its positioning later? ...
27
votes
1answer
292 views

Best Practices for Lua Modules

In the Lua world Lua Modules are installed using LuaRocks. With LuaTeX these modules are normally installed in the scripts folder (under MikTeX windows). What tools are available for downloading and ...
5
votes
0answers
77 views

Letterspacing via microtype vs fontspec (in LuaLaTeX)

I've just realised that I can get somewhat similar letterspacing effects using either the microtype or fontspec packages; for example: \documentclass{article} \usepackage{fontspec} ...
2
votes
3answers
109 views

What is the best way to handle bibliographies which include a lot of online sources?

This question arises from discussion of my earlier question about URLs and BibTeX, I am looking for a solution that works smoothly with primarily web-based references. I have .bib files which contain ...
2
votes
1answer
54 views

The code of figures at the end of file, indeed

This question is connected with How to put figures at the end of pdf file. As one can see from @cfr's and mine comments, I hoped, that it was a question, how to put a code of figures, wich are lying ...
29
votes
2answers
249 views

How do I gracefully retire a package?

I maintain a LaTeX package which is obsolete. All its useful commands are provided by other packages, possibly with different syntax, but still the point is there is no reason for anyone to use my ...
2
votes
0answers
118 views

Column Space and Null Space of a Matrix [closed]

What are the notational best-practices for typesetting the column space and null space of a matrix A? Let's see how some of the different options look: Column Space: $col(\mathbf(A))$ ...
4
votes
1answer
67 views

Avoid accidental \\*

When you write in LaTeX some like: A\\ % *A You expect see the asterisk before of the second character, as usual in any text. However, the above chunk is equivalent to write: A\\* % A ...
14
votes
1answer
342 views

In tex file ascii characters only : if so should I encode the file in ascii? Or is utf-8 better used anyway?

This is a best practices question. Should I encode tex files in ascii or should I use utf-8? Is either preferred for a reason (ANY reason) in the case where ascii characters and nothing else appear ...
5
votes
1answer
68 views

In a package or parasitic class, when is it better to redefine a command and when is it better to define a new one?

When I'm working on a document for which I need special layout, I tend initially to accumulate a very long preamble. At some point, if I need to reuse similar layout regularly, I decide that I really ...
15
votes
1answer
393 views

How often do you commit when you use a version control system for your own LaTeX documents? Why? [closed]

I'd like learn about your practices and why you commit the way you do. Whether the practice is just "good" or "better" than another one is of course debatable but this topic could be really helpful ...
1
vote
0answers
16 views

How to define a bold font style for \emph text [duplicate]

Recently, I wanted to set all my \emphasized text to bold, because I think the default Italic of \emph is not distinctly emphasized. But I haven't found a solution for it. Please give me some idea. ...
4
votes
2answers
296 views

Double tagged equations?

In the following example the inequality (2.26) is obtained in the environment equation, but the equations (2.27) and (2.28) by dirty tricks, destroying the structure of the document. This is because ...
6
votes
1answer
235 views

Typesetting mathematical constants

Is there any command for typesetting constants in mathematical formulas? I would imagine something similar to \operatorname or \DeclareMathOperator, but for constants. I want the constant to be ...
13
votes
3answers
445 views

Best practice - how can I get my whole document (including math) to only use font X with LuaLaTeX and fontspec?

Considering one uses math symbols in a document, it is desirable to have them all displayed in the serif font one is using for text, or in basically any font x one would like to use for this sort of ...
5
votes
2answers
108 views

Suggestions to a better preamble for creating a handbook

The following is the preamble I was given to work with to create a student handbook. I believe there are a few things that are not right. The document compiles well but I am looking for suggestions of ...
10
votes
0answers
101 views

Customizing names of auxiliary file: safe practices?

I maintain a package (morewrites) which requires a temporary auxiliary file to function (written and read right away). This auxiliary file is currently named \jobname.mw, and a user has asked me to ...
2
votes
1answer
175 views

Best practices - How should one go about drawing lots of rectangular (=similar) shapes?

This is rather general inquiry, with intent to find out how to go about this the best way with the less time-consuming the better. How would you draw a graphics with lots of rectangles (or other ...
2
votes
0answers
155 views

Contextual mix of lining and old-style numbers

I am developing a class that fits the needs of both academics and non-academics; the latter often need to write highly legible numbers that are not math (they will be prices, reference numbers, dates, ...
12
votes
1answer
256 views

Is there a limit to the size of a tex-file?

I've been writing a document for some time now. It is steadily growing and hopefully will continue to do so. Lately I realised that -- although I just recently bought a new MacBook -- when I work on ...
9
votes
1answer
264 views

Make a “standalone” version of multiple files: all document in one .tex file

Disclaimer: this question is not related to the standalone package. When writing an article, I split the content between several files, to ease the versionning notably. At the time of writing, most ...
9
votes
1answer
167 views

Writing documents easily editable by non-proficient LaTeX users

We often produce documents that will have to be edited by others who are not as proficient at LaTeX than us, and not as keen to spend time learning. It may be that such documents will persist for a ...
7
votes
3answers
165 views

Handling typesetting of plural class names

I'm sorry if this is the wrong stackexchange to ask in, but it seems to be the place where people care about typography :) I'm writing lecture notes on Android development, and I like to put class ...
10
votes
1answer
924 views

DIV and BCOR setting in KOMA (best practices)

I have been playing around and I now realize it is possible to set the type area using a KOMA class by a couple of ways, and I'll like to know which is the correct one. \documentclass[% a4paper, ...
3
votes
0answers
80 views

Edit Tabular-like Environment using Emacs+AUCTeX [closed]

I am using Emacs+AUCTeX to write all my LaTeX files. So far so good except every time when I need to edit some tabular-like environment. I need some tricks or key bindings to take advantage of Emacs ...
4
votes
1answer
160 views

distinguish between symmetric and asymmetric page layouts

In order to fix a bug in the new version of the sidenotes package (bug reported here), I made the following environment: \newenvironment{autoadjustwidth}[2]% {\ifthenelse{\boolean{@twoside}}% ...
2
votes
1answer
100 views

How can I avoid the need for global variables here?

Consider the following example: \documentclass{article} \usepackage{xparse} \usepackage{longtable} \usepackage{multirow} \usepackage{hyperref} \ExplSyntaxOn \int_new:N \g__ioiooiioio_args_int ...
3
votes
1answer
34 views

subsequent macro detection

I would like to detect subsequent macros, in order to insert superscript numbers. If two macros follow each other, a comma should be inserted in between. The minimal example (stripped of the useful ...
4
votes
1answer
99 views

Test for empty value in xparse

Following the recommendation of the answers to this question, I use the following code \ExplSyntaxOn \DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{mmm} { \IfNoValueTF{#1} {#2} % true ...
7
votes
1answer
161 views

Loading a font via package or fontspec

In Xe(La)TeX, what is the difference between loading a font via its package, i. e. \usepackage{tgpagella}, and loading it through fontspec (\fontspec{TeX Gyre Pagella}). When loaded with the package, ...
1
vote
1answer
90 views

Dame latex macros

I am in the initial stages of writing my thesis (Maths). I once wrote a joint paper with someone and because they had an existing template we used it, with all the latex macros it had. Basically ...
4
votes
0answers
90 views

Latexdiff “fixes” and config files

Latexdiff, while overall very useful, sometimes requires manual fixes to its configuration variables and default options; for instance, excluding the tikzpicture environment from the diff algorithm ...
8
votes
3answers
628 views

TikZ: How can I write my code more concisely?

I am learning how to use TikZ and want to learn ways to write more concise TikZ code. I feel I use many more lines than others may need to achieve the same results. In particular, I want to learn a ...
2
votes
0answers
100 views

Upright math in italic lemma

I naively entered the following math-mode/text mix in a theorem environment, but the way LaTeX treats the parenthesis doesn't seem right. Especially upright math formulas in italic text parenthesis ...
12
votes
1answer
237 views

Proper semantics for italicized foreign words and phrases

In English, foreign words and phrases such as per se and ibid. should be italicized, as shown here. There might be a number of ways to accomplish this in LaTeX: with \emph{per se} with \textit{per ...
6
votes
1answer
188 views

Why not put a space between commands and parameters?

I hope this is just a matter of taste, but is there any reason not to separate a command from its first parameter with a space? (Or multiple parameters with intervening spaces for that matter.) ...
4
votes
1answer
96 views

Why are certain mathematics operators not defined and how do I replicate them?

I noticed that while \ker renders correctly as the "kernel" operator in Linear Algebra, the corresponding \im for the "image" is not defined (I tried everything that could possibly be an abbreviation ...
3
votes
0answers
107 views

How do you best differentiate listings in different programming languages? [closed]

I am currently producing a new edition of an old book of mine; this new book will incorporate code samples from several different computing environments. I can using the listings package quite ...
2
votes
1answer
121 views

Subscripts on Variables uneven

When I write something like $|x_n y_n - xy|<\epsilon$ the n's in the subscripts are placed at different depths, which looks awkward in my opinion. For instance, see this post over on ...
6
votes
2answers
273 views

Fractions with large elements

What is best practice for typesetting fractions with large objects in the numerator and denominator? For example, fractions with limits, integrals, summations, etc... cause the expressions to look ...
5
votes
0answers
130 views

Guidelines for creating an index

This is not necessarily a LaTeX-only question, and it is a bit open-ended, but given that this community is clearly very detail-oriented, and it is a general-interest question, I think that this is a ...