Initialization of `pagenumberformat` for ToC style `toctext` missing
KOMA-Script is a bundle of versatile LaTeX classes and packages
Brought to you by:
kohm
When using \DeclareTOCStyleEnry{toctext}{foo}
for a new level foo
, tocbasic
throws an error, because of unspecified pagenumberformat
. This does not happen with style tocline
. So IMHO there is missing an initialization of the format.
\documentclass{article}
\usepackage{tocbasic}
\usepackage{mwe}
\DeclareTOCStyleEntry{tocline}{section}% works
\DeclareTOCStyleEntry{toctext}{subsection}% does not work
%\DeclareTOCStyleEntry[pagenumberformat=\textup]{toctext}{subsection}% works
\setcounter{tocdepth}{2}
\begin{document}
\listoftoc[\contentsname]{toc}
\blinddocument
\end{document}
→
Package tocbasic Error: toc style `toctext' needs page number format
(tocbasic) of `subsection'.
Thank you for reporting this. Indeed the missing initialization is a bug. I've added a "no change of the current format" initialization in [r4187]. IMHO this makes more sense for
toctext
than using something like\normalfont\normalcolor #1
or even a level depending initialization similar to thetocline
.Related
Commit: [r4187]
In this case, can I also request for feature
dynindent
fortoctext
? Is the missing option also a bug?No this is not a bug. It is documented, that only
tocline
providesdynindent
. So it would be a new feature. If you'd ask for it, I'd think about it. If there is a parent level, it should be enough to use theindent
of the parent level so it shouldn't be very complicated. But in your example, it would not work, if you'd remove thesection
declaration, becausetocbasic
would not have aindent
for the parentsection
in this case.