typesetting chapter--label for cross references
I'd like to display a cross reference, using a en-dash to separate the chapter number from the text being cross referenced. In the example below, if you look at label attached to the example caption "A Sample XML file," you'll see that it is typeset as Example~1--1 however if you look at the cross reference to the example, it is typeset as Example~1.1 how do I change the period (.) separator in the cross reference to an en-dash separator (--). ----- \defineenumeration [example] [location=serried, text=Example, before=\blank, after=\blank, way=bychapter, style=italic, separator=--] \starttext \chapter{One} \in{Example}[ex:Simple-doc] has the chapter number separated from the example number by a period, and not an en-dash. \example[ex:Simple-doc] A Sample XML file \startXML <?xml version="1.0"?> <?xml-stylesheet href="simple-doc.xsl" type="text/xsl"?> \stopXML \stoptext -----
At 04:25 PM 2/24/2003 +0800, you wrote:
I'd like to display a cross reference, using a en-dash to separate the chapter number from the text being cross referenced. In the example below, if you look at label attached to the example caption "A Sample XML file," you'll see that it is typeset as
Example~1--1
however if you look at the cross reference to the example, it is typeset as
Example~1.1
how do I change the period (.) separator in the cross reference to an en-dash separator (--).
-----
\defineenumeration [example] [location=serried, text=Example, before=\blank, after=\blank, way=bychapter, style=italic, separator=--]
\starttext
\chapter{One}
\in{Example}[ex:Simple-doc] has the chapter number separated from the example number by a period, and not an en-dash.
\example[ex:Simple-doc] A Sample XML file
\startXML <?xml version="1.0"?> <?xml-stylesheet href="simple-doc.xsl" type="text/xsl"?> \stopXML
\stoptext
This is a mixture of a bug and feature. I'm not sure if the following patch is completely safe (so i'll have to test it for a while) \unprotect \def\preparethenumber#1#2#3% {\??id#1} \number \result {\doifelsevaluenothing{#1\c!scheider} {\let\numberseparator\empty \let#3#2} {\edef\numberseparator{\getvalue{#1\c!scheider}}% \edef#3{\@EA\separatednumber\@EA{#2}}}} % hm, etex \protect the best way to handle sep's is \definesymbol[MySep][--] separator={\symbol[MySep]} Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Hans Hagen wrote:
Guy Worthington wrote:
I'd like to display a cross reference, using a en-dash to separate the chapter number from the text being cross referenced.
This is a mixture of a bug and feature.
I don't understand what you did to patch the bug, but I can certainly appreciate the feature. I get a lot of pleasure when I trip across these types of electric macros. ----- %output=pdf \unprotect \def\preparethenumber#1#2#3% {\??id#1} \number \result {\doifelsevaluenothing{#1\c!scheider} {\let\numberseparator\empty \let#3#2} {\edef\numberseparator{\getvalue{#1\c!scheider}}% \edef#3{\@EA\separatednumber\@EA{#2}}}} % hm, etex \protect \definesymbol[MySep][--] \defineenumeration [example] [location=serried, text=Example, before=\blank, after=\blank, way=bychapter, style=italic, separator={\symbol[MySep]}] \starttext \chapter{One} \in{Example}[ex:Simple-doc] has the chapter number separated from the example number by a period, and not an en-dash. \example[ex:Simple-doc] A Sample XML file \startXML <?xml version="1.0"?> <?xml-stylesheet href="simple-doc.xsl" type="text/xsl"?> \stopXML \stoptext -------
participants (2)
-
Guy Worthington
-
Hans Hagen