I've tried to define a new Document section, called tomo ("volume" in English) at the upper level of the amsmath part document section like this:
\documentclass[12pt,italian]{amsbook} \newcounter{tomo} \renewcommand\thetomo {\roman{tomo}} \let\tomorunhead\tomorunhead \def\tomoname{tomo} \def\tomo{\cleardoublepage \thispagestyle{empty}% \null\vfil \markboth{}{}\secdef\@tomo\@tomo} \def\@tomo[#1]#2{% \ifnum \c@secnumdepth >-2\relax \refstepcounter{tomo}% \addcontentsline{toc}{tomo}{\tomoname\ \thetomo. \protect\enspace\protect\noindent#1}% \else \addcontentsline{toc}{tomo}{#1}\fi \begingroup\centering \ifnum \c@secnumdepth >-2\relax {\fontsize{\@xviipt}{22}\bfseries \tomoname\ \thetomo} \vskip 20\p@ \fi \fontsize{\@xxpt}{25}\bfseries #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}} \def\@stomo#1{\addcontentsline{toc}{tomo}{\protect\noindent#1}% \begingroup\centering \fontsize{\@xxpt}{25}\bfseries #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}} \def\tomorunhead#1#2#3{% \@ifnotempty{#2}{\uppercase{#1 #2}\@ifnotempty{#3}{. }}% \def\@tempa{#3}% \ifx\@empty\@tempa\else\uppercasenonmath\@tempa\@tempa\fi} \def\l@tomo{\@tocline{-1}{12pt plus2pt}{0pt}{}{\bfseries}} \let\toctomo\tocsection \begin{document} \tomo{example} \part{ciao} \chapter{test} \end{document} But at compile time, it returned me the following error:
! Use of \@ doesn't match its definition. \@xdblarg #1#2->#1[ {#2}]{#2} l.36 \tomo {example} I've been using the amsbook class to define the following extension. Where am I wrong?
By the way, I didn't use the volumes package, as it won't add the tomo in my table of contents.
\makeatletter ... \makeatothersince you're using@on command names.\makeatletterand\makeatother. See tex.stackexchange.com/questions/8351/…