使用 Roboto 字體時,如何讓參考書目中的方括號數字大小相同?

使用 Roboto 字體時,如何讓參考書目中的方括號數字大小相同?

當我使用 Roboto 字體時,參考書目編號的大小不相等:使用這個最小的範例

\documentclass{article}
\usepackage[backend=bibtex,style=ieee, sorting=none]{biblatex} 
\usepackage[sfdefault]{roboto}

 \begin{filecontents*}{./example.bib}
   @article{nice,
   author={B. C. Dull},
   title={All functions are {$C^{\infty}$}},
   journal={J. False Results},
   year={2033},
   }
   @article{nice2,
   author={B. C. Dull},
   title={All functions are {$C^{\infty}$}},
   journal={J. False Results},
   year={2033},
   }
 \end{filecontents*}
\addbibresource{example.bib} 

\begin{document}
   Test~\cite{nice,nice2}.
   \printbibliography
\end{document}

輸出是這樣的:

在此輸入影像描述

如何使它們大小相等?

答案1

您可以在任何地方使用表格數字,可以透過使用roboto以下tabular選項載入套件來實現:

\usepackage[sfdefault,tabular]{roboto}

或者您可以透過在加載後添加以下內容來更改參考書目中標籤的數字類型biblatex

為了pdflatex

\DeclareFieldFormat{labelnumber}{%
  \ifbibliography
    {\fontfamily{Roboto-TLF}\selectfont}
    {}#1}

對於xelatexlualatex

\DeclareFieldFormat{labelnumber}{%
  \ifbibliography
    {\addfontfeatures{Numbers=Monospaced}}
    {}#1}

相關內容