inukshuk / jekyll-scholar

jekyll extensions for the blogging scholar
MIT License
1.13k stars 101 forks source link

Multiple bib files with continuous numbering #144

Open dpo opened 8 years ago

dpo commented 8 years ago

My bibliography is split into multiple files. In _config.yml, I indicate source: ./_bibliography but not bibliography: reference.bib. I would like to create a complete bibliography containing all the references. I also would rather not add YAML headers to the bib files because the same bib files are used by LaTeX elsewhere.

Is there a way to indicate bibliography: *.bib in the config? The star syntax didn't work for me.

Alternatively, in one of my Markdown files, I can indicate

{% bibliography --file bib1 %}
{% bibliography --file bib2 %}

etc., but that has the side effect of restarting the numbering at 1 for each new file.

Is there a way, other than merging all the bib files into one?

Thanks!

inukshuk commented 8 years ago

I don't think so, no. The first approach is probably fairly easy to implement though -- we could simply allow the bibliography value to be an array (or support globs/wildcards) and combine all the entries from each file.

inukshuk commented 8 years ago

Somewhat related to #157

solarchemist commented 8 years ago

Allowing the bibliography value to be an array would be great. My use case is that I have one main bibtex file which is maintained by Mendeley, and in another I put manually curated bibtex entries.

For now I have a work-around that copies the Mendeley bib-file into Jekyll's _bibliography folder, adds an empty YAML frontmatter, and finally appends the contents of the second bibtex file into it.

#!/bin/bash
cp -a /mendeley/library.bib /jekyll/site/_bibliography/library.bib
sed -i '1i ---\n---\n' /jekyll/site/_bibliography/library.bib
printf "\n\n\n"
cat /jekyll/site/_bibliography/secondary.bib >> /jekyll/site/_bibliography/library.bib
eatdust commented 6 years ago

+1 for array input!!! bibliography --file a.bib --file b.bib --file c.bib works fine, but it still prevents a liquid forloop over a variable :(