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

learn more… | top users | synonyms

0
votes
0answers
28 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
73 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
211 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
202 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
126 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
140 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 ...
8
votes
1answer
192 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
51 views

Edit Tabular-like Environment using Emacs+AUCTeX

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
128 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
90 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
29 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
65 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 ...
4
votes
1answer
88 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
78 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
52 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
592 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
70 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
182 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
160 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
88 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
83 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
80 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
147 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
114 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
76 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
168 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
351 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
66 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
81 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
126 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
62 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
355 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
30 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
47 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 ...
12
votes
2answers
356 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
62 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
159 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 ...
4
votes
0answers
122 views

Fonts: Is there any scientific proof about the choice? [closed]

It is common knowledge that the more you work with TeX, the more likely you are to make changes in the basic format so as to fit it in your needs. Of course, one of the most important things that ...
9
votes
3answers
326 views

Inline math or \textit for author defined math constants?

Wondering if people here have a thought on what the best practice is here (if it matters). I used to use baskerville (well, the baskervald package) as my main font and charter as my math font (since ...
5
votes
3answers
130 views

When to break lines? [duplicate]

I am very new to LaTeX. A newline in the input file does not mean anything to LaTeX. An empty line in the input file means a new paragraph. Trouble is, when I view my sources with different text ...
36
votes
4answers
2k views

How does your mind bend \expandafter to its will?

Expansion is often cited as one of the most arcane aspects of TeX, more akin to witchcraft than to something easily picked up by the newcomer. There are many great questions and great answers about ...
5
votes
2answers
158 views

What packages are useful for (secondary school) teachers?

I'm trying to bring LaTeX to some of my colleague-teachers (in secondary schools, pupils 12->18 years old). They all seem quite reluctant to change. So I'm trying to collect some quick-win ...
4
votes
1answer
114 views

Difference between renewing commands before and after \begin{document}

I was wondering what could be reasons for differences when I redefine control sequences in the preamble or after \begin{document}? For example, this code typesets abcd when compiled by any of ...
5
votes
4answers
170 views

Simplify how I write my address in documents

Often when writing letters and articles, I need to print my address at the beginning or end of the document. I do this in the following ugly way: \documentclass{article} \begin{document} \noindent My ...
7
votes
4answers
495 views

How is the spirit of LaTeX different from writing in MS-Word? [closed]

I am learning the use of LaTeX by porting an 12-page LibreOffice Writer file to a set of pdflatex input files. The ability to separate the source in different files and later generate a single output ...
20
votes
1answer
210 views

What date should I specify in the optional argument of \NeedsTeXFormat?

Subsection 4.1 of LaTeX2e for class and package writers contains the following passage: \NeedsTeXFormat {⟨format-name⟩} [⟨release-date⟩] This command tells TeX that this file should be ...
3
votes
1answer
97 views

Way to remember LaTeX commands

I'm new to LaTeX but have already read so much about it. Now, as I write my first long document, I notice that my head can't process all of this new information ;) For example creating a float - and I ...
3
votes
1answer
57 views

Legend on every page

This is both a style question as well as a latex question: What is the preferred method of providing a legend for about 30 figures having a similar or the same legend in a thesis? Is it desirable ...
3
votes
0answers
33 views

Multiple \usepackage vs comma separated package names [duplicate]

What, if anything, is the difference between \usepackage{foo,bar} and \usepackage{foo} \usepackage{bar}