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

learn more… | top users | synonyms

28
votes
1answer
3k 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
488 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
11k 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
8k 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
5k 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
41
votes
1answer
3k views

What is the advantage of using $f^\prime$ instead of $f'$?

Although the two outputs look quite similar, what is the advantage of using $f^\prime$ instead of $f'$? By the way, here is my code: \documentclass‎{article‎}‎ \begin{document}‎‎‎ \[‎ ‎f^‎\prime ...
3
votes
1answer
135 views

How do I best combine several documents?

I have a collection of articles written in latex, and I would like to "merge" them into a larger thesis document, in which each article will be a chapter. I have been looking at include and input, ...
40
votes
6answers
3k views

Writing readable LaTeX

Lets say I have the following LaTeX code \subsection{Convex sets} A set \( \mathcal{S} \) in \( \mathbb{R}^n \) is said to be convex if \[ \mathbf{x}_1, \mathbf{x}_2 \in \mathcal{S} \implies \lambda ...
4
votes
1answer
150 views

Should I load packages (for instance, all AMS packages) separately or all together?

I was reading some post here at SE and I noticed that many people load packages one by one. For example, \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amsthm} and so on. Usually, I load ...
14
votes
6answers
8k views

How should imaginary numbers be typeset?

I've never had to typeset complex numbers before and I'm finding that I'm uncertain about what best-practices are. My question is really about typesetting just i. (Hence my title referring to ...
6
votes
1answer
168 views

Recreating a square with fixed baseline and height (3d)

I am trying to recreate the following image, as close as possible. The point is that the circumference of the bottom, plus the height of the cube needs to be 30. Which gives 30 = 4x + h so I want ...
3
votes
1answer
815 views

Tag placement in split equation within alignment block

Whenever I have an equation that does not fit on a single line, I am using \begin{equation}\begin{split}...\end{split}\end{equation} as recommended in the AMS math guide. This gives me an equation ...
3
votes
1answer
344 views

Example figure placement

I am using the following code in an example file. \documentclass{book} \usepackage{graphicx} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{figure}[h] ...
8
votes
1answer
6k views

Correct way to set margins

I set the margins of my document in this way using the geometry package \usepackage[left=2.5cm,top=3cm,right=2.5cm,bottom=3cm,bindingoffset=0.5cm]{geometry} Is it a correct way or does there exist ...
46
votes
3answers
8k views

What is the difference of \mathop, \operatorname and \DeclareMathOperator?

One sees all kind of versions in source files for defining something like a limit etc. So my question is which one serves what purpose. Is there any "best practice" in chosing one over the other?
5
votes
0answers
55 views

Review of algorithm-related packages? [duplicate]

