ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* consistent index entries
@ 2020-08-01 11:22 Henning Hraban Ramm
  2020-08-01 18:49 ` Henning Hraban Ramm
  0 siblings, 1 reply; 9+ messages in thread
From: Henning Hraban Ramm @ 2020-08-01 11:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

besides the CG journal I’m working on a scientific biography with huge person and locality indexes (named Person and Locality for the examples).

In many cases, the author wants additional information in the index, e.g.

\Locality{Altona (Hamburg)}
\Locallity{Breslau (pol. Wrocław)}
or
\Person{Arends, Katharina (née Schoemaker)}
\Person{Wilhelm II. (Kaiser)}

Now, I need that consistent and I don’t want to type these complicated entries every time.

I’m looking for a good way to handle this – maybe a lookup table in Lua, so that
\LookupPerson{Willy II}
would call a Lua function that returns
\Person{Wilhelm II. (Kaiser)}
?

Or is there already something in place that I overlooked, like
\OverwriteIndexEntry{Hraban}{Ramm, Henning Hraban}
?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 11:22 consistent index entries Henning Hraban Ramm
@ 2020-08-01 18:49 ` Henning Hraban Ramm
  2020-08-01 19:01   ` Jairo A. del Rio
  2020-08-01 19:30   ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Henning Hraban Ramm @ 2020-08-01 18:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> Am 01.08.2020 um 13:22 schrieb Henning Hraban Ramm <texml@fiee.net>:
> 
> Hi,
> 
> besides the CG journal I’m working on a scientific biography with huge person and locality indexes (named Person and Locality for the examples).
> 
> In many cases, the author wants additional information in the index, e.g.
> 
> \Locality{Altona (Hamburg)}
> \Locality{Breslau (pol. Wrocław)}
> or
> \Person{Arends, Katharina (née Schoemaker)}
> \Person{Wilhelm II. (Kaiser)}
> 
> Now, I need that consistent and I don’t want to type these complicated entries every time.
> 
> I’m looking for a good way to handle this – maybe a lookup table in Lua, so that
> \LookupPerson{Willy II}
> would call a Lua function that returns
> \Person{Wilhelm II. (Kaiser)}
> ?
> 
> Or is there already something in place that I overlooked, like
> \OverwriteIndexEntry{Hraban}{Ramm, Henning Hraban}
> ?

I came up with:

\startluacode
user.Lookups = {
  ["Albano"] = "Albano (Provinz Rom)",
  ["Altona"] = "Altona (Hamburg)",
  ["Aurich"] = "Aurich (Ostfriesland)"
}

function user.Lookup(Name)
  local Res = user.Lookups[Name]
  if Res then
    return context(Res)
  else
    return context(Name)
  end
end
\stopluacode

\def\Ort#1{\index{\ctxlua{user.Lookup("#1")}}}

\starttext

\Ort{Albano}
\Ort{Altona}
\Ort{Aurich}
\strut\page

\placeindex

\stoptext


The lookup works so far, but all the entries get sorted unter C (because of \ctxlua).

I remember I had the same problem with other macros (like \index{\emph{bla}}), but can’t find a solution in my usual sources.


Hraban

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 18:49 ` Henning Hraban Ramm
@ 2020-08-01 19:01   ` Jairo A. del Rio
  2020-08-01 19:18     ` Jairo A. del Rio
  2020-08-01 19:50     ` Henning Hraban Ramm
  2020-08-01 19:30   ` Wolfgang Schuster
  1 sibling, 2 replies; 9+ messages in thread
From: Jairo A. del Rio @ 2020-08-01 19:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2595 bytes --]

Hi, Henning. According to the garden, something like:

\def\Ort#1{\index[#1]{\ctxlua{user.Lookup("#1")}}}

as long as #1 is capable of being sorted in the normal way, should work.

Regards,

Jairo

El sáb., 1 de ago. de 2020 a la(s) 13:49, Henning Hraban Ramm (
texml@fiee.net) escribió:

