Define Math formatting for vectors, matrices, etc., in the preamble, and use it
consistently
Tables for article manuscripts
Captions for Tables and Figures
Text vs. Math vs. Italics
Make smart use of label and ref command pairs for cross-references
Dirac brackets
_________________________________________________________________________
Suppose you are finally ready to write your PhD thesis, or you decided to write a
research paper, or a book, and you want to format symbols representing vectors in
bold italic, and symbols representing matrices in sans serif. Bold math is easily
accessible, for all sorts of glyphs, by loading the boldmath package and using the
\bm{} command defined in the package. Math sans serif is accessible via
\mathsf{}. However, it is not a good idea to type, for example, the inhomogeneous
linear equation
in your LaTeX source document like this:
\mathsf{A}\bm{x} = \bm{b}
Why is this not a good idea? Imagine this: After typing dozens or hundreds of equations, you decide—or someone else tells you—to change the formatting for matrices and vectors (and all sorts of other things)...? Now you would have to apply those changes everywhere you used your chosen formatting for matrices or vectors.
Instead, you want to define the formatting for different types of mathematical or
physical objects in the preamble, so that you can change the notation easily
throughout the document, simply by changing the definitions. For example, with the
xelatex/lualatex + STIX2 setup described elsewhere on this site, I usually define
in the preamble
\newcommand{\vect}[1]{\bm{\mathit{#1}}} % boldface-italic for vectors \newcommand{\bold}[1]{\bm{\mathrm{#1}}} % boldface-upright \newcommand{\mat}[1]{\mathsf{#1}} % upright-sans matrices \newcommand{\matvec}[1]{\bm{\mat{#1}}} % upright-bold-sans
The equation above would then be typed in the LaTeX source file like this:
\mat{A}\vect{x} = \vect{b}
Now you can define the formatting in the preamble any way you like, and change it
easily, if needed.
Back to Table to Contents
_________________________________________________________________________
Table rule #1: Keep it simple
An example:
Table 1: My simple table.a
col. 1 headerb | col. 2 header | col. 3 header |
block 1 data label | val. | val. |
val. | val. | |
block 2 data label | more stuff | even more |
block 3 data label | so | much |
more | stuff | |
\begin{tabular}{lrr}\hline col.\ 1 header\textsuperscript{b} & col.\ 2 header & col.\ 3 header \\ \hline block 1 data label & val. & val. \\ & val. & val. \\ block 2 data label & more stuff & even more \\ block 3 data label & so & much \\ & more & stuff \\ \hline \end{tabular}
Back to Table to Contents
_________________________________________________________________________
Captions for figures go below the figures
Captions for tables go above the tables
People tend to overload table captions with information, which will then be put into
additional footnotes by journal production, thus likely messing up your existing table
footnote labels. Keep table captions short, and put all additional information in the
table footnotes. A footnote label may be attached to the table caption itself. See the
example above.
Back to Table to Contents
_________________________________________________________________________
Use Math ($ ... $) only for Math, not for formatting italics.
Consistently format things like cis, trans and so on in italics
(\textit{cis} etc, not $cis$ !).
If you have a physical quantity or a label in an equation that is typeset in
Math (e.g. temperature
is typeset as $T$) it must be typeset the same everywhere, also in the text.
and T are different things.
Avoid stuff like E$_a$ + 2 E$_b$ in your LaTeX code when in fact E is
supposed to be
(e.g. an energy). In that case you use a single in-line Math construct such
as $E_a + 2 E_b$.
Sometimes we want to use text acronyms and such for subscripts and
superscrips. Say, we define an isotropic chemical shift as .
Here, the LaTeX code is $\delta_{\text{iso}}$, with ‘iso’ short for
‘isotropic’. On the other hand, ,
coded as $\delta_{iso}$, indicates a delta with three subscripts or
alternatively a subscript
times
times .
Note that even
($\delta_{\text{\textit{iso}}}$) looks different from .
In the former case the textual subscript is italic but the spacing/size may
be different. Remember that there is a difference between $iso$ and
\textit{iso}.
The \text{...} command requires the amsmath package. \text{} is
preferred over \mathrm{...} etc. You can use formatting inside \text{...}.
Chemical formulas: load the chemformula package and use the \ch{} command. For example, \ch{H3O^+} is then typeset properly, unlike $H_3O^+$, which gives with incorrect italic element symbols and terrible spacing. Instead of the chemformula macros, you can use H$_3$O$^+$, or even better, H\textsubscript{3}O\textsuperscript{+}, which is the safer way to format chemical formulas in BibTeX entries.
Back to Table to Contents
_________________________________________________________________________
Some tips:
You can use \label{} and \ref{} for pretty much everything:
Figures, Tables, Equations, Footnotes, Sections and Sub-(sub-sub-)
Sections, Chapters, Book Parts, enumerated list items, and so
forth. There is also \pageref{}. Given this powerful mechanism
of having all such cross-references automatically updated, as you
develop your manuscript, why would you not use it for all cross
references? For example, I can reference item 2 in this list
using \ref{item:use-descriptive-labels} after having placed
\label{item:use-descriptive-labels} somewhere in that \item
(which I just did).
Choose descriptive labels. A label such as eq:3-1 may make sense at
some point during the draft stage of a manuscript, but cross references
have a tendency to change during the writing process. What used to be
Equation 3.1 at some point may no longer be so at a later stage. Better
use something like eq:schrodinger-time-dependent-initialdef. A
good text editor, such as the one I’m using (GNU Emacs with the
AucTeX add-on), will offer you a list of already defined labels to choose
from when you type a \ref{} command, so having long descriptive
labels should not be a problem. See also item 1. (Incidentally, I placed
\label{item:use-label-ref-combos} at the end of that item and
referenced it here as \label{item:use-label-ref-combos}.)
On the topic of descriptive labels, I usually use eq: at the beginning
of an equation label, and likewise fig:, tab:, sec:, for figures, tables,
and sectioning, respectively. That way it’s easier to keep track of which
label is for which kind of reference. Furthermore, some text editors can be
configured to offer string completion only for labels beginning with eq:
following the word Equation, for example.
Blank space and special characters in labels should work, but why take the risk? Try to stick to ASCII characters and use dashes instead of blank spaces.
Back to Table to Contents
_________________________________________________________________________
I wrote a little style file, jobraket.sty, to help with typesetting Dirac brackets. The commands \sket{}, \sbra{}, \sbraket{}, and \sobraket{} (‘s’ for ‘small’) simply use delimiters etc. that are the same size as the text’s base font.
Commands \ket{}, \bra{}, \braket{}, and \obraket{} use \left and
\right for delimiters, but the macros adjust the vertical height of the arguments
such that the delimiters are the same height throughout a bracket. This is useful for
stuff like
(\braket{\Psi_i^{(0)}}{\Psi_j^{(0)}}=0$) or
($\scop{H}^{(1)}_{i,j} = \obraket{\Psi_i^{(0)}}{\scop{H}^{(1)}}{\Psi_j^{(0)}}$)
Back to Table to Contents
_________________________________________________________________________
© 2021 – 2024 J. Autschbach.