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

learn more… | top users | synonyms

4
votes
2answers
144 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
69 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
386 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
35 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
604 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
76 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
181 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
123 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
495 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
154 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
180 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
126 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
189 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
540 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
324 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
106 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
63 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}
0
votes
1answer
103 views

Why is scaling text evil?

The TikZ & PGF manual says that It is possible to transform nodes, but, by default, transformations do not apply to nodes. The reason is that you usually do not want your text to be scaled ...
54
votes
4answers
3k views

Defining custom commands is bad style?

I recently received this in a e-mail from my professor Good LaTeX style would preclude creating any of your own commands, counters, etc. (Most journals would reject submissions with user-defined ...
3
votes
0answers
185 views

Typesetting programming packages/libraries in LaTeX

When referring to programming packages/libraries (such as matplotlib for example) within a LaTeX document should one typeset it to denote it as a package/library name? Such as using \texttt{}?
12
votes
1answer
426 views

Code improvement on a title page design

I am designing a new title page to post in the topic Showcase of beautiful title page done in TeX but am having some issues with the code I wrote. I don't like and I know it can be improved. In ...
23
votes
2answers
554 views

Multi-line options with the `\usepackage` command

When including a package using the \usepackage command that has a lot of options, are there: Any restrictions on how the options can be split across multiple lines? Any best practices for formatting ...
8
votes
1answer
56 views

Potential side-effects associated with a dash in a package/class name?

Common practice for naming packages and classes seems to be, using regex-like notation: [a-z][a-z0-9]* In other words, the name usually starts by a lowercase letter, followed by any sequence of ...
8
votes
1answer
105 views

Fixed position for pgfplot area

I use pgfplots to generate graphics for a beamer presentation. The graphics are placed on consecutive slides. This works great, but the graphic position is slightly moving from slide to slide, which ...
5
votes
1answer
128 views

Library of reusable equations

I want to do something that sounds simple. I want to create an external file where I will store my equations. Then I would like to be able to these equations and input them in a document without ...
6
votes
1answer
75 views

Font formatting order

I want to set my chapterprefix font for scrbook class. This is what I want to do: \setkomafont{chapterprefix}{\centering\Huge\rmfamily\mdseries\scshape} However, as I was writting it, I asked ...
5
votes
1answer
172 views

“Flatten” macros prior to sharing LaTeX file

Is there a way/an existing tool to process a LaTeX source document such that for a given list of macro definitions (using \newcommand), calls to those macros are replaced by their expanded version? ...
9
votes
0answers
618 views

best practice to include (standalone precompiled) graphics

General understanding I know that several people have asked about how to include plots and graphics (created by tikz and pstricks) into a latex document. What is the best way to include Matlab ...
46
votes
4answers
2k views

What is the advantage of using the notation 'fig:' in the \label {}?

Reading manuals I always find figure labeled as \label{fig:name}. I wonder where is the advantage of using this notation with fig:instead to start with the name it self. If in my document I have only ...
3
votes
1answer
330 views

Best practices in organizing BibDesk files

How many BibDesk files? I am using LaTeX (and BibDesk) for research only (i.e., to write papers, book chapters, dissertation, etc.), therefore I need to cite an overlapping selection of references ...
16
votes
3answers
2k views

Always \textrm, never \rm? A counterexample?

Let us see the following code: \documentclass{article} \begin{document} \newtheorem{theorem}{Theorem} \begin{theorem} TFAE \begin{itemize} \item[(i)] $0<1$; \item[(ii)] $1>0$. \end{itemize} ...
15
votes
1answer
140 views

Should babel package call be placed at the end of the preamble?

I remember to have read few year ago1 that babel line2 should be placed at the end of the preamble in order to avoid problems with other packages. (I believe hyperref package should also be placed at ...
2
votes
0answers
84 views

How to backup custom fonts and packages

I'm about to format my computer but I have installed a lot of TeX fonts and some useful TeX packages. I'd like to backup them, especially the fonts, because it took me a long long time to install but ...
13
votes
4answers
316 views

How do I tell which version of a command to use?

So LaTeX has a lot of commands that do very similar things. Often this is a result of some of these being old. For example: $x^2$ vs \(^2\); As I understand it, the second example is the more modern ...
10
votes
3answers
548 views

Empty line (in code) before enumerate environment

I like my code to look like this: \documentclass{article} \begin{document} \begin{enumerate} \item test text \begin{enumerate} \item 1 \item 2 \item 3 \item 4 \item 5 ...
3
votes
1answer
58 views

The actual source of pst-plot?

In the comment to answer to his question Labels with \psplot Svend Tveskæg writes: The newest version of pst-plot can be found at http://texnik.dante.de/tex/generic/pst-plot/pst-plot.tex. Is it the ...
4
votes
2answers
352 views

Doubts for customize classicthesis

I downloaded the classicthesis from its site and I was analysing the contents of the class, the manual, examples and all that. But I have few doubts yet about how to customize well the classic thesis ...
4
votes
0answers
157 views

Long vs. short labels for cross-references

@DavidCarlisle argued in his answer that there is no need to use very long labels and it is actually a misuse! In my dissertation I find myself using very long labels all over the place. For the same ...
6
votes
1answer
125 views

Why to use [T2A, T1] when [T2A] is enough?

I am writing some seminar in Cyrillic for university \documentclass[a4paper,14pt]{extarticle} \usepackage[T2A,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{droid} ...
8
votes
1answer
98 views

How to mimic LINQ's query method for macro's key-value?

Inspired by LINQ's query method, such as deck.Take(randomCount) .Where (card => card.Suit == "Hearts") .Skip(2) .Take(5) .OrderBy (card => card.FaceValue); The deck which is ...
5
votes
1answer
67 views

Should I use \documentclass[12pt]{article} with \Large or \documentclass{article} with \LARGE?

So, I'm working on making some cards, and they need to have nice, large, clear text. So I've set the text to be \LARGE. Then I was thinking, am I doing bad things to the font by over-enlarging it? It ...
12
votes
1answer
2k views

Use of \midrule in booktabs table

Are there any formal guidelines/suggestions on the use of \midrule inside a booktabs table with just rows of identically formatted data? The booktabs manual is very specific about vertical rules, ...
6
votes
1answer
221 views

How to format mathematical and programming variables in text?

I am describing an algorithm in a journal paper. In this algorithm I have a few variables. I gave them the same names as in my source code (C++ source of the algorithm, not LaTeX source). So I have ...
7
votes
1answer
175 views

Gobble optional arguments

You can use \@gobble, for instance, to restrict the usage of a macro like: \documentclass{article} \makeatletter \newcommand*{\cmd}[1]{% #1 \global\let\cmd\@gobble } \makeatother \begin{document} ...
6
votes
1answer
1k views

Typesetting chemical element names

What is the 'best' package for typesetting names of chemical element? (I don't need anything but the names of the chemical elements.) Assume I want to typeset ``The dissociation of a AgBr ...
5
votes
2answers
125 views

How to buffer the extreme value of f(x) to draw a line representing a range of f(x)?

Please consider the following animation. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \def\f{x^2-x-6} \psset{unit=3,algebraic} \def\Atom#1{% ...