我需要在目录中添加作者姓名,我刚刚从 amsart.cls 复制了作者宏,该命令用于在章节开头页中打印作者姓名,当我通过以下错误\@setauthors
添加它时使用相同的命令\addcontentsline{toc}{section}{\@setauthors}
Chapter 1.
! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.118 \makechaptertitle
如何使用相同命令在目录中添加作者姓名
梅威瑟:
\documentclass{book}
\usepackage{amsmath,ifthen,color,showframe}
\definecolor{grayten}{cmyk}{0,0,0,0.1}
\makeatletter
\def\@makechapterhead#1{%
\gdef\@chapterhead{#1}
}
\def\makechaptertitle{\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries \@chapterhead\par\nobreak
\vspace*{24pt}
\large\@setauthors
\addcontentsline{toc}{section}{\@setauthors}
\vskip 40\p@
\@afterindentfalse
}}
\let\@xp=\expandafter
\let\@nx=\noexpand
\def\author{\@ifnextchar[{\@@author}{\@author}}
\def\@@author[#1]#2{%
\ifx\@empty\authors
\gdef\authors{#2$^{#1}$\kern-1pt}%
\gdef\tocauthors{#2$^{#1}$\kern-1pt}%
\else
\g@addto@macro\authors{\and#2$^{#1}$\kern-1pt}%
\g@addto@macro\tocauthors{\and#2$^{#1}$\kern-1pt}%
\fi
}
%
\def\@author#1{%
\ifx\@empty\authors%
\gdef\authors{#1}%
\gdef\tocauthors{#1}%
\else%
\g@addto@macro\authors{\and#1}%
\g@addto@macro\tocauthors{\and#1}%
\fi
}
\newcommand{\xandlist}[4]{\@andlista{{#1}{#2}{#3}}#4\and\and}
\def\@andlista#1#2\and#3\and{\@andlistc{#2}\@ifnotempty{#3}{%
\@andlistb#1{#3}}}
\def\@andlistb#1#2#3#4#5\and{%
\@ifempty{#5}{%
\@andlistc{#2#4}%
}{%
\@andlistc{#1#4}\@andlistb{#1}{#3}{#3}{#5}%
}}
\let\@andlistc\@iden
\newcommand{\nxandlist}[4]{%
\def\@andlistc##1{\toks@\@xp{\the\toks@##1}}%
\toks@{\toks@\@emptytoks \@andlista{{#1}{#2}{#3}}}%
\the\@xp\toks@#4\and\and
\edef#4{\the\toks@}%
\let\@andlistc\@iden}
\def\@@and{and}
\newcommand{\andify}{%
\nxandlist{\unskip, }%
{\unskip{} \@@and~}%
{\unskip, \@@and~}}%
\def\and{\unskip{ }\@@and{ }\ignorespaces}
\def\author@andify{%
\nxandlist {\unskip,\space\ignorespaces}%
{\unskip {} \@@and~}%
{\unskip ,\penalty-2 \space \@@and~}%
}
\def\@setauthors{
\begingroup
\author@andify\authors
\def\\{\protect\linebreak}%
{\authors}%
\endgroup
}
\let\authors\@empty
\let\tocauthors\@empty
\makeatother
\begin{document}
\tableofcontents
\chapter{Sample Chapter}
\author{Author 1}
\author{Author 2}
\author{Author 3}
\author{Author 4}
\makechaptertitle
For measuring time, the horizontal gnomon is inserted into the hole above the scale meant for the current solar month and the staff turned slowly towards the sun so that the gnomon throws its shadow exactly on the scale below. Where the end of the shadow touches the numbered scale, the number indicates in the forenoon the that have elapsed since the sunrise, and in the afternoon, the number of that are to elapse up to sunset.
Compared with these, the Indian versions are much longer, ranging between 1,100 to 1,550mm. Instead of twelve separate scales for the twelve solar months, they usually have eight scales, employing one common scale for two solar months which are at equal distance from the equinoxes. The scales are not divided by continuous curves, but by straight lines unconnected with those on the adjacent column. In other words, these are cruder imitations of those produced in the Islamic world and in Europe. Obviously the idea of the column dial came from the Islamic world we cannot identify the exact process of transmission but the Sanskrit authors merely borrowed the name, not the principle feature, namely marking the hours on the different scales by continuous curves.
The extant specimens of Indian column dials are of three types: those made of metal or ivory, those made of wood on which scales are painted, and those made of timber on which the scales are carved. There exist just two specimens of the first group. The first is an exquisitely crafted steel column dial in the museum of the History of Science, Oxford, 95.6 cm, with all the scale lines, numbers and decorative patterns inlaid in gold (Figure. 2). It is topped with an ornate finial and the other end terminates in a sharply polished blade. It must have been created for some prince in Rajasthan. The other, made of ivory, is also of excellent workmanship, with a beautifully carved finial at the top and an ornate end at
\end{document}