Re: [NTG-context] Sorting of abbreviations in index

2017-10-09 Thread Floris van Manen
> On 9 October 2017 at 17:35, Henning Hraban Ramm  wrote:
> 
> If you like, I’ll gladly send you a voucher copy of the book*, once it’s 
> printed.
> *) https://www.dreiviertelhaus.de/editionka/gewerkschaftspolitik/

(1947 — 1975) why does the book ends a year before i travelled there ?
;-)

.F




signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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
___

Re: [NTG-context] Sorting of abbreviations in index

2017-10-09 Thread Jano Kula
On 9 October 2017 at 17:35, Henning Hraban Ramm  wrote:
>
>
> If you like, I’ll gladly send you a voucher copy of the book*, once it’s
> printed.
> *) https://www.dreiviertelhaus.de/editionka/gewerkschaftspolitik/


Sure, I'll check the page numbers in the register are right, especially at
the page borders.
Could be improved, if the printer wouldn't be knocking on the door.

Jano
___
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
___

Re: [NTG-context] Sorting of abbreviations in index

2017-10-09 Thread Henning Hraban Ramm
Am 2017-10-09 um 12:42 schrieb Jano Kula :

> Hello Hraban,
> 
> have a look into the TUC file to find out, what's going on. I'm sure, Hans 
> would come with a more efficient approach, but this works here. Especially 
> the abbreviation table is probably stored on the fly somewhere, not only in 
> the TUC file and the table could be stored once.

Jano, you’re my saviour! Thank you so much!
(I hope I didn’t overlook any serious flaws of the approach - efficiency is not 
so important.)

If you like, I’ll gladly send you a voucher copy of the book*, once it’s 
printed.
*) https://www.dreiviertelhaus.de/editionka/gewerkschaftspolitik/

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

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

Re: [NTG-context] Sorting of abbreviations in index

2017-10-09 Thread Jano Kula
Hello Hraban,

have a look into the TUC file to find out, what's going on. I'm sure, Hans
would come with a more efficient approach, but this works here. Especially
the abbreviation table is probably stored on the fly somewhere, not only in
the TUC file and the table could be stored once.

Change definition to:

\def\Abk#1{\ctxlua{WriteToIndex("#1")}{\sc\lowercase{#1}}}

Add lua code to preamble:

\startluacode
function WriteToIndex (abbr)
-- test, if table exits already
if structures.synonyms.collected["abbreviation"] then
local abbreviation_entries_table =
structures.synonyms.collected["abbreviation"]["entries"]
local abbreviation = abbr
local meaning = ""
for i=1,#abbreviation_entries_table do
   local def = abbreviation_entries_table[i]["definition"]
   if def["synonym"] == abbreviation then
   meaning = def["meaning"]
   end
end
context.Sach(meaning .. " (" .. abbreviation .. ")")
end
end
\stopluacode

Abbreviation isn't used then (no \infull), so you need criterium=all to
display the list:
\setupsynonyms [abbreviation] [textstyle=normal,criterium=all]

Complete example attached.

Regards,
Jano


On 24 September 2017 at 00:45, Henning Hraban Ramm  wrote:

