1

I am just wondering why the titlesec package doesn't work well with the amsart document class. For example, in the code below the first \section seems to work fine whereas the second doesn't even compile in the first place. In fact, I get the error

! Undefined control sequence.
<argument> ...on\endcsname \protect \@secnumpunct 

l.5 \section{more lalala}

? 
\documentclass[11pt]{amsart}
\usepackage{titlesec}
\begin{document}
\section*{lalala}
\section{more lalala}
\end{document}

I'm not looking for a solution to the problem (cause I'm not gonna be using titlesec), but I want to know why this (and possibly numerous other similar errors) happens.

4
  • 1
    It didn't surprise me at all that titlesec doesn't work with amsart. After all amsart redefines some of the code for section headings quite heavily, which means that it may also define commands upon which titlesec relies in a way incompatible with the titlesec approach. But the titlesec documentation says "Titlesec works with the standard classes and with many others, including the AMS ones, and it runs smoothly with hyperref (However, be aware the AMS classes reimplement the original internal commands. These changes will be lost here.).", so maybe it should work?
    – moewe
    May 11, 2020 at 6:19
  • Note that you only showed a fragment of the error so did not show which command is undefined (\@secnumpunct) May 11, 2020 at 9:27
  • @DavidCarlisle Yes, thank you. That is indeed the full error I get. And I don't understand why.
    – Jim
    May 14, 2020 at 3:57
  • 1
    section headings are defined by the class not by the latex format. titlesec patches the standard classes and may work with other classes if they use similar code but if it doesn't work with a class that is no real surprise. May 14, 2020 at 6:21

0

You must log in to answer this question.

Browse other questions tagged .