
我希望我可以使用 Libertine 字體的半粗體版本。
預設情況下,我使用 elzevirian 數字,沒有問題,我可以使用半粗體的 elzevirian 數字。
在某些情況下,我需要使用帶有半粗體的襯裡數字。
然而,本應為半粗體的襯裡數字實際上是正常粗細的。
這是一個 MWE :
\documentclass{article}
\RequirePackage[oldstyle,proportional]{libertine}
\DeclareRobustCommand\textsb[1]{{\libertineSB#1}}
\begin{document}
\LARGE
\noindent
Some "default" text with old style nums : 1234567890\\
\textsb{Some semi-bold text with old style nums : 1234567890}\\
\textbf{Some bold text with old style nums : 1234567890}\\
\noindent
Some text with lining nums : \liningnums{1234567890}\\
\textsb{Some semi-bold text with lining nums : \liningnums{1234567890}}\\
\textbf{Some bold text with lining nums : \liningnums{1234567890}}\\
\end{document}
你知道如何解決這個問題嗎?
謝謝。
答案1
它適用於pdflatex
,但不適用於 (Lua|Xe)LaTeX,因為它libertine.sty
會重置字體系列,而不是在執行 時添加所需的功能\liningnums
。
\documentclass{article}
\usepackage{iftex}
\usepackage[oldstyle,proportional]{libertine}
\DeclareTextFontCommand\textsb{\libertineSB}
\iftutex % XeLaTeX or LuaLaTeX
\RenewDocumentCommand{\liningnums}{m}{%
{\addfontfeatures{Numbers=Lining}#1}%
}
\fi
\begin{document}
\noindent
Some "default" text with old style nums: 1234567890\\
\textsb{Some semi-bold text with old style nums: 1234567890}\\
\textbf{Some bold text with old style nums: 1234567890}
\noindent
Some text with lining nums: \liningnums{1234567890}\\
\textsb{Some semi-bold text with lining nums: \liningnums{1234567890}}\\
\textbf{Some bold text with lining nums: \liningnums{1234567890}}
\end{document}