From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/112613 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Indexing redux Date: Thu, 26 Aug 2021 16:46:23 -0400 Message-ID: <338559e1-98ac-3ccd-3409-e6744656119a@rik.users.panix.com> References: <5193d8e1-c07e-a2f8-b5c4-9e2cb5a1276d@rik.users.panix.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0533417643234709237==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34452"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.0 Cc: Rik Kabel To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 26 22:47:06 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJMHB-0008dJ-Ee for gctc-ntg-context-518@m.gmane-mx.org; Thu, 26 Aug 2021 22:47:05 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 10C2B286D43; Thu, 26 Aug 2021 22:46:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ru3TtD7tgBW1; Thu, 26 Aug 2021 22:46:32 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 25D3E286D48; Thu, 26 Aug 2021 22:46:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 72ACE286D43 for ; Thu, 26 Aug 2021 22:46:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f879CbHy9wdV for ; Thu, 26 Aug 2021 22:46:27 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=166.84.1.89; helo=mailbackend.panix.com; envelope-from=context@rik.users.panix.com; receiver= Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 401C32836DC for ; Thu, 26 Aug 2021 22:46:26 +0200 (CEST) Original-Received: from [192.168.1.106] (cpe-69-204-136-231.nycap.res.rr.com [69.204.136.231]) by mailbackend.panix.com (Postfix) with UTF8SMTPSA id 4GwZdC4VHyz3yK0 for ; Thu, 26 Aug 2021 16:46:23 -0400 (EDT) Content-Language: en-US In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:112613 Archived-At: This is a multi-part message in MIME format. --===============0533417643234709237== Content-Type: multipart/alternative; boundary="------------5ERrvWs9L0jtlNfzJzQbagOu" Content-Language: en-US This is a multi-part message in MIME format. --------------5ERrvWs9L0jtlNfzJzQbagOu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8/26/2021 03:26, Taco Hoekwater wrote: > Hi Rik, > >> On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context wrote: >> >> List, >> >> I am trying to create an index with both "see" and "see also" cross-reference entries.[1] At this point, ConTeXt provides basic support for "see" entries via the \seeREGISTER command (it does not properly support references to sub-entries) and it provides no support at all for "see also" entries. >> >> Can somebody suggest a way to generate these entries? Perhaps a way of inserting entries into the index before it is formatted, in the manner of \writetolist or \writebetweenlist? (MkII has \writetoregister, but that did not carry forward and I do not know if it would have helped here.) > > Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best bet is to create an > actual functional example along with an explanation of what you want the typeset result to look > like in the cases where it is not doing what you want. > > Generally, explicit examples / test files are the best way to get replies to questions > (either by Hans or anyone else). The following produces what I am looking for, and a bit more. Page 3 of the output shows what I would like to see, page 4 is the generated index. I don't really need the "see under" and "see also under" variants, but they would be nice to have. I am indifferent to having stops before "see also"s. I would like to be able to turn checking on or off, so that generic directives (in the example, see also specific breeds) will not generate an error, while the Ford Prefect example will generate an error.    \defineprocessor[also][color=blue]    \defineprocessor[under][color=green]    \defineprocessor[alsounder][color=orange]    \define\seealsoindex\seeindex    \define\seealsounderindex\seeindex    \define\seeunderindex\seeindex    \setupinteraction [state=start]    \setupregister    [index][balance=no,check=no] %% seeindex entries may start on the same line as their head entry    \seeindex         {dog breeds+Wiener dog}{dog breeds+Dachshund} %%  The next example should not work, %%    since there is no main entry /Adams, Douglas/    \seeindex         {Prefect, Ford}{Adams, Douglas} %%  When referring to a subentry, the target must be a subentry, %%    but should display as if a main entry. The next example %%    should point to the /Adams+Douglas/ subentry, but it %%    should be formatted as if it were /Adams, Douglas/    \seeindex         {Dent, Arthur}{Adams+Douglas} %% The following two work as expected    \seeindex         {Matilda effect}{obliteration}    \seeindex         {Marut, Ret}{Traven, B.} %% seealso should be placed after as a subentry after real page references %% seealso should have an appropriate label (default English /see also/)    \seealsoindex     {pseudepigraphy}{also->obliteration}    \seealsoindex     {dog breeds}{also->breeding programs}    \seealsoindex     {dog breeds}{also->specific breeds} %% seealsounder is like seealso except that it refers to a main entry    \seealsounderindex{Coton de Tulear}{alsounder->dog breeds} %% seeunder also is like seealso except that it refers to a main entry    \seeunderindex    {Weimaraner}{under->dog breeds}    \starttext      Stuff      \index{obliteration}      \index{Adams+Douglas}\index{Adams+John}      \index{Beagle}      \index{dog breeds+Beagle}      \index{dog breeds+Coton de Tulear}      \index{dog breeds+Dachshund}      \index{dog breeds+Weimaraner}    \page      More stuff      \index{Adams+John Quincy}      \index{misquotation}      \index{pseudepigraphy}      \index{Traven, B.}      \index{Beagle}      \index{Coton de Tulear}      \index{breeding programs}    \page \definedescription[Index][headstyle=bold,alternative=top,inbetween=]    \startIndex{a}      Adams\par      \quad \reference[AdamsDouglas]{Adams, Douglas}Douglas\quad 1\par      \quad John\quad 1\par      \quad John Quincy\quad 2\par    \stopIndex    \startIndex{b}      Beagle\quad 1, 2\par      \reference[breedingprograms]{breeding programs}breeding programs\quad 2    \stopIndex    \startIndex{c}      Coton de Tulear\quad 2.\par      \quad {\em See also under} \in[dogbreeds]    \stopIndex    \startIndex{d}      \reference[DentArthur]{Dent, Arthur}Dent, Arthur {\em see} \in[AdamsDouglas]\par      \reference[dogbreeds]{dog breeds}dog breeds\par      \quad \reference[dbBeagle]{dog breeds, Beagle}Beagle\quad 1\par      \quad \reference[dbCoton]{dog breeds, Coton}Coton de Tulear\quad 1\par      \quad \reference[dbDachshund]{dog breeds, Dachshund}Dachshund\quad 1\par      \quad \reference[dbWeimaraner]{dog breeds, Weimaraner}Weimaraner\quad 1\par      \quad Wiener dog\quad {\em see} \in[dbDachshund]\par      \quad{\em See also} \in[breedingprograms] {\em and specific breeds}    \stopIndex    \startIndex{m}      Marut, Ret\quad {\em see} \in[TravenB]\par      Matilda effect\quad {\em see} \in[obliteration]\par      \reference[misquotation]{misquotation}misquotation\quad 2    \stopIndex    \startIndex{o}      \reference[obliteration]{obliteration}obliteration\quad 1\par      \quad{\em See also} \in[misquotation] {\em and} \in[pseudepigraphy]    \stopIndex    \startIndex{p}      Prefect, Ford\quad {\em see Adams, Douglas}\par \reference[pseudepigraphy]{pseudepigraphy}pseudepigraphy\quad 2\par      \quad {\em See also} \in[obliteration]    \stopIndex    \startIndex{t}      \reference[TravenB]{Traven, B.}Traven, B.\quad 2    \stopIndex    \startIndex{w}      Weimaraner\quad {\em see under} \in[dogbreeds]    \stopIndex    \page    \placeindex    \stoptext -- Rik --------------5ERrvWs9L0jtlNfzJzQbagOu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 8/26/2021 03:26, Taco Hoekwater wrote:
Hi Rik,

On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context <ntg-context@ntg.nl> wrote:

List,

I am trying to create an index with both "see" and "see also" cross-reference entries.[1] At this point, ConTeXt provides basic support for "see" entries via the \seeREGISTER command (it does not properly support references to sub-entries) and it provides no support at all for "see also" entries.

Can somebody suggest a way to generate these entries? Perhaps a way of inserting entries into the index before it is formatted, in the     manner of \writetolist or \writebetweenlist? (MkII has \writetoregister, but that did not carry forward and I do not know if it would have helped here.)

Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best bet is to create an
actual functional example along with an explanation of what you want the typeset result to look 
like in the cases where it is not doing what you want.

Generally, explicit examples / test files are the best way to get replies to questions 
(either by Hans or anyone else).

The following produces what I am looking for, and a bit more. Page 3 of the output shows what I would like to see, page 4 is the generated index. I don't really need the "see under" and "see also under" variants, but they would be nice to have. I am indifferent to having stops before "see also"s. I would like to be able to turn checking on or off, so that generic directives (in the example, see also specific breeds) will not generate an error, while the Ford Prefect example will generate an error.


   \defineprocessor[also][color=blue]
   \defineprocessor[under][color=green]
   \defineprocessor[alsounder][color=orange]
   \define\seealsoindex\seeindex
   \define\seealsounderindex\seeindex
   \define\seeunderindex\seeindex
   \setupinteraction [state=start]
   \setupregister    [index][balance=no,check=no]

%% seeindex entries may start on the same line as their head entry
   \seeindex         {dog breeds+Wiener dog}{dog breeds+Dachshund}
%%  The next example should not work,
%%    since there is no main entry /Adams, Douglas/
   \seeindex         {Prefect, Ford}{Adams, Douglas}

%%  When referring to a subentry, the target must be a subentry,
%%    but should display as if a main entry. The next example
%%    should point to the /Adams+Douglas/ subentry, but it
%%    should be formatted as if it were /Adams, Douglas/
   \seeindex         {Dent, Arthur}{Adams+Douglas}

%% The following two work as expected
   \seeindex         {Matilda effect}{obliteration}
   \seeindex         {Marut, Ret}{Traven, B.}

%% seealso should be placed after as a subentry after real page references
%% seealso should have an appropriate label (default English /see also/)
   \seealsoindex     {pseudepigraphy}{also->obliteration}
   \seealsoindex     {dog breeds}{also->breeding programs}
   \seealsoindex     {dog breeds}{also->specific breeds}
%% seealsounder is like seealso except that it refers to a main entry
   \seealsounderindex{Coton de Tulear}{alsounder->dog breeds}
%% seeunder also is like seealso except that it refers to a main entry
   \seeunderindex    {Weimaraner}{under->dog breeds}
   \starttext
     Stuff
     \index{obliteration}
     \index{Adams+Douglas}\index{Adams+John}
     \index{Beagle}
     \index{dog breeds+Beagle}
     \index{dog breeds+Coton de Tulear}
     \index{dog breeds+Dachshund}
     \index{dog breeds+Weimaraner}
   \page
     More stuff
     \index{Adams+John Quincy}
     \index{misquotation}
     \index{pseudepigraphy}
     \index{Traven, B.}
     \index{Beagle}
     \index{Coton de Tulear}
     \index{breeding programs}
   \page
   \definedescription[Index][headstyle=bold,alternative=top,inbetween=]
   \startIndex{a}
     Adams\par
     \quad \reference[AdamsDouglas]{Adams, Douglas}Douglas\quad 1\par
     \quad John\quad 1\par
     \quad John Quincy\quad 2\par
   \stopIndex
   \startIndex{b}
     Beagle\quad 1, 2\par
     \reference[breedingprograms]{breeding programs}breeding programs\quad 2
   \stopIndex
   \startIndex{c}
     Coton de Tulear\quad 2.\par
     \quad {\em See also under} \in[dogbreeds]
   \stopIndex
   \startIndex{d}
     \reference[DentArthur]{Dent, Arthur}Dent, Arthur {\em see} \in[AdamsDouglas]\par
     \reference[dogbreeds]{dog breeds}dog breeds\par
     \quad \reference[dbBeagle]{dog breeds, Beagle}Beagle\quad 1\par
     \quad \reference[dbCoton]{dog breeds, Coton}Coton de Tulear\quad 1\par
     \quad \reference[dbDachshund]{dog breeds, Dachshund}Dachshund\quad 1\par
     \quad \reference[dbWeimaraner]{dog breeds, Weimaraner}Weimaraner\quad 1\par
     \quad Wiener dog\quad {\em see} \in[dbDachshund]\par
     \quad{\em See also} \in[breedingprograms] {\em and specific breeds}
   \stopIndex
   \startIndex{m}
     Marut, Ret\quad {\em see} \in[TravenB]\par
     Matilda effect\quad {\em see} \in[obliteration]\par
     \reference[misquotation]{misquotation}misquotation\quad 2
   \stopIndex
   \startIndex{o}
     \reference[obliteration]{obliteration}obliteration\quad 1\par
     \quad{\em See also} \in[misquotation] {\em and} \in[pseudepigraphy]
   \stopIndex
   \startIndex{p}
     Prefect, Ford\quad {\em see Adams, Douglas}\par
     \reference[pseudepigraphy]{pseudepigraphy}pseudepigraphy\quad 2\par
     \quad {\em See also} \in[obliteration]
   \stopIndex
   \startIndex{t}
     \reference[TravenB]{Traven, B.}Traven, B.\quad 2
   \stopIndex
   \startIndex{w}
     Weimaraner\quad {\em see under} \in[dogbreeds]
   \stopIndex
   \page
   \placeindex
   \stoptext

--
Rik


    
--------------5ERrvWs9L0jtlNfzJzQbagOu-- --===============0533417643234709237== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============0533417643234709237==--