0

I wanna use EBGaramond-LF figures for siunitx such that the following digits are of the same font (EBGaramond-LF):

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[detect-all]{siunitx}   % replace sistyle, siunits, units
\usepackage[]{ebgaramond}
\DeclareSymbolFont{numbers}{T1}{EBGaramond-LF}{m}{n}
\DeclareMathSymbol{0}\mathalpha{numbers}{"30}
\DeclareMathSymbol{1}\mathalpha{numbers}{"31}
\DeclareMathSymbol{2}\mathalpha{numbers}{"32}
\DeclareMathSymbol{3}\mathalpha{numbers}{"33}
\DeclareMathSymbol{4}\mathalpha{numbers}{"34}
\DeclareMathSymbol{5}\mathalpha{numbers}{"35}
\DeclareMathSymbol{6}\mathalpha{numbers}{"36}
\DeclareMathSymbol{7}\mathalpha{numbers}{"37}
\DeclareMathSymbol{8}\mathalpha{numbers}{"38}
\DeclareMathSymbol{9}\mathalpha{numbers}{"39}   



\begin{document}
$28508$ (standard)

$\num{28508}$ (siunitx)
\end{document}

Related to this question Use libertine numbers in math mode and with siunitx but using pdflatex.

1

I don't know why, but using

\usepackage[detect-all,math-rm=]{siunitx}

solves the problem.

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.