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

learn more… | top users | synonyms

2
votes
0answers
61 views

Best practices for “factoring” relatively small snippets of shared code

My particular use case is that I have a long academic CV, and a short résumé. The two of them share a reasonable amount of textual content, but, for example, the order of the content varies, some ...
1
vote
2answers
92 views

Justify the TeX-code from the editor

Maybe it's the writer (or the editor) who should be capable of this. But anyway, I wonder if I can do that with TeX. I usually want my TeX-code to appear somehow justified. Is there a way to do that? ...
4
votes
0answers
47 views

Include semicolon in preamble definition for tikz macro?

Say I define a macro \arr in the preamble for use in a tikzpicture. Is it best practice to: Exclude the semicolon from the definition and include it in the tikzpicture, \documentclass{article} \...
32
votes
7answers
3k views

What to decide before writing a math book?

Until now, I have only written short documents in LaTeX. Whenever I encounter a problem or an error, I google'd it, and copy-paste'd the package/newcommand to my code. I use the same beginning code ...
5
votes
0answers
78 views

MikTeX Deployment for multiple users

We use mainly MikTeX/pdflatex 2.9. I'm wondering if the deployment scheme we have here is really the best. The way we deploy is as follows: Create a miktex 2.9 System with required packages for our ...
1
vote
0answers
65 views

How to change typographic style when unicode characters are used instead of macros

When writing a manuscript or converting from other systems, I can come with Unicode characters for some punctuation marks: u'2026' for … (ellipsis) u'2014' for — (em-dash) u'00AB' for \guillemotleft ...
2
votes
2answers
59 views

Latex how to call subsubsections in text

I am writing a large text using Latex, where I use chapters, sections, subsections, subsubsections and paragraphs. My problem is that I would like to write, in my text, something like "this is ...
1
vote
0answers
10 views

Change cleverefs conjunction for one reference

What is the best practice to use a different conjunction for a single reference with cleveref? Background: I would like to produce something like "Theorem~1, Lemma~2 and [external reference]". If I ...
7
votes
1answer
134 views

“$a, b$” vs. “$a$, $b$”

I have two questions. Would you use Let $x, y$ and $z$ be real numbers. or Let $x$, $y$ and $z$ be real numbers. ? Which one is better? Would you use For $x, y\in\mathbb R$ we have ... or For $x$, $...
7
votes
2answers
92 views

Fixing overfull \hbox with mdframed containing an equation

When creating a boxed environment with mdframed, I ran into an issue with a line with an equation, that also happens to be the first line of a definition. Is there a way to fix the problem ...
4
votes
1answer
85 views

How do I share a beamer theme?

While working on my thesis, I customized a beamer theme with the corporate design of my university. Now I would like to share it with other students so they don't need to bother with recreating a nice ...
7
votes
3answers
217 views

Best practices in labeling (giving labels to equations, theorems, items, etc..)

Are there some Latex style guides with part dedicating to labeling? I want to use some persistent labeling scheme, but don't know any (except for uncertain one in my mind). What labeling scheme ...
6
votes
4answers
863 views

How to make a Born square?

The Born square is supposed to look like this: My attempt looks close enough, but the code is a bit unreadable because of the liberal \multicolumn usage. \documentclass{article} \begin{document}...
8
votes
1answer
413 views

How to wrap pictures in lists in theorems with formulas?

I want text to flow pictures. @Bernard adviced me this way of doing it with formulas and theorems. Thanks him, it works great in many cases better than any other variants I have ever seen. I have ...
4
votes
1answer
105 views

Robust commands

What is the primary reason to \protect new definitions or macros, or use \DeclareRobustCommand rather than just \def? (Assuming one does not redefine things by accident.) If it is primarily to do with ...
35
votes
2answers
2k views

Finishing math with a period

I am new to this site and couldn't find this question after a quick search but it may have been asked before. This is possibly the most inconsequential issue one can have, but it has been bothering ...
5
votes
2answers
190 views

Using \big| and \right| versus \bigr\rvert and \right\rvert

