ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Preparing a weird index.
@ 2014-04-05 19:42 john Culleton
  2014-04-05 21:09 ` Hans Hagen
  2014-06-26 14:17 ` Gour
  0 siblings, 2 replies; 10+ messages in thread
From: john Culleton @ 2014-04-05 19:42 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'


I have a customer that uses a publisher that has
truly weird requirements. The weirdness is
that the locaters are not page numbers but
paragraph numbers. And some paragraph numbers
start with the prefix 'BO' and others with the
chapter number.  so a correct sequence would be 
BO.15 3.2

A finished  sequence would be

goddess @@ BO.15 3.2 3.5

The sort order has to be letter by letter,
as defined in the Chicago Manual of Style.

Can Context sort and summarize these locaters?

I can even change the BO sequence to 0 (zero) and
then change it back later on. The key is can
Context sort by paragraph number rather than
page number for an index. 

I have looked into Xindy for this job but the
learning curve is pretty steep and the
documentation pretty opaque. makeindex won't
handle decimals for locators. I don't mind doing
a little reformatting along the way (I already
have for this project) but I don't want to
rewrite makeindex or xindy just for this
job. 



-- 
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
PDF e-book: "Create Book Covers with Scribus"
available at
http://www.booklocker.com/books/4055.html
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Preparing a weird index.
  2014-04-05 19:42 Preparing a weird index john Culleton
@ 2014-04-05 21:09 ` Hans Hagen
  2014-06-26 14:17 ` Gour
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2014-04-05 21:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/5/2014 9:42 PM, john Culleton wrote:
>
> I have a customer that uses a publisher that has
> truly weird requirements. The weirdness is
> that the locaters are not page numbers but
> paragraph numbers. And some paragraph numbers
> start with the prefix 'BO' and others with the
> chapter number.  so a correct sequence would be
> BO.15 3.2
>
> A finished  sequence would be
>
> goddess @@ BO.15 3.2 3.5
>
> The sort order has to be letter by letter,
> as defined in the Chicago Manual of Style.
>
> Can Context sort and summarize these locaters?

You can use the "BO.15 3.2 3.5" as subentry and it will probably be 
sorted all right; you can then disable page numbers. This kind of 
indexing happens in critical editions.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Preparing a weird index.
  2014-04-05 19:42 Preparing a weird index john Culleton
  2014-04-05 21:09 ` Hans Hagen
@ 2014-06-26 14:17 ` Gour
  2014-06-26 16:13   ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Gour @ 2014-06-26 14:17 UTC (permalink / raw)
  To: ntg-context

john Culleton <John@wexfordpress.com> writes:

Hello,

> I have looked into Xindy for this job but the learning curve is pretty
> steep and the documentation pretty opaque. makeindex won't handle
> decimals for locators.

in the past when working on some books with the
English/Croatian/Sanskrit(diacritics) using Xindy in companion with
LyX/LaTeX was the only option to ger proper sorting.

I was playing with the ConTeXt more than 10 years ago, but lack of
proper docs was always keeping me back from fully embracing it.

Today after checking (again) I see that there are even some printed
books and MkIV/LuaTeX seems to be quite stable, so I wonder about
ConTeXt's capabilities to generate index/glossary in regard to xindy
which is powerful, but I never really grokked it properly?

Other typesetting features of ConTeXt are certainly very tempting and
along with Emacs/AUCTeX everything looks as very pleasant typesetting
environment.

@John: I'm curios if you were able to prepare desired index *without*
makeindex/xindy?


Sincerely,
Gour

-- 

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Preparing a weird index.
  2014-06-26 14:17 ` Gour
@ 2014-06-26 16:13   ` Hans Hagen
  2014-06-27  5:42     ` Gour
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2014-06-26 16:13 UTC (permalink / raw)
  To: ntg-context

On 6/26/2014 4:17 PM, Gour wrote:

> Today after checking (again) I see that there are even some printed
> books and MkIV/LuaTeX seems to be quite stable, so I wonder about
> ConTeXt's capabilities to generate index/glossary in regard to xindy
> which is powerful, but I never really grokked it properly?

i don't know xindy but normally the context mkiv index mechanism is 
flexible enough (and it can be configured)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Preparing a weird index.
  2014-06-26 16:13   ` Hans Hagen
@ 2014-06-27  5:42     ` Gour
  2014-06-27  7:32       ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Gour @ 2014-06-27  5:42 UTC (permalink / raw)
  To: ntg-context

Hans Hagen <pragma@wxs.nl> writes:

> i don't know xindy but normally the context mkiv index mechanism is
> flexible enough (and it can be configured)

Here are some snippets from my old xindy setup...

;; define order of sorting runs
(use-rule-set :run 0
              :rule-set ("resolve-sanskrit-diacritics" "hr-alphabetize" 
              "hr-ignore-special"))
(use-rule-set :run 1
              :rule-set ("hr-resolve-diacritics" "hr-ignore-special"))
(use-rule-set :run 2
              :rule-set ("hr-resolve-case" "hr-ignore-special"))
(use-rule-set :run 3
              :rule-set ("hr-resolve-special"))

which says that the sorting should be done in the following order: first
rules for sanskrit diacriticits, then alphabetic sort of Croatian (hr)
characters etc. followed by another set of rules saying to sort Croatian
diacritics (I was using latin2 encoding) etc.

Here is example of resolve-sanskrit-diacritics:

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

   :rules  (("\\={(a)}" "\1" :bregexp :again)
            ("\\={\\i}" "i" :bregexp :again)
            ("\\={I}" "I" :bregexp :again)
            ("\\\.{(.)}" "\1" :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)
            ("\\d{(s)}" "š" :bregexp :again)
            ("\\d{(S)}" "Š" :bregexp :again)
            ("\\~{(.)}" "\1" :bregexp :again)
            ("\\'{(c)}" "ć" :bregexp :again)
            ("\\'{(C)}" "Ć." :bregexp :again)
            ("\\'{(s)}" "š" :bregexp :again)
            ("\\'{(S)}" "Š" :bregexp :again)
            ))

which says that e.g. 'ṣ' which is pronounced similar to Croatian 'š'
should go in the same letter-group, same with 'Ś' which goes to 'Š'. 'ṛ'
is pronounced as 'ri' and it should goes in the letter group 'ri' etc.

Of course, at that time, without proper Unicode support, it was a bit
cumbersome but I was able to see everything properly in LyX as well as
properly sorted in the final PDF/PS outputs.

Is something like that possible in ConTeXt?


Sincerely,
Gour

-- 
The working senses are superior to dull matter; mind is higher 
than the senses; intelligence is still higher than the mind; 
and he [the soul] is even higher than the intelligence.

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Preparing a weird index.
  2014-06-27  5:42     ` Gour
@ 2014-06-27  7:32       ` Hans Hagen
  2014-06-27  8:05         ` Gour
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2014-06-27  7:32 UTC (permalink / raw)
  To: ntg-context

On 6/27/2014 7:42 AM, Gour wrote:
> Hans Hagen <pragma@wxs.nl> writes:
>
>> i don't know xindy but normally the context mkiv index mechanism is
>> flexible enough (and it can be configured)
>
> Here are some snippets from my old xindy setup...
>
> ;; define order of sorting runs
> (use-rule-set :run 0
>                :rule-set ("resolve-sanskrit-diacritics" "hr-alphabetize"
>                "hr-ignore-special"))
> (use-rule-set :run 1
>                :rule-set ("hr-resolve-diacritics" "hr-ignore-special"))
> (use-rule-set :run 2
>                :rule-set ("hr-resolve-case" "hr-ignore-special"))
> (use-rule-set :run 3
>                :rule-set ("hr-resolve-special"))
>
> which says that the sorting should be done in the following order: first
> rules for sanskrit diacriticits, then alphabetic sort of Croatian (hr)
> characters etc. followed by another set of rules saying to sort Croatian
> diacritics (I was using latin2 encoding) etc.
>
> Here is example of resolve-sanskrit-diacritics:
>
> (define-rule-set "resolve-sanskrit-diacritics"
>
>     :rules  (("\\={(a)}" "\1" :bregexp :again)
>              ("\\={\\i}" "i" :bregexp :again)
>              ("\\={I}" "I" :bregexp :again)
>              ("\\\.{(.)}" "\1" :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)
>              ("\\d{(s)}" "š" :bregexp :again)
>              ("\\d{(S)}" "Š" :bregexp :again)
>              ("\\~{(.)}" "\1" :bregexp :again)
>              ("\\'{(c)}" "ć" :bregexp :again)
>              ("\\'{(C)}" "Ć." :bregexp :again)
>              ("\\'{(s)}" "š" :bregexp :again)
>              ("\\'{(S)}" "Š" :bregexp :again)
>              ))
>
> which says that e.g. 'ṣ' which is pronounced similar to Croatian 'š'
> should go in the same letter-group, same with 'Ś' which goes to 'Š'. 'ṛ'
> is pronounced as 'ri' and it should goes in the letter group 'ri' etc.
>
> Of course, at that time, without proper Unicode support, it was a bit
> cumbersome but I was able to see everything properly in LyX as well as
> properly sorted in the final PDF/PS outputs.
>
> Is something like that possible in ConTeXt?

