Siunitx 偵測全域字體而不是本機字體

Siunitx 偵測全域字體而不是本機字體

我正在用 roboto 排版文本,對於表格的內容,我使用 robotocondensed,效果很好。但是,我使用 siunitx 來格式化我的一些列,並且這些列不是用 robotocondensed 而是在 roboto 中排版。如何讓 siunitx 偵測我的本地字體?

\documentclass[a4paper, 10pt]{scrartcl}

\usepackage[sfdefault]{roboto}
\usepackage{siunitx}

\begin{document}

\begin{table}
\robotocondensed
\begin{tabular}{r S[table-format=2.0, detect-all]}
\multicolumn{2}{c}{Table}\\
\hline
{r} & {S} \\
44 & 44 \\
23 & 23\\
38 & 38\\
\hline
\end{tabular}
\end{table}

\end{document}  

siunitx字體問題

答案1

您也可以siunitx透過聲明text-rm=\robotocondensed以下內容來提供協助detect-all

\documentclass[a4paper, 10pt]{scrartcl}

\usepackage[sfdefault]{roboto}
\usepackage{siunitx}

\begin{document}

\begin{table}
\robotocondensed
\begin{tabular}{r S[table-format=2.0,detect-all,text-rm=\robotocondensed]}
\multicolumn{2}{c}{Table}\\
\hline
{r} & {S} \\
44 & 44 \\
23 & 23\\
38 & 38\\
\hline
\end{tabular}
\end{table}

\end{document}

在此輸入影像描述

相關內容