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