Re: [NTG-context] Sections, cross-references and separators
Taco wrote:
In this case it is easier to make the actual chapter number include the 'A'. That way, you won't have to worry about "separator" at all (which is good, because its use is confusing).
Try this:
@@ -1,4 +1,4 @@ -\setupheads[separator=] %<-- this can't be right \setupreferencing[state=start,chapternumber=yes,global=yes] -\setupsection[section-1][conversion=Characters] -\setupsection[section-2][previousnumber=yes] +\def\Mychapter#1{\convertnumber{Characters}{\getvalue{@@sesection-1}}#1} +\defineconversion[MyChapter][\Mychapter] +\setupsection[section-2][conversion=MyChapter]
Ah, thanks so much Taco, never thought of that approach - works like a charm. (I also thought that macros with @ in their names could only be used in protected mode, so that's two things I have learned for the price of one.) Do you think this is general interest enough to warrant wikifying? Thanks very much. Duncan
Duncan Hothersall wrote:
Taco wrote:
In this case it is easier to make the actual chapter number include the 'A'. That way, you won't have to worry about "separator" at all (which is good, because its use is confusing).
Try this:
@@ -1,4 +1,4 @@ -\setupheads[separator=] %<-- this can't be right \setupreferencing[state=start,chapternumber=yes,global=yes] -\setupsection[section-1][conversion=Characters] -\setupsection[section-2][previousnumber=yes] +\def\Mychapter#1{\convertnumber{Characters}{\getvalue{@@sesection-1}}#1} +\defineconversion[MyChapter][\Mychapter] +\setupsection[section-2][conversion=MyChapter]
Ah, thanks so much Taco, never thought of that approach - works like a charm. (I also thought that macros with @ in their names could only be used in protected mode, so that's two things I have learned for the price of one.)
As far as TeX is concerned, I am not actually using the macro myself, just mentioning its name. The \getvalue macro then constructs the actual macro name internally. That works always, but usually macro calls look funny when used in that way. I just found \rawsectionnumber, so with this change it should also work (and look less low-level, which is good if you want to wikify it): \def\Mychapter#1% {\convertnumber{Characters}{\rawsectionnumber{section-1}}#1} Best wishes, Taco
participants (2)
-
Duncan Hothersall
-
Taco Hoekwater