
この tabularray 環境のタイトル行を小文字大文字にできない理由がわかりません ( を追加するとすぐに発生するようですrow{2} = {font = \bfseries, cmd = \textrm},
が、 を追加しても上書きできません) row{1} = {cmd = \textsc},
。
私はただ知る私は何か愚かなことをしています...特に、パッケージを含めずにこれを適切にコンパイルすることはできないのでpythontex
...私には意味がわかりません。
\documentclass{article}
\usepackage{pythontex}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[margin = 0.5in]{geometry}
\usepackage{tabularray}
\begin{document}
% timeperiod calculations
\begin{tblr}[T]{
colspec = {Q[c,m] *{4}{Q[c,m,$]}},
column{1} = {2-Z}{font = \bfseries},
row{odd} = {azure9},
row{2} = {font = \bfseries, cmd = \textrm},
hline{1,Z} = {2pt},
}
% header
\SetCell[c=5]{c} \textsc{Why am I not Small Caps?} \\
\hline
&
who &
cares &
not &
me \\
tab &
\mathrm{10\ \frac{units}{time}} &
\mathrm{7\ units} &
\mathrm{1\ unit \cdot 2\ units} &
\mathrm{10\ unit^2} \\
\end{tblr}
\end{document}
編集: 明確にするために、Computer Modern フォントには太字の小文字大文字がないことは承知しています。そのため、最初の行には太字を適用しないようにしています。
私の理解では、2 行目以降は最初の列を太字にし、2 行目全体を太字にする必要があります。ヘッダーのどこに太字を適用するのかわかりません。
を使用すると\normalfont \textsc{Why am I not Small Caps?}
正しく表示されますが、理解できませんなぜ。
編集 #2: @Clara のコメントは確かに機能しますが、何が起こっているのかをまだ理解する必要があると思います。なぜなら、おそらく、これらの複雑な書式設定のプリアンブルを実行しようとしたときに他の場所で遭遇するのと同じエラーだと思うからです。
答え1
答え2
@DavidCarlisleが指摘しているように答えただし、Computer Modern テキスト フォント ファミリには、太字と小文字の組み合わせは含まれません。
解決策は? 必要な太さと形状の組み合わせを提供するフォントを使用することです。Times Roman と Palatino のクローンをそれぞれ提供するnewtxtext
とnewpxtext
パッケージは、この組み合わせを提供するフォント パッケージの例です。
\documentclass{article}
\usepackage{pythontex}
%\usepackage{amsmath} % amsmath is loaded automatically by mathtools
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[margin = 0.5in]{geometry}
\usepackage{tabularray}
\usepackage{newtxtext,newtxmath} % or: \usepackage{newpxtext,newpxmath}
\begin{document}
% timeperiod calculations
\begin{tblr}[T]{
colspec = {Q[c,m] *{4}{Q[c,m,$]}},
column{1} = {2-Z}{font = \bfseries},
row{odd} = {azure9},
row{2} = {font = \bfseries, cmd = \textrm},
hline{1,Z} = {2pt},
}
% header
\SetCell[c=5]{c} \textsc{Why am I not Small Caps?} \\
\hline
&
who &
cares &
not &
me \\
tab &
\mathrm{10\ \frac{units}{time}} &
\mathrm{7\ units} &
\mathrm{1\ unit \cdot 2\ units} &
\mathrm{10\ unit^2} \\
\end{tblr}
\end{document}