>
>
> > Am 01.08.2020 um 13:22 schrieb Henning Hraban Ramm <texml@fiee.net>:
> >
> > Hi,
> >
> > besides the CG journal I’m working on a scientific biography with huge
> person and locality indexes (named Person and Locality for the examples).
> >
> > In many cases, the author wants additional information in the index, e.g.
> >
> > \Locality{Altona (Hamburg)}
> > \Locality{Breslau (pol. Wrocław)}
> > or
> > \Person{Arends, Katharina (née Schoemaker)}
> > \Person{Wilhelm II. (Kaiser)}
> >
> > Now, I need that consistent and I don’t want to type these complicated
> entries every time.
> >
> > I’m looking for a good way to handle this – maybe a lookup table in Lua,
> so that
> > \LookupPerson{Willy II}
> > would call a Lua function that returns
> > \Person{Wilhelm II. (Kaiser)}
> > ?
> >
> > Or is there already something in place that I overlooked, like
> > \OverwriteIndexEntry{Hraban}{Ramm, Henning Hraban}
> > ?
>
> I came up with:
>
> \startluacode
> user.Lookups = {
>   ["Albano"] = "Albano (Provinz Rom)",
>   ["Altona"] = "Altona (Hamburg)",
>   ["Aurich"] = "Aurich (Ostfriesland)"
> }
>
> function user.Lookup(Name)
>   local Res = user.Lookups[Name]
>   if Res then
>     return context(Res)
>   else
>     return context(Name)
>   end
> end
> \stopluacode
>
> \def\Ort#1{\index{\ctxlua{user.Lookup("#1")}}}
>
> \starttext
>
> \Ort{Albano}
> \Ort{Altona}
> \Ort{Aurich}
> \strut\page
>
> \placeindex
>
> \stoptext
>
>
> The lookup works so far, but all the entries get sorted unter C (because
> of \ctxlua).
>
> I remember I had the same problem with other macros (like
> \index{\emph{bla}}), but can’t find a solution in my usual sources.
>
>
> Hraban
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3750 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 19:01   ` Jairo A. del Rio
@ 2020-08-01 19:18     ` Jairo A. del Rio
  2020-08-01 19:50     ` Henning Hraban Ramm
  1 sibling, 0 replies; 9+ messages in thread
From: Jairo A. del Rio @ 2020-08-01 19:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3048 bytes --]

Wrt formatting (e.g. \index{\emph{something}}), the garden also mentions
processors for MkIV (https://wiki.contextgarden.net/Registers#Processors),
so you can wrap them with custom commands, in case it helps.

Cordially,

Jairo.

El sáb., 1 de ago. de 2020 a la(s) 14:01, Jairo A. del Rio (
jairoadelrio6@gmail.com) escribió:

> Hi, Henning. According to the garden, something like:
>
> \def\Ort#1{\index[#1]{\ctxlua{user.Lookup("#1")}}}
>
> as long as #1 is capable of being sorted in the normal way, should work.
>
> Regards,
>
> Jairo
>
> El sáb., 1 de ago. de 2020 a la(s) 13:49, Henning Hraban Ramm (
> texml@fiee.net) escribió:
>
>>
>>
>> > Am 01.08.2020 um 13:22 schrieb Henning Hraban Ramm <texml@fiee.net>:
>> >
>> > Hi,
>> >
>> > besides the CG journal I’m working on a scientific biography with huge
>> person and locality indexes (named Person and Locality for the examples).
>> >
>> > In many cases, the author wants additional information in the index,
>> e.g.
>> >
>> > \Locality{Altona (Hamburg)}
>> > \Locality{Breslau (pol. Wrocław)}
>> > or
>> > \Person{Arends, Katharina (née Schoemaker)}
>> > \Person{Wilhelm II. (Kaiser)}
>> >
>> > Now, I need that consistent and I don’t want to type these complicated
>> entries every time.
>> >
>> > I’m looking for a good way to handle this – maybe a lookup table in
>> Lua, so that
>> > \LookupPerson{Willy II}
>> > would call a Lua function that returns
>> > \Person{Wilhelm II. (Kaiser)}
>> > ?
>> >
>> > Or is there already something in place that I overlooked, like
>> > \OverwriteIndexEntry{Hraban}{Ramm, Henning Hraban}
>> > ?
>>
>> I came up with:
>>
>> \startluacode
>> user.Lookups = {
>>   ["Albano"] = "Albano (Provinz Rom)",
>>   ["Altona"] = "Altona (Hamburg)",
>>   ["Aurich"] = "Aurich (Ostfriesland)"
>> }
>>
>> function user.Lookup(Name)
>>   local Res = user.Lookups[Name]
>>   if Res then
>>     return context(Res)
>>   else
>>     return context(Name)
>>   end
>> end
>> \stopluacode
>>
>> \def\Ort#1{\index{\ctxlua{user.Lookup("#1")}}}
>>
>> \starttext
>>
>> \Ort{Albano}
>> \Ort{Altona}
>> \Ort{Aurich}
>> \strut\page
>>
>> \placeindex
>>
>> \stoptext
>>
>>
>> The lookup works so far, but all the entries get sorted unter C (because
>> of \ctxlua).
>>
>> I remember I had the same problem with other macros (like
>> \index{\emph{bla}}), but can’t find a solution in my usual sources.
>>
>>
>> Hraban
>>
>>
>> ___________________________________________________________________________________
>> 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
>>
>> ___________________________________________________________________________________
>>
>

[-- Attachment #1.2: Type: text/html, Size: 4475 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 18:49 ` Henning Hraban Ramm
  2020-08-01 19:01   ` Jairo A. del Rio
@ 2020-08-01 19:30   ` Wolfgang Schuster
  2020-08-01 20:16     ` Henning Hraban Ramm
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2020-08-01 19:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Henning Hraban Ramm schrieb am 01.08.2020 um 20:49:
> 
> 
>> Am 01.08.2020 um 13:22 schrieb Henning Hraban Ramm <texml@fiee.net>:
>>
>> Hi,
>>
>> besides the CG journal I’m working on a scientific biography with huge person and locality indexes (named Person and Locality for the examples).
>>
>> In many cases, the author wants additional information in the index, e.g.
>>
>> \Locality{Altona (Hamburg)}
>> \Locality{Breslau (pol. Wrocław)}
>> or
>> \Person{Arends, Katharina (née Schoemaker)}
>> \Person{Wilhelm II. (Kaiser)}
>>
>> Now, I need that consistent and I don’t want to type these complicated entries every time.
>>
>> I’m looking for a good way to handle this – maybe a lookup table in Lua, so that
>> \LookupPerson{Willy II}
>> would call a Lua function that returns
>> \Person{Wilhelm II. (Kaiser)}
>> ?
>>
>> Or is there already something in place that I overlooked, like
>> \OverwriteIndexEntry{Hraban}{Ramm, Henning Hraban}
>> ?
> 
> I came up with:
> 
> \startluacode
> user.Lookups = {
>    ["Albano"] = "Albano (Provinz Rom)",
>    ["Altona"] = "Altona (Hamburg)",
>    ["Aurich"] = "Aurich (Ostfriesland)"
> }
> 
> function user.Lookup(Name)
>    local Res = user.Lookups[Name]
>    if Res then
>      return context(Res)
>    else
>      return context(Name)
>    end
> end
> \stopluacode
> 
> \def\Ort#1{\index{\ctxlua{user.Lookup("#1")}}}

You have to expand the \index argument:

\define[1]\Ort{\expanded{\index{...}}}

> \starttext
> 
> \Ort{Albano}
> \Ort{Altona}
> \Ort{Aurich}
> \strut\page
> 
> \placeindex
> 
> \stoptext
> 
> 
> The lookup works so far, but all the entries get sorted unter C (because of \ctxlua).
> 
> I remember I had the same problem with other macros (like \index{\emph{bla}}), but can’t find a solution in my usual sources.

When you use formatting commands etc. you have to use the optional 
argument for sorting.

You can avoid a few problems when you move the \index command to Lua and 
use context.index or you use a pure TeX solution.

%%%% begin lua example
\startluacode

userdata = userdata or { }

userdata.lookup = {
     ["Albano"] = "Albano (Provinz Rom)",
  -- ["Altona"] = "Altona (Hamburg)",
     ["Aurich"] = "Aurich (Ostfriesland)"
}

function userdata.index(name)
     local indexentry = userdata.lookup[name] or name
     context.index(indexentry)
end
\stopluacode

\define[1]\Ort{\ctxlua{userdata.index("#1")}}

\starttext

\Ort{Albano}
\Ort{Altona}
\Ort{Aurich}
\dontleavehmode\page

\placeindex

\stoptext
%%%% end lua example

%%%% begin tex example
\setvariables
   [index]
   [Albano={Albano (Provinz Rom)},
   %Altona={Altona (Hamburg)},
    Aurich={Aurich (Ostfriesland)}]

\define[1]\Ort
   {\doifelsevariable{index}{#1}
      {\expanded{\index{\getvariable{index}{#1}}}}
      {\index{#1}}}

\starttext

\Ort{Albano}
\Ort{Altona}
\Ort{Aurich}
\dontleavehmode\page

\placeindex

\stoptext
%%%% end tex example

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 19:01   ` Jairo A. del Rio
  2020-08-01 19:18     ` Jairo A. del Rio
@ 2020-08-01 19:50     ` Henning Hraban Ramm
  1 sibling, 0 replies; 9+ messages in thread
