![](https://secure.gravatar.com/avatar/1f1420d2f042c8497d63406a4033a676.jpg?s=120&d=mm&r=g)
Hello, In the example below... ---------------------------------------------------- %\def\myCommand#1#2{} \def\myCommand#1#2{#1 #2} %\def\myCommand{} \setuphead[chapter] [number=yes, align=middle, % anyotherparameter=whatever, command=\myCommand] % command=] \starttext \startfrontmatter %\placecontent \completecontent \stopfrontmatter \startbodymatter \chapter{chapter one} \dorecurse{5}{\input tufte\par} \chapter{chapter two} \dorecurse{5}{\input douglas\par} \stopbodymatter \stoptext ---------------------------------------------------- ... how do you define myCommand so \setuphead[chapter] [(any other parameter settings), command=\myCommand, (any other parameter settings)] is equal to \setuphead[chapter] [(any other parameter settings), command=, (any other parameter settings)] i.e. with any other parameter settings remaining active. In the example above, with align=middle and - \def\myCommand#1#2{} the ToC and chapter heads are blank - \def\myCommand#1#2{#1 #2} the ToC and chapter head alignment is lost - \def\myCommand{} the ToC and chapter head alignment is lost Thanks, Alan
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
On Thu, Jan 29, 2009 at 11:50 AM, Alan Stone
... how do you define myCommand so
\setuphead[chapter] [(any other parameter settings), command=\myCommand, (any other parameter settings)]
is equal to
\setuphead[chapter] [(any other parameter settings), command=, (any other parameter settings)]
i.e. with any other parameter settings remaining active.
This is not possible because ConTeXt use the \normalplacehead command by default (even for "command=," as fallback) and this is where the align key is used, with your \myCommand this \normalplacehead is repleaced and the align key and many of the others are no longer used by ConTeXt. The best thing is to key that are used in higher level macros like style, color or \numbercommand and \textcommand because they act independent of the command key. Wolfgang
![](https://secure.gravatar.com/avatar/952397f0ff5c6a25f556cd771c85db0c.jpg?s=120&d=mm&r=g)
i also have a question; why can't i use different fonts in \def\myCommand#1#2{{\ss\sc #1}{\rm\sc #2}{\ss\sc\bf #1}{\rm\sc\bf #2}} \setuphead[part][command=\myCommand] the font commands are simply ignored. I don't want to have to resort to using numberstyle and textstyle. Thanks
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 30.01.2009 um 13:13 schrieb Mohamed Bana:
i also have a question; why can't i use different fonts in
\def\myCommand#1#2{{\ss\sc #1}{\rm\sc #2}{\ss\sc\bf #1}{\rm\sc\bf #2}} \setuphead[part][command=\myCommand]
the font commands are simply ignored. I don't want to have to resort to using numberstyle and textstyle.
You code works but the style and number/textstyle values act as part of #1 and #2 and you have to set them to nothing to get your own settings. \setuphead[part][command=\myCommand,style=] Wolfgang
participants (3)
-
Alan Stone
-
Mohamed Bana
-
Wolfgang Schuster