1

This is a follow-up question to Restriction of a function: the subscript seems too low.

Typesetting the following math formulas with kpfonts

\documentclass{article}
\usepackage{kpfonts-otf}
\begin{document}
$\left.g\right\vert, \left.g\right\Vert$
\end{document}

produces a vertical bar that does not go sufficiently low to cover the descender of g. By contrast, the double vertical bar goes low enough.

enter image description here

The single bar is a single character:

\TU/KpMath-Regular.otf(1)/m/n/10 ๐‘”
\vbox(8.85+0.0)x3.09, shifted 1.925, direction TLT
.\hbox(7.13+1.72)x3.09, direction TLT
..\TU/KpMath-Regular.otf(1)/m/n/10 |

The double bar is a constructed from an extensible character:

\TU/KpMath-Regular.otf(1)/m/n/10 ๐‘”
\vbox(12.0+0.0)x5.18, shifted 3.5, direction TLT
.\hbox(0.11+4.61)x5.18, direction TLT
..\TU/KpMath-Regular.otf(1)/m/n/10 ๎ฉ
.\glue -1.57 plus 1.37001
.\hbox(7.13+1.72)x5.18, direction TLT
..\TU/KpMath-Regular.otf(1)/m/n/10 โ€–

When typesetting the same with Computer Modern instead of kpfonts, both vertical bars behave the same (a single character in both cases):

enter image description here

\OML/cmm/m/it/10 g
\kern0.35878 (italic)
\hbox(7.5+2.5)x2.77779, direction TLT
.\OMS/cmsy/m/n/10 j
\OML/cmm/m/it/10 g
\kern0.35878 (italic)
\hbox(7.5+2.5)x5.00002, direction TLT
.\OMS/cmsy/m/n/10 k

Why does the single vertical bar in kpfonts not behave in the same way as the double vertical bar?

Additional remark after reading the answer

The answer says

\vert is not extended (this is a bug)

But the vertical bar after a taller formula

$$\left.g\over h\right\vert$$

is extended:

\hbox(11.48+6.96)x7.62999, direction TLT
.\hbox(0.0+0.0)x1.2, shifted -2.5, direction TLT
.\vbox(11.48+6.96)x5.23, direction TLT
..\hbox(4.64+2.59)x5.23, glue set 0.28fil, direction TLT
...\glue 0.0 plus 1.0fil minus 1.0fil
...\TU/KpMath-Regular.otf(1)/m/n/10 ๐‘”
...\glue 0.0 plus 1.0fil minus 1.0fil
..\kern1.5 (font)
..\rule(0.5+0.0)x*
..\kern1.89 (font)
..\hbox(7.22+0.1)x5.23, direction TLT
...\TU/KpMath-Regular.otf(1)/m/n/10 โ„Ž
.\hbox(0.0+0.0)x1.2, shifted -2.5, direction TLT
\vbox(17.03398+0.0)x3.09, glue set 0.68758, shifted 6.017, direction TLT
.\hbox(0.11+4.61)x3.09, direction TLT
..\TU/KpMath-Regular.otf(1)/m/n/10 ๎™
.\glue -1.57 plus 1.37001
.\hbox(0.11+4.61)x3.09, direction TLT
..\TU/KpMath-Regular.otf(1)/m/n/10 ๎™
.\glue -1.57 plus 1.37001
.\hbox(7.13+1.72)x3.09, direction TLT
..\TU/KpMath-Regular.otf(1)/m/n/10 |
4
  • If I understand your posting correctly, your beef is not with the vertical bars drawn by \left.g\right\vert and \left.g\right\Vert having different sizes. Instead, it appears to be with the fact that the bar drawn by \left.g\right\vert "does not go sufficiently low to cover the descender of g", i.e., it's too short. The height of the vertical bars is a choice variable for the font designer. It's well known that the \vert and \Vert symbols drawn by Palatino-type math fonts are quite short -- and, in particular, "do not go sufficiently low to cover the descender of g".
    – Mico
    Oct 8, 2022 at 15:17
  • But \Vert does go low enough, thus behaving differently from \vert. Oct 8, 2022 at 15:19
  • I've rephrased the last sentence, not sure if that is what you meant. Oct 8, 2022 at 15:23
  • You wrote, "But \Vert does go low enough, thus behaving differently from \vert". Sorry, but that's false: Both \vert and \Vert draw bars that have the exact same depth -- which you have criticized as as being "too short", since they don't cover the descender of g. What you have come across is that \left.g\right\vert and \left.g\right\Vert create symbols of different heights. To me, the question is not why the symbol drawn by \left.g\right\vert is too short; instead, it shoud be why the symbol drawn by \left.g\right\Vert is needlessly tall.
    – Mico
    Oct 8, 2022 at 15:29

1 Answer 1

4

The \vert delimiter has wrong parameters in the GlyphCompositionVertical field (fontforge) which makes the extension fail on this case. The other two \Vert and \Vvert are fine.

To make it clear: in your picture the \right\vert is not extended, it is a raw \vert while the \right\Vert is composed of \Vert plus a vertical extension. As both are (automatically) centered on the math axis, the \right\Vert goes deeper down and higher up.

Thanks for pointing this out, it will be fixed in the next version of kpfonts-otf.

Follow up: should \vert be extended or not?

The decision is made by the TeX engine: the extension is triggered if and only if g descends lower than \vert (vertically centred on the maths axis); this explains the different results between newpxmath and kpfonts-otf

Here is what you get with newpxmath (the red line shows the maths axis):

enter image description here

And with the current (v.045) kpfonts-otf:

enter image description here

As mentioned above, \vert is not extended (this is a bug) but \Vert, which has the same height and depth as \vert, is extended as expected.

Note: the gap between the total heights of \vert and \Vert above is too large. I will add intermediate sizes for a smoother transition.

Here is the source of these tests:

\documentclass{article}
\usepackage{xcolor,iftex}
\iftutex
  \usepackage{kpfonts-otf}
\else
  \usepackage{newpxmath}
\fi
\newlength{\height}
\newlength{\depth}
\parindent=0pt
\begin{document}
{\tiny
 \settoheight{\height}{h}        ht(h)=\the\height ;
 \settoheight{\height}{$\vert$}  ht(vert)=\the\height

 \settodepth {\depth}{g}         dp(g)=\the\depth ;
 \settodepth {\depth}{$\vert$}   dp(vert)=\the\depth
}

\makebox[0pt]{\color{red}\rule[2.5pt]{\textwidth}{0.2pt}}%
$\left.h\right\vert$, $\left.g\right\vert$,
\iftutex$\left.g\right\Vert$\fi
\end{document}
2
  • See also my additional remark. Oct 8, 2022 at 18:08
  • 1
    \vert misses small extensions where required, not big ones. Oct 9, 2022 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .