In R one can easily obtain citation info by running citation()
function
>> citation()
To cite R in publications use:
R Core Team (2018). R: A language and environment for statistical
computing. R Foundation for Statistical Computing, Vienna, Austria.
URL https://www.R-project.org/.
A BibTeX entry for LaTeX users is
@Manual{,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2018},
url = {https://www.R-project.org/},
}
We have invested a lot of time and effort in creating R, please cite it
when using it for data analysis. See also 'citation("pkgname")' for
citing R packages.
This extends to packages as well.
>> citation("ggplot2")
To cite ggplot2 in publications, please use:
H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
Springer-Verlag New York, 2016.
A BibTeX entry for LaTeX users is
@Book{,
author = {Hadley Wickham},
title = {ggplot2: Elegant Graphics for Data Analysis},
publisher = {Springer-Verlag New York},
year = {2016},
isbn = {978-3-319-24277-4},
url = {https://ggplot2.tidyverse.org},
}
I would like to have this functionality in Julia as well. I envision non-exported function Base.citationinfo()
, which returns CitationInfo
object that is displayed appropriately. Then packages can extend this method (e.g. JuMP.citationinfo()
) to return CitationInfo
object with their own citation info.
Then we can have a Citations.jl
package with the method
Citations.cite(ci::CitationInfo, s::Style = BibTeX)
that outputs citation info in various citation styles (BibTeX, MLA, APA, etc.) defaulting to BibTeX.
Why can't the Citations.jl
package handle this on its own?
If CitationInfo
is defined in Citations.jl
then packages that want to just add the citation info would have to have Citations.jl
as a dependency, but this is irrelevant to most users since only a minor subset of package users want to cite them. Alternatively the maintainer of Citations.jl
would have to add citation info for every package in the ecosystem, which does not scale.
If CitationInfo is defined in Citations.jl then packages that want to just add the citation info would have to have Citations.jl as a dependency
What is the problem with this? The alternative is to just store some file with metadata in the package that the Citations.jl package can just read, no dependency needed.
The current convention seems to be that packages wanting to be cited have a CITATION file at their top-level, like we have README/CONTRIBUTING/etc. That's what Base, Optim and DiffEq do, for instance. I think this is fine; we could also have a citation
function that would read this file if it exists.
We started having a CITATION.bib file in various packages. Perhaps that is good enough for now? Documented at: https://julialang.org/research/
I think any capabilities to read and present this data can easily be added in a package.
I think this is best discussed on discourse
https://discourse.julialang.org/t/replacing-citation-bib-with-a-standard-metadata-format/26871
In any case, there's zero reason to put support for citations in the base language. There's also no reason that packages that contain citation information would have to depend on a citation library as far as I can tell. All you need is:
Most helpful comment
In any case, there's zero reason to put support for citations in the base language. There's also no reason that packages that contain citation information would have to depend on a citation library as far as I can tell. All you need is: