# Q: using Latexify.jl in VS Code

**URL:** <https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136>\
**Category:** VS Code\
**Tags:** question\
**Created:** [August 2, 2022, 1:39am UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136 "2022-08-02T01:39:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Audrius-St](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/audrius-st/32/24175_2.png) [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Post date:** [August 2, 2022, 1:39am UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/1 "2022-08-02T01:39:28Z")

</div>

Hello,

I would like to display an equation using Latexify in the VS Code IDE.  
The MWE is

```julia
# test_latexify_main.jl

using Symbolics
using Latexify 

function main()

    @variables x, t
    @variables Φ(x, t)

    Dx = Differential(x)
    D2x = Dx * Dx

    Dt = Differential(t)

    # Dimensionless simple reaction-diffusion equation
    ∂Φ∂t = D2x(Φ) - Φ^2
    println("∂Φ∂t = ", ∂Φ∂t, "\n")

    display(latexify(∂Φ∂t))

end

begin
    main()

end

```

which I runs as a script in the Julia REPL  
julia\> include(“test\_latexify\_main.jl”)

resulting in the output to terminal

```julia
∂Φ∂t = Differential(x)(Differential(x)(Φ(x, t))) - (Φ(x, t)^2)

L"\begin{equation}
 - \left( \Phi\left( x, t \right) \right)^{2} + \frac{d(d / (d * x))(\Phi(x, t))}{dx}
\end{equation}

```

How to render this to a PDF or graphical image?

Julia 1.7.3  
Windows 11

---

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [August 2, 2022, 2:51am UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/2 "2022-08-02T02:51:17Z")

</div>

You need `render` not `display`.

[https://korsbo.github.io/Latexify.jl/stable/#External-rendering](https://korsbo.github.io/Latexify.jl/stable/#External-rendering)

---

<div class="post-metadata">

**Author:** ![Audrius-St](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/audrius-st/32/24175_2.png) [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Post date:** [August 2, 2022, 4:15am UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/3 "2022-08-02T04:15:39Z")

</div>

Thanks for your suggestion and link.

I had tried using `render` rather than `display` as per the documentation

` render(latexify(∂Φ∂t))`

which resulted in the following output

```julia
julia> include("test_latexify_main.jl")
∂Φ∂t = Differential(x)(Differential(x)(Φ(x, t))) - (Φ(x, t)^2)

L"\begin{equation}
 - \left( \Phi\left( x, t \right) \right)^{2} + \frac{d(d / (d * x))(\Phi(x, t))}{dx}
\end{equation}
"
dvilualatex: security risk: running with elevated privileges
ERROR: LoadError: failed process: Process(`dvilualatex --interaction=batchmode 'C:\Users\AUDRIU~1\AppData\Local\Temp\jl_Pf2Br11rCk.tex'`, ProcessExited(1)) [1]

```

I have no idea what the above error message means.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [August 2, 2022, 11:13am UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/4 "2022-08-02T11:13:03Z")

</div>

It means this command failed:

```julia
dvilualatex --interaction=batchmode 'C:\Users\AUDRIU~1\AppData\Local\Temp\jl_Pf2Br11rCk.tex'

```

To debug it, try opening PowerShell (or some other shell if you have a favorite), and run

```julia
cd C:\Users\AUDRIU~1\AppData\Local\Temp
dvilualatex --interaction=batchmode jl_Pf2Br11rCk.tex

```

---

<div class="post-metadata">

**Author:** ![tobydriscoll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobydriscoll/32/1843_2.png) [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Post date:** [August 2, 2022, 7:07pm UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/5 "2022-08-02T19:07:30Z")

</div>

This may be off topic, but unless you need to generate a lot of these fully automatically, you might want to try something like [KLatexFormula](https://klatexformula.sourceforge.io) with the latexify code pasted in. It’s easier to control the latex enviro, make adjustments, choose output format, etc.

---

<div class="post-metadata">

**Author:** ![trilobit](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@trilobit](https://discourse.julialang.org/u/trilobit)\
**Post date:** [August 3, 2022, 7:04am UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/6 "2022-08-03T07:04:09Z")

</div>

You also need the package: “LaTeXStrings” to render a LaTeX-String  
i.e.

> using Latexify, LaTeXStrings  
> latexify(L"\Huge\int\_0^\infty \frac{x^3}{e^x-1},dx = \frac{\pi^4}{15}", render=true);

---

<div class="post-metadata">

**Author:** ![Audrius-St](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/audrius-st/32/24175_2.png) [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Post date:** [August 3, 2022, 5:23pm UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/7 "2022-08-03T17:23:54Z")

</div>

> [@trilobit](#):
>
> latexify(L"\Huge\int\_0^\infty \frac{x^3}{e^x-1},dx = \frac{\pi^4}{15}", render=true);

Ran your example in a script and directly in the REPL.  
Same error message for both

```julia
julia> using LaTeXStrings
julia> using Latexify
julia> latexify(L"\Huge\int_0^\infty \frac{x^3}{e^x-1},dx = \frac{\pi^4}{15}", render=true);
ERROR: failed process: Process(`lualatex --interaction=batchmode 'C:\Users\AUDRIU~1\AppData\Local\Temp\jl_9VPRJ56YK7.tex'`, ProcessExited(1)) [1]

```

---

<div class="post-metadata">

**Author:** ![trilobit](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@trilobit](https://discourse.julialang.org/u/trilobit)\
**Post date:** [August 3, 2022, 9:07pm UTC](https://discourse.julialang.org/t/q-using-latexify-jl-in-vs-code/85136/8 "2022-08-03T21:07:13Z")

</div>

Perhaps you have another problem in your OS ?

On my PC the script and in the REPL the LaTEX-strings are rendered correct.  
.

 ![Untitled](https://global.discourse-cdn.com/julialang/original/3X/9/8/98abb1891ecd5349eee6ccb51a2a0ea5d9bec515.webp)

Julia (not in VSC) renders a .PDF
