Julia code with references (Latex style). Can I write a code and a paper in one file?

Is it possible to include in the code file reference to papers or other code lines? So can I write code and include a latex command like \citet \eq and others.

I would be helpful to comment code.

You can reference some things like code etc. if you’re using Documenter
https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@ref-link-1
I’m not exactly sure what you want though, for latex to run through your code and find latex references?

2 Likes

I wonder about next two futures:

  1. in comment have ability to cite some papers. For instance: "here we use the number from \citet{boroner1974}.
    1.1) As result, there have to be reference block somewhere
  2. I would like to comment cite to other line of code: For instance: "Additional explanation can be found \ref{…}. OR "Here we use this equation: \ref

To sum up, I would like that comments would be like latex document, since a lot of people use Julia for research computations, it would be very helpful.
In additional, it would be great to write a code and a paper in one file.

I might be mistaken, but what you describe sounds a lot like “Literate Programming” ; have you looked at packages providing such features? The two names that come to mind are:

3 Likes