abbreviations: \infull always in small caps

Ahoi, I’m trying to employ the synonyms mechanism for abbreviations, as documented: \setupsynonyms [style=italic, headstyle=bold, titlestyle=normal, synonymstyle=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} \starttext \placelistofabbreviations[criterium=all] \infull{AV} \infull{AFL} \stoptext The result of \infull is always in small caps, and I don’t like that. I couldn’t find its definition in the source* nor a setup command. * http://source.contextgarden.net/tex/context/base/mkiv/strc-syn.mkiv?search=i... Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD

Am 2017-09-23 um 21:28 schrieb Thomas A. Schmitz
AARG, that’s the one setup option I overlooked... Danke, Thomas! Grüßlinge, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD

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

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

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

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

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

Am 2017-09-23 um 21:28 schrieb Thomas A. Schmitz
AARG, that’s the one setup option I overlooked... Danke, Thomas! Grüßlinge, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD
participants (5)
-
Floris van Manen
-
Henning Hraban Ramm
-
Henning Hraban Ramm
-
Jano Kula
-
Thomas A. Schmitz