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

learn more… | top users | synonyms

21
votes
0answers
182 views
+100

Best Practices for Lua Modules

In the Lua world Lua Modules are installed using LuaRocks. With LuaTeX these modules are normally installed in the scripts folder (under MikTeX windows). What tools are available for downloading and ...
2
votes
0answers
27 views

Adding prefix to TikZ node and coordinate names

This question is somewhat related to my search for a good practice to include TikZ stuff in my documents. Suppose a document (book) with a lot of formulas and equations which you have decorated with ...
4
votes
1answer
60 views

Strange preamble for a thesis or this is normal?

I have a somewhat strange template that I should use for submit my dissertation for the speciality. I put the code as a minimal working example for you to see: ...
5
votes
3answers
109 views

In tikz, is it possible to define a node and set its position later?

I'm trying to draw a diagram and my code is getting too cluttered and difficult to read. For code style purposes, is it possible to define a node in one place and mess with its positioning later? ...
2
votes
0answers
56 views

Best practice for including standalone commented equations with tikz

I'm writing a document where there are some equations which I'm commenting with hf-tikz package. It needs two LaTeX compilations in order to get the right coordinates and to draw everything in the ...
77
votes
4answers
2k views

Techniques and packages to keep up with good practices

Question What techniques and packages are there to keep up with good practices? What I already know I already know of the following packages for this kind of purpose: ...
57
votes
3answers
3k views

Are there any coding style guidelines for LaTeX?

I have been using LaTeX for a long time now, but still all my document files look a bit messy. Now I want to get rid of this bad habit and get some order into my code. That is why I am wondering ...
30
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 ...
12
votes
1answer
220 views

Demonic correspondence: Best practices when defining devils in TiKZ

tikzsymbols defines a series of symbols which can be used in text (or nested in larger pictures) and which can be customised in various ways e.g. scaling size, choice of colours etc. For example: ...
14
votes
6answers
2k views

Which equations should be numbered? [closed]

Is the best practice to number all equations, or just those that will be referred to?
5
votes
0answers
61 views

Letterspacing via microtype vs fontspec (in LuaLaTeX)

I've just realised that I can get somewhat similar letterspacing effects using either the microtype or fontspec packages; for example: \documentclass{article} \usepackage{fontspec} ...
2
votes
3answers
96 views

What is the best way to handle bibliographies which include a lot of online sources?

This question arises from discussion of my earlier question about URLs and BibTeX, I am looking for a solution that works smoothly with primarily web-based references. I have .bib files which contain ...
1
vote
0answers
41 views

The code of figures at the end of file, indeed

This question is connected with How to put figures at the end of pdf file. As one can see from @cfr's and mine comments, I hoped, that it was a question, how to put a code of figures, wich are lying ...
29
votes
2answers
245 views

How do I gracefully retire a package?

I maintain a LaTeX package which is obsolete. All its useful commands are provided by other packages, possibly with different syntax, but still the point is there is no reason for anyone to use my ...
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 ...
5
votes
1answer
67 views

In a package or parasitic class, when is it better to redefine a command and when is it better to define a new one?

When I'm working on a document for which I need special layout, I tend initially to accumulate a very long preamble. At some point, if I need to reuse similar layout regularly, I decide that I really ...
5
votes
1answer
245 views

Best practice regarding graphics size

Whenever I make graphs from R to be included in Latex, I find myself scuttling back and forth between R to specify the size of the output and Latex to play with the \includegraphics[scale=??]. It ...
4
votes
2answers
172 views

How to make the function identifier ( f(x) ) more dominant?

When a function has a rather complex set of parameters, the function identifier (usually simply f), gets dwarfed by the parentheses and the parameters inside of them: As you can see in the red ...
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 ...
2
votes
0answers
95 views

Column Space and Null Space of a Matrix [closed]

What are the notational best-practices for typesetting the column space and null space of a matrix A? Let's see how some of the different options look: Column Space: $col(\mathbf(A))$ ...
6
votes
2answers
261 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 ...
46
votes
2answers
62k views

Which dot character to use in which context?

Wikipedia lists several dot characters in Unicode. These are the ones that are ambiguous to me: interpunct, middle dot (·) · · U+00B7 "midpoint (in typography)" ...
4
votes
1answer
66 views

Avoid accidental \\*

When you write in LaTeX some like: A\\ % *A You expect see the asterisk before of the second character, as usual in any text. However, the above chunk is equivalent to write: A\\* % A ...
106
votes
6answers
45k views

utf8x vs. utf8 (inputenc)

I normally use \usepackage[utf8]{inputenc} for my latex document but on this site i saw a lot of code with \usepackage[utf8x]{inputenc}. What are the differences between the 2 options ? Is there one ...
49
votes
3answers
9k 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?
14
votes
1answer
323 views

