Skip to content

Getting a list of citekeys for html outputs #11734

Answered by mcanouil
zackbatist asked this question in Q&A
Discussion options

You must be logged in to vote

Something like that to write unique citation id into a file:

local citations = {}

function Cite(cite)
  for _, citation in ipairs(cite.citations) do
    citations[citation.id] = true
  end
end

function Pandoc(doc)
  local file = io.open("citekeys.txt", "w")
  for citekey, _ in pairs(citations) do
    file:write(citekey .. "\n")
  end
  file:close()
end

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mcanouil
Comment options

@zackbatist
Comment options

@zackbatist
Comment options

@mcanouil
Comment options

Answer selected by zackbatist
@zackbatist
Comment options

@mcanouil
Comment options

@zackbatist
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bibliography lua Issues related to the lua codebase, filter chain, etc
2 participants