See sort-lan.lua ... you could define a pseudo-language for this and use 
that one for sorting. The actual sorting is driven by a sequence of 
steps that (can) involve uppercase, lowercase, shape, unicode, specific 
order etc.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Preparing a weird index.
  2014-06-27  7:32       ` Hans Hagen
@ 2014-06-27  8:05         ` Gour
  2014-06-27  8:09           ` Wolfgang Schuster
  2014-06-27  8:11           ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Gour @ 2014-06-27  8:05 UTC (permalink / raw)
  To: ntg-context

Hans Hagen <pragma@wxs.nl> writes:

> See sort-lan.lua ... you could define a pseudo-language for this and
> use that one for sorting. The actual sorting is driven by a sequence
> of steps that (can) involve uppercase, lowercase, shape, unicode,
> specific order etc.

It looks very good. Congratulations?

Does it mean I can e.g. still use 'hr' as main language for writing and
then use my pseudo language *just* for sorting purposes?


Sincerely,
Gour

-- 
There is no possibility of one's becoming a yogī, O Arjuna, 
if one eats too much or eats too little, sleeps too much 
or does not sleep enough.

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Preparing a weird index.
  2014-06-27  8:05         ` Gour
@ 2014-06-27  8:09           ` Wolfgang Schuster
  2014-06-27 10:15             ` Gour
  2014-06-27  8:11           ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2014-06-27  8:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 27.06.2014 um 10:05 schrieb Gour <gour@atmarama.net>:

> Hans Hagen <pragma@wxs.nl> writes:
> 
>> See sort-lan.lua ... you could define a pseudo-language for this and
>> use that one for sorting. The actual sorting is driven by a sequence
>> of steps that (can) involve uppercase, lowercase, shape, unicode,
>> specific order etc.
> 
> It looks very good. Congratulations?
> 
> Does it mean I can e.g. still use 'hr' as main language for writing and
> then use my pseudo language *just* for sorting purposes?

Yes, the register mechanism provides a language key where you can
specify the language which is used for the sorting of the entries.

Wolfgang
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Preparing a weird index.
  2014-06-27  8:05         ` Gour
  2014-06-27  8:09           ` Wolfgang Schuster
@ 2014-06-27  8:11           ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2014-06-27  8:11 UTC (permalink / raw)
  To: ntg-context

On 6/27/2014 10:05 AM, Gour wrote:
> Hans Hagen <pragma@wxs.nl> writes:
>
>> See sort-lan.lua ... you could define a pseudo-language for this and
>> use that one for sorting. The actual sorting is driven by a sequence
>> of steps that (can) involve uppercase, lowercase, shape, unicode,
>> specific order etc.
>
> It looks very good. Congratulations?
>
> Does it mean I can e.g. still use 'hr' as main language for writing and
> then use my pseudo language *just* for sorting purposes?

yes


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Preparing a weird index.
  2014-06-27  8:09           ` Wolfgang Schuster
@ 2014-06-27 10:15             ` Gour
  0 siblings, 0 replies; 10+ messages in thread
From: Gour @ 2014-06-27 10:15 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <schuster.wolfgang@gmail.com> writes:

> Yes, the register mechanism provides a language key where you can
> specify the language which is used for the sorting of the entries.

Excellent!!

It's time to dive into ConTeXt again...

Sincerely,
Gour

-- 
One must deliver himself with the help of his mind, and not 
degrade himself. The mind is the friend of the conditioned soul, 
and his enemy as well.

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2014-06-27 10:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-05 19:42 Preparing a weird index john Culleton
2014-04-05 21:09 ` Hans Hagen
2014-06-26 14:17 ` Gour
2014-06-26 16:13   ` Hans Hagen
2014-06-27  5:42     ` Gour
2014-06-27  7:32       ` Hans Hagen
2014-06-27  8:05         ` Gour
2014-06-27  8:09           ` Wolfgang Schuster
2014-06-27 10:15             ` Gour
2014-06-27  8:11           ` Hans Hagen

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