How and whether to fine-tune the vertical placement of a fraction line

This is a question about the aesthetics of mathematical typesetting, as well as a technical question about LaTeX.

I'm writing a lot of expressions like this: (\log\frac{p_{i\to j}}{p_{j\to i}} in a display math environment.)

This looks odd to me, because of the very large gap between the fraction line and the denominator, compared with quite a small gap between the line and the numerator.

I realise that in some sense that gap needs to be there in order to accommodate taller characters like 'A' or 'b', but since there are no such letters in my expression it seems like it might look better if the spacing were different.

So my questions are (with roughly equal priority):

1. Should I be messing with this? Am I right in thinking the expression looks unbalanced, or should I just trust the algorithm's designer (presumably Knuth) to have made the right decision about how to typeset this?

2. If I should change it, what should change exactly? Should the line be lower, or should the denominator and/or numerator be higher up?

3. If changing it isn't a terrible idea, what is the best way to affect such a change?

I believe this is not a duplicate of How to vertically center the fraction line?, since that question is about how the spacing relates to the font, rather than to the actual characters used in the numerator and denominator.

• Please see if this helps -- tex.stackexchange.com/q/70527/34618 and this tex.stackexchange.com/q/72819/34618 – Jesse Feb 2 '14 at 5:35
• @Jesse those questions help a little, but they're only tangentially related, and don't address the aesthetics/best-practice aspect of my question. – Nathaniel Feb 2 '14 at 5:44
• Great, the focal point is clear. – Jesse Feb 2 '14 at 5:50
• How about \log\frac{p(i\to j)}{p(j\to i)} , so you don't have subscripts in the fraction? This might be easier to read, unless it violates some notation convention important in your discipline. – Ethan Bolker Feb 2 '14 at 16:05
• – Steven B. Segletes Feb 2 '14 at 21:31

1. Usually I don't bother about these things, except when the result is very ugly.

In this case, the result is not so ugly, but effectively the fraction looks a bit unbalanced.

2. I would live with it, but if you really can't, this can be a way to achieve a more balanced fraction.

First of all, let's have a closer look at the result in all styles (displaystyle, textstyle, etc.) IMHO, the latter two can be OK, while the former two need both the denominator and the numerator to be raised up.

The following can be a solution (a new command \bfrac, with the meaning "balanced fraction"):

\DeclareRobustCommand{\bfrac}{%
\mathchoice{\frac{\raisebox{0.1ex}{$#1$}}{\raisebox{0.4ex}{$#2$}}}%
{\frac{\raisebox{0.4ex}{$\scriptstyle#1$}}{\raisebox{0.1ex}{$\scriptstyle#2$}}}%
{\frac{#1}{#2}}%
{\frac{#1}{#2}}%
}

MWE

\documentclass{article}
\usepackage{amsmath}

\DeclareRobustCommand{\bfrac}{%
\mathchoice{\frac{\raisebox{0.1ex}{$#1$}}{\raisebox{0.4ex}{$#2$}}}%
{\frac{\raisebox{0.4ex}{$\scriptstyle#1$}}{\raisebox{0.1ex}{$\scriptstyle#2$}}}%
{\frac{#1}{#2}}%
{\frac{#1}{#2}}%
}

\begin{document}
$\displaystyle{\frac{p_{i\to j}}{p_{j\to i}}}\quad \textstyle{\frac{p_{i\to j}}{p_{j\to i}}}\quad \scriptstyle{\frac{p_{i\to j}}{p_{j\to i}}}\quad \scriptscriptstyle{\frac{p_{i\to j}}{p_{j\to i}}}$

\bigskip

$\displaystyle{\bfrac{p_{i\to j}}{p_{j\to i}}}\quad \textstyle{\bfrac{p_{i\to j}}{p_{j\to i}}}\quad \scriptstyle{\bfrac{p_{i\to j}}{p_{j\to i}}}\quad \scriptscriptstyle{\bfrac{p_{i\to j}}{p_{j\to i}}}$
\end{document}

You can compare the output: 