From: Henning Hraban Ramm @ 2020-08-01 19:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> Am 01.08.2020 um 21:01 schrieb Jairo A. del Rio <jairoadelrio6@gmail.com>:
> 
> Hi, Henning. According to the garden, something like:
> 
> \def\Ort#1{\index[#1]{\ctxlua{user.Lookup("#1")}}}
> 
> as long as #1 is capable of being sorted in the normal way, should work. 

Thank you, but that doesn’t work if my lookup e.g. creates "Garmisch-Partenkirchen" from "Partenkirchen".

> Am 01.08.2020 um 21:18 schrieb Jairo A. del Rio <jairoadelrio6@gmail.com>:
> 
> Wrt formatting (e.g. \index{\emph{something}}), the garden also mentions processors for MkIV (https://wiki.contextgarden.net/Registers#Processors), so you can wrap them with custom commands, in case it helps.

I already use processors; \emph was just an example.


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 19:30   ` Wolfgang Schuster
@ 2020-08-01 20:16     ` Henning Hraban Ramm
  2020-08-01 20:44       ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Henning Hraban Ramm @ 2020-08-01 20:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 01.08.2020 um 21:30 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>> \def\Ort#1{\index{\ctxlua{user.Lookup("#1")}}}
> 
> You have to expand the \index argument:
> 
> \define[1]\Ort{\expanded{\index{...}}}

Ah, I never know where to expand (tried \expanded\ctxlua).

Now,

\def\TOrt#1{\expanded{\Ort{\ctxlua{userdata.Lookup("#1")}}}#1} % Loc + Text
\defineprocessor[kursiv][style=italicface]
\def\TFOrt#1{\expanded{\Ort[kursiv->]{\ctxlua{userdata.Lookup("#1")}}}#1} % Loc in Footnote + Text

works. :)

