ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Indexing macros
@ 2002-12-02 16:20 John Culleton
  2002-12-02 16:41 ` Taco Hoekwater
  2002-12-02 16:51 ` Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: John Culleton @ 2002-12-02 16:20 UTC (permalink / raw)


The "register" macros in Context only provide for a single level index
AFAIK so I have been looking at the use of either makeindex or Xindy
in a Context project. I have slightly modified the index.tex file
from the Texsis distribution and renamed it indexx.tex. Instructions
for use are included in the file. The  command sequence is:

texexec test.tex
makeindex test.idx -o test.ind
texexec test.tex.

The  test.tex file is as follows:



\input indexx.tex
\markindextrue
\starttext
Hello
\page[yes]
\idx{Frisbee}
\idx{Saucer}
\indexx{foo}
\indexx{foo!bar}
\page[yes]
\input test.ind
\stoptext

The indexx.tex file can be found at:

http://wexfordpress.com/tex/indexx.tex

Most parties seem to prefer the more capable Xindy to the old standby
makeindex. However The Xindy distribution has a program for
translating makeindex raw index files to Xindy raw index files. So the
indexx.tex macros can be used as a stopgap method now. I will work on
another version that will emit Xindy raw files natively. 

Questions, comments, suggestions welcome :-)

-- 
John Culleton
Able Indexers and Typesetters 
Rowse Reviews
Culleton Editorial Services
http://wexfordpress.com

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

* Re: Indexing macros
  2002-12-02 16:20 Indexing macros John Culleton
@ 2002-12-02 16:41 ` Taco Hoekwater
  2002-12-03 13:33   ` John Culleton
  2002-12-02 16:51 ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2002-12-02 16:41 UTC (permalink / raw)



On Mon, 2 Dec 2002 16:20:52 +0000, John wrote:

> The "register" macros in Context only provide for a single level index
> AFAIK so I have been looking at the use of either makeindex or Xindy
> in a Context project. I have slightly modified the index.tex file

Unless I misunderstand your intentions, you were looking this ConTeXt command:

\index{main+sub+subsub}


-- 
groeten,

Taco

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

* Re: Indexing macros
  2002-12-02 16:20 Indexing macros John Culleton
  2002-12-02 16:41 ` Taco Hoekwater
@ 2002-12-02 16:51 ` Hans Hagen
  2002-12-03 14:18   ` John Culleton
  1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2002-12-02 16:51 UTC (permalink / raw)


At 04:20 PM 12/2/2002 +0000, you wrote:
>The "register" macros in Context only provide for a single level index
>AFAIK so I have been looking at the use of either makeindex or Xindy
>in a Context project. I have slightly modified the index.tex file
>from the Texsis distribution and renamed it indexx.tex. Instructions
>for use are included in the file. The  command sequence is:

hm, actually context provides three levels of indexing and as many 
independent indexes as you want

\index{aa+bb+cc}

\defineregister[your][yours]

\your{cc+dd+ee}

and alike

concerning xindy: where can i find a windows version (there hangs only some 
old dos stuff and all kind fo unix stuff around)

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] 9+ messages in thread

* Re: Indexing macros
  2002-12-02 16:41 ` Taco Hoekwater
@ 2002-12-03 13:33   ` John Culleton
  2002-12-03 16:57     ` Hans Hagen
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: John Culleton @ 2002-12-03 13:33 UTC (permalink / raw)


On Monday 02 December 2002 16:41, Taco Hoekwater wrote:
> On Mon, 2 Dec 2002 16:20:52 +0000, John wrote:
> > The "register" macros in Context only provide for a single level
> > index AFAIK so I have been looking at the use of either makeindex
> > or Xindy in a Context project. I have slightly modified the
> > index.tex file
>
> Unless I misunderstand your intentions, you were looking this ConTeXt
> command:
>
> \index{main+sub+subsub}
Thanks for your correction! It is even in the manual :-] But there are
other features found in Makeindex and especially Xindy that are
useful. For example attributes attached to the page reference # can be
passed through the system. An entry, subentry etc. can be sorted out
of order. This also handles elegantly the situation where one needs to
put a font change in with the item, e.g.:
\index{sortitem@\it Sortitem\rm}

The Context manual mentions the "see" form of entry but not
the "see also" form, although there is passing reference to another
form (not described fully) that allows one to input a "pure ASCII
string." 

Makeindex will automatically collapse a page reference string. If
three or more successive pages have the identical index item then
"1,2,3" becomes "1-3" etc. Perhaps Context does this also.

Xindy will handle appendix references like "A-3" although these are
becoming rarer.

Both Makeindex and Xindy have style files that allow for customizing
of the output. For example the letter headers might be centered in the
column, or left justified, in bold or not, capital or lower case,
surrounded by em dashes etc. 

Xindy goes well beyond this, allowing for special headers for e.g.
Hungarian which has the letter combination Ly sorted separately. 

Perhaps as is so often the case, the features are there but not yet
described in Context. A Context-only solution would be nice, but in
the meantime the power of the existing packages are available. 
-- 
John Culleton
Able Indexers and Typesetters 
Rowse Reviews
Culleton Editorial Services
http://wexfordpress.com

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

* Re: Indexing macros
  2002-12-02 16:51 ` Hans Hagen
@ 2002-12-03 14:18   ` John Culleton
  0 siblings, 0 replies; 9+ messages in thread
From: John Culleton @ 2002-12-03 14:18 UTC (permalink / raw)


On Monday 02 December 2002 16:51, Hans Hagen wrote:
>>
> concerning xindy: where can i find a windows version (there hangs
> only some old dos stuff and all kind fo unix stuff around)
>
> Hans
>

As you may already know, it comes in compiled versions for various
*nix platforms, OS2, and MDOS. There is also a source code file which
can theoretically be compiled wherever a Clisp compiler exists. But
there are problems with this in a modern environment. 

Here is a quote from somebody who has walked down that path:
----------------------------


It's a PITA to create xindy from sources. Reasons are IMO
 -- It wasn't written for current CLISP.
 -- Usage of external shared libraries (in particular, GNU regex)
    complicates the build process. Their usage made sense at the time
    when xindy was created but they could be replaced with more
    portable Common Lisp code that we didn't know then.
 -- Too many other non-usual tools are needed for its compilation
    (e.g., noweb) that are not part of the xindy distribution.
 -- Too much manual intervention is needed. It doesn't work as
    "./configure; make; make install".

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Joachim Schrod                                  Email: jschrod@acm.org
Roedermark, Germany

(end quote)-----------------------

-- 
John Culleton
Able Indexers and Typesetters 
Rowse Reviews
Culleton Editorial Services
http://wexfordpress.com

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

* Re: Indexing macros
  2002-12-03 13:33   ` John Culleton
@ 2002-12-03 16:57     ` Hans Hagen
  2002-12-03 16:59     ` Hans Hagen
  2002-12-04 14:30     ` Gour
  2 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2002-12-03 16:57 UTC (permalink / raw)


At 01:33 PM 12/3/2002 +0000, you wrote:

>useful. For example attributes attached to the page reference # can be
>passed through the system. An entry, subentry etc. can be sorted out

you can use attributes:

Copied from the manual source:

Most of the time the layout of a register is rather simple.
Some manuals may need some form of differentiating between
entries. The definition of several registers may be a
solution. However the layout can contribute to a better use
of the register:

\starttyping
\index           {entry}
\index[key]      {entry}
\index[form::]   {entry}
\index[form::key]{entry}
\index           {form::entry}
\index[key]      {form::entry}
\index[form::]   {form::entry}
\index[form::key]{form::entry}
\stoptyping

The first two alternatives are known, but the rest is new and
offers some control over the way the entry itself is
typeset. The specification between
\setchars\ relates to the pagenumber, the specification
in front of the entry relates to the entry itself.

\starttyping
\setupregister[index][form][pagestyle=bold,textstyle=slanted]
\stoptyping

Without any problems we can use different appearances
for pagenumber and entry.

\starttyping
\setupregister[index][nb][pagestyle=bold]
\setupregister[index][hm][pagestyle=slanted]
\stoptyping

With for example:

\starttyping
\index[nb::]{squareroot}
\index[hm::root]{$\srqt{2}$}
\stoptyping

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] 9+ messages in thread

* Re: Indexing macros
  2002-12-03 13:33   ` John Culleton
  2002-12-03 16:57     ` Hans Hagen