> So, in extension of my previous question:
> I’m combining abbreviations and registers (index).
> My author wants organizations listed with full name and abbreviation, and
> I try to avoid many verbose entries in the text.
>
> If I use \infull within \index, entries get sorted at i – probably a
> problem of expansion. How can I solve this?
>
> \Sach[\infull{ADN}]{\infull{ADN} (ADN)} doesn’t help.
>
> -
>
> \mainlanguage[de]
> \setupsynonyms [abbreviation] [textstyle=normal]
>
> \abbreviation{Abt.}{Abteilung}
> \abbreviation{ADN}{Allgemeiner Deutscher Nachrichtendienst}
> \abbreviation{AFL}{American Federation of Labor}
> \abbreviation{ANC}{African National Congress}
> \abbreviation{AV}{Auslandsvertretung}
> \abbreviation{BArch}{Bundesarchiv}
>
> \defineregister[Sach][
>   pagestyle=normal,
>   compress=yes,
>   indicator=no,
> ]
> \setupregister[Sach][style=normal]
>
> \def\Abk#1{\Sach{\infull{#1} (#1)}{\sc\lowercase{#1}}}
> %\def\qAbk#1{\Sach{\infull{#1} (#1)}}
>
>
> \starttext
> \section{Intro}
> \Sach{Abenteuer}\Sach{Abba}\Sach{Alliteration}
> \Sach{Berta}\Sach{Cäsar}\Sach[Context]{\CONTEXT}\Sach{COBOL}\Sach{Cäsium}
> \Sach{Igel}\Sach{Jagertee}\Sach{Humboldt}\Sach{infulk}\Sach{infulm}
>
> \Abk{ADN}, \Abk{ANC}, \Abk{AV}
>
> \section{Abkürzungen}
> \placelistofabbreviations %[criterium=all]
>
> \section{Sachregister}
> \placeregister[Sach]
>
> %\infull{AV}
> %\infull{AFL}
>
> \stoptext
>
> -
>
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD
>
> 
> ___
> 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
> 
> ___


index-hraban.tex
Description: TeX document
___
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
___

Re: [NTG-context] Sorting of abbreviations in index

2017-10-06 Thread Henning Hraban Ramm
Sorry to insist, but this bug is blocking the publication of our latest book:


\def\Some#1{#1}
\def\Sindex#1{\index{\Some{#1}}#1}

\starttext

\index{Tufte}\index{Knuth}\index{Zapf}
\index{Sole}\index{Some}\index{Sone}

\input tufte \Sindex{Tufte}

\input knuth \Sindex{Knuth}

\input zapf \Sindex{Zapf}

\placeindex

\stoptext


The generated index sorts everything that is indexed via \Sindex{} after "Some".

In the book, I’m using ConTeXt’s abbreviations (synonyms) mechanism and resolve 
them with \infull, so that all the organizations are sorted after "infull".

I don’t understand what’s going on in strc-reg.mkiv or strc-reg.lua, but I 
guess the problem might be in local function filtercollected - or does some 
interpolation take place within \index (\register[something]) itself?

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

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

Re: [NTG-context] Sorting of abbreviations in index

2017-10-01 Thread Henning Hraban Ramm
Pretty please?

Am 2017-09-25 um 19:50 schrieb Henning Hraban Ramm :

> Might I get an answer? It’s getting urgent...
> 
> In short: \index{\SomeMacro{stuff}} orders not after the result of 
> \SomeMacro{stuff}, but after "SomeMacro".
> The same, if I use \SomeMacro within the sorting option: 
> \index[\SomeMacro{stuff}]{stuff}.
> How can I change this?
> 
> Best, Hraban
> 
> Am 2017-09-24 um 00:45 schrieb Henning Hraban Ramm :
> 
>> So, in extension of my previous question:
>> I’m combining abbreviations and registers (index).
>> My author wants organizations listed with full name and abbreviation, and I 
>> try to avoid many verbose entries in the text.
>> 
>> If I use \infull within \index, entries get sorted at i – probably a problem 
>> of expansion. How can I solve this?
>> 
>> \Sach[\infull{ADN}]{\infull{ADN} (ADN)} doesn’t help.
>> 
>> -
>> 
>> \mainlanguage[de]
>> \setupsynonyms [abbreviation] [textstyle=normal]
>> 
>> \abbreviation{Abt.}{Abteilung}
>> \abbreviation{ADN}{Allgemeiner Deutscher Nachrichtendienst}
>> \abbreviation{AFL}{American Federation of Labor}
>> \abbreviation{ANC}{African National Congress}
>> \abbreviation{AV}{Auslandsvertretung}
>> \abbreviation{BArch}{Bundesarchiv}
>> 
>> \defineregister[Sach][
>> pagestyle=normal,
>> compress=yes,
>> indicator=no,
>> ]
>> \setupregister[Sach][style=normal]
>> 
>> \def\Abk#1{\Sach{\infull{#1} (#1)}{\sc\lowercase{#1}}}
>> %\def\qAbk#1{\Sach{\infull{#1} (#1)}}
>> 
>> 
>> \starttext
>> \section{Intro}
>> \Sach{Abenteuer}\Sach{Abba}\Sach{Alliteration}
>> \Sach{Berta}\Sach{Cäsar}\Sach[Context]{\CONTEXT}\Sach{COBOL}\Sach{Cäsium}
>> \Sach{Igel}\Sach{Jagertee}\Sach{Humboldt}\Sach{infulk}\Sach{infulm}
>> 
>> \Abk{ADN}, \Abk{ANC}, \Abk{AV}
>> 
>> \section{Abkürzungen}
>> \placelistofabbreviations %[criterium=all]
>> 
>> \section{Sachregister}
>> \placeregister[Sach]
>> 
>> %\infull{AV}
>> %\infull{AFL}
>> 
>> \stoptext
>> 
>> -
>> 
>> Greetlings, Hraban
>> ---
>> http://www.fiee.net
>> http://wiki.contextgarden.net
>> GPG Key ID 1C9B22FD
>> 

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

