This problem has actually already been solved in some packages, like my Reduce.jl package, which can turn Julia code into LaTeX code and also display it as LaTeX in IJulia:

```
julia> using Reduce
julia> :(sin(x*im) + cos(y*φ)) |> latex |> print
\documentstyle{article}
\begin{document}
\begin{displaymath}
\cos \left(\left(\left(\sqrt {5}+1\right) y\right)/2\right)+\sinh \,x\: i
\end{displaymath}
\end{document}
```

also SymPy.jl can also convert to latex.

of course, making a plain Julia package that does this without any external programs would be nice too.