Based on the answers to this question (about \bigl, \bigr, \big, etc.) and this question (about \lvert, \rvert, |, etc.), I would think that anytime one used a vert bar to delimit on the right they ...
1
vote
1answer
143 views

Table formatting - Best practice to get professional and consistent looking short and long tables

General Understanding Basically, what I'm trying to do is streamline the entire process of creating tables for one or possibly a number of scientif papers. The ultimate objective would be to find ...
15
votes
4answers
441 views

“Evaluated at” bar for derivatives: \Bigr, \biggr, or \left…\right?

I'm trying to determine if there is a best practice for typesetting the "evaluated at" bar for derivatives. The three possibilities I'm thinking of are shown in the code excerpt below: \begin{gather*}...
1
vote
0answers
41 views

Open two tex files [closed]

I used to open two separate tex files, it's very useful, e.g. to cut and paste, compare, etc... When upgrading to El Capitan (I use a MAC) I cannot do that any more. When I try to open a second tex ...
5
votes
1answer
78 views

Visualize which \if this \fi associates to

For example, I use macros \ifbook and \ifslide. Because both can be closed by \fi, it's easy to lose track which \if* this particular \fi points to. They can be nested too, which makes things harder. ...
2
votes
1answer
54 views

Solitary ü problem

I am writing an article in english using the LaTeX package by Acta Acustica for proper formatting corresponding to journal demands. In all the text there is only one umlaut ("Brüel & Kjaer ...
5
votes
2answers
435 views

Best Practice: Package for Mathematical Documents - amsmath and Beyond

I am aware that best practice questions are not always appreciated since there there's not "one size that fits all". I am going to give a LaTeX introduction for phd students at my company. All of ...
29
votes
3answers
938 views

When to use TeX vs LaTeX for package writing

So I got into the whole idea of learning plain TeX (or what I think is plain TeX) and it's been very fun and rewarding. I also started writing some macros/packages for my personal use for now. Since ...
8
votes
2answers
103 views

How can I explain the concept of “separation of contents and presentation” to a “computer-illiterate” LaTeX user?

My friend is a grad student in mathematics and describes himself as being "computer-illiterate." He uses LaTeX to write papers but he writes (for example) a set is called $\mathit{regular}$ if [...] ...
15
votes
1answer
527 views

productivity tools

I am using latex to write a mathematically dense document which has several hundred differential forms and products. There must be better ways than just typing out the whole equations line by line. ...
3
votes
1answer
143 views

Math command that works in text and math mode

The command \newcommand{\rsim}{\text{$\overset{r}{\sim}$ }} works in text and math mode. That said, the workaround looks somewhat ugly, as text mode and math mode are summoned for a single ...
2
votes
1answer
106 views

Automatic style guide for LaTeX?

Is there some kind of automatic test to check for best practice according to some sort of style guide in LaTeX, or will there be any in near future? For python we have pep8, pyflakes, pyflint, and ...
3
votes
2answers
324 views

Is using \\[.5 \baselineskip] bad practice?

I've developed the habit of using \\[.5\baselineskip] to indicate that a part of a bigger argument ended in that line. I found this quite helpful to structure bigger arguments. By now, I start ...
3
votes
1answer
65 views

Which informations belong on every page [closed]

I finished my first thesis last summer and I was wondering: "What can I do better next time?". Since I'm a fan of simple styles, I thought about maybe removing content from the header (I placed the ...
1
vote
0answers
81 views

How to fill the calendar from an excel file

I am creating a calendar with marked dates of influential personalities births and deaths with one sentence of description like "the death of mr. XY in YEAR". The "input" is an Excel file containing ...
24
votes
3answers
553 views

Best Practice: Match different Journal specifications

In most cases one does not write papers for one journal exclusively. Changing your code to match all specifications takes a lot of afford and time. There is a wide variety of question referring to ...
2
votes
1answer
64 views

\bibentry producing dashes for authors with custom bst

I made a custom .bst file using makebst and chose the option for producing a long dash for repeated author names in the bibliography (option nmdash,nmd-3). (I'm using bibtex with natbib and author-...
9
votes
1answer
79 views

\@ifnextchar breaks kerning when expanded

I've defined a macro for an initialism (abbreviation) with periods, making sure that an end-of-sentence period is not printed twice: \gp prints "G.P." and \gp. prints "G.P." Here's an M.W.E.: \...
9
votes
1answer
152 views

Which one should be used: `newcommand` or `sbox`

Suppose I want to use an element numerous times, which is the best way to go at it (I chose a tikz-drawn arrow, because that is what made me think of the question, but I suppose it could be anything, ...
15
votes
1answer
451 views

Use of spaces for readability

Is there a reason to use the style like: \def\xx{foo} \let\yy = \xx instead of: \def \xx{foo} \let \yy = \xx I'm new to TeX, but everyone seems to prefer the former, while I think the latter ...
2
votes
1answer
55 views

How can I minimise errors arising from TikZ pictures involving too large dimensions?

What general strategies are available for minimising the occurrence of errors concerning too large dimensions in PGF/TikZ? The following is an example but I'm less interested in a fix for this ...
1
vote
0answers
624 views

LaTeX vs InDesign [closed]

I've been using LaTeX for a while (even tough I'm far from being a pro), and I would like to ask expert users whether they prefer LaTeX or InDesign. Obviously, one is open source and the other not. ...
1
vote
1answer
57 views

xparse command definition vs \newcommand [duplicate]

Maybe my question is too broad, but I'd really like to know: what is best to use (and why) between xparse command definition (e.g. \NewDocumentCommand) and LaTeX "standard" definitions (e.g. \...
16
votes
3answers
830 views

align vs. equation: Which way is typograpically preferred?

The main differences between align and equation are the spaces and that align cannot be used with split, as far as I know. What would be, from a typographic point of view, the preferred practice? ...
2
votes
1answer
86 views

Proper way to linebreak

When not doing tables, it's \\ or to leave a blank line. I heard a few times that \\ should be avoided whenever possible. Thus, any doc with a bunch of different-line formulas would have lots of empty ...
1
vote
1answer
148 views

How to typeset a proof via structural induction

Structural induction differs from "mathmatical" induction in the number of cases: While mathmatical induction requires exactly two cases, structural induction may require many more. A proof via ...
3
votes
4answers
485 views

Beginning Thesis [closed]

I am a graduate student in statistics and am about to begin writing my thesis, having finished my analyses and theoretical work. I have used LyX in the past and am well versed in knitr and have some ...
5
votes
1answer
238 views

Empty/blank lines in LaTeX code

I hope this question is in order here although it rather asks for a "best practice" than for some "solution". I am wondering to what extent blank/empty lines in the code (I am using pdflatex) should ...
6
votes
4answers
335 views

Soft question - popularizing LaTeX for a class (of musicians)

I am afraid that this is close to be "off topic" of the site. If so, I will gladly close it. I need to popularize LaTeX for a class. There will be a special (non-optional) class about LaTeX basics to ...
3
votes
2answers
184 views

How to format long and large tables in a thesis?

In my master's thesis I have a lot of tables, large and long; what's the best practice to fit them ? It would be fine split the longer table in multiple pages? what about the larger ones? any ...
7
votes
2answers
400 views

Is it better to write the subscript or the superscript first (e.g. x_a^i vs x^i_a)?

Is it better to write subscripts or superscripts first (e.g. $x_a^i$ vs $x^i_a$)?
9
votes
2answers
141 views

Enforcing or encouraging use of the most up-to-date version of a class

Background I maintain a thesis class for my university. The class changes more frequently that I would like based on the whims of the university thesis office who clearly have little else to occupy ...
2
votes
0answers
51 views

Adding default \skew to math accents

Out of corporate design reasons I should use Helvetica for my documents. I could simply ignore this, as most people do ;-) But out of fun I just combined ideas taken from sfmath and beamer to make ...
2
votes
0answers
44 views

Where should protected white spaces be used for numbers?

Protected whitespaces are used to prevent linebreaks in certain positions. For example: I have watched a movie which consisted of exactly 1.2 million images. is much worse to read than I have ...