-
Notifications
You must be signed in to change notification settings - Fork 481
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
Proposal to add support for BibTeX citations and references #1162
Comments
Yes, I do think a plugin package is a way to go and starting from Citations is probably a good start. Among other things, it would be nice if core Documenter wouldn't depend on things like BibTeX.jl.
I won't have time to work on this feature myself really, I would be happy to brainstorm this here or on Slack. I can give a hand with whatever refactoring might be necessary for Documenter's internals though. |
Hi! A while ago I ported most of pybtex to Julia to allow markdown, latex and plain text output from a bib file. The package is BibTeXFormat.jl The package still needs some work and I don't have much time to devote to this, but perhaps, it can be useful. |
Sounds like a great idea for a GSOC project? |
Or possibly a Code-In project, if someone was willing to provide some guidance? |
Maybe it exists in |
Sorry to let this issue sit around for so long but thanks to @Azzaare and his new Bibliography.jl package I think I was able to get a minimal working example of hacking in Bibliography.jl as a Documenter.jl "plugin" without too much work! I’ve put up the code up on https://github.com/ali-ramadhan/DocumenterBibliographyTest.jl but it's a little messy ( Too lazy to set up documentation builds but here's a screenshot of a page with two references: @article{ahu61,
author={Arrow, Kenneth J. and Leonid Hurwicz and Hirofumi Uzawa},
title={Constraint qualifications in maximization problems},
journal={Naval Research Logistics Quarterly},
volume={8},
year=1961,
pages={175-191},
doi={10.1002/nav.3800080206}
}
@book{ab94,
author = {Charalambos D. Aliprantis and Kim C. Border},
year = {1994},
title = {Infinite Dimensional Analysis},
publisher = {Springer},
address = {Berlin},
url = {https://www.springer.com/gp/book/9783540295860}
} # DocumenterBibliographyTest.jl documentation
Hi!
In this page I will cite an article [ahu61](@cite) and a book [ab94](@cite).
# References
```@bibliography``` The idea is that you read in a Limitations: 1 |
Thank you for your work, this is what I was hoping for in Markdown code :) I wouldn't mind having this within documenter directly, though it adds Bibliography.jl as a dependency. Just for the limitations I think one of those should be resolved, I can either have one large bib-file (which is what I prefer) and a selection printed or a bib-file per page for example and printing all. Would it be possible to print only cited ones? That would be great. edit: another possibility is of course to have the bibliography on its own page (a |
@kellertuer I updated the test repo with a bibliography on its own page ( Regarding the limitations, I don't know enough about Documenter.jl to implement printing only cited references. The I think it shouldn't be too hard to add support for multiple bibliographies but I'm not sure which approach would be best. We can write e.g. For a very first version of this plugin, allowing only one |
Cool, so then one of my approaches would work! I think I prefer the one with only-cited ones, but you are right, it might b worth first checking for the plugin and its design and then (maybe with the help from more experienced Documenter programmers) extend the plugin to the two other features. |
This is cool @ali-ramadhan! Just a few thoughts from me:
The internal APIs, that I can see, that we'd need to formalize:
|
The plugin exists now: https://github.com/JuliaDocs/DocumenterCitations.jl |
It not only exists, it also works really great! 👍 |
Hi Documenter devs,
A few of us would love to see support for in-text citations and reference generation in Documenter through BiBTeX (see CliMA/ClimateMachine.jl#152 and CliMA/Oceananigans.jl#474).
I guess I envision being able to pass a BibTeX file to Documenter and automatically be able to cite references in the text with something like
[<label>](@ref)
(which would pull the info from the BibTeX file), and also generate a bibliography from the BibTex file through something likeI'm wondering if this is something that could be worked on by someone unfamiliar with Documenter. Thought it might be good to open an issue first to see if it's possible and if I'm missing anything. Not sure of the best approach but here's what I've gathered so far.
It looks like there was an attempt back in 2017 by @lucianolorenti to add a
bibtex
option tomakedocs
that allowed citations with[<label>](@ref)
: #379 (comment)But it had to use the Python package
pybtex
to parse bibtex files. But since then there's been a native Julia parser: https://github.com/JuliaTeX/BibTeX.jlSo maybe if we can get that
bibtex
option to work with BibTeX.jl then we can pretty easily have citations in Documenter?But then I came across a recent issue (#1018) where @mortenpi suggested that proper bibliography support should be done via a plugin like Citations.jl, although it was mentioned on Slack that it's an unmaintained package that would need some work to bring it up to speed with the current version of Documenter and it would have to be registered.
It seems like the best approach would be to polish off Citations.jl to work with Documenter v0.24 and register it? Would #745 have to be resolved first?
cc @glwagner @charleskawczynski @simonbyrne who might be interested as well.
The text was updated successfully, but these errors were encountered: