Open John02139 opened 4 days ago
luamml changes \bBigg@
to use a luatex primitive, so it looks as if that doesn't work properly for some fonts:
\documentclass[11pt]{article}
\usepackage{unicode-math}
\setmathfont{STIXTwoMath-Regular}[
Extension = .otf,
Scale=MatchUppercase,
]
\makeatletter
\ExplSyntaxOn
\cs_set:Npn \bBigg@ #1 #2 {
{
\ensuremath {
\Uvextensible height~#1 \big@size axis~exact~#2
}
}
}
\makeatother
\ExplSyntaxOff
\begin{document}
The \verb+\Bigg\vert+ is vertically misaligned when math tagging is active if certain math fonts are loaded.
\begin{equation}
\int_{\Gamma^h_s}\frac{\partial}{\partial n_x}\int_{\Gamma^a_\xi} \mkern-3mu b(\xi) \frac{\partial E(x|\xi)}{\partial n_\xi} \,dl_\xi \Bigg\vert_{x\to s}\,dl_s = 0
\end{equation}
This behavior occurs for Stix2, TeX Gyre fonts, and Lucida; but NOT for FiraMath, GFSNeohellenicMath, Libertinus, or default LMR.
\end{document}
@davidcarlisle @zauguin thoughts?
@u-fischer the luatex manual isn't exactlyclear but if you force height and depth to be half the requested size rather than relying on axis
to shift then it's closer to the intended layout
\Uvextensible height~#1~ \dimexpr0.5\big@size\relax ~ depth ~#1~ \dimexpr0.5\big@size\relax~ axis~~#2
actually having got clarification in chat axis
does not re-centre the entire delimiter on the axis, just interprets height and depth relative to that, so the code you originally showed should have a depth
component as well (not clear why it appears to work in some cases without)
So you can try with definition which should go after \begin{document}
\makeatletter
\ExplSyntaxOn
\cs_set:Npn \bBigg@ #1 #2 {
{
\ensuremath {
\Uvextensible height~#1~ \dimexpr0.5\big@size\relax ~ depth ~#1~ \dimexpr0.5\big@size\relax~ axis~exact~#2
}
}
}
\makeatother
\ExplSyntaxOff
Thanks, that code works with all the fonts I tried.