Pandoc: Create subset of bib-file

Created on 5 Oct 2020  路  9Comments  路  Source: jgm/pandoc

Don't know if this issue goes here or to pandoc. Anyway, would it be possible to add a command that creates a bibliography file containing only the references cited in a given document?

citeproc enhancement

Most helpful comment

All 9 comments

Pandoc does that automatically, doesn't it?
If not, it's a change from pandoc-citeproc and we should fix it.
This library does not do that yet, but we could add a filter feature.

Yes, I confirmed that pandoc does this.

I'm not sure it's needed for this library. The library takes a list [Reference a] which you can filter as you wish.

Perhaps the command-line tool could use a feature like this, though.

Pandoc does that already? How?

To clarify, I imagine you have a main.json bibfile but create a used-items.json file based on the references in a given document.

What I meant is that, in constructing a bibliography in a document, pandoc includes only cited references (unless you use nocite to indicate others.

Sounds like you want something different: create target-bibliography from source-bibliography, using only citations cited in other-document.

This would involve a change to pandoc, so I will move this issue there.

I don't have good ideas so far about a clean way to do this.

If you need something in a short term I have a python script that does this on my (constrained) YAML files.

https://github.com/reagle/pandoc-wrappers/blob/master/md2bib.py

If you need something in a short term I have a python script that does this on my (constrained) YAML files.
https://github.com/reagle/pandoc-wrappers/blob/master/md2bib.py
Thanks, I remember having seen this before. I actually don鈥檛 really need it at the moment, but I think it would be nice to have. Maybe this could be also a nice task for a lua filter.

You called?

@tarleb Thanks for the hint. That's a good solution when using a bibtex-centric workflow. The downside is that this will require a latex run, and a solution with less dependencies might be favorable. Anyway, I using a filter could work here, and it's debatable how many features should end up in pandoc itself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgm picture jgm  路  48Comments

graymalkin picture graymalkin  路  54Comments

jgm picture jgm  路  62Comments

stepht picture stepht  路  54Comments

anton-k picture anton-k  路  53Comments