Gregory Paciga

Gregory Paciga

Scientist by training, Tester by trade
Ph.D., Astronomy & Astrophysics

Email: gregory [at] paciga.com

LaTeX

As a natural part of my physics and astronomy background, I have accumulated many years of exerpience working with LaTeX, from simple one-page memos to theses and journal articles. I enjoy copy editing and typesetting documents in LaTeX more than your average astronomer; in fact one of my favourite parts of the paper writing process is the copy editing, from making sure the notation is consistent to proper punctuation and grammar around equations.

I am willing to provide LaTeX copy editing and typesetting services for both academic and non-academic texts. Please contact me for more information.

Common Mistakes

  1. Italics where there should be no italics.

    This comes up most often when things are written in a math environment. It is often convenient to do this, but the math environment assumes every plain character is a variable, meaning it is typeset in italics and separated from neighbouring letters more than it would be in a regular word. This comes up most often in variable labels and when including units in an equation.

    For an extreme example, you might be tempted to write

    velocity = \frac{distance}{time}
    which renders as

    velocity = \frac{distance}{time} .

    However, this is really telling me that v times e times l times o times c times i times t times y is equal to d times i times t times... well, you get the point. What you should have written is something like

    \mathrm{velocity} = \frac{ \mathrm{distance} }{ \mathrm{time} }
    which renders as

    \mathrm{velocity} = \frac{ \mathrm{distance} }{ \mathrm{time} }.

    The same is true of variable lables, which are often used for clarity where there are several similar quantities. For example, one might write the total density of the universe as

    \Omega_{total} = \Omega_{M} + \Omega_{Rad} + \Omega_{DM}
                       + \Omega_{DE} + \Omega_k
    
    which renders as

    \Omega_{total} = \Omega_{M} + \Omega_{Rad} + \Omega_{DM} + \Omega_{DE} + \Omega_k

    but most of those labels are words, not variables. Again we should use mathrm, so the equation becomes

    \Omega_\mathrm{total} = \Omega_\mathrm{M} + \Omega_\mathrm{Rad} + \Omega_\mathrm{DM}
                            + \Omega_\mathrm{DE} + \Omega_k
    
    which renders as

    \Omega_\mathrm{total} = \Omega_\mathrm{M} + \Omega_\mathrm{Rad} + \Omega_\mathrm{DM} + \Omega_\mathrm{DE} + \Omega_k .

    Note the difference between the last omega term and the rest. Since k actually is a variable (representing the curvature of the universe, which can take on many values), it should remain italisized. All the other omega terms have words or abbreviations as their labels and should be in plain roman.

  2. Formatting around equations

    Equations are part of the sentence and should be punctuated as such. Note how in the above section, some equations have a period at the end, ending the sentence, while some do not, and the sentence continues after it. They also do not automatically start a new paragraph (unless you want them to). I'm not using indentation at the beginning of my paragraphs here, but if I were, unless I really did want to start a new paragraph, I would use a \noindent at the beginning of the text after an equation. Otherwise, LaTeX will assume you do have a new paragraph and indent it.

    In general, whitespace in LaTeX doesn't matter much, but while there is no difference between one blank line and twenty, there is a difference between one blank line and zero. Around equations, keep in mind that if you have a blank line between the text and the \begin{equation} or \end{equation} tags, LaTeX will see it as a new paragraph, even if you didn't intend it as such. This has a small change in the spacing between the text and the equation.

  3. Spacing between numbers and units

    This is a pretty subtle difference, but units should be separated from the magnitude with a space that is smaller than the space between two words, but greater than no space at all. So, instead of writing "542 km", you should write "542\,km". This also has the advantage that the magnitude and the unit won't be split over a line break when a \, space is used. A tilde also prevents line breaks, but makes a regularly sized space. Of course, if you're inside the math environment, you'd write "542\,\mathrm{km}", which is different from "542 times k times m"!

These are a few pet-peeves of mine that I often come across in academic texts. Some of the details on the proper way to do these things may vary depending on journal style, but wrong is still wrong!

Embedding LaTeX in HTML

This page uses the jsLaTeX plugin for jQuery by Andreas Grech. It is incredibly simple to install (just download one file and insert a few lines of code into your page's header) and to use. Once in place, LaTeX can be written directly into an HTML document just by enclosing it in <div class="latex"></div> tags. I highly recommend it.