# WhoShouldICite.jl, idea for bibliography generation

**URL:** <https://discourse.julialang.org/t/whoshouldicite-jl-idea-for-bibliography-generation/40354>\
**Category:** Community\
**Created:** [May 28, 2020, 4:35pm UTC](https://discourse.julialang.org/t/whoshouldicite-jl-idea-for-bibliography-generation/40354 "2020-05-28T16:35:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jagot/32/12217_2.png) [@jagot](https://discourse.julialang.org/u/jagot)\
**Post date:** [May 28, 2020, 4:35pm UTC](https://discourse.julialang.org/t/whoshouldicite-jl-idea-for-bibliography-generation/40354/1 "2020-05-28T16:35:46Z")

</div>

I hope this is the right subforum.

I had a showerthought ™, how about a small package that collates all prior work you should cite? In addition to citation.bib, which I understand is to properly cite the author(s) of a package, it could be interesting to tag specific functions in a package – I have not derived every equation or algorithm I’ve implemented in a package, and the researchers beyond those could also deserve recognition, or it might just be interesting to see which research is behind all the computations you do.

I thought of something like this:

```julia
function spiffy_algorithm(args...)
    ...
end
@reference spiffy_algorithm Bethe1977 "Equation (63.2)" more optional arguments here ...

```

This could possibly also modify the docstring for you. Then, when your fantastic computation works, you could maybe run something like

```julia
@whoshouldIcite my_calculation()

```

which would trace all `@reference`-tagged functions and collect them in a tree structure, containing function name, package + author, reference (BibTeX code), and the optional extra remarks. Then it’s up to your conscience how deep or shallow your citations will be 😛

This is way beyond what I have time or knowledge for, but it was a neat idea, I thought.

---

<div class="post-metadata">

**Author:** ![ranocha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ranocha/32/35588_2.png) [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Post date:** [May 28, 2020, 5:15pm UTC](https://discourse.julialang.org/t/whoshouldicite-jl-idea-for-bibliography-generation/40354/2 "2020-05-28T17:15:15Z")

</div>

I like that idea. It reminds me a bit of the way you can register references/citations within PETSc and [retrieve them from the command line](https://www.mcs.anl.gov/petsc/documentation/referencing.html).

I implemented a [very basic version of such an idea](https://github.com/ranocha/Postprocessing.jl/blob/3a3fa8994487c0bc390110222e9d7665fcf9b3e7/src/total_variation.jl#L133) in one of my draft packages. There, I just define a function `reference` which returns a `String` containing a bibtex entry for given argument functions/algorithms. That’s not really perfect and your idea described above seems to be much more useful (but also involved).

Related discussions here on discourse:

- [Citations in docs - #38 by mpastell](https://discourse.julialang.org/t/citations-in-docs/5066/38)
- [Replacing CITATION.bib with a standard metadata format - #25 by stevengj](https://discourse.julialang.org/t/replacing-citation-bib-with-a-standard-metadata-format/26871/25)

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [May 28, 2020, 5:23pm UTC](https://discourse.julialang.org/t/whoshouldicite-jl-idea-for-bibliography-generation/40354/3 "2020-05-28T17:23:43Z")

</div>

grep?

---

<div class="post-metadata">

**Author:** ![jagot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jagot/32/12217_2.png) [@jagot](https://discourse.julialang.org/u/jagot)\
**Post date:** [May 28, 2020, 5:38pm UTC](https://discourse.julialang.org/t/whoshouldicite-jl-idea-for-bibliography-generation/40354/4 "2020-05-28T17:38:49Z")

</div>

@ranocha Yes, the `reference(::typeof(function_name))` was the first thing I thought of, but then more ideas kept popping up. I guess the tracing could be done with a Cassette-based algorithm.

@PetrKryslUCSD Sure, `grep` _could_ do parts of what I thought about, but still a lot of postprocessing would be necessary, and it would not be able to find the packages/functions I need to cite for me; I would have to manually go to each package directory and `grep` there.
