Menu

#91 Suggesting `tocafterskip` option for `\RedeclareSectionCommand`

once upon a time
open
2025-09-08
2025-08-20
No

I had to imitate a layout of a book as shown in the attachment. As can be seen, there is quite a large vertical gap before and after the 'KAPITEL' headings (in spite of being called 'KAPITEL' it is actually implemented as \part). While it was easy to adjust the space before the heading with tocbeforeskip, I couldn't do such an adjustment for the space after the heading because tocafterskip doesn't exist. Instead, I had to do

\renewcommand\addparttocentry[2]{%
  \addtocentrydefault{part}{#1}{#2}%
  \addtocontents{toc}{\protect\vspace{7mm}}%
}

Is there a reason why tocafterskip doesn't exist? Otherwise I suggest to add it.

1 Attachments

Discussion

  • Markus Kohm

    Markus Kohm - 2025-08-20
    • labels: --> feature request
    • assigned_to: Markus Kohm
     
  • Markus Kohm

    Markus Kohm - 2025-08-20

    The reason is simple: Nobody asked for it before and I did not need it, because I was able to add the needed vertical space in ToCs using beforeskip (in \DeclareTOCStyleEntry syntax). BTW: As a workaround you should be able to use onstarthigherlevel for chapter to add additional space only, if a chapter entries follows a part entry.

     
    • Werner LEMBERG

      Werner LEMBERG - 2025-08-20

      OK, thanks.

      I've seen onstarthigherlevel in the documentation after modifying \addparttocentry, and I was too lazy to improve the code :-)

       

      Last edit: Werner LEMBERG 2025-08-20
  • Markus Kohm

    Markus Kohm - 2025-08-28
    • Milestone: KOMA-Script 3.47 --> KOMA-Script 3.48
     
  • Markus Kohm

    Markus Kohm - 2025-09-08

    I must correct myself. There is a good reason for not to do this:

    When adding a vertical space TeX resets \lastpenalty to 0. When adding a penalty, TeX resets \lastskip to 0. So either \addvspace (used to add the vertical distance of beforeskip) wouldn't be able to recognize a previous vertical skip (of a new afterskip option) or the penalty handling of consecutive entries (of different level) would not work. And because the penalty handling is a documented feature, I don't want to break it.

    What I could do it to document, that using afterskip does break the penalty handling. But if I'd do so, I'd never the less expect several support effort because of it. I could also replace the penalty handling by something else, but this would also break existing documents using the penalty handling or even documents ignoring the penalty handling doing something like you are doing with your \addtocontents{toc}{\protect\vspace{7mm}}.

    So, at the moment I reject your feature request.

     
    • Werner LEMBERG

      Werner LEMBERG - 2025-09-08

      OK, thanks

       
  • Markus Kohm

    Markus Kohm - 2025-09-08
    • Milestone: KOMA-Script 3.48 --> once upon a time
     

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.