Assuming that one wants punctuation in equations, what is the best way to adjusting the vertical position of the punctuation if it follows a fraction? I am using Palatino and Euler here (which I generally really like). The problem is especially apparent with commas, which end up looking like primes on elements in the denominator (without a prime close by, the first equation looks an awful lot like it has a B'
in the denominator):
Adding some space before the punctuation (second example) helps slightly, but still looks strange to me. It seems that, when following a fraction, the comma (and maybe the period) should be raised by a small amount (third example).
Questions
- What is the best typographic practice for including punctuation in these cases?
- Is there a robust way of doing this? I.e. one that somehow uses font information to work well in all sizes and fonts.
Obviously raising of punctuation should only occur in specific cases such as the fractions shown here. Perhaps there is a way of inserting something at the end of fractions that will trigger this behaviour, then reset it if the following text is not punctuation?
Here is the MWE I used to make the output above:
\documentclass{minimal}
\usepackage{mathpazo} % To get Palatino
\linespread{1.05} % See question 31064
\usepackage[small, euler-digits]{eulervm} % and now Euler
\begin{document}
Here are two equations that look awfully similar:
\begin{equation}
a = \frac{1}{A+B}, \qquad b = \frac{1}{A+B'}.
\end{equation}
\begin{equation}
a = \frac{1}{A+B}\,, \qquad b = \frac{1}{A+B'}\,.
\end{equation}
\newcommand\raisepunct[1]{\,\mathpunct{\raisebox{0.5ex}{#1}}}
\begin{equation}
a = \frac{1}{A+B}\raisepunct{,}
\qquad b = \frac{1}{A+B'}\raisepunct{.}
\end{equation}
\end{document}
Related Questions
Several questions have addressed punctuation in equations, but most discuss only whether or not to include it, or if a thin horizontal space should be included:
- Proper punctuation after cases environment
- For formal articles, should a displayed equation be followed by a punctuation to conform to the language grammar?
- Spacing before punctuation in displayed equations
- Punctuation in equations
- comma like \cdot Peter Grill's answer to this question mentions the raising issue, and demonstrates the use of
\mathpunct
, but the question does not really address the typographic or robustness aspects of the problem - Periods and commas in mathematical writing (mathoverflow)
Best Answer
The typography as displayed by
LaTeX
is the correct one. A comma needs to be placed at the baseline.If you need to make any adjustments rather place the fraction within brackets. Agreed that the comma can be mistaken as a prime, but remember that mathematics is read in context, i.e., if no primes are used on the variables it is highly unlikely that a mathematically inclined reader will mix it up.
I have checked the above with a couple of books and always the comma is as shown by LaTeX.
Your suggestion of raising the comma can lead to other problems such as
$(a,b)\frac{a}{b},
resulting in the commas not lining up.