-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
citeproc settings in YAML metadata block: Problems when using pandoc-zotxt.lua filter #2294
Comments
Thanks for reporting this. It looks like we were disabling the citeproc filter unless we determine that there are references or a bibliography. You should now be able to specify:
See below |
Correction (thanks @cderv!) - |
Thanks for the update. This is not a problem for the pandoc-zotxt.lua use case described above, but it might be worth keeping in mind that there are others where filters need to be run before and after citeproc in a specific order (for one example, see here). |
I don't know if that will help but I think it is worth mentioning that Pandoc 2.19.1 has now a Could help running before and after using filters. |
Thanks for pointing this out. For future reference: This filter (taken from here), in a file
combined with the following in a YAML metadata block
does run pandoc-zotxt.lua and then citeproc with the expected results. I haven’t tried anything else so far, but it does seem it will allow you to run citeproc at any specific stage within an ordered sequence of filters and hence would solve all problems I can imagine in this context for now. What doesn’t work as expected so far is that full paths to filters in the |
Thanks for the additional context regarding filter order (esp with citeproc). It may be that we have to re-introduce the concept of filter ordering or perhaps allow you to provide different classes of filters that target different positions in the AST rendering stack for just this type of reason. We're planning to do some work on our own LUA / filters and I'd expect we'll reconsider this as a part of that! |
@dragonstyle, just curious if there were any updates on this. In case not, perhaps a simple new field would suffice. filters-after-citeproc:
- filter1.lua
|
@bcdavasconcelos Thanks for the idea. We'll do something similar, but slightly different. We're not going to be able to ship this in 1.3 because of regression risk (we're getting ready for a release). A simple new field unfortunately does not suffice in the presence of our new Custom AST handlers, but this is a generally good idea. We'll do it in 1.4. |
Unfortunately, the solution described above seems to have stopped working. A file,
processed from the command line with
still produces the expected result (i.e., includes a resolved citation), whereas a second file:
processed from the command line with
which used to work well back in September 2022 (see above), now emits a warning:
and the result lacks a resolved citation. Rendering the second file from within RStudio produces the same unsatisfactory result. Since including pandoc-zotxt.lua and citeproc as command line parameters does lead to the expected result, it seems unlikely that there’s anything wrong with the other elements in the toolchain, including Zotero, zotxt, pandoc-zotxt.lua or BBT, or quarto per se – but maybe something has been changed with regard quarto’s processing of filters listed in the YAML header?
|
@njbart as linked by @TomBener, this issue seems to be related to #7888 improvement. It seems See also my reply in a related issue So watch out for #7888!
Since 2022, I believe there were some changes in the complex Lua filter chain that messed this up. #7888 is about improving this. Current limitation is for any filter in |
Many thanks. I will watch out for #7888 then. One small thing however:
I don't think that's accurate: The logic is for Example: This file:
processed with
outputs
to obtain the expected result:
|
Then I am surprised this does not work. let me try to reproduce the error on my side. It could be something else. |
FWIW, I've moved #7888 to 1.7 - that seems like a fairly important fix. |
@njbart Looking more closely to your example you mentioned the following
Is this filter expected to be used in two steps ? Because passing as
So this was probably wrong conclusion, but still #7888 is required so that citeproc can correctly be called at the right time. With current logic, I don't think the filter is working. We'll try to check this filter when working on #7888 to be sure this is solving the issue. |
No. First ‘step’ is Second ‘step’ is Reversing the order (i.e., |
The document is not processed a second time with this new YAML by Quarto; This is why I was asking about two step process. If this is supposed to be written in-document then it won't be read again by Quarto. Though my understanding of the lua filter is that it puts the biblio in Metadata inside the AST, but it is not picked up by citeproc in our filter chain logic. I really think that #7888 will help with this problem.
Yeah sorry to have been misleading on this. This is another problem for other filters that #7888 aims to fix. Not the case here. Problem is a bit different. |
Bug description
This report describes an issue with obtaining bibliographic data directly from Zotero, bypassing the need for exporting
.bib
,.json
, or.yaml
bibliographic data, by using the Zotero add-on zotxt and the associated pandoc filter pandoc-zotxt.lua.Using Rmarkdown, it is possible to knit/render files such as the following from within RStudio (provided Zotero is running, and an entry
@bard:2015introduction
does exist):Result:
Using quarto from the command line, with this file (
test.qmd
)and the command
produces the exact same expected result.
(Note that I had to provide the full path to the filter here, but that seems to be a different issue.)
For
qmd
from within RStudio, one would expect to be able to achieve the same with appropriate settings in the YAML metadata block; however, this does not seem to be possible, as usingpandoc-args
(orpandoc_args
) has no effect, and does not seem to be supported anyway.Example:
Result:
(i.e., citation not resolved)
Including
filters
andciteproc: TRUE
in the header has no effect either:Result:
(i.e., citation not resolved)
What does work is including the instruction to use a bibliography file (
dummy.json
) which includes only one (dummy) entry, different from@bard:2015introduction
. This seems sufficient to trigger the activation ofciteproc
.Result: as expected (note that not even
citeproc: TRUE
is required here).Possible solutions:
Allow the use of
citeproc
as a (pseudo-) filter (note that the the order of filters matters)Include support for using
pandoc-args
(orpandoc_args
) in a YAML metadata block.Make the following work:
A problem I see here, though, is that in this particular case
pandoc-zotxt.lua
has to be run beforeciteproc
, but there might be other filters that have to be run afterciteproc
, so the option to force a specific order of filters (and pseudo-filters) which would be possible with 1. and 2. might be best.RStudio 2022.07.1+554 "Spotted Wakerobin" Release (7872775ebddc40635780ca1ed238934c3345c5de, 2022-07-22) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_6_8) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36
quarto -v
1.1.179
Checklist
The text was updated successfully, but these errors were encountered: