From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6574 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: docbook Date: Mon, 21 Jan 2002 21:58:20 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20020121213234.02aecbc0@server-1> References: <200201211101.MAA17323@smail.let.uu.nl> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035397098 11831 80.91.224.250 (23 Oct 2002 18:18:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:18:18 +0000 (UTC) Cc: Jaroslav Snajdr , spepping@scaprea.hobby.nl Original-To: ntg-context@let.uu.nl In-Reply-To: <200201211101.MAA17323@smail.let.uu.nl> Xref: main.gmane.org gmane.comp.tex.context:6574 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6574 [simon: this is another docbook example] [non member submission, pleas use registered address] >Hello, > >I'm typesetting a Docbook document with ConTeXt and I cannot get it to >typeset the index correctly. The index is generated automatically with >this code: > >\defineXMLenvironment[book]{\starttext}{\completeindex\stoptext} > >\defineXMLargument[indexterm]{\index} >\defineXMLcommand[primary]{} >\defineXMLcommand[secondary]{+} > >Index entries in DocBook are coded through the text as: > >animals > >or > >animalsdogs since you need to distinguish between primary and secondary index entries, you can best save/flush them, as in: \defineXMLenvironment [book] {\starttext} {\placeindex \stoptext} \defineXMLenvironment [indexterm] {\defineXMLenvironmentsave[primary] \ignorespaces \ignorespaces \defineXMLenvironmentsave[secondary] \ignorespaces \ignorespaces} {\doifelseXMLdata{secondary} {\expanded{\index{\XMLflushdata{primary}+\XMLflushdata{secondary}}}} {\expanded{\index{\XMLflushdata{primary}}}}} \enableXMLelements So we have primary animals animals as well as secondary animals dogs ones, at least in the Czech republic. ------------------------------------------------------------------------- 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 ------------------------------------------------------------------------- fall-back web server: www.pragma-pod.nl -------------------------------------------------------------------------