(I always define \TIndex to avoid doubling, e.g. Hamburg\index{Hamburg}.)


> When you use formatting commands etc. you have to use the optional argument for sorting.

I don’t understand.

\Ort[kursiv->]{Hamburg} works.

> You can avoid a few problems when you move the \index command to Lua and use context.index or you use a pure TeX solution.
> 
> %%%% begin lua example
> 
> function userdata.index(name)
>    local indexentry = userdata.lookup[name] or name
>    context.index(indexentry)
> end

That’s nice, but since I use different registers, I’d need to define that function for each. Since I also use several shortcuts (e.g. \TOrt, \TFOrt, \TPerson, \TFPerson) I would multiply the effort on the Lua side.
I find my TeX definitions (like above) shorter, where I can use the same Lua function for each.
With your code I could at least shorten it to:

function userdata.Lookup(name)
   context(userdata.Lookups[name] or name)
end

> %%%% begin tex example

Oh, this is also nice. But isn’t the Lua version faster? (I have >600 person entries and a few hundred locations).

Thank you!

Hraban

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 20:16     ` Henning Hraban Ramm
@ 2020-08-01 20:44       ` Wolfgang Schuster
  2020-08-01 20:57         ` Henning Hraban Ramm
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2020-08-01 20:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Henning Hraban Ramm schrieb am 01.08.2020 um 22:16:
> 
>> Am 01.08.2020 um 21:30 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>>> \def\Ort#1{\index{\ctxlua{user.Lookup("#1")}}}
>>
>> You have to expand the \index argument:
>>
>> \define[1]\Ort{\expanded{\index{...}}}
> 
> Ah, I never know where to expand (tried \expanded\ctxlua).

\expanded needs a argument, i.e. \expanded{...}

> Now,
> 
> \def\TOrt#1{\expanded{\Ort{\ctxlua{userdata.Lookup("#1")}}}#1} % Loc + Text
> \defineprocessor[kursiv][style=italicface]
> \def\TFOrt#1{\expanded{\Ort[kursiv->]{\ctxlua{userdata.Lookup("#1")}}}#1} % Loc in Footnote + Text
> 
> works. :)
> 
> (I always define \TIndex to avoid doubling, e.g. Hamburg\index{Hamburg}.)
> 
> 
>> When you use formatting commands etc. you have to use the optional argument for sorting.
> 
> I don’t understand.
> 
> \Ort[kursiv->]{Hamburg} works.

You mentioned only \index{\emph{...}} in your mail ...

>> You can avoid a few problems when you move the \index command to Lua and use context.index or you use a pure TeX solution.
>>
>> %%%% begin lua example
>>
>> function userdata.index(name)
>>     local indexentry = userdata.lookup[name] or name
>>     context.index(indexentry)
>> end
> 
> That’s nice, but since I use different registers, I’d need to define that function for each. Since I also use several shortcuts (e.g. \TOrt, \TFOrt, \TPerson, \TFPerson) I would multiply the effort on the Lua side.
> I find my TeX definitions (like above) shorter, where I can use the same Lua function for each.
> With your code I could at least shorten it to:
> 
> function userdata.Lookup(name)
>     context(userdata.Lookups[name] or name)
> end
> 
>> %%%% begin tex example
> 
> Oh, this is also nice. But isn’t the Lua version faster? (I have >600 person entries and a few hundred locations).


Hard to say without testing but the difference can be ignored because 
\index itself is what take processing time.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: consistent index entries
  2020-08-01 20:44       ` Wolfgang Schuster
