On 9/26/2013 12:16 PM, Philipp Gesang wrote:
···<date: 2013-09-24, Tuesday>···<from: Thangalin>···

Hi,

How do you prevent ConTeXt from hiding (collapsing?) duplicate level 2
index items?

For example:

       \startitem
         5 array \index{hedgehog+SECTION A}hedgehog
       \stopitem
       \startitem
         7 army \index{herring+SECTION A}herring
       \stopitem
       \startitem
         100 bloat \index{hippopotamuses+SECTION A}hippopotamuses
       \stopitem

The text "SECTION A" will only appear once in the index, right after
hedgehog. I would like it to appear once per index term, always.

Confirmed. The subentries aren’t shown if:

   - entries that share a subentry (level 2) are indexed
     consecutively, and

   - these entries are different but belong in the same register
     section (same initial letter)

Example:

     \starttext
       \placeindex

       \page

       \index{a+foo}        whatever %% shows up
       \index{aa+foo}       whatever %% doesn’t
       \index{aaa+foo}      whatever %% doesn’t
       \index{aaaa+bar}     whatever %% shows up
       \index{aaaaa+foo}    whatever %% shows up
       \index{aaaaaa+foo}   whatever %% doesn’t

     \stoptext

If you s/bar/foo/ in the fourth invocation of \index, only the
first entry (“a”) of the register will have the subentry “foo”.
Change the initial letters of each entry and all subentries are
printed.

can you run tests with (line 695 in strc-reg):

            for i=1,4 do -- max 4
                if list[i] then
                    e[i] = list[i][1]
                end
                if e[i] ~= done[i] then
                    if e[i] and e[i] ~= "" then
                        done[i] = e[i]
for j=i+1,4 do done[j] = false end
                        if n == i then
                            context.stopregisterentries()
                            context.startregisterentries(n)
                        else
                            while n > i do
                                n = n - 1
                                context.stopregisterentries()
                            end
                            while n < i do
                                n = n + 1
                                context.startregisterentries(n)
                            end
                        end
                        local internal  = entry.references.internal or 0
                        local seeparent = entry.references.seeparent or ""
local processor = entry.processors and entry.processors[1] or ""
                        if metadata then

context.registerentry(processor,internal,seeparent,function() helpers.title(e[i],metadata) end)
                        else -- ?

context.registerentry(processor,internal,seeindex,e[i])
                        end
                    else
                        done[i] = false
for j=i,4 do done[j] = false end
                    end
                end
            end

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

Reply via email to