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

learn more… | top users | synonyms

7
votes
2answers
799 views

Is usage of \ell instead of l in math mode best practice?

Is usage of \ell instead of l in math mode best practice?
5
votes
1answer
182 views

Best practice for typesetting Knuth's up-Arrow notation

What's the best practice to typeset Knuth's up-Arrow notation? \uparrow and \upuparrow are relation symbols (according to unimath-symbols.pdf). But in Knuth's up arrow notation, these should be a ...
5
votes
2answers
1k views

Professional slashbox alternative

Suppose I have the following table which lists conversion rules, where rows denote the input and columns denote the output type (so, for example, the conversion int8_t -> int16_t would use b, while ...
47
votes
12answers
3k views

How to practice LaTeX?

With many programming languages, you have the opportunity of practicing the language by doing problems or developing programs that will do certain things. With LaTeX, however, you can't exactly do ...
12
votes
1answer
187 views

Best Practice for creating user-defined command names

I want to let the users of a package define the name of command into which some unique content will be stuffed, so that they can then recall that content using the command name that they prefer. Is ...
4
votes
1answer
157 views

How to know the line width of enumeration in two column document prior to entering the enumeration?

I want to populate the following lengths just once prior to entering the enumeration (or perhaps prior to entering the document environment) to free me from worrying whether or not the ...
5
votes
1answer
136 views

Using \@-ified punctuation while using \frenchspacing

After reading this very informative TeX.SE thread about spacing and punctuation, I was left wondering about an issue that didn't seem to be addressed: using \frenchspacing together with the modified ...
13
votes
3answers
86 views

What to consider when naming labels to prevent errors?

This question is inspired by Umlauts in label and a quote from an answer to How to automatically add \! in subscripts? However the best is to avoid _ in labels. I already name all my labels with ...
2
votes
1answer
144 views

Which one is recommended to split, continue and align a long equation?

In my investigation, the outputs are identical as follows. Version 1: Using aligned. \begin{align*} \framebox[6cm]{Top LHS}\\ \framebox[5cm]{Middle LHS}\\ \framebox[4cm]{Bottom LHS} &= \! ...
3
votes
1answer
459 views

\twosides in KOMA - Why is my titlepage not centered

I'm using scrbook with the twosidesoption, and BCOR=10mm. The title page, being an odd page, has a large margin on the right, and a small margin on the left. I'm currently using the following to make ...
0
votes
2answers
96 views

If \section is followed by a \subsection, should there be nothing in between? [closed]

If \section is followed by a \subsection, should there be nothing in between? 2.1 The art of the bla some text 2.1.1 The details of bla blaaaa 2.1.2 Further details of bla blaaaaaaaaaa Is ...
15
votes
4answers
922 views

Good typesetting practice for long equations

I have the following (quite horrible) equation in my thesis: \begin{align*} \frac{\partial^2}{\partial t_1^2} f(t_0,t_1) = ( \delta+2t_0+2t_1)^{\alpha( w-t_0+t_1 )-1} \cdot \bigl( ...
13
votes
1answer
2k views

How should one maintain and update a MiKTeX installation?

Every once in a while after updating MiKTeX, the installation gets into an inconsistent state. This might be a problem with the packages (an example is described in this question), but sometimes ...
44
votes
5answers
4k views

Why use a package to typeset units?

I've seen a lot of posts about different packages for typesetting units and their relative strengths and weaknesses. Most posts seem to agree that the siunitx package is the most up to date package, ...
9
votes
3answers
450 views

Are there any downsides to using macros to avoid typing accents?

As a native English speaker, I am not used to many words with accents on them, so I find it somewhat difficult to keep the various accents straight in my head, and moreso to also remember the TeX ...
8
votes
2answers
180 views

How to make this pgfkeys code more compact and streamlined?

I have just managed to create my first command with pgfkeys. I defined a command \myset, whose purpose is to make (for example) \myset[big]{abc} correspond to \bigl\{abc\bigr\} Part of my goal ...
19
votes
2answers
350 views

Is it okay for a command to slurp more arguments than it is passed to?

Is it okay for a control sequence \foo to include another control sequence \slurp which slurps more arguments than \foo actually passes to it? For example, is it okay to do this: ...
2
votes
1answer
69 views

How to prevent preview from discarding my PostScript constants defined in the preamble?

Considerations: I have to use beamer document class to create a step-by-step tutorial. I have to use preview package to trim everything outside pspicture. Using standalone document class is not ...
3
votes
1answer
342 views

How to use commands in table specs, and still support array package?

For a package, I want to write code that creates tables, where the exact type of table is configurable (tabular, longtable, tabularx, ... [Update: David rightly remarked that formats like tabularx ...
3
votes
0answers
73 views

Best Practices For Including A Version Controlled File Across All Projects? [duplicate]

I am getting started with WinEdt 7.1 and TEX in general on a windows platform. I have a file where I've defined custom commands. Its current contents are: \newcommand{\avgE}{\bar{E}} ...
19
votes
4answers
2k views

git LaTeX and branches workflow

I'm getting more and more comfortable with git, and I'm learning how to use it with my LaTeX documents. However, I'm not at all a git wizard and thus I'm looking for further advices. One can find many ...
13
votes
4answers
283 views

What are the consideration when choosing either newcommand or newenvironment?

The first time I learnt LaTeX, I thought \newcommand properly fits for inline mode and \newenvironment for displayed mode. Later I noticed it is not correct. So the question is What is the rule of ...
17
votes
2answers
271 views

Does a single \path for drawing a series of geometrical objects make the compilation more efficent?

The TikZ syntax is so liberal (as mentioned in the documentation) that makes me a bit confused with which I have to adopt. Best practice is really my main consideration in coding anything. I have no ...
14
votes
1answer
139 views

Should I use packages when writing a class

I am trying to write a class based on the book class (a thesis class for my department). My question is: is it bad for some reason (or, is it considered bad) to use packages in the class files ...
45
votes
1answer
456 views

Is it always best practice to not include text punctuation in inline math mode?

It has been pointed out on this site, e.g. here by egreg, that text punctuation doesn't belong to the formula in inline math. I've been following this practice for a long time, so I write for all ...
30
votes
3answers
2k views

Best practice for hyperref link colours?

I'm using the hyperref package with the option colorlinks=true. However, I'm not happy with the default link colours: for instance, citation links appear in a flamboyantly bright green that hurts my ...
4
votes
3answers
201 views

Best way to present plain text results in a tex file?

I have some plain text results that I want to include into my bachelor thesis. The output looks like this: Protein: noname Length: 611 N-terminus: OUT Number of transmembrane helices: 3 ...
21
votes
2answers
1k views

The TeXbook: Spiral or hard-cover binding?

I would like to purchase Donald Knuth's TeXbook, and I have noticed that there are two versions available. One is a spiral-bound edition, usually sold by itself. The other is a hard-cover edition, ...
57
votes
21answers
4k views

Do you use TeX for writing your thesis or only for its composition?

I would like to submit my university thesis composited in TeX. But I am not sure what is the best practise in the writing stage so I would like to ask you - do you write your thesis in a TeX editor or ...
7
votes
1answer
439 views

When should we use \DeclareMathSizes, \xxxstyle and font size changing macros (\tiny, \small, etc)?

Could you give me a complete overview when we should use \DeclareMathSizes, \xxxstyle (such as \scriptstyle, etc), and font size changing macros (\tiny, \small, etc)? I want this answer to be CW so ...
15
votes
1answer
234 views

What are best practices for package authors to deal with package conflicts?

One occasionally encountered problem with LaTeX is incompatibility between packages. What are best practices for package authors to deal with package conflicts? For example: What is the best way to ...
16
votes
1answer
631 views

Which command should I use for textual subscripts in math mode?

Textual subscripts like in W_{total} should be typeset in an upright text font (so that code isn't good practice), as has been discussed in various questions here. Now there are several ways to ...
4
votes
2answers
136 views

Why can't I insert a blank line in this code?

In the code below, everything is OK until I insert a blank line instead of one of the \\'s. Upon inserting a blank line, I'll get some errors. How can I get rid of these errors? ...
4
votes
2answers
247 views

Which one is preferred to write x-axis as a single unit that cannot be hyphenated?

Which one is preferred to write x-axis as a single unit that cannot be hyphenated by LaTeX? \documentclass[preview,varwidth]{standalone} \usepackage{amsmath} \begin{document} \preview Along the ...
2
votes
0answers
71 views

Is removing \ensuremath the best practice? [duplicate]

First of all, let's see the following dialogue. Generally speaking, is removing \ensuremath the best practice?
19
votes
1answer
505 views

Rationale to use \input{filename} on the pdflatex command line?

In a tex.SX user profile, I read the best practice recommendation Execute pdflatex \input{filename} instead of pdflatex filename. I have always used the latter one, directly, in scripts, and in ...
17
votes
1answer
285 views

What is the ConTeXt equivalent of LaTeX “\@.”

In English text, TeX follows the convention of putting extra space after a period by default, which I like. However, in the case of abbreviations it causes a problem. To suppress the extra space, ...
9
votes
1answer
928 views

Printing on A4 - standard classes vs. KOMA-Script classes

As I'm located in Europe the standard paper size is A4. So far I was normally using either \documentclass[a4paper]{article} or even simply \documentclass{article}. Recently I spotted sections (1.1) ...
25
votes
2answers
1k views

What are coding conventions in LaTeX?

What do I mean by Convention? First of all, allow me to clear myself about the word 'conventions. As most of you already know, coding conventions are a set of guidelines for a specific programming ...
15
votes
2answers
215 views

Macro Improvements

I am looking to simplify and improve on the code below: \documentclass{article} \usepackage{filecontents} \begin{filecontents}{test.txt} a an and the this by on of \end{filecontents} ...
13
votes
3answers
1k views

Macro for Declaring Variables in Class Files

I'm designing a new LaTeX class, and trying to write a convenient helper command for declaring new 'variables' for use in the class. Specifically, say I want to use a variable called \foo. I'd like ...
36
votes
7answers
2k views

Should I place \title, \author, \date in the preamble or after \begin{document}?

The motivation for this question Forgive me if this looks very basic to you but nobody has pointed out to me yet until now in a comment to a question that the \title command (and thus the other two ...
36
votes
3answers
6k views

Why use .sty files?

Why is it preferable to put inclusions of commonly used packages and user defined commands in a .sty file instead of putting them in an ordinary .tex file?
26
votes
1answer
2k views

When to use the xcolor package instead of the color package?

Can someone explain when to use the xcolor package instead of the color package? Unless you are creating your own specific colors, the differences between the packages seem to be fairly superficial. ...
13
votes
2answers
453 views

How to avoid nesting of tikzpicture?

I have to draw the probability distribution function (PDF) in the following MWE multiple times in a figure as well as across multiple figures. I have read the following questions: Problem with ...
3
votes
0answers
9k views

Where should I use \textsc? [closed]

When should I use macro \textsc ? What is common practice in document like diploma thesis? Should I use it for names of persons, names of described entities of particular interest or in some other ...
5
votes
1answer
7k views

Using Koma-Script's scrartcl class as an American academic: suggested changes?

It was recommended to me when I first started using LaTeX (not too long ago) and asked a question about footnotes to use Koma-Script's scrartcl class because of its /deffootnote command. Browsing ...
4
votes
0answers
63 views

Should I put the name of a new command in braces? [duplicate]

Possible Duplicate: Why do people use unnecessary braces? In so far as I know, the open and close braces around the command name for \newcommand{\commandname}{...} versus ...
9
votes
2answers
293 views

Best practices longtable

I have a long table with the explanation of 50 items (the MWE displays only 9). I believe this is hard to read. How do I make it easy to read? \documentclass[10pt,cleardoublepage=empty,twoside]{book} ...
8
votes
1answer
4k views

BibTeX or biblatex/Biber 'private communication' entry

What is the correct way to cite "private communications" and similar sources that seem not to belong into the .bib database. I am using biber and biblatex with TL2012