From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110249 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: Re: styling part of an index entry Date: Thu, 7 Jan 2021 20:19:45 -0500 Message-ID: References: <4eb8b297-a330-9511-112e-8e9e960e11a9@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7884066112389553740==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14251"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mailing list for ConTeXt users To: jbf Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 08 02:20:25 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 1kxgS1-0003bw-3n for gctc-ntg-context-518@m.gmane-mx.org; Fri, 08 Jan 2021 02:20:25 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 47A9A1C1998; Fri, 8 Jan 2021 02:20:03 +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 T3agwVmuqcvV; Fri, 8 Jan 2021 02:20:02 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1B8231C19A8; Fri, 8 Jan 2021 02:20:02 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0F5171C19A7 for ; Fri, 8 Jan 2021 02:20:00 +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 6zkDyK_CaUwM for ; Fri, 8 Jan 2021 02:19:58 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.49; helo=mail-wm1-f49.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id D1C411C1998 for ; Fri, 8 Jan 2021 02:19:57 +0100 (CET) Original-Received: by mail-wm1-f49.google.com with SMTP id a6so6553357wmc.2 for ; Thu, 07 Jan 2021 17:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AFxdDK3akSdwvMpblVnflb0v+tzKmn8qqbKfNTMy4gk=; b=ZoQ+HY4XPLkIlkjLR6qNeHWbcPIBzEA0FOVfAGrYlpGiojTdJSDs55PPxEUb0By2le ApMuyOiqMbosUIsLpGBTO+L60tOq2rySgtBl+Z86LiZ3pDLjJJKxDtkEOW+Vb14hOcqX vAyjYS16R1ZLoxaFZ0TuSkQyDTsocPx2+VyvxlqCvhtp/FbiWIaiG3o9Wh6pxARz2j+l 41r+jurjkWBti2dSRuLEymCRVbuQo63/brxvRzQoT3NdZJgC09/CUavyYGtC4g9dKEGN yQ1zzXB+8V9JerO569UNMyVC5r+M13C8TN9fPwt2rPk/GoFbHj16Nc0L8OBBUfdGCu+s 7BPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AFxdDK3akSdwvMpblVnflb0v+tzKmn8qqbKfNTMy4gk=; b=YuioRpVCNvhyADvx9dLuEbZ1KV+5okNcsNQsGLUL1E6ujZlBTplNQAqKpiQyz5NosF 06Oe5sKVS6i2mhEiLjaTVLqwyjoxnWgyHX6UBAP3vKSgvYyRfok1l+GwmDMIPS8rOCfD GH76+DPbMcWSNK5/Q2w7DRCyBdTSYqUVVApoVrRoZPgePn/rGNwquMLA4V0yqoKnm7aq /HLu092XCEpwBdCz9mBCD/Rqr0XQs4kRNdjHSm16+64eCZYN51GGm94gbTxoL7HFnyuh yl0CklFAXsDKwXXjN7ZupDOe6fQeJHaWwMWqA/8oEY7zgr3cbBLkouNWDwZkyPZtVVgY 94gA== X-Gm-Message-State: AOAM533mZEJNUXT1nYQ2rYs4ieFR78240Wm4WC2VPeH62DVkj1AXJx1M IM5Ts7kzzHr2Oh3t2Tm9izXPAq8RK57pQbZxT4s= X-Google-Smtp-Source: ABdhPJzLHHWQ9578B7CZSUdybXW2+djPcoUz0pF3YFB04kg1WDhKZ8IvEJJDnHCvABQjOl0e+KzFv9WTvBdo4CYxlbQ= X-Received: by 2002:a1c:87:: with SMTP id 129mr864367wma.183.1610068797372; Thu, 07 Jan 2021 17:19:57 -0800 (PST) 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:110249 Archived-At: --===============7884066112389553740== Content-Type: multipart/alternative; boundary="000000000000bb3c6f05b8595a8f" --000000000000bb3c6f05b8595a8f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oh, I would do it another way, as processors aren't very happy with commands which split "strings". The drawback of my quick and dirty method is the need for additional commands, but I hope this will be useful. \defineregister[myindex] %Sorry for the funny names \def\myindexspaced#1{% \splitstring{#1}\at{ }\to\myindexoneone\and\myindexonetwo% \myindex[\myindexonetwo,\myindexoneone]{\myindexonetwo,\space\emph{\myindex= oneone}}% } \def\myindexcomma#1{% \splitstring{#1}\at,\to\myindextwoone\and\myindextwotwo% \myindex[#1]{\myindextwoone,\emph{\myindextwotwo}}% } \starttext In \myindexspaced{The Observer}{\em The Observer} of 31 July 2018... In \myindexcomma{Onion, The}{\em The Onion} of 31 July 2018... \placemyindex% \stoptext Maybe someone else in the list has a cleaner alternative? Cordially, Jairo El jue, 7 de ene. de 2021 a la(s) 18:01, jbf (roma83537@gmail.com) escribi= =C3=B3: > Thanks Jairo, with some tweaking I now have it working ( I had \placeinde= x > instead of \placemyindex! And altered the 'style' name to something else = as > you hinted I should). > > Now, this might be asking too much of ConTeXt, but some Newspaper names > don't italicise the 'The', only the main name. Is it possible, do you > think, to get the -> operator to work only on, say 'Observer' and not > 'The', and for that matter not on the page number as well? Perhaps not, b= ut > worth asking the question anyway! > > Julian > On 8/1/21 9:46 am, Jairo A. del Rio wrote: > > Hi. In latest LMTX (2021.01.07 16:59), your example works as expected: > > \defineregister[myindex] > > \defineprocessor[style][style=3Ditalic]%Isn't another name available? > > \starttext > > In \myindex{style->Observer, The}{\em The Observer} of 31 July 2018 > > \placemyindex% > > \stoptext > > Jairo > > El jue, 7 de ene. de 2021 a la(s) 17:29, jbf (roma83537@gmail.com) > escribi=C3=B3: > >> I'm wondering if further progress has been made in Mk IV on styling part= s >> of an index (register) entry? I have followed the explanation on the wik= i, >> but do not seem to be able to achieve what I need. >> >> And what I need is to be able to italicise entries that refer to >> newspaper names, e.g. The Observer >> >> MWE >> >> \defineregister[myindex] >> \defineprocessor[style][style=3Ditalic] >> >> \starttext >> >> In \myindex{style->Observer, The} {\em The Observer} of 31 July 2018 >> >> \stoptext >> >> The only result I am getting is: >> >> ->Observer, The 223 >> >> But what I want is *Observer, The* (in other words, in italics). >> >> Clearly I am doing something wrong, or not enough, or... maybe there is >> another way to achieve waht I need? >> >> Julian >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> 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 >> >> ________________________________________________________________________= ___________ >> > > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ > > --000000000000bb3c6f05b8595a8f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Oh, I would do= it another way, as processors aren't very happy with commands which sp= lit "strings". The drawback of my quick and dirty method is the n= eed for additional commands, but I hope this will be useful.

