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)
\cdot
which shows how to adjust the position of the comma.\frac
(and\dfrac
) to look ahead and if the next token is a comma, then gobble it and put one itself, raised a bit. But man, this is a good question. I'd upvote it twice if that were possible...\mathpunct
could be used but still requires tweaking (though0.22em
should be0.5ex
as in your solution... doh). Do you know if there is a way of increasing the default spacing provided by\mathpunct
? @mbork I suspect you are right, but I worry about if there are any situations where this might cause problems (or incompatibility issues). I should probably look through the ams classes.equation
. Perhaps a raised variant to Will Robertson's answer could be a semantic solution to your problem.cases
lines, for example), but not at all costs: if the punctuation can lead to ambiguity, some remedy has to be taken. Raising the sign is out of the question, I'd probably look for a way to avoid it or I'd put an additional thick space.