Possible Duplicate: Print programs with its proper syntax Where can I find (if it exists) an updated review of the most relevant packages for handling with algorithms (pseudocode or code ...
40
votes
1answer
2k views

Difference between ref, varioref and cleveref. Decision for a thesis

How can one make a quick decision what the best "ref" for a thesis in pdflatex with hyperref is? After a few hours reading I do not know more than ref is used by everyone who does not know about ...
9
votes
2answers
169 views

Ensuring correct LaTeX compilation on different systems

I'm currently writing a document collaboratively and I need to make sure that the compilation is executed correctly on every possible system (e.g., that the document encoding - UTF-8 - is detected by ...
35
votes
2answers
2k views

Will cruft from a previous compile ever change the final look of my document

Ok, this has been bugging me for a while; Will cruft left over from a previous run of LaTeX ever change how my document looks? Would the following procedures ever give me different results: I ...
58
votes
2answers
11k views

When to use \par and when \\

What is the difference between \par and \\ and when should I use \par instead of \\?
13
votes
2answers
610 views

Why are these commands considered as bad practice?

I was reading LaTeX: Do not use these commands, but the author didn't explain why they are bad. Could anyone help me understand. \\ (except inside a special environment like tabular, array, or ...
55
votes
6answers
2k views

How bad for TeX is omitting braces {}, even if the result is the same?

Sometimes writing braces and omitting them produces the same result: \tilde{\psi} \mathrm{e}^{\mathrm{i} \pi} vs \tilde \psi \mathrm e^{\mathrm i \pi} Or (taken from Werner's comment below) ...
4
votes
3answers
206 views

Shorthand for variables lead to name clash

In formulas I need often the same constants and variables with lot of "make-up". I want to have readable and maintainable LaTeX code, so I thought about writing \newcommands like ...
6
votes
1answer
358 views

Newline, indentation, parskip - when to use what in what stylistic manner?

I intend to use scrbook. In real-life literature, English and German language, the text often looks like this: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod ...
59
votes
2answers
1k views

Detecting unused packages in LaTeX document

I have quite a bad habit of copy-and-pasting my packages from one LaTeX document to another. Is there any way we can detect unused packages (i.e. \usepackage commands) so that they can be removed from ...
8
votes
1answer
375 views

Can I assume that the \ht+\dp of a strutbox == \baselineskip?

In Context, as long as the interline space is set through the proper interface, it is safe to assume that (tex.box.strutbox.height + tex.box.strutbox.depth) == tex.baselineskip.width. This relation is ...
5
votes
1answer
729 views

Shortcut commands for referencing floats

I always include the following commands in the preamble of my latex documents to make sure I refer to floats consistently in the text. I was wondering if the community had any thoughts about this, is ...
17
votes
1answer
216 views

Is there a right way to do combined conditionals in LaTeX3?

I have some LaTeX3 code and I want to add a new feature. This will involve choosing between various actions at a particular point. There are two choices to be made, and these choices are ...
10
votes
2answers
700 views

Are there any situtations where it is better to load a package after other code?

I always place all my packages immediately following the document class, followed by setting information (\hypersetup for example) and customization to my documents (header and footer customization ...
0
votes
1answer
2k views

How should I write arctanh? [duplicate]

Possible Duplicate: Define additional math operators to be typeset in roman If I want to use the function sin in LaTeX, I write $\sin x$ or $\sin(x+1)$. If I want to use the function ...
6
votes
3answers
254 views

Without using intersection method, can we find the following vector component?

Given that two vectors, i.e., green and red ones. The objective is to find the blue one such that the resultant of the green and blue ones is parallel to the red one and with the same direction as the ...
32
votes
3answers
1k views

How to make TikZ faster?

I have a long document containing plenty of TikZ figures and it is painfully slow to compile it. Is there any specific TikZ tips / good practices you could recommend me so that I can write figures ...
0
votes
1answer
182 views

Best way of representing logical statements

I have a number of statemts which describe the process of creating a data element which are intergrated within a "data manual". For example: IF ( ( heigth between 58 AND 76 ) AND ( BMI between 19 AND ...
5
votes
1answer
2k views

How to use classicthesis?

Once I discovered classicthesis I fell in love with the layout and used it for study reports and so on. In the first step I downloaded the sources and customized the settings in various files as ...
1
vote
1answer
360 views

Should citations be used before or after equations?

Should I put citations before or after equations? For example: the following sequence \citep{----} \begin{equation} -------- \end{equation} or the following sequence \begin{equation} -------- ...
18
votes
2answers
342 views

Does a zero-length line with an arrow make sense? Is it a bug?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \multido{\i=0+30}{12}{% \begin{pspicture}(-2,-2)(2,2) \pscircle{1} \pnode(1;\i){R} ...
16
votes
3answers
1k views

What are some best practices for the typography of tables and figures?

I put captions above my tables and below my figures. I use the booktabs package (and no vertical lines) for my tables. Do I show both tables and figures (graphs) for the same data? If so, in what ...
11
votes
1answer
309 views

Is it a good practice if we always locally precede \href with \sloppy?

Is it a good practice if we always locally precede \href with \sloppy as follows? if you are interested to know the details, please contact me at {\sloppy ...
20
votes
1answer
780 views

Write to logfile

I want to write some things to the log file. What is the best practice for this? Is it \message{} or \typeout{} or what?
8
votes
1answer
346 views

XeTeX: better using system fonts or packages?

I've recently switched to XeTeX. In my document I use this code to set the fonts: \usepackage[math-style=ISO,bold-style=ISO]{unicode-math} \usepackage{xunicode} \usepackage{fontspec} ...
5
votes
1answer
2k views

Update TikZ/PGF on mac

the TeXLive 2012 distribution on my Mac is shipped with TikZ version 2.10 - I want to use (try) the CVS (most updated beta(?) version). Here's what I've done so far: Downloaded the the TDS package ...
20
votes
1answer
365 views

Why are \@title, \@author, and \@date cleared during \maketitle?

(This is not a duplicate of How can I use @author, @date, and @title after maketitle?) I understand that \maketitle resets a bunch of macros, including \@title, \@author, \@date, and \maketitle ...
3
votes
1answer
642 views

Fonts too thin when A4 scaled down to A5 in printing

In my document I am using the same settings as in the MWE below. I need copies of the document in A4 and A5. Both have to be identical so I cannot optimise the appearance of both by using a4paper for ...
10
votes
2answers
638 views

Difference between draw=none and draw opacity=0 (also for fill=none and fill opacity=0)?

What is the difference between the TikZ key-value pairs draw=none and draw opacity=0? Are they functionally equivalent, or are there situations in which one should be preferred over another? ...
9
votes
1answer
281 views

What is best practice for aligning distinct arrays or tables side-by-side?

I have two related tables that could naturally be displayed side-by-side but don't have to be. However, it saves space to display them side-by-side rather than one atop the other. If I do so without ...
11
votes
1answer
969 views

What is the best practice for typesetting set-builder notation with a large number of membership criteria?

That is, I have something akin to the following right now: \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} We must have $(a^i,b^i,c^i) \in X^i(d) = \bigg\{(a,b,c) ...
11
votes
3answers
869 views

Reusing LaTeX code to achieve a consistent layout

What is the best approach to reusing the same layout for numerous tables, paragraphs etc. which share the same structure but different content? Is the best method to use custom commands/macros?
1
vote
1answer
189 views

Best practices with \titlespacing?

I think my titles are too close to the text as they are set by default, but when I try to modify the distance, my document does not look nice. What are the best practices for \titlespacing options? ...