In tex file ascii characters only : if so should I encode the file in ascii? Or is utf-8 better used anyway?

This is a best practices question. Should I encode tex files in ascii or should I use utf-8? Is either preferred for a reason (ANY reason) in the case where ascii characters and nothing else appear ...
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 ...
120
votes
42answers
8k views

What are the most common mistakes that beginners of (La)TeX and Friends make?

I want to collect the most common mistakes, misconceptions, pitfalls, etc that (La)TeX and Friends users make. Please one answer for each mistake, misconception, pitfall, etc. I am only interested in ...
31
votes
1answer
1k views

Best practice for writing comments in LaTeX documents

I would like to find out about recommended practices when using comments in LaTeX documents. Some programming languages are quite clear about how to use comments in source code: for instance, [here] ...
15
votes
1answer
385 views

How often do you commit when you use a version control system for your own LaTeX documents? Why? [closed]

I'd like learn about your practices and why you commit the way you do. Whether the practice is just "good" or "better" than another one is of course debatable but this topic could be really helpful ...
54
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 ...
1
vote
0answers
16 views

How to define a bold font style for \emph text [duplicate]

Recently, I wanted to set all my \emphasized text to bold, because I think the default Italic of \emph is not distinctly emphasized. But I haven't found a solution for it. Please give me some idea. ...
4
votes
2answers
270 views

Double tagged equations?

In the following example the inequality (2.26) is obtained in the environment equation, but the equations (2.27) and (2.28) by dirty tricks, destroying the structure of the document. This is because ...
13
votes
3answers
424 views

Best practice - how can I get my whole document (including math) to only use font X with LuaLaTeX and fontspec?

Considering one uses math symbols in a document, it is desirable to have them all displayed in the serif font one is using for text, or in basically any font x one would like to use for this sort of ...
9
votes
3answers
892 views

What are some good examples of LaTeX Cayley diagrams?

I'm looking for some good examples of LaTeX code used to generate basic Cayley diagrams like this one: Ideally, I'd like for the examples to make it fairly clear how to modify or remove various ...
16
votes
2answers
3k views

Choosing font for bold small caps (or any other particular family+series+shape combination)

What is the best way (most proper and general solution) to get rid of the warning LaTeX Font Warning: Some font shapes were not available, defaults substituted. by explicitly setting which font ...
6
votes
1answer
226 views

Typesetting mathematical constants

Is there any command for typesetting constants in mathematical formulas? I would imagine something similar to \operatorname or \DeclareMathOperator, but for constants. I want the constant to be ...
27
votes
6answers
13k views

How to best typeset “special” constants (complex unit i, Euler's number e,…)?

I'm trying to come up with a typographically appealing way to express "special" numbers such as the complex unit i = sqrt(-1) or Euler's number e. It has to be such that it cannot be confused with ...
5
votes
2answers
107 views

Suggestions to a better preamble for creating a handbook

The following is the preamble I was given to work with to create a student handbook. I believe there are a few things that are not right. The document compiles well but I am looking for suggestions of ...
68
votes
12answers
11k views

What are the advantages of using version control (git, CVS etc) in LaTeX documents

Why would I need to use version control with my LaTeX documents? I know people who do it, and I've seen questions about it on here and on SO, but I haven't understood what value there is to doing ...
36
votes
6answers
8k views

Footnotes in tables?

I would like to have footnotes in tables, but the \footnote command does not work inside a table environment. Googling one finds that this is a frequently asked question, at least in the UK. That ...
7
votes
1answer
159 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, ...
10
votes
0answers
97 views

Customizing names of auxiliary file: safe practices?

I maintain a package (morewrites) which requires a temporary auxiliary file to function (written and read right away). This auxiliary file is currently named \jobname.mw, and a user has asked me to ...
50
votes
3answers
1k views

Advantages and disadvantages of fully expandable macros

As I currently understand them, fully-expandable macros are analogous to pure/effect-free functions in functional programming. Correspondingly, things that are not expandable, such as \def, are ...
2
votes
1answer
170 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 ...
62
votes
2answers
10k views

When should one use \begingroup instead of \bgroup?

Is there ever a case when the use of \begingroup is preferred to \bgroup? Obviously, \bgroup is necessary in cases where you need to have balanced braces and thus cannot use {, but when is it ...
33
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 ...
65
votes
6answers
3k views

How to keep up with packages and know which ones are obsolete?

I'm an on and off user of LaTeX so I'm not familiar with every package out there. Having said that, whenever I use LaTeX and need to accomplish a certain goal (i.e. generate a list of appendices), I ...
2
votes
0answers
148 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
250 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 ...