The definition of the chapter command in KOMA-class scrbook is:


I am wondering what \secdef does.


\secdef is a utility command; if a definition is in the form


a call of \foo will do


while calling \foo* will do


This is because the definition of \secdef is


Therefore, leaving aside the <tokens> that may precede the execution of \secdef, we get


If \foo* is called, \fooB is executed, otherwise TeX does


and so \fooA must be defined in a special way:


like \@chapter is. The \@dblarg trick basically examines the next token; if it is [, then we are in a situation such as


and LaTeX will do


Otherwise we have


and \@dblarg will arrange things in such a way that TeX will eventually see


Change \foo into \chapter, \fooA into \@chapter and \fooB into \@schapter to better understand the idea.


Oh... I guess I got it on my own: \secdef seems to switch between \chapter and \chapter* call, so you can define in the example above for each case an own macro \@chapter (non-star case) or \@schapter (star-case).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.