ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \convertnumber with macro parameter
@ 2013-06-11 12:22 Jan Pohanka
  2013-06-11 12:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Pohanka @ 2013-06-11 12:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 328 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 875 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \convertnumber with macro parameter
  2013-06-11 12:22 \convertnumber with macro parameter Jan Pohanka
@ 2013-06-11 12:29 ` Wolfgang Schuster
  2013-06-11 12:36   ` Jan Pohanka
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2013-06-11 12:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 604 bytes --]


Am 11.06.2013 um 14:22 schrieb Jan Pohanka <xhpohanka@gmail.com>:

> 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

[-- Attachment #1.2: Type: text/html, Size: 1469 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \convertnumber with macro parameter
  2013-06-11 12:29 ` Wolfgang Schuster
@ 2013-06-11 12:36   ` Jan Pohanka
  2013-06-11 12:46     ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Pohanka @ 2013-06-11 12:36 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 669 bytes --]


>> \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

[-- Attachment #1.2: Type: text/html, Size: 2619 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \convertnumber with macro parameter
  2013-06-11 12:36   ` Jan Pohanka
@ 2013-06-11 12:46     ` Wolfgang Schuster
  2013-06-11 13:53       ` Jan Pohanka
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2013-06-11 12:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1121 bytes --]


Am 11.06.2013 um 14:36 schrieb Jan Pohanka <xhpohanka@gmail.com>:

> 
>>> \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

[-- Attachment #1.2: Type: text/html, Size: 3487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \convertnumber with macro parameter
  2013-06-11 12:46     ` Wolfgang Schuster
@ 2013-06-11 13:53       ` Jan Pohanka
  2013-06-11 14:00         ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Pohanka @ 2013-06-11 13:53 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1626 bytes --]


> \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

[-- Attachment #1.2: Type: text/html, Size: 3753 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \convertnumber with macro parameter
  2013-06-11 13:53       ` Jan Pohanka
@ 2013-06-11 14:00         ` Wolfgang Schuster
  2013-06-12  6:58           ` Jan Pohanka
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2013-06-11 14:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 918 bytes --]


Am 11.06.2013 um 15:53 schrieb Jan Pohanka <xhpohanka@gmail.com>:

> 
>> \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

[-- Attachment #1.2: Type: text/html, Size: 2781 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \convertnumber with macro parameter
  2013-06-11 14:00         ` Wolfgang Schuster
@ 2013-06-12  6:58           ` Jan Pohanka
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Pohanka @ 2013-06-12  6:58 UTC (permalink / raw)
  To: ntg-context

>
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-12  6:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-11 12:22 \convertnumber with macro parameter Jan Pohanka
2013-06-11 12:29 ` Wolfgang Schuster
2013-06-11 12:36   ` Jan Pohanka
2013-06-11 12:46     ` Wolfgang Schuster
2013-06-11 13:53       ` Jan Pohanka
2013-06-11 14:00         ` Wolfgang Schuster
2013-06-12  6:58           ` Jan Pohanka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).