@ 2020-08-01 20:57         ` Henning Hraban Ramm
  0 siblings, 0 replies; 9+ messages in thread
From: Henning Hraban Ramm @ 2020-08-01 20:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 01.08.2020 um 22:44 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>>> \define[1]\Ort{\expanded{\index{...}}}
>> Ah, I never know where to expand (tried \expanded\ctxlua).
> 
> \expanded needs a argument, i.e. \expanded{...}

I recognized it doesn’t work otherwise. But I thought TeX would always use the next token? Isn’t a command (or its result?) such a token?

>>> When you use formatting commands etc. you have to use the optional argument for sorting.
>> I don’t understand.
>> \Ort[kursiv->]{Hamburg} works.
> 
> You mentioned only \index{\emph{...}} in your mail ...

I tried to simplify and couldn’t remember which command I needed when I had the \index{\something} problem (probably something similar, i.e. a self defined command that changed the text of the index entry). 

>>> %%%% begin tex example
>> Oh, this is also nice. But isn’t the Lua version faster? (I have >600 person entries and a few hundred locations).
> 
> Hard to say without testing but the difference can be ignored because \index itself is what take processing time.

Ok, thank you!

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-01 20:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-01 11:22 consistent index entries Henning Hraban Ramm
2020-08-01 18:49 ` Henning Hraban Ramm
2020-08-01 19:01   ` Jairo A. del Rio
2020-08-01 19:18     ` Jairo A. del Rio
2020-08-01 19:50     ` Henning Hraban Ramm
2020-08-01 19:30   ` Wolfgang Schuster
2020-08-01 20:16     ` Henning Hraban Ramm
2020-08-01 20:44       ` Wolfgang Schuster
2020-08-01 20:57         ` Henning Hraban Ramm

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).