\definereg= ister[myindex]

%Sorry for the funny names

\def\myindexsp= aced#1{%

\splitstring{#= 1}\at{ }\to\myindexoneone\and\myindexonetwo%

\myindex[\myin= dexonetwo,\myindexoneone]{\myindexonetwo,\space\emph{\myindexoneone}}%

}


\def\myindexco= mma#1{%

\splitstring{#= 1}\at,\to\myindextwoone\and\myindextwotwo%

\myindex[#1]{\= myindextwoone,\emph{\myindextwotwo}}%

}


\starttext


In \myindexspa= ced{The Observer}{\em The Observer} of 31 July 2018...

In \myindexcomma{Onion, The}{\e= m The Onion} of 31 July 2018...


\placemyindex%=

\stoptext
=

Maybe = someone else in the list has a cleaner alternative?

Cordially,

Jairo


El ju= e, 7 de ene. de 2021 a la(s) 18:01, jbf (roma83537@gmail.com) escribi=C3=B3:
=20 =20 =20

Thanks Jairo, with some tweaking I now have it working ( I had \placeindex instead of \placemyindex! And altered the 'style'= name to something else as you hinted I should).

Now, this might be asking too much of ConTeXt, but some Newspaper names don't italicise the 'The', only the main name. Is i= t possible, do you think, to get the -> operator to work only on, say 'Observer' and not 'The', and for that matter not= on the page number as well? Perhaps not, but worth asking the question anyway!

Julian

On 8/1/21 9:46 am, Jairo A. del Rio wrote:
=20
Hi. In latest LMTX (2021.01.07 16:59), your example works as expected:

\defin= eregister[myindex]

\defin= eprocessor[style][style=3Ditalic]%Isn't another name available?

\start= text

In \my= index{style->Observer, The}{\em The Observer} of 31 July 2018

\place= myindex%

\stopt= ext=20

Jairo


El jue, 7 de ene. de 2021 a la(s) 17:29, jbf (roma83537@gmail.com) escribi=C3=B3:

I'm wondering if further progress has been made in Mk IV on styling parts of an index (register) entry? I have followed the explanation on the wiki, but do not seem to be able to achieve what I need.

And what I need is to be able to italicise entries that refer to newspaper names, e.g. The Observer

MWE

\defineregister[myindex]
\defineprocessor[style][style=3Ditalic]

\starttext

In \myindex{style->Observer, The} {\em The Observer} of 31 July 2018

\stoptext

The only result I am getting is:

->Observer, The=C2=A0=C2=A0 223

But what I want is Observer, The (in other words, in italics).

Clearly I am doing something wrong, or not enough, or... maybe there is another way to achieve waht I need?

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-co= ntext
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 : https://bitbucket.org/phg= /context-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

________________________________________________________________=
___________________
If your question is of interest to others as well, please add an entry to t=
he Wiki!

maillist : ntg-cont=
ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://ww=
w.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://co=
ntextgarden.net
___________________________________________________________________________=
________
--000000000000bb3c6f05b8595a8f-- --===============7884066112389553740== 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== --===============7884066112389553740==--