@ 2002-12-03 16:59     ` Hans Hagen
  2002-12-04 14:30     ` Gour
  2 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2002-12-03 16:59 UTC (permalink / raw)


At 01:33 PM 12/3/2002 +0000, you wrote:

>Makeindex will automatically collapse a page reference string. If
>three or more successive pages have the identical index item then
>"1,2,3" becomes "1-3" etc. Perhaps Context does this also.

yes, plus ranges

>Xindy will handle appendix references like "A-3" although these are
>becoming rarer.

this kind of prefixing is possible; also you can ask for registers per 
chapter, section, etc

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] 9+ messages in thread

* Re: Indexing macros
  2002-12-03 13:33   ` John Culleton
  2002-12-03 16:57     ` Hans Hagen
  2002-12-03 16:59     ` Hans Hagen
@ 2002-12-04 14:30     ` Gour
  2 siblings, 0 replies; 9+ messages in thread
From: Gour @ 2002-12-04 14:30 UTC (permalink / raw)
  Cc: Taco Hoekwater

John Culleton (john@wexfordpress.com) wrote:

> Perhaps as is so often the case, the features are there but not yet
> described in Context. A Context-only solution would be nice, but in
> the meantime the power of the existing packages are available. 

I agree that ConTeXt-only solution would be terrific since it will provide
better mechanism for extension & easier maintainance.

However, main reason why I had to switch to Xindy (over makeindex) was handling
of my national alphabet (Croatian) as well as ability to define my sort order -
for Sanskrit transliteration.

For example, here is the part of my xindy file which handled Sanskrit
diacritics for LaTeX:

(define-rule-set "resolve-sanskrit-diacritics"

   :rules  (("\\={(a)}" "\1" :bregexp :again)
            ("\\={\\i}" "i" :bregexp :again)
            ("\\={I}" "I" :bregexp :again)
            ("\\d{(r)}" "ri" :bregexp :again)
            ("\\d{(t)}" "\1" :bregexp :again)
            ("\\d{(T)}" "\1" :bregexp :again)
            ("\\d{(d)}" "\1" :bregexp :again)
            ("\\d{(n)}" "\1" :bregexp :again)
                 ...
            ))

This snippet just resolve sanskrit diacritics and sort them according to their
Latin (or Croatian) counterpart chars without accent.

It would be wonderful to be able to do such things with ConTeXt only.

Sincerely,
Gour

-- 
Gour
gour@mail.inet.hr
Registered Linux User #278493

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

* Re: Indexing macros
  2008-09-12 13:37   ` Aditya Mahajan
@ 2008-09-15 12:49     ` Alan BRASLAU
  0 siblings, 0 replies; 9+ messages in thread
From: Alan BRASLAU @ 2008-09-15 12:49 UTC (permalink / raw)
  To: ntg-context

On Tuesday 3 December 2002 17:57:00 Hans Hagen wrote:
> Copied from the manual source: 
...
> \index {form::entry}

The following minimal example works as expected:
\setupregister[index][au][textstyle=\sc]
\def\Index#1{\index{#1}#1}
\def\Author#1{\index{au::#1}#1}
\starttext
The \index[TeX]{\TeX}\TeX \Index{typesetting} system (\Author{Knuth})
\page
\completeindex
\stoptext

Within a large project using the above definitions, author entries in the index 
are typeset normally, not in \sc.
However, if I use
\setupregister[index][au][textstyle=boldslanted]
I do get bold-slanted entries in my large project. Have I misunderstood the 
use of setupregister, or is this a bug?
Thank you, in advance.

Alan

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2008-09-15 12:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-02 16:20 Indexing macros John Culleton
2002-12-02 16:41 ` Taco Hoekwater
2002-12-03 13:33   ` John Culleton
2002-12-03 16:57     ` Hans Hagen
2002-12-03 16:59     ` Hans Hagen
2002-12-04 14:30     ` Gour
2002-12-02 16:51 ` Hans Hagen
2002-12-03 14:18   ` John Culleton
2008-09-11 20:58 width of cell in TABLE Peter Münster
2008-09-12  8:27 ` span ROWS in \starttables? Alan BRASLAU
2008-09-12 13:37   ` Aditya Mahajan
2008-09-15 12:49     ` Indexing macros Alan BRASLAU

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