![](https://secure.gravatar.com/avatar/13aa48aeefd46e69ca405af99bf5b5e0.jpg?s=120&d=mm&r=g)
Hi, just another newbie question \setuphead[section] [command=\MyCommand] \define[2]\MyCommand% {\convertnumber{I}{#1} --- #2} \convertnumber does not work on command parameter. What am I doing wrong? I know that I can use /conversion/ key in setuphead, but I need slightly more complicated command. thanks Jan
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 11.06.2013 um 14:22 schrieb Jan Pohanka
Hi,
just another newbie question
\setuphead[section] [command=\MyCommand]
\define[2]\MyCommand% {\convertnumber{I}{#1} --- #2}
\convertnumber does not work on command parameter. What am I doing wrong? I know that I can use conversion key in setuphead, but I need slightly more complicated command.
Use \setuphead[section][conversion=I], you can’t use \convertnumber because the first argument is the formatted (styles and colors are applied) content of the section number. Wolfgang
![](https://secure.gravatar.com/avatar/13aa48aeefd46e69ca405af99bf5b5e0.jpg?s=120&d=mm&r=g)
\convertnumber does not work on command parameter. What am I doing wrong? I know that I can use /conversion/ key in setuphead, but I need slightly more complicated command.
Use \setuphead[section][conversion=I], you can't use \convertnumber because the first argument is the formatted (styles and colors are applied) content of the section number.
Thanks, I'm aware of this method and I mentioned it in the original question. The question is what to do if I need to use the command key to apply more complex formating using \framed etc. At least I need to make \section{My section title} to print I. Section My section title regards Jan
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 11.06.2013 um 14:36 schrieb Jan Pohanka
\convertnumber does not work on command parameter. What am I doing wrong? I know that I can use conversion key in setuphead, but I need slightly more complicated command.
Use \setuphead[section][conversion=I], you can’t use \convertnumber because the first argument is the formatted (styles and colors are applied) content of the section number.
Thanks, I'm aware of this method and I mentioned it in the original question. The question is what to do if I need to use the command key to apply more complex formating using \framed etc. At least I need to make \section{My section title} to print
I. Section My section title
You can create your own section layout. \definesectionalternative[mysection][renderingsetup=mysection] \startsetups[mysection] \vbox\bgroup \headsetupspacing \strut\headnumbercontent\par \begstrut\headtextcontent\endstrut \egroup \stopsetups \setuplabeltext[en][section={}{Section] \setuphead[section][alternative=mysection] Wolfgang
![](https://secure.gravatar.com/avatar/13aa48aeefd46e69ca405af99bf5b5e0.jpg?s=120&d=mm&r=g)
\definesectionalternative[mysection][renderingsetup=mysection]
\startsetups[mysection] \vbox\bgroup \headsetupspacing \strut\headnumbercontent\par \begstrut\headtextcontent\endstrut \egroup \stopsetups
\setuplabeltext[en][section={}{Section]
\setuphead[section][alternative=mysection]
It seams that my context does not know /definesectionalternative/ mtx-context | run 1: luatex --fmt="/home/honza/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" --jobname="test" --lua="/home/honza/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" --no-parse-first-line --c:currentrun=1 --c:fulljobname="./test.tex" --c:input="./test.tex" --c:kindofrun=1 --c:maxnofruns=8 "cont-yes.mkiv" This is LuaTeX, Version beta-0.75.0-2013031401 (rev 4589) \write18 enabled. (/home/honza/context/tex/texmf-context/tex/context/base/cont-yes.mkiv ConTeXt ver: 2013.03.17 13:59 MKIV fmt: 2013.3.19 int: english/english system > 'cont-new.mkiv' loaded (/home/honza/context/tex/texmf-context/tex/context/base/cont-new.mkiv system > beware: some patches loaded from cont-new.mkiv ) system > files > jobname 'test', input 'test', result 'test' fonts > latin modern fonts are not preloaded languages > language 'en' is active (test.tex ! Undefined control sequence. log system > tex > error on line 9 in file test.tex: Undefined control sequence ... l.9 \definesectionalternative [mysection][renderingsetup=mysection] ? thanks Jan
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 11.06.2013 um 15:53 schrieb Jan Pohanka
\definesectionalternative[mysection][renderingsetup=mysection]
\startsetups[mysection] \vbox\bgroup \headsetupspacing \strut\headnumbercontent\par \begstrut\headtextcontent\endstrut \egroup \stopsetups
\setuplabeltext[en][section={}{Section]
\setuphead[section][alternative=mysection]
It seams that my context does not know definesectionalternative
Has to be \defineheadalternative: \defineheadalternative[mysection][renderingsetup=mysection] \startsetups[mysection] \vbox\bgroup \headsetupspacing \strut\headnumbercontent\par \begstrut\headtextcontent\endstrut \egroup \stopsetups \setuplabeltext[en][section={, Section}] \setuphead [section] [alternative=mysection, conversion=I, sectionstopper=.] \starttext \section{Test} \stoptext Wolfgang
![](https://secure.gravatar.com/avatar/13aa48aeefd46e69ca405af99bf5b5e0.jpg?s=120&d=mm&r=g)
Has to be \defineheadalternative:
\defineheadalternative[mysection][renderingsetup=mysection]
\startsetups[mysection] \vbox\bgroup \headsetupspacing \strut\headnumbercontent\par \begstrut\headtextcontent\endstrut \egroup \stopsetups
\setuplabeltext[en][section={, Section}]
\setuphead [section] [alternative=mysection, conversion=I, sectionstopper=.]
\starttext \section{Test} \stoptext
Wolfgang
It works nice, thanks Jan
participants (2)
-
Jan Pohanka
-
Wolfgang Schuster