Have intext citations that link to PDFs stored in Zotero #13253
laxnx
started this conversation in
Feature Requests
Replies: 1 comment
-
You can write a LUA filter. local references = {}
function get_references(doc)
references = pandoc.utils.references(doc)
return doc
end
function process_citations(elem)
local cite_id = elem.citations[1].id
-- Find the reference by ID
local ref = nil
for _, reference in ipairs(references) do
if reference.id == cite_id then
ref = reference
break
end
end
if ref and ref.DOI then
local doi_text = pandoc.utils.stringify(ref.DOI)
local doi_url = "https://doi.org/" .. doi_text
local doi_link = pandoc.Link({pandoc.Str("DOI")}, doi_url)
return {elem, pandoc.Str(" "), doi_link}
end
return elem
end
return {
{ Pandoc = get_references },
{ Cite = process_citations }
} You would need this filter to come after Quarto's processing. filters:
- path: citation.lua
at: post-quarto |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to PDF from intext / inline citation instead of to bibliography
Sorry if this isn't really a Quarto thing. I'm in the process of writing my thesis, and I really like how Quarto has made me focus more on writing than formatting (cuz I made a template for my thesis), while usingg rbbt to link to Zotero and make my citations and bibliography.
I think that it'd be very helpful to share my manuscript alongside the PDF files, so that when someone is reading the manuscript, they can click on the intext citation and it'd take them to the PDF (or maybe even at a specific page or selection).
It's very difficult somehow to see this asked in the internet, but I found this: (Link to PDF from citation in Docs?), and it's pretty much the most similar to my desired feature.
I think this can be done by duplicating and storing all the reference PDFs in a folder, and have the Quarto intext citation reference that PDF. Then the exported manuscript and the PDF folder can be shared together to allow readers to also see the sources themselves. This would be really helpful when multiple people need to check each other's work, like my adviser reading my manuscript.
Beta Was this translation helpful? Give feedback.
All reactions