* Porting from MkII to MkIV
@ 2010-08-24 19:21 Peter Schorsch
2010-08-24 19:43 ` Wolfgang Schuster
0 siblings, 1 reply; 5+ messages in thread
From: Peter Schorsch @ 2010-08-24 19:21 UTC (permalink / raw)
To: ntg-context
Hi,
I started to write under MkII a module to number and reference each
paragraph. I got it to work but it was not well done. Now I want to finish
and clean it to upload it on contextgarden for all. But I am stucking at the
port to MkIV.
(Reduced MkII Version):
\definenumber[paraNumber]
\setuphead[chapter,section,subsection,subsubsection]
[after={\resetnumber[paraNumber]}]
\def\StartPara[#1]%
{\getparameters[tmp][heading=,mark=,#1]%
\incrementnumber[paraNumber]%
\inothermargin{\tfx\getnumber[paraNumber]~}%
\doifnot{\tmpheading}{}{\inmargin{\tmpheading}}%
\doifnot{\tmpmark}{}{\expanded{\textreference[\tmpmark]{XXX
/\getnumber[paraNumber]}}}%
}
\def\StopPara%
{\blank[medium]}
\starttext
\chapter{Alter novom}
\StartPara[heading={lorem ipsum},mark=test]
Lorem ipsum ...
\StopPara
\StartPara
Lorem ipsum \in[test]
\StopPara
\stoptext
XXX stands for an already ported part that works. I have two problems I do
not know how to solve:
- the line starting with inothermargin gives back in mkii always the correct
number form: n (always latin numbers). In mkiv it gives back m.n. Also in
mkiv: inside bodymatter the numbers are latin number e.g. 1.2 and inside
appendecies latin letters and numbers, e.g. A.II.
What needs to be change in my module to get the old mkii behavior back?
- There must be a problem in the last line: as soon I use my mark option I
get following error:
! Use of \dovspacingyes doesn't match its definition.
\doifnextoptionalelse ...\nextoptionalcommandyes {
#1}\def
\nextoptionalcomma...
<argument> ...ference [\tmpmark ]{XXX /\getnumber
[paraNumber]}
\expanded ...\long \xdef \@@expanded {\noexpand #1
}\@@expanded
l.18 \StartPara[mark=test]
Does anyone know how to solve/port this to mkiv?
Thanks for your help
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Porting from MkII to MkIV
2010-08-24 19:21 Porting from MkII to MkIV Peter Schorsch
@ 2010-08-24 19:43 ` Wolfgang Schuster
2010-08-24 22:23 ` Peter Schorsch
0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2010-08-24 19:43 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 24.08.10 21:21, schrieb Peter Schorsch:
> Hi,
>
> I started to write under MkII a module to number and reference each
> paragraph. I got it to work but it was not well done. Now I want to finish
> and clean it to upload it on contextgarden for all. But I am stucking at the
> port to MkIV.
>
> (Reduced MkII Version):
>
> \definenumber[paraNumber]
> \setuphead[chapter,section,subsection,subsubsection]
> [after={\resetnumber[paraNumber]}]
>
> \def\StartPara[#1]%
> {\getparameters[tmp][heading=,mark=,#1]%
> \incrementnumber[paraNumber]%
> \inothermargin{\tfx\getnumber[paraNumber]~}%
> \doifnot{\tmpheading}{}{\inmargin{\tmpheading}}%
> \doifnot{\tmpmark}{}{\expanded{\textreference[\tmpmark]{XXX
> /\getnumber[paraNumber]}}}%
> }
> \def\StopPara%
> {\blank[medium]}
>
> \starttext
>
> \chapter{Alter novom}
>
> \StartPara[heading={lorem ipsum},mark=test]
> Lorem ipsum ...
> \StopPara
>
> \StartPara
> Lorem ipsum \in[test]
> \StopPara
>
> \stoptext
>
> XXX stands for an already ported part that works. I have two problems I do
> not know how to solve:
>
> - the line starting with inothermargin gives back in mkii always the correct
> number form: n (always latin numbers). In mkiv it gives back m.n. Also in
> mkiv: inside bodymatter the numbers are latin number e.g. 1.2 and inside
> appendecies latin letters and numbers, e.g. A.II.
> What needs to be change in my module to get the old mkii behavior back?
>
> - There must be a problem in the last line: as soon I use my mark option I
> get following error:
>
> ! Use of \dovspacingyes doesn't match its definition.
> \doifnextoptionalelse ...\nextoptionalcommandyes {
> #1}\def
> \nextoptionalcomma...
> <argument> ...ference [\tmpmark ]{XXX /\getnumber
> [paraNumber]}
> \expanded ...\long \xdef \@@expanded {\noexpand #1
> }\@@expanded
> l.18 \StartPara[mark=test]
>
>
> Does anyone know how to solve/port this to mkiv?
\definenumber[PARANUMBER][way=bysection,prefixsegments=100]
\unexpanded\def\startPARA
{\dosingleempty\dostartPARA}
\def\dostartPARA[#1]%
{\getrawparameters[PARA][heading=,mark=,#1]%
\incrementnumber[PARANUMBER]%
\inothermargin{\tfx\getnumber[PARANUMBER]~}%
\doifsomething\PARAheading{\inmargin{\PARAheading}}%
\doifsomething\PARAmark
{\textreference[\PARAmark]{XXX/\rawnumber[PARANUMBER]}}%
\ignorespaces}
\unexpanded\def\stopPARA
{\blank[medium]}
Wolfgang
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Porting from MkII to MkIV
2010-08-24 19:43 ` Wolfgang Schuster
@ 2010-08-24 22:23 ` Peter Schorsch
2010-08-25 20:44 ` Wolfgang Schuster
0 siblings, 1 reply; 5+ messages in thread
From: Peter Schorsch @ 2010-08-24 22:23 UTC (permalink / raw)
To: ntg-context
Thanks Wolfgang! Your source code looks a lot different than mine... there
are some commands I have not seen before... so I have to learn :-)
Unluckily I still get an error message:
! Use of \startPARA doesn't match its definition.
l.21 \startPARA[
heading={lorem ipsum},mark=test]
What did I wrong?
------------8<--------------
\definenumber[PARANUMBER][way=bysection,prefixsegments=100]
\unexpanded\def\startPARA
{\dosingleempty\dostartPARA}
\def\dostartPARA[#1]%
{\getrawparameters[PARA][heading=,mark=,#1]%
\incrementnumber[PARANUMBER]%
\inothermargin{\tfx\getnumber[PARANUMBER]~}%
\doifsomething\PARAheading{\inmargin{\PARAheading}}%
\doifsomething\PARAmark
{\textreference[\PARAmark]{XXX/\rawnumber[PARANUMBER]}}%
\ignorespaces}
\unexpanded\def\stopPARA
{\blank[medium]}
\starttext
\chapter{Alter novom}
\startPARA[heading={lorem ipsum},mark=test]
Lorem ipsum ...
\stopPARA
\startPARA
Lorem ipsum \in[test]
\stopPARA
\stoptext
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Porting from MkII to MkIV
2010-08-24 22:23 ` Peter Schorsch
@ 2010-08-25 20:44 ` Wolfgang Schuster
2010-08-26 13:58 ` Peter Schorsch
0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2010-08-25 20:44 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 25.08.10 00:23, schrieb Peter Schorsch:
> Thanks Wolfgang! Your source code looks a lot different than mine... there
> are some commands I have not seen before... so I have to learn :-)
Works here without problems.
MTXrun | current version: 2010.08.25 11:13
Wolfgang
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Porting from MkII to MkIV
2010-08-25 20:44 ` Wolfgang Schuster
@ 2010-08-26 13:58 ` Peter Schorsch
0 siblings, 0 replies; 5+ messages in thread
From: Peter Schorsch @ 2010-08-26 13:58 UTC (permalink / raw)
To: ntg-context
I used the context from the ubuntu repository. So I switched to context-
minimals current-version.... and viola it works here too
Thanks
Wolfgang Schuster wrote:
> Am 25.08.10 00:23, schrieb Peter Schorsch:
>> Thanks Wolfgang! Your source code looks a lot different than mine...
>> there are some commands I have not seen before... so I have to learn :-)
>
> Works here without problems.
>
> MTXrun | current version: 2010.08.25 11:13
>
> Wolfgang
>
>
___________________________________________________________________________________
> 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
>
___________________________________________________________________________________
___________________________________________________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2010-08-26 13:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-24 19:21 Porting from MkII to MkIV Peter Schorsch
2010-08-24 19:43 ` Wolfgang Schuster
2010-08-24 22:23 ` Peter Schorsch
2010-08-25 20:44 ` Wolfgang Schuster
2010-08-26 13:58 ` Peter Schorsch
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).