13

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:

enter image description here

(\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.

N. Virgo
  • 4,289
  • 2
  • 26
  • 41
  • Please see if this helps -- http://tex.stackexchange.com/q/70527/34618 and this http://tex.stackexchange.com/q/72819/34618 – Jesse Feb 02 '14 at 05: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. – N. Virgo Feb 02 '14 at 05:44
  • Great, the focal point is clear. – Jesse Feb 02 '14 at 05: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 02 '14 at 16:05
  • Related: http://tex.stackexchange.com/questions/120976/a-special-fraction-macro-with-raised-fraction-bar/120980#120980 – Steven B. Segletes Feb 02 '14 at 21:31

1 Answers1

9
  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.)

    enter image description here

    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}[2]{%
      \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}[2]{%
      \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:

    enter image description here

  3. About this question, I don't have an answer...

karlkoeller
  • 124,410
  • 1
    May be using ex units (or mu/em) you can provide a more “secure” solution. – Manuel Feb 02 '14 at 10:30
  • @Manuel I definitely agree – karlkoeller Feb 02 '14 at 10:41
  • in the question, the fraction is set next to \log. context matters. although from the code, the vertical position of the fraction rule isn't adjusted, only that of the numerator and denominator, the effect of setting it in smaller sizes appears to lower the rule, which would look very odd in context, especially if it happens to be followed by, say, a plus or minus, which has a very strong horizontal at the math axis. it would be best if the fraction rule can be kept, even artificially, at the math axis. – barbara beeton Feb 02 '14 at 14:45
  • @barbarabeeton I can't notice any problem if the code is followed by a plus or minus. – karlkoeller Feb 02 '14 at 14:53
  • i didn't replicate the test, and i suspect other readers won't either. so if you separate the four examples by minus signs rather than a quad, the visual clue would be instructive. – barbara beeton Feb 02 '14 at 14:59
  • @barbarabeeton I keep not seeing anything wrong... – karlkoeller Feb 02 '14 at 15:08
  • @barbarabeeton Both with and without the new code, the height of the fraction bar changes with the script and scriptscript styles, reflecting the lower x-axis in these cases. – Andrew Swann Feb 02 '14 at 16:02
  • @AndrewSwann -- yes, that's what i surmised, and i also think it's not a good idea to move the fraction rule out of alignment with the math axis. that's what i would like to see shown in the example, so other people can make up their own minds. – barbara beeton Feb 02 '14 at 16:05
  • @Manuel -- you're correct -- he is not moving the fraction rule intentionally; it's a consequence of the different size/style. nonetheless, i think the resulting effect is not good (a journal copyeditor would mark it for adjustment if it looked misaligned in context), so i think it would be good to show the result in this example, which can be done easily by separating the different instances by minus signs. – barbara beeton Feb 02 '14 at 16:13