ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* index term in term of a definition list
@ 2003-03-17 19:27 Simon Pepping
  2003-03-18  8:04 ` Hans Hagen
  2003-03-18  8:08 ` Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Pepping @ 2003-03-17 19:27 UTC (permalink / raw)


Hi,

It appears that Context cannot deal with an \index command in the term
of a definition list:

\startvariable{sarge\index{sarge}}
De groene soldaat
\stopvariable

In XML documents this may occur:

 <varlistentry>
   <term>sarge
     <indexterm significance="normal">
       <primary>sarge</primary>
     </indexterm>
   </term>
   <listitem>
     <para>De groene soldaat</para>
   </listitem>
 </varlistentry>

Is it a fundamental problem to enable this in Context? If so I must
find other solutions.

Does Context have something for stacks?

Regards, Simon

-- 
Simon Pepping
email: spepping@scaprea.hobby.nl

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: index term in term of a definition list
  2003-03-17 19:27 index term in term of a definition list Simon Pepping
@ 2003-03-18  8:04 ` Hans Hagen
  2003-03-18  8:08 ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2003-03-18  8:04 UTC (permalink / raw)


At 08:27 PM 3/17/2003 +0100, you wrote:

>Does Context have something for stacks?

In what way? There is \pushmacro \popmacro cum suis; also, when you're 
taling about xml, you can save xml constructs either or not encapsulated in 
elements with additional attributes but i suppose that you already located 
that code -)

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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: index term in term of a definition list
  2003-03-17 19:27 index term in term of a definition list Simon Pepping
  2003-03-18  8:04 ` Hans Hagen
@ 2003-03-18  8:08 ` Hans Hagen
  2003-03-18 21:06   ` Simon Pepping
  1 sibling, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2003-03-18  8:08 UTC (permalink / raw)


At 08:27 PM 3/17/2003 +0100, you wrote:
>Hi,
>
>It appears that Context cannot deal with an \index command in the term
>of a definition list:
>
>\startvariable{sarge\index{sarge}}
>De groene soldaat
>\stopvariable
>
>In XML documents this may occur:
>
>  <varlistentry>
>    <term>sarge
>      <indexterm significance="normal">
>        <primary>sarge</primary>
>      </indexterm>
>    </term>
>    <listitem>
>      <para>De groene soldaat</para>
>    </listitem>
>  </varlistentry>
>
>Is it a fundamental problem to enable this in Context? If so I must
>find other solutions.

\defineXMLenvironmentsave[indexterm][significance=]
   {\bgroup
    \defineXMLsave[primary]}
   {\expanded{\index{\XMLflush{primary}}}%
    \egroup}

Hans (who will look into indexes some day soon; maybe provide an xml mode 
for them)
-------------------------------------------------------------------------
                                   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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: index term in term of a definition list
  2003-03-18  8:08 ` Hans Hagen
@ 2003-03-18 21:06   ` Simon Pepping
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Pepping @ 2003-03-18 21:06 UTC (permalink / raw)


On Tue, Mar 18, 2003 at 09:08:33AM +0100, Hans Hagen wrote:
> At 08:27 PM 3/17/2003 +0100, you wrote:
> >In XML documents this may occur:
> >
> > <varlistentry>
> >   <term>sarge
> >     <indexterm significance="normal">
> >       <primary>sarge</primary>
> >     </indexterm>
> >   </term>
> >   <listitem>
> >     <para>De groene soldaat</para>
> >   </listitem>
> > </varlistentry>
> >
> >Is it a fundamental problem to enable this in Context? If so I must
> >find other solutions.
> 
> \defineXMLenvironmentsave[indexterm][significance=]
>   {\bgroup
>    \defineXMLsave[primary]}
>   {\expanded{\index{\XMLflush{primary}}}%
>    \egroup}

The term element is saved in \XMLDBterm, complete with embedded
indexterm, and then used as: \startvariable{\XMLDBterm}, so the above
\index command would still be in the term of the definitionlist.

I now save the indexterm element when \XMLDBterm is expanded, and
process it after \startvariable. However, \XMLDBterm may contain more
than one indexterm element (not likely, but it can), so I would need
to save a stack of them to cater for that possibility.

Of course I could also expand the term element and save the expanded
value in \XMLDBterm, but that has its own risks.

Regards, Simon

-- 
Simon Pepping
email: spepping@scaprea.hobby.nl

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-18 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-17 19:27 index term in term of a definition list Simon Pepping
2003-03-18  8:04 ` Hans Hagen
2003-03-18  8:08 ` Hans Hagen
2003-03-18 21:06   ` Simon Pepping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).