according to https://towardsdatascience.com/5-ways-julia-is-better-than-python-334cc66d64ae it says (under item 2) the following
Julia code is universally executable in R, Latex, Python, and C.
I googled a little bit and could not find an example of how to do this. of course one would need to have Julia itself installed on one's PC in addition to TexLive.
I am not talking about listing Julia code in Latex of course. Or about using Latex inside Julia.
The above says Julia code executable in Latex
, which for me, means one can write some Julia function and call it from Latex and get the result back. Same as using Lua from Lualatex now. And the same when calling Python from Latex.
At least this is how I read the above.
If so, could we have a very small example of how to do this?
For starter, here is a MWE I wrote sometime ago about using Python in Latex
\documentclass[11pt]{article}%
\usepackage{pythontex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{pyconsole}
x = 987.27
x = x**2
\end{pyconsole}
The variable is $x=\pycon{x}$
\end{document}
Which needs to be compiled like this:
pdflatex foo.tex
/usr/local/texlive/2019/bin/x86_64-linux/pythontex foo.tex
pdflatex foo.tex
How to do something similar to the above for Julia?
pythontex
I used in the example, is needed when calling Python from Latex. – Nasser Apr 17 '20 at 7:15pythontex
is "basic"; but actally everything works :D – Tomáš Kruliš Apr 17 '20 at 10:44