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