Menu

#87 Initialization of `pagenumberformat` for ToC style `toctext` missing

KOMA-Script 3.46
closed
2025-06-26
2025-06-26
Cabohah
No

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'.

Related

Issues: #88

Discussion

  • Markus Kohm

    Markus Kohm - 2025-06-26
    • labels: tocbasic, feature request --> tocbasic, bug
    • status: open --> closed
    • assigned_to: Markus Kohm
     
  • Markus Kohm

    Markus Kohm - 2025-06-26

    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 the tocline.

     

    Related

    Commit: [r4187]

    • Cabohah

      Cabohah - 2025-06-26

      In this case, can I also request for feature dynindent for toctext? Is the missing option also a bug?

       
      • Markus Kohm

        Markus Kohm - 2025-06-26

        No this is not a bug. It is documented, that only tocline provides dynindent. 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 the indent of the parent level so it shouldn't be very complicated. But in your example, it would not work, if you'd remove the section declaration, because tocbasic would not have a indent for the parent section in this case.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.