1

The symbols \dashv and \vdash with kpfonts-otf appear to be too low, instead of being vertically centered. But as the classical kpfonts package produces the same result, it seems to be part of the font design. Is there some way to redefine them into a vertically centered version?

enter image description here

\documentclass{article}
\usepackage{kpfonts-otf}
\begin{document}

( F \dashv U )

( U \vdash F )

\end{document}

Jinwen
  • 8,518
  • Isn't that up to the font designer? – daleif Mar 10 '23 at 12:32
  • 2
    kpfonts-otf vertically centers \dashv and \vdash on the math axis, why should this be wrong? – Daniel Flipo Mar 10 '23 at 13:04
  • @DanielFlipo I didn't mean they are wrong. It is just that visually these symbols appear to be aligned to the bottom of the line, comparing with the default Latin Modern (possibly due to the size of the symbols). – Jinwen Mar 10 '23 at 13:28

1 Answers1

1

In Computer Modern (or Latin Modern), the vertical stroke is as high as the uppercase letters and the horizontal stroke is in the middle, hence higher than the math axis.

In Kp fonts the choice is different: the horizontal stroke is on the math axis and the heigh of the vertical stroke is chosen accordingly.

Latin Modern

enter image description here

Kp fonts

enter image description here

Do you want the symbols to be higher?

\documentclass{article}
\usepackage{kpfonts-otf}

\AtBeginDocument{% \NewCommandCopy\standarddashv\dashv \NewCommandCopy\standardvdash\vdash \RenewDocumentCommand{\dashv}{}{\mathrel{\mathpalette\raisesymbol\standarddashv}}% \RenewDocumentCommand{\vdash}{}{\mathrel{\mathpalette\raisesymbol\standardvdash}}% }

\makeatletter \newcommand{\raisesymbol}[2]{% \begingroup \sbox\z@{$\m@th#1A$}% \sbox\tw@{$\m@th#1#2$}% \raisebox{\dimexpr(\ht\z@-\ht\tw@)/2}{\usebox{\tw@}}% \endgroup } \makeatother

\begin{document}

( F \dashv U )

( U \vdash F )

({\vdash}\frac{1}{2})

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thank you for this! Please allow me to ask a question: the command \raisesymbol requires two arguments, but only \standard... is given, so what is the second argument here? Does it have something to do with the \mathpalette before it? – Jinwen Mar 10 '23 at 13:39
  • @Jinwen Yes: \mathpalette takes two arguments, the first of which should be a two-argument macro. See https://tex.stackexchange.com/q/34393/4427 – egreg Mar 10 '23 at 17:04