KOMA%20%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A7%20dynnumwidth%20%E3%81%8C%E7%A2%BA%E5%AE%9F%E3%81%AB%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%AA%E3%81%84.png)
によるKOMA スクリプトのドキュメント、 -style (目次の KOMA-Script のセクション コマンドで使用されるスタイルのテンプレート)dynnumwidth
のオプションは次のようになります。tocbasic
toclines
dynnumwidth=switch
: スイッチがスタイル でアクティブになっている場合tocline
、属性numwidth
は無視されます。その代わりに、前回の LaTeX 実行時に検出された最大数値幅に の値を加えた値numsep
が使用されます。
ただし、最大数値幅の検出は確実に機能しないようです。次の 2 つの MWE を検討してください。
test_1.tex
:
\documentclass[american]{scrartcl}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\RedeclareSectionCommands[tocdynnumwidth]{section,subsection,subsubsection}
\begin{document}
\tableofcontents
\addsectiontocentry{Nr.~1}{Test1}
\addsectiontocentry{Nr.~2}{Test2}
\addsectiontocentry{Nr.~3}{Test3}
\addsectiontocentry{Number~4}{Test4 (long)}
\end{document}
出力:
test_2.tex
:
\documentclass[american]{scrartcl}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\RedeclareSectionCommands[tocdynnumwidth]{section,subsection,subsubsection}
\begin{document}
\tableofcontents
\addsectiontocentry{Nr.~1}{Test1}
\addsectiontocentry{Nr.~2}{Test2}
\addsectiontocentry{Number~3}{Test3 (long)}
\addsectiontocentry{Number~4}{Test4 (long)}
\end{document}
出力:
したがって、数値幅が短いエントリが 3 つ以上ある場合、dynnumwidth
長いエントリは検出されず、numwidth
小さすぎる値 (MWE 1) が選択されます。一方、数値幅が短いエントリが 2 つと長いエントリが 2 つある場合は、正しい値numwidth
が決定されます (MWE 2)。これはバグでしょうか、それとも使い方がdynnumwidth
間違っているのでしょうか?
TeX Live 2016/KOMA-Script v3.21を使用しています。
答え1
私は KOMA-Script の作者 Markus Kohm にバグレポートを提出しましたが、これは意図したとおりに動作していないことが確認されました。
前述の通りエスディー、バグは修正されましたプレリリース v3.22.2559変更ログより:
r2559 2016-12-02 09:03:11 +0100 キロ:
- scrkernel-tocstyle.dtx: 欠落していた \relax を dynnumwidth
機能の修正に追加しました
したがって、KOMA-Script リリース v3.22 では削除されます。