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
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
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
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
___________________________________________________________________________________
participants (2)
-
Peter Schorsch
-
Wolfgang Schuster