Menu

#102 Problem with recent babel package and language "spanish"

KOMA-Script 3.49.1
closed
babel (1)
2026-01-07
2025-12-22
No

The recent update of KOMA-Script seems to have a problem with option spanish from babel (v25.17). The error is LaTeX hooks Error: Generic hooks cannot be added to '\@startsection'. Changing to another language or switching to standard book class resolves the problem.

\documentclass{scrbook}
\usepackage[spanish]{babel}

\begin{document}
   Test
\end{document}

Discussion

  • Markus Kohm

    Markus Kohm - 2025-12-22

    You get the same error with:

    \documentclass{book}
    \AddToHook{cmd/@startsection/before}{\typeout{Hook Test}}
    
    \usepackage[spanish]{babel}
    
    \begin{document}
       Test
    \end{document}
    

    So IMHO this is a babel-spanish issue not a KOMA-Script issue.

    BTW: KOMA-Script does not use \@startsection anymore and the new version does no longer redefine it but only adds a hook to warn that several features are no longer available, when using \@startsection. See also [wiki-en:Release 3.49] resp. [wiki-de:Release 3.49].

     

    Related

    Wiki (Deutsch): Release 3.49
    Wiki (English): Release 3.49


    Last edit: Markus Kohm 2025-12-22
  • U_Fischer

    U_Fischer - 2025-12-22

    In some sense it is a KOMA issue, as KOMA is the one doing the patching. Command hooks are quite nice, but they are no fully safe if catcode changes are involved and personally I try to avoid them for long term code. See e.g. https://github.com/latex3/latex2e/issues/1099

     
    • Markus Kohm

      Markus Kohm - 2025-12-22

      The alternative would be to once again redefine \@startsection, which has been removed to avoid several other issues. So this is not really an option.

       
  • Markus Kohm

    Markus Kohm - 2026-01-06
    • status: open --> closed
    • assigned_to: Markus Kohm
     
  • Markus Kohm

    Markus Kohm - 2026-01-06

    Workaround added in [r4254].

     

    Related

    Commit: [r4254]


Log in to post a comment.