0

I'm wondering if it's possible to access the information in a .bib file using Lua code in LuaTeX. Basically, I have a function where I'd like to be able to add idiosyncratic custom citation styles for certain works that rely on information other than the standard author/title/year available in most citation packages.

I'm also open to a non-Lua way of doing this, but I haven't found any clear answers yet. The goal is to be as parsimonious as possible in terms of not having to duplicate information in multiple .lua/.bib/.tex files.

Edit: Upon request, a MWE:

We have a .bib that contains the following two entries:

@book{yassawi1904,
  author={Yassawī, Xoca Aḥmad bin Ibrāḥīm bin Muḥammad bin Iftiḥār},
  title={Dīwān-i Ḥikmat},
  publisher={Imperatorskaja Universitet},
  editor={(anon.)},
  address={Kazan},
  year={1904}
}

@book{yassawi2013, author={Yassawī, Xoca Aḥmad bin Ibrāḥīm bin Muḥammad bin Iftiḥār}, title={Diwani Hikmet}, publisher={Living Zen Books}, editor={Johnathan Trapman}, address={Glastonbury}, year={2013} }

We want to be able to produce a citation that looks something like this:

This word appears as blah in ed. Kazan (1904), but this seems to be an error for bleh, as reflected in ed. Trapman (2013).

where the first would be based on a function that uses the address, and the latter the name of the editor.

Edit: To be clear, I'm not having trouble writing the Lua; just asking if its possible in any way (Lua or not) to write a function that access bib information like this.

0 Answers0