(toc)dynnumwidth가 KOMA-Script에서 안정적으로 작동하지 않습니다.

(toc)dynnumwidth가 KOMA-Script에서 안정적으로 작동하지 않습니다.

에 따르면KOMA 스크립트 문서, -style (목차에서 KOMA-Script의 섹션화 명령에 사용되는 스타일에 대한 템플릿) dynnumwidth의 옵션은 다음을 수행합니다.tocbasictoclines

dynnumwidth=switch: 스위치가 스타일로 활성화된 경우 tocline속성 numwidth은 무시됩니다. 대신 이전 LaTeX 실행에서 감지된 최대 개수 너비를 값만큼 증가시켜 numsep사용합니다.

그러나 최대 숫자 너비 감지는 안정적으로 작동하지 않는 것 같습니다. 다음 두 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}

산출:

첫 번째 MWE: <code>dynnumwidth</code> 깨짐

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}

산출:

두 번째 MWE: <code>dynnumwidth</code> 작동 중

따라서 숫자 너비가 짧은 항목이 3개 이상 있는 경우 에서는 dynnumwidth더 긴 항목을 감지하지 못하고 numwidth너무 작은 값(MWE 1)을 선택합니다. 반면에 두 개의 짧은 숫자 너비 항목과 두 개의 긴 숫자 너비 항목이 있으면 올바른 숫자 numwidth가 결정됩니다(MWE 2). 이것은 버그입니까, 아니면 잘못 사용하고 있습니까 dynnumwidth?

저는 TeX Live 2016/KOMA-Script v3.21을 사용하고 있습니다.

답변1

나는 KOMA-Script 작성자인 Markus Kohm에게 버그 보고서를 제출했는데, 그는 이것이 의도한 대로 작동하지 않는다는 것을 확인했습니다.

에서 언급했듯이esdd, 버그가 수정되었습니다.시험판 v3.22.2559. 변경 로그에서:

r2559 2016-12-02 09:03:11 +0100kohm:

  • scrkernel-tocstyle.dtx: dynnumwidth
    기능을 수정하기 위해 \relax가 추가되지 않았습니다.

따라서 KOMA-Script 릴리스 v3.22에서는 사라질 것입니다.

관련 정보