Problems with µ, displaying ţ with sisetup option (for combination of siunitx, fontspec and kpfonts)

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}

\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.

• @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
• 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

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}

$$\frac{\partial Q}{\partial t} = \frac{\partial s}{\partial t} % just testing the partial ups$$

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

• 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

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.