4

I have problems with the combination of using siunitx and displaying upright partial derivative symbols using:

\usepackage[partialup]{kpfonts}

The unit prefix µ is not displayed using this code:

\documentclass[preview]{standalone}
\usepackage{fontspec}
\usepackage[T1]{fontenc}
\usepackage[partialup]{kpfonts}

\usepackage{siunitx}

\begin{document}
\SI{1}{\micro\meter}
\end{document}

Adding the line

\sisetup{math-micro=\text{µ},text-micro=µ}

as mentioned on this board will display a ţ instead of a µ.

I've no idea how to solve that problem and would aprecciate your help.

2
  • @campa wouldn't kp work just fine in xelatex and lualatex, just ditch fontspec (on tablet so cannot test) – daleif Oct 24 '19 at 14:53
  • 7
    Using T1 fonts with LuaTeX/XeTeX is not generally a great plan, and that's what's happening here. siunitx is looking for a symbol that does not exist, as with these Unicode engines it goes with 'just use a µ' as the standard position. (The ţ is a µ, or at least it's in that slot in the T1-encoded text font you are using.) – Joseph Wright Oct 24 '19 at 16:43
3

This seems to work. The primary/only relevant? change is explicitly setting math-micro to \mu via \sisetup

\documentclass{article}
\usepackage{fontspec}
\usepackage[T1]{fontenc}
\usepackage[uprightgreeks,partialup]{kpfonts}


\usepackage{siunitx}

\sisetup{
    math-micro = \mu,
 }

\begin{document}
    \SI{1}{\micro \meter}

    \SI{1}{\micro \gram}

    \SI{1}{\kilo \gram}

    \SI{1}{\nano \gram}

    \si{\gram}

    \begin{equation}
    \frac{\partial Q}{\partial t} = \frac{\partial s}{\partial t} % just testing the partial ups
    \end{equation}

    \si{\micro \gram}
\end{document}

enter image description here

1
  • This works so far. However now all greek letters in my document will be upright although it is not wanted for parameters. \textit{} does not help at this point. – Richard Oct 25 '19 at 8:56
0

Considering Joseph Wright's comment I tried to avoid \usepackage[T1]{fontenc}. This resulted in a warning for a undefined font shape due to the \usepackage[partialup]{kpfonts} command.

Looking for a solution without kpfonts I found the package unicode-math, which allows upright partial derivative symbols as well:

\documentclass{article}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage[math-style=ISO]{unicode-math}
\usepackage{siunitx}

\begin{document}
\SI{1}{\micro\meter}

$\frac{\symrm{\partial} Q}{\partial t}=\mu$
\end{document}

Hope, this solution will not effect other problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.