-
Notifications
You must be signed in to change notification settings - Fork 26
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
Rmd build error when some citation keys are missing from Zotero #15
Comments
I find this annoying as well, but this is a limitation of the API endpoint ( https://retorque.re/zotero-better-bibtex/exporting/json-rpc/ ). I do this on an ad-hoc basis to find these references...it could be modified to walk(
rbbt::bbt_detect_citations("~/Desktop/thesis/01-chapter-introduction.Rmd"),
~try(rbbt::bbt_bib(.x, .action = rbbt::bbt_return))
) Arguably, |
@paleolimbot thanks for following things up, sorry to have postponed my response.
I think this depends on the philosophy - which of course I leave up to you. Personally, it think it would be good to have a default behaviour that would suit most usecases. IMHO, that would be the approach taken by pandoc - I'd regard consistency with pandoc's take on this as a plus. I.e., generate warnings and some replacement like '???', and handle existing citations as it would do otherwise. If Are such things now made easier by the more specific error message of the json-rpc API, discussed in #11 ? @retorquere any further opinion / ideas? |
What we're discussing here is a single issue from the perspective of BBT. I'd prefer it if would could discuss it in a single place. |
I don't think this is a bbt issue... It provides an excellent API already, especially with the latest addition. Why don't you just surround the bbt_write() call with try()? |
@paleolimbot From your example with readr::write_file(
bbt_bib(setdiff(keys, ignore), translator, library_id = library_id, .action = bbt_return),
path
) However this would cause as many calls to the API (by When one does use the below YAML header key (
IMO it would be better if the bibliography file could be populated with non-duplicated keys. I agree that your suggestion to provide Then, the question is whether this step best sits in |
I hear you, but with the new error I think it's best to leave it at that: users have will have all the information they need to sort out missing references. Perhaps this can be revisited after RStudio's new citation connections is released such that rbbt can fit with that! |
Thanks for the feedback @paleolimbot. I'm aware of the RStudio VME, see also this tentative comparative table. I made a request at RStudio to port the insert-citation tool to the source mode (issue 7876 at https://github.com/rstudio/rstudio/issues). Currently there are still some open issues with the way the Zotero database is queried. Actually in issue 7876 I've suggested to also have a look at the |
When providing an existing bibliography file in the YAML header of Rmd file, e.g.
bibliography: references.yaml
, while the Rmd file contains citation keys that are missing from that file, pandoc-citeproc does not error but mentions the missing keys - see extract from build message below. And in the rendered (html) result, the missing citation will just show as???
.However, when doing the same with
rbbt
(i.e. instead using the YAML header key, displayed in the documentation ofbbt_write_bib()
, see further), in which case the above missing citationincollection-a3e3
can be found in Zotero, but some others are missing in Zotero (they're only in the above mentionedreferences.yaml
), the build errors:A further side-effect is that the
rbbt
-generated file is emptied at this stage - while before, it still had theincollection-a3e3
record (from an earlier experiment), because that record is present in Zotero.Note that the following YAML header key was used in this:
It would be nice if citations that are missing from Zotero could just be skipped, the ones that are found could be written to the output file, and then let pandoc-citeproc handle the messaging about missing citations.
This was encountered while I was searching for ways to combine multiple bibliography files, which pandoc supports. For this example case however, combining the sources using the below key in the YAML header did not work because of the above error, even though the missing Zotero references are in
references.yaml
.The text was updated successfully, but these errors were encountered: