Hmm, here is a fragile hack that uses regex to parse raw ref.bib
. It should work if your ref.bib
is properly formatted. (at least I think so)
#let journals = {
read("papers.bib").matches(
// Assuming you always use `journaltitle` but never `journal`,
// and no journal title contains any bracket
regex(`\s*journaltitle\s*=\s*\{(.+?)\},`.text)
).map(it => it.captures.at(0))
}
#let count-journal(journal) = {
// Assuming you always use “Physical Review Letters” but never “Phys. Rev. Lett.” or “PRL”.
journals.filter(j => j == journal).len()
}
#count-journal("Physical Review Letters")