From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Repeat second-level registers within index
Date: Fri, 27 Sep 2013 20:18:16 +0200 [thread overview]
Message-ID: <5245CBE8.6050809@wxs.nl> (raw)
In-Reply-To: <20130926101657.GA10697@phlegethon>
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
___________________________________________________________________________________
next prev parent reply other threads:[~2013-09-27 18:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 3:59 Thangalin
2013-09-26 10:16 ` Philipp Gesang
2013-09-27 18:18 ` Hans Hagen [this message]
2013-09-27 22:22 ` Thangalin
2013-09-27 22:34 ` Aditya Mahajan
2013-09-27 23:17 ` Thangalin
2013-09-27 22:27 ` Thangalin
2013-09-29 8:05 ` Hans Hagen
2013-09-29 17:25 ` Thangalin
2013-10-07 19:25 ` mathew
2013-10-08 18:39 ` mathew
2013-10-08 19:57 ` Hans Hagen
2013-10-08 22:34 ` mathew
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5245CBE8.6050809@wxs.nl \
--to=pragma@wxs.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).