-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for note
and eprint
fields
#32
Conversation
I would be fine with this in style if I could read the docs – are they pushed somewhere (into some |
1ee80b2
to
6315738
Compare
6315738
to
1e0b14e
Compare
Good point! I (manually) added a preview at https://juliadocs.org/DocumenterCitations.jl/previews/PR32 I also tweaked the CI so that it uploads the built documentation as an artifact, e.g., in https://github.com/JuliaDocs/DocumenterCitations.jl/actions/runs/5718645355 Lastly, if you can clone the branch, you should be able to run |
TIL about the For my own reference: https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786 |
Yes that one I meant. That usually even creates a link in the list of CI checks to directly look at the preview. |
This looks good so far, but there is no mention of |
Good point, I'll rephrase that part of the documentation. There is an example for a note, technically: [GoerzSPIEO2021]. That even has html code in the note to render a link, although I don't think that's really going to be an officially supported feature (better to have some latex syntax like I'll add some more examples for things with notes, including Thanks for the feedback! Just a heads up: I'll be on conference travel myself next week, so I'll probably keep this (and #31) open until I get back on Aug 14. |
Cool! And no worries about the time line, this is not urgent. Enjoy your conference! |
e1dcaf8
to
9235cf6
Compare
I've added a significant number of additional examples for notes/eprints, see https://juliadocs.org/DocumenterCitations.jl/previews/PR32/references/ As part of this, I've also fixed some formatting issues (punctuation, and handling missing fields). See NEWS.md. In principle, this should also be ready to merge, except that I have to rebase after #31 is merged. |
@@ -165,6 +165,8 @@ @article{GoerzJPB2011 | |||
Doi = {10.1088/0953-4075/44/15/154011}, | |||
Pages = {154011}, | |||
Volume = {44}, | |||
eprint = {1103.6050}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question on this one – how do you know this is an arXiv preprint? Or is that the default? In BibLaTeX there is EPRINTTYPE
for that, see, e.g. https://github.com/JuliaManifolds/Manopt.jl/blob/b574950cf349013232e8ab07fa355046bd90e8d3/docs/src/references.bib#L504-L517, and I already have a few that are HAL ( https://hal.science/?lang=en, mainly French authors) which would require a different url prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field for that is Archiveprefix
. It's supposed to be an alias for eprinttype
(cf. the biblatex manual). I don't think Bibliography.jl understands eprinttype
, though (but it should, so that would be something to open an issue on; also primaryclass
/eprintclass
). ArXiv itself recommends Archiveprefix
.
The one thing I did was make Archiveprefix={arxiv}
the default (which you can also do in LaTeX). See the notes on the Syntax for the .bib
file in the PR.
Other Archiveprefixes (e.g., Archiveprefix={bioRxiv}
) are supported and will render correctly, but currently aren't linked. I'm very open to adding support (i.e., automatic linking) for other preprint servers. All I need to know is the mapping from eprint
to a URL for a given preprint server.
Actually, bioRxiv is the only other preprint server I was even aware of, and I couldn't find any LaTeX .bst
file that has linking support for it (or any other preprint server besides arXiv). Not that that should prevent me from adding support, as soon as someone requests it.
So yeah, if you can open a new issue for HAL with a link to how HAL defines eprint
identifiers and how that maps to a URL/DOI, I'll be happy to add linking support for it in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification :)
Sure we should link probably at least bioRxiv and HAL – I can check for the URL, since I have that somewhere in my LaTeX/BibLaTeX document header.
if archive_prefix == "arXiv" | ||
link = "https://arxiv.org/abs/$eprint" | ||
end | ||
return linkify(text, link) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we could add for archive_prefix == "HAL"
return linkify(text, link) | |
if archive_preprint == "HAL" | |
link = "https://hal.science/$(eprint)/" | |
end | |
if archive_preprint == "biorxiv" | |
link = "https://www.biorxiv.org/content/$doi" | |
end | |
return linkify(text, link) |
For HAL see e.g. https://hal.science/hal-03909427/, where the eprint id is hal-XXXXXXXX
.
For biorXiv I am not sure they have IDs still, since e.g. https://www.biorxiv.org/content/10.1101/2023.03.06.531268v1 just uses the DOI as identifier – one could still do exactly that, use the doi, though that leaves the eprint field ignored in this case. I sketched the code above and hope that works as intended :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add bioRxiv and HAL support in another PR after this is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#35. Looks like the official ID for bioRxiv is only the last part of the DOI (excluding the 10.1101
prefix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new PR is of course fine – and yes you are correct, since the first part of the DOI identifies the publisher.
This includes a significant number of formatting fixes.
9235cf6
to
1fcb537
Compare
This is ready to be merged. If there are no further comments/reviews, I'll merge on Friday and then immediately start addressing #35 in a new PR. If someone else wants to merge this before Friday, that's fine too ;-) |
Closes #20
There is also a workaround for Humans-of-Julia/BibInternal.jl#22. If @Azzaare can merge Humans-of-Julia/BibInternal.jl#23 before we merge this, I can remove the monkeypatched
Bibliography.BibInternal.make_bibtex_entry
.I've also rewritten the "Syntax for the .bib file" section in the documentation a bit to include some of the discussion in #15, with some tips on how to write a "good"
.bib
file.Currently, this builds on top of PR #31. Once that is merged, I will rebase.