Re: [NTG-context] Sorting of abbreviations in index

2017-09-25 Thread Henning Hraban Ramm
Might I get an answer? It’s getting urgent...

In short: \index{\SomeMacro{stuff}} orders not after the result of 
\SomeMacro{stuff}, but after "SomeMacro".
The same, if I use \SomeMacro within the sorting option: 
\index[\SomeMacro{stuff}]{stuff}.
How can I change this?

Best, Hraban

Am 2017-09-24 um 00:45 schrieb Henning Hraban Ramm :

> So, in extension of my previous question:
> I’m combining abbreviations and registers (index).
> My author wants organizations listed with full name and abbreviation, and I 
> try to avoid many verbose entries in the text.
> 
> If I use \infull within \index, entries get sorted at i – probably a problem 
> of expansion. How can I solve this?
> 
> \Sach[\infull{ADN}]{\infull{ADN} (ADN)} doesn’t help.
> 
> -
> 
> \mainlanguage[de]
> \setupsynonyms [abbreviation] [textstyle=normal]
> 
> \abbreviation{Abt.}{Abteilung}
> \abbreviation{ADN}{Allgemeiner Deutscher Nachrichtendienst}
> \abbreviation{AFL}{American Federation of Labor}
> \abbreviation{ANC}{African National Congress}
> \abbreviation{AV}{Auslandsvertretung}
> \abbreviation{BArch}{Bundesarchiv}
> 
> \defineregister[Sach][
>  pagestyle=normal,
>  compress=yes,
>  indicator=no,
> ]
> \setupregister[Sach][style=normal]
> 
> \def\Abk#1{\Sach{\infull{#1} (#1)}{\sc\lowercase{#1}}}
> %\def\qAbk#1{\Sach{\infull{#1} (#1)}}
> 
> 
> \starttext
> \section{Intro}
> \Sach{Abenteuer}\Sach{Abba}\Sach{Alliteration}
> \Sach{Berta}\Sach{Cäsar}\Sach[Context]{\CONTEXT}\Sach{COBOL}\Sach{Cäsium}
> \Sach{Igel}\Sach{Jagertee}\Sach{Humboldt}\Sach{infulk}\Sach{infulm}
> 
> \Abk{ADN}, \Abk{ANC}, \Abk{AV}
> 
> \section{Abkürzungen}
> \placelistofabbreviations %[criterium=all]
> 
> \section{Sachregister}
> \placeregister[Sach]
> 
> %\infull{AV}
> %\infull{AFL}
> 
> \stoptext
> 
> -
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD
> 
> ___
> 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
> ___

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