pandoc-ext / multibib Goto Github PK
View Code? Open in Web Editor NEWGenerate multiple, topic-specific bibliographies.
License: MIT License
Generate multiple, topic-specific bibliographies.
License: MIT License
The multibib
/multiple-bibliographies
filters are not compatible with citefield. I cannot say where the problem lies, but both (multibib
/multiple-bibliographies
& citefield
) are compatible with citation-backlinks
, so it seems that it should be a matter of adjusting something. However, it could be that the multibib
filter is resolving all the inline citations and that when citefield
comes around there is nothing left to do. In this case, it seems that the citefield
filter would have to be incorporated into the multibib
filter somehow for it to work. But I am not sure about this yet.
Und eine Kleinigkeit mehr...
The configuration is the same in both cases. Just the filter is different (multibib/multiple-bibliographies).
When running Pandoc normally, it applies a Bibliography style to the references in docx
output. It would be brilliant if this filter could do the same.
I am using R version 4.2.2 and pandoc version 3.1.1 on MacOS Big Sur 11.6.
I am trying to use this filter to add multiple bibliographies to my academic CV with the vitae
package. I link to a reproducible example of my issue below.
When I try to compile the document, I get the following output:
[WARNING] Citeproc: Citation with no printed form:
[WARNING] Citeproc: Citation with no printed form:
! You can't use `\vadjust' in vertical mode.
l.130 \leavevmode\vadjust
pre{\hypertarget{ref-4}{}}%
Error: LaTeX failed to compile cv_temp_test.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See cv_temp_test.log for more info.
Execution halted
I have successfully used this lua filter to knit a Word Document with Bookdown, so this appears to be an issue with knitting to a PDF specifically.
Thanks for your wonderful work on this filter. When I run it with pandoc 3.2.1, I receive warnings on all citations whether or not they render correctly. For example, running on the base directory of this repository:
$ pandoc test/input.md --lua-filter=multibib.lua
[WARNING] Citeproc: citation Bae not found
[WARNING] Citeproc: citation Knu86 not found
[WARNING] Citeproc: citation Bel not found
[WARNING] Citeproc: citation Nie72 not found
I'm sure I'm doing something silly here, but with Quarto 1.3.450, pandoc 3.1.8, quarto render books.qmd --to markdown
gives:
ERROR: Validation of YAML front matter failed.
ERROR: In file books.qmd
(line 7, columns 4--24) Field "bibliography" has value main: main_books.bib, which must instead be a string
6: bibliography:
7: main: main_books.bib
~~~~~~~~~~~~~~~~~~~~~
8: filters:
✖ The value main: main_books.bib is of type object.
ℹ The error happened in location bibliography.
ERROR: Render failed due to invalid YAML.
Should I be asking for help here or on Quarto forums?
Test file (I don't think you need the bib file to diagnose this ...?)
---
title: "Annotated bibliography"
bibliography:
main: main_books.bib
filters:
- multibib
---
## Primary references
::: {#refs-main}
:::
In some cases, a reference may be present in more than one bibliography file. Would it be possible to avoid this repetition? That is, if a reference has already appeared in a previous bibliography section/file, to avoid displaying it again.
## Bib 1
::: {#refs-some-references} <!-- if it appears here -->
:::
## Bib 2
::: {#refs-other-references} <!-- avoid displaying it again here -->
:::
I have no idea if this is feasible, to be honest.
I noticed a curious pattern. It happens when using multibib
and converting to typst
. The inline citations are not getting rendered, instead they are being converted to the typst markup.
Here is how a working document looks like after conversion to HTML.
(base) ➜ mwe3 pandoc -f markdown index.qmd -dfilters --to html
[WARNING] Citeproc: citation EN not found
<p><span class="citation" data-cites="EN">(<a href="#ref-EN"
role="doc-biblioref">Aristotelis 1831</a>)</span>.</p>
<div id="refs-primary" class="references csl-bib-body hanging-indent"
data-entry-spacing="0" role="list">
<div id="ref-EN" class="csl-entry" role="listitem">
Aristotelis. 1831. <span>“Ethica Nicomachea.”</span> In <em>Aristotelis
Opera</em>, edited by Immanuel Bekker. Berlim: Reimer.
</div>
</div>
(base) ➜ mwe3
Here is how the same file converts to typst.
(base) ➜ mwe3 pandoc -f markdown index.qmd -dfilters --to typst
[WARNING] Citeproc: citation EN not found
#cite(<EN>);.
#block[
#block[
Aristotelis. 1831. “Ethica Nicomachea.” In #emph[Aristotelis Opera];,
edited by Immanuel Bekker. Berlim: Reimer.
] <ref-EN>
] <refs-primary>
(base) ➜ mwe3
Instead of #cite(<EN>)
we should be getting Aristotelis 1831
.
Here is a MWE.
I still have no idea where the error could be. Using pandoc 3.1.11.
Hi,
I was wondering if that could be used in quarto for books (PDF) . The idea would be to have a refernce section for each chapter of my book that has a reference section in their qmd file.
I tried the following as a _quarto.yml file but it does not work
project:
type: book
book:
title: "Test"
author: "name"
date: "15.06.2023"
chapters:
- index.qmd
- part: "part1"
chapters:
- Article1.qmd
- Article2.qmd
- part: "part2"
chapters:
- Chapter1.qmd
filters:
- multibib
bibliography:
Art1: refArt1.bib
Art2: refArt2.bib
format:
html:
theme: cosmo
pdf:
documentclass: scrreprt
editor: visual
In Article1.qmd I have a reference section
## References {.unnumbered}
::: {#refs-Art1}
:::
and the same principle in Article2.qmd.
Any idea how this would be possible or what I could try next ?
Is it possible to get continuous number between the two bibliographies? Currently, the citations are given for example 1-18, while the corresponding two bibliographies with 9 entries each would both show 1-9. The numbering of the citations in the text are therefore not consistent with the numbering in the bibliographies.
I am experiencing a similar issue to the one I encountered previously (and resolved) when using the section-bibliographies filter (link to description of section-bibliographies issue). That is, using RStudio/Quarto I installed the multibib
extension and added multibib
to the filters entry in the document's YAML header. When I render the document (to PDF), I get the error message, "Error running filter multibib: Could not find executable multibib". I then added the full relative path for multibib.lua
to the multibib
filter entry (/_extensions/pandoc-ext/multibib/multibib.lua
). That errors with the message, "Error running filter /_extensions/pandoc-ext/multibib/multibib.lua: cannot open /_extensions/pandoc-ext/multibib/multibib.lua: No such file or directory." Using the full absolute file path produces the same error message. I have confirmed that multibib.lua
is present in the referenced directory. The relevant portion of the YAML is as follows:
bibliography:
main: translocation.bib
supporting: supporting_info.bib
filters:
- multibib
validate-yaml: false
csl: pnas.csl
format: pdf
Do you have any suggestions on how to resolve this?
Environment: Quarto 1.2.335, RStudio 2023.09.1+494, OS Ubuntu 22.04.3 LTS
I am getting a ERROR: Render failed due to invalid YAML
on Quarto 1.2.313.
3: bibliography:
4: sources: test/primary.bib
~~~~~~~~~~~~~~~~~~~~~~~~~~
5: recommended-reading: test/secondary.bib
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The value must instead be a string.
Probably related to quarto-dev/quarto-cli#2349 (comment).
There some demand for recursive citations, i.e. handling \cite commands within the bibliographies themselves, usually in the BibTeX note field. See this exchange on pandoc-discuss. Would you be interested in a PR adding this?
I've written a recursive citeproc filter that we use in the journal dialectica. I'm considering updating it for Quarto, but I'd be glad to contribute to section-bibliographies and multibib and use one of these instead.
I'd try to make the addition as lightweight as possible when no recursion is needed by first scanning the first citeproc pass's output with a filter {{ Citation = function(elem) has_citations = true end }}
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.