From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114334 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: sorting for particular sub entries to register Date: Tue, 1 Feb 2022 08:49:04 +0100 Message-ID: <7898B757-2A47-45B8-9B52-BC36BEB231D5@hccnet.nl> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Content-Type: multipart/mixed; boundary="===============6964281756710263397==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25756"; mail-complaints-to="usenet@ciao.gmane.io" Cc: r.ermers@hccnet.nl To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 01 08:50:06 2022 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 1nEnvQ-0006U0-Ne for gctc-ntg-context-518@m.gmane-mx.org; Tue, 01 Feb 2022 08:50:04 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2467628969F; Tue, 1 Feb 2022 08:49:26 +0100 (CET) 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 lSdbVdi70tgY; Tue, 1 Feb 2022 08:49:24 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 61DBB28981F; Tue, 1 Feb 2022 08:49:24 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8609228981C for ; Tue, 1 Feb 2022 08:49:23 +0100 (CET) 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 G91ta43ohq3e for ; Tue, 1 Feb 2022 08:49:22 +0100 (CET) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=136.144.141.120; helo=mailhost-2.trined.nl; envelope-from=r.ermers@hccnet.nl; receiver= Original-Received: from mailhost-2.trined.nl (mailhost-2.trined.nl [136.144.141.120]) (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 825FC28969F for ; Tue, 1 Feb 2022 08:49:22 +0100 (CET) Original-Received: from 54f72c4f.static.cust.trined.nl ([84.247.44.79] helo=smtpclient.apple) by mailhost-2.trined.nl with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1nEnuW-0001pa-9A for ntg-context@ntg.nl; Tue, 01 Feb 2022 08:49:21 +0100 In-Reply-To: X-Mailer: Apple Mail (2.3693.20.0.1.32) X-Originating-IP: 84.247.44.79 X-SpamExperts-Domain: smtp.trined.nl X-SpamExperts-Username: 84.247.44.0/24 Authentication-Results: trined.nl; auth=pass smtp.auth=84.247.44.0/24@smtp.trined.nl X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.15) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT9IQcjfJI899NL/Wnd7P9jjPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5x+OkQ6e4TPVgvpcS1fNw4ZIpdOJ9Sgfu6rKL8kf6cp2Usg ETlmxQBg8HWNoAor11zilbHtbFYVmmyNP/jzd7CCzPgfBgZM0FjuQW6Y55dUiQZmnW/XN+tohdLu D74c7RLRwSz+KoVDJomgp3t9YQAlg8CBO1Snvm6qXHQp7O9kdejwy6tqX7daHqVkW9zuWkUn7LC9 J8c3gjsOXYKkdHbemTmYf9felIf8Q0lvYJANyxFoCiCewMtEVSapQNNxh8ezmytOdv4y7nsDnCOW pjMbPbitB7379e1yUs5NUxGr1bvatWWiSP0Jxll7g1bGZi2aqyJlyjykBDQv+3Yemh1sLOkwtWIz KiIdsC+f8eLjTuZE7YJwhBWCb1PmFojBOyjXs2KsRjKrCowEavDwQuKoCEa4Q9+3mFxDHE9LF+GB ikv2MsRAA7r/2aLNaRjQnGQnWgAofHWoeO84ZebpAH6aTplPMI8qwV+3DFuSDk5MQkFJkPEV0x2O FYpBGzXLrfgPApLgXVUwTJroWzNXj2p0sGVZjUy4CrXi8bPpFDvZKicuWbZ/PrJydf8Nu2dAN1IH mFDqewO9xyOqCYO8P1aHu7q8vKF5p2QONf08HUkfSfw9/HuR38fJI7ezMZ0ZheMSZfHNHNEAA7iv ceJEhE+r54J3/IEmnLaMFNkKblNtgLPPjWeEL+aQ/CIdUShTEqcn4pfRJSK0PqjjKw5ydlIvxPO/ zcN8+QqzJCgSgEZPo45a/avZk02g/ X-Report-Abuse-To: spam@mailhost-1.trined.nl 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:114334 Archived-At: --===============6964281756710263397== Content-Type: multipart/alternative; boundary="Apple-Mail=_251B43A8-E953-43AD-B5C7-E37A1453324B" --Apple-Mail=_251B43A8-E953-43AD-B5C7-E37A1453324B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Julian, Another solution could be to use Lua. I have a multilingual document in which some elements to be printed bold = (Language 1), and collected in an index (trk) arranged according their = (verbal) stems. Elements from Language 2 are to be printed in italics in = the text and collected in a separate index. In the present example the morphemes from Language 2 are separated by = ::, the verbal stem ends in -. In \\textbf the input is reproduced as is. Then interesting things = happen in the index (trk). The first element (until the first ::) is taken as an main entry in the = index (hence !). Then the complete input is retained as the secondary = entry. Note that in the index - separates the morphemes. I use LuaLatex, but I am quite sure this is also possible in Context. It is quite complex, but it works. Robert \newcommand{\TWI}[1]{\directlua{twi_help(\luastring{#1})}} \begin{luacode} function twi_help ( s ) s =3D unicode.utf8.gsub (s, = '^([^:]+)::([^:]+)::([^:]+)::([^:]+)::([^:]+)$' , = '\\textbf{%1::%2::%3%::%4::%5}\\sindex%[trk%]{%#%1!%1%-%2%-%3%-%4-%5}=E2=80= =99 ) s =3D unicode.utf8.gsub =E2=80=A6 other action \end{luacode} \begin{document} text text text text \TWI{d=C4=AB-::d=C5=AB::kin::dah} text text text = text text=20 \end{document} > Op 1 feb. 2022, om 01:41 heeft jbf via ntg-context = het volgende geschreven: >=20 > Yes, Adam, that works. Though it can be a laborious solution, since it = means creating keys for everything in a sub entry list (and I have many = instances, 40 or more in some cases). However, I did not ask for a = 'simple' solution, just a solution! Thank you. >=20 > Julian >=20 > On 1/2/22 11:09, Adam Reviczky wrote: >> Hi Julian, >>=20 >> How about using the keys in every instance? >>=20 >> \setupregister[index][n=3D1,method=3D{zc,pc,zm,pm,uc},style=3DWORD] >> \defineprocessor[special][style=3Ditalic] >>=20 >> \starttext >> P\index[Plenary+periti]{Plenary Council+{\it periti} (experts)} >> B\index[Plenary+beriti]{Plenary Council+{\it beriti} (experts)} >> A\index[Plenary+aeriti]{Plenary Council+aeriti (experts)} >>=20 >> S\index[animals+special]{animals+=E2=80=98special kinds=E2=80=99} >> B\index[animals+bpecial]{animals+bpecial} >> A\index[animals+apecial]{animals+=E2=80=98apecial=E2=80=99} >> U\index[animals+upecial]{animals+=E2=80=98upecial=E2=80=99} >> T\index[animals+tpecial]{animals+tpecial} >>=20 >> \placeindex >> \stoptext >>=20 >> See result in: = https://live.contextgarden.net/cgi-bin/result.cgi?id=3Dj46XhZ = >>=20 >> Adam >>=20 >> On Mon, Jan 31, 2022 at 10:38 PM jbf via ntg-context = > wrote: >> Let me come back to the unresolved (for me) question of two = situations in sub entries to a book index (register). Sub entries that = have formatting or sub entries that are surrounded by quote marks = (straight or curly, it makes no difference) do not appear in the correct = alphabetical order. >>=20 >> Two attempts on my part: >>=20 >> text before \index[Plenary+periti]{Plenary Council+{\it periti} = (experts)} text after. >>=20 >> text before \index{animals+=E2=80=98special kinds=E2=80=99} text = after. Or alternatively, \index[animals+special]{animals+=E2=80=98special = kinds=E2=80=99} >>=20 >> The setup for my register is a pretty standard one. The processor is = not for the 'periti' case above but I use it for book titles. >>=20 >> \setupregister[index][n=3D1,method=3D{zc,pc,zm,pm,uc},style=3DWORD] >> \defineprocessor[special][style=3Ditalic] >> In the periti case it is the \it command that clearly interferes with = correct alphabetic positioning in the sub entry list. Placing +periti in = the key does not overcome that problem. >>=20 >> In the =E2=80=98special kinds=E2=80=99 case it is the initial single = quote mark (=E2=80=98) that causes the problem. The item comes last in = the sub entry list. And if i include a key [special], then it comes = first in the sub entry list. Either way, it is out of the desired = sorting order. >>=20 >> I believe I have followed the helpful suggestions of various ones, = but it is always possible that I have not fully understood those = suggestions. The reality is that at the moment the issue remains = unresolved for me. Any further wisdom out there to offer me? >>=20 >> Julian >>=20 >> = __________________________________________________________________________= _________ >> If your question is of interest to others as well, please add an = entry to the Wiki! >>=20 >> maillist : ntg-context@ntg.nl / = http://www.ntg.nl/mailman/listinfo/ntg-context = >> webpage : http://www.pragma-ade.nl / = http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ = >> wiki : http://contextgarden.net >> = __________________________________________________________________________= _________ > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / = http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > = __________________________________________________________________________= _________ --Apple-Mail=_251B43A8-E953-43AD-B5C7-E37A1453324B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hi Julian,

Another solution could be to use Lua.

I have a multilingual document in which = some elements to be printed bold (Language 1), and collected in an index = (trk) arranged according their (verbal) stems. Elements from Language 2 = are to be printed in italics in the text and collected in a separate = index.

In the = present example the morphemes from Language 2 are separated by ::, the = verbal stem ends in -.

In \\textbf the input is reproduced as is. Then interesting = things happen in the index (trk).

The first element (until the first ::) = is taken as an main entry in the index (hence !). Then the complete = input is retained as the secondary entry. Note that in the index - = separates the morphemes.

I use LuaLatex, but I am quite sure this is also possible in = Context.

It is quite complex, but it works.

Robert


\newcommand{\TWI}[1]{\directlua{twi_help(\luastring{#1})}}

\begin{luacode}
function twi_help ( s = )
   s =3D unicode.utf8.gsub (s, = '^([^:]+)::([^:]+)::([^:]+)::([^:]+)::([^:]+)$' , = '\\textbf{%1::%2::%3%::%4::%5}\\sindex%[trk%]{%#%1!%1%-%2%-%3%-%4-%5}=E2=80= =99 )

  s = =3D unicode.utf8.gsub =E2=80=A6 other action

\end{luacode}

\begin{document}
text text text text = \TWI{d=C4=AB-::d=C5=AB::kin::dah} text text text text = text 

\end{document}



Op 1 feb. 2022, om 01:41 heeft = jbf via ntg-context <ntg-context@ntg.nl> het volgende geschreven:

=20 =20

Yes, Adam, that works. Though it can be = a laborious solution, since it means creating keys for everything in a sub entry list (and I have many instances, 40 or more in some cases). However, I did not ask for a 'simple' solution, just a solution! Thank = you.

Julian

On 1/2/22 11:09, Adam Reviczky = wrote:
Hi Julian,

How about using the keys in every = instance?

\setupregister[index][n=3D1,method=3D{zc,pc,zm,pm,uc},style=3DW= ORD]
\defineprocessor[special][style=3Ditalic]

\starttext
P\index[Plenary+periti]{Plenary Council+{\it periti} (experts)}
B\index[Plenary+beriti]{Plenary Council+{\it beriti} (experts)}
A\index[Plenary+aeriti]{Plenary Council+aeriti (experts)}

S\index[animals+special]{animals+=E2=80=98special kinds=E2=80=99= }
B\index[animals+bpecial]{animals+bpecial}
A\index[animals+apecial]{animals+=E2=80=98apecial=E2=80=99}
U\index[animals+upecial]{animals+=E2=80=98upecial=E2=80=99}
T\index[animals+tpecial]{animals+tpecial}

\placeindex
\stoptext


Adam

On Mon, Jan 31, 2022 at = 10:38 PM jbf via ntg-context <ntg-context@ntg.nl> wrote:

Let me come back to the = unresolved (for me) question of two situations in sub entries to a book index (register). Sub entries that have formatting or sub entries that are surrounded by quote marks (straight or curly, it makes no difference) do not appear in the correct alphabetical order.

Two attempts on my part:

text before \index[Plenary+periti]{Plenary Council+{\it periti} (experts)} text after.

text = before \index{animals+=E2=80=98special kinds=E2=80=99} text after. Or alternatively, = \index[animals+special]{animals+=E2=80=98special kinds=E2=80=99}

The setup for my register = is a pretty standard one. The processor is not for the 'periti' case above but I use it for book titles.

\setupregister[index][n=3D1,method=3D{zc,pc,zm,pm,uc},style=3DWORD]
\defineprocessor[special][style=3Ditalic]

In the periti case it is the \it command that clearly interferes with correct alphabetic positioning in the sub entry list. Placing +periti in the key does not overcome that problem.

In the =E2=80=98special = kinds=E2=80=99 case it is the initial single quote mark (=E2=80=98) that causes the problem. The item = comes last in the sub entry list. And if i include a key [special], then it comes first in the sub entry list. Either way, it is out of the desired sorting order.

I believe I have followed the helpful suggestions of various ones, but it is always possible that I have not fully understood those suggestions. The reality is that at the moment the issue remains unresolved for me. Any further wisdom out there to offer me?

Julian

= __________________________________________________________________________= _________
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-con= text
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/c= ommits/
wiki     : http://contextgarden.net
= __________________________________________________________________________= _________
= __________________________________________________________________________= _________
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://context.aanhet.net
archive  : = https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
_______________________________________________________________= ____________________

= --Apple-Mail=_251B43A8-E953-43AD-B5C7-E37A1453324B-- --===============6964281756710263397== 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== --===============6964281756710263397==--