.png)
- 私はLinux Libertineフォント(システムから)を使用しています
XeTeX.
- 本文では数字を使用していますが、表にも数字が
OldStyle
必要です。Lining
- テキストが入ったセルがいくつかある表をタイプセットしています
\bfseries
。
ただし、この\addfontfeature
設定は通常のテキストにのみ適用され、 に設定されているテキストには適用されません\bfseries
。
ムウェ
\documentclass{scrartcl}
\usepackage{array,booktabs,fontspec}
\setmainfont[Ligatures={Common},Numbers={OldStyle}]{Linux Libertine O}
\begin{document}
\begin{table}
\addfontfeature{Numbers={Lining}}
\begin{tabular}{>{\bfseries}ll} \toprule
3 & 3 \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
これにより次のようになります:
\addfontfeatures{Numbers={Lining}}
グループ内のすべてのテキストに適用するように設定するにはどうすればよいですか?
答え1
この問題は表形式がなくても再現可能です。
\documentclass{scrartcl}
\usepackage{array,booktabs,fontspec}
\setmainfont[Ligatures={Common},Numbers={OldStyle}]{Linux Libertine O}
\begin{document}
1234567890
{\addfontfeatures{Numbers=Lining}
1234567890
\normalfont 1234567890
\bfseries 1234567890}
1234567890
\end{document}
ご覧のとおり、 の呼び出しにより、\normalfont
機能が最初に指定した状態にリセットされます。\bfseries
コマンドは\fontseries{\bfdefault}\selectfont
、選択された機能を無効にします。
\addfontfeatures
私のアドバイスは、たとえ多少のコード重複が発生しても、可能な限り避けることです。
\documentclass{scrartcl}
\usepackage{array,booktabs,fontspec}
\setmainfont[Ligatures={Common},Numbers={OldStyle}]{Linux Libertine O}
\newfontfamily{\mainlining}[Ligatures=Common,Numbers=Lining]{Linux Libertine O}
\begin{document}
\begin{table}
\mainlining
\begin{tabular}{>{\bfseries}ll}
\toprule
3 & 3 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}