[NTG-context] Modifying bibliography entries using lua

Stanislav Sokolenko stanislav at sokolenko.net
Mon Jul 23 22:17:48 CEST 2018


Thanks Hans, that's really helpful!

> This is not for the fainthearted so here we go
>
> \startluacode
>     function document.MyBoldPub(set,tag)
>      -- local a = publications.getfield(set,tag,"author")
>      -- inspect(a)
>      -- local c = publications.getcasted(set,tag,"author")
>      -- inspect(c)
>         if c[1].surnames[1] == "Myname" then
>             context.bold(function()
>                 context.btxflush('author')
>             end )
>         else
>             context.btxflush('author')
>         end
>     end
> \stopluacode

So if I wanted to bold one specific author in a reference of many, I can 
just loop over publications.getcasted(...), and print the appropriate 
names, initials, etc...

That said -- is there any way to call the appropriate authorconversion 
routine based on the \setupbtx settings? I found the 
publications.authorhashers method table, which seems to do most of this 
work, but I'm not sure how to pick the appropriate method and ensure 
that the correct separators are used.

Stan




More information about the ntg-context mailing list