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

learn more… | top users | synonyms

19
votes
1answer
93 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
72 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
64 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
305 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 ...
3
votes
0answers
51 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
363 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
15 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
237 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
201 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
410 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
102 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
85 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
164 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 ...
1
vote
0answers
132 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
232 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
237 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
154 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
160 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
611 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
69 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
150 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
99 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
33 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
89 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
152 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
87 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
78 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
618 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
89 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
219 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
177 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
94 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
102 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
108 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
238 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
126 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 ...
1
vote
0answers
83 views

What are the recommended tools (other than LaTex) for academicians and professionals? [closed]

I am not sure if this sort of question is allowed or not, but I thought it was better to try than not. The reason I am asking this here is because I want the answer from the sort of person who uses ...
6
votes
0answers
218 views

Typography and style - good choices for font styles in TikZ or pgfplots graphics?

When creating graphics or graphs with TikZ and/or pgfplots, one can put several commands to format the text to his likings. My question is: what are sound possibilities to format the elements in said ...
8
votes
4answers
548 views

What is the easiest way to generate a compact bibliography?

In a beamer presentation I want to use the \nocite{*} macro, so all entries in the bib file will be included, regardless whether I actually cited an entry or not. However, this yields a rather long ...
4
votes
1answer
87 views

Improve legibility in a siunitx table

I am a rather basic user of LaTeX, so please be kind. ;) I am using the siunitx package to align numbers on tables, and this is a rather similar question to this one: Centering table column titles ...
2
votes
1answer
91 views

How to separate definitions from the following text?

Using the definition theorem style from amsthm does not enable the reader to separate between text that belongs to the definition and the text following it. Example: \documentclass{scrbook} ...
4
votes
2answers
141 views

Manipulate a LaTeX2e counter with LaTeX3

I have some expl3 code where I want to manipulate a counter which is defined by a package using LaTeX2e code. If I want to manipulate the counter foo, I could either mixing up LaTeX2e code with ...
4
votes
1answer
66 views

Commenting out all blank lines not TeXnically necessary?

This is a follow-up to this question on commenting out empty lines vs. \noindent. Given that I have now begun commenting out lines surrounding environments like this: \documentclass{article} ...
17
votes
2answers
377 views

Difference between commenting out empty lines and \noindent?

My question is similar to this one but I understand the behavior described there and am interested in best practices in cases like the following. Typically, when ending an environment like quote in ...
4
votes
1answer
33 views

Custom Compilation Messages

Is there a way to create custom compilation messages? For example \msg{Compiling Chapter 1} \input{chapter1.tex} \msg{Finished chapter compilation}
1
vote
0answers
52 views

Practically, where to put \index?

I use vim-latex. For the sake of SyncTeX, I usually format my paragraphs into separate lines, using a customized gqip. I used to put \index after the term to be indexed, as suggested here. For ...
4
votes
0answers
35 views

Is there a good reason to define helper macros second? [duplicate]

As a mathematician, my training is to define my terms before I use them. As a computer programmer, I recognize that there are sometimes good reasons to call a method/function/procedure before its full ...
13
votes
2answers
508 views

How to typeset a file path?

I would like to properly typeset a file path, e.g. C:\Program Files\Some program\bin\executable.exe The first problem I encountered was that LaTeX tries to treat \Program as a command. I tried ...
2
votes
1answer
67 views

Best practive for managing the same bibliography files across several machines?

If you are/have using/used the same bibliography files across several machines (say a laptop and a desktop machine) of yours... How did you solve the problem of consistency? With a version control ...
4
votes
1answer
176 views

Is there a preferred capitalization style for reference types in BibTeX/biblatex?

When looking at examples of reference lists, I've seen three capitalization styles used for reference types in .bib files: @misc @Misc @MISC I notice the all-lowercase style appears to be the most ...