DCsunset / pandoc-include

A pandoc filter to allow file and header inclusion
MIT License
63 stars 14 forks source link

Include support for bibliography #14

Closed Gjacquenot closed 3 years ago

Gjacquenot commented 3 years ago

Pandoc now allows native support for bibliography. However when a citation is made inside an included document, the citation is not rendered.

Is it possible to add support for bibliography ?

pandoc --citeproc --bibliography=doc.bib  main.md --filter pandoc-include -o main.html

with main.md

# Hello world

!include chap01.md

## References

::: {#refs}
:::

with chap01.md

# Chapter 1

[@MyBibliographicRef]
DCsunset commented 3 years ago

The pandoc command-line options are processed in order. Therefore --citeproc and --bibliography=doc.bib should be placed after --filter pandoc-include to let it process the reference in chap01.md.

The command should be

pandoc main.md --filter pandoc-include --citeproc --bibliography=doc.bib -o main.html
Gjacquenot commented 3 years ago

Thanks for the answer.

Maybe, it is worthy to mention that option order is important in the main Readme.md and give this bibliogrpahic example?

DCsunset commented 3 years ago

Thanks for your suggestion. I will add it to the Readme soon.