4

If you use sisetup{mode=text} of siunitx with kpfonts-otf then \num{2.23e-23} fails.

MWE:

\documentclass[]{scrbook}
\usepackage[spanish,es-tabla]{babel}
\usepackage{siunitx}
\usepackage[]{kpfonts-otf}

\setmathfont{KpMath-Sans.otf}[]

\sisetup{
mode = text % falla y pone puntos en vez de commas
}

\vbadness=10000
\begin{document}

Fuera: \num{2,23e-3} y como números: 2,23 o 2.23

\[
      \theta=\sec\alpha\,(\num{2,20e-4} h + \num{2,23e-3})
\]
\[
      \theta=\sec\alpha\,(\num{2.20e-4} h + \num{2.23e-3})
\]
\end{document}

enter image description here

Why doesn't this work?

2 Answers 2

6

Thanks to Joseph Wright for pointing out the origin of this issue!

The text fonts of the kpfonts-otf package were lacking superior and inferior substitutions for the minus sign. This is fixed now in version 0.53 which is on the way to CTAN and should be available tomorrow or after-tomorrow in the TeX distributions.

With this new version, I recommend to drop the patch suggested by Joseph, as 'real' superscripts definitely look better than faked ones. The code

1\textsuperscript{(+)(\textminus)(=)}

now prints:

enter image description here

1
  • Wow!!! Working as a charm! Thanks!!! It's so nice having this quick on the fly response! It seems you are driving the ship! Not used to it.
    – juanfal
    May 30 at 7:52
5

The font setup here is using realscripts, which doesn't work properly if there is not an available superscript glyph. Try for example

\documentclass{article}
\usepackage{kpfonts-otf}
\begin{document}
1\textsuperscript{\textminus}
\end{document}

You can save-and-restore the definition of \textsuperscript to sort this:

\NewCommandCopy\savedsuperscript\textsuperscript
\usepackage{kpfonts-otf}
\RenewCommandCopy\textsuperscript\savedsuperscript
0

You must log in to answer this question.

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