BNHSX
BNHSX

Reputation: 141

how to type in latex styled variables for julia in vs code or jupyter notebook

As in Julia REPL, we can type in latex styled variables by using tab and \epsilon to get the greek letter and give it a value. Since I mainly wirte Julia codes in VS Code now, I was wondering if we could do that in vs code also? or can we do that in Jupyter notebook?

enter image description here

and in advance, can we have complicate latex styled computation formula in vs code when progrmming with the julia extension? or in Jupyter notebook

What I want to describe here is something very similar to what Mathematica can do, which makes the math equations much easier to read.

Upvotes: 4

Views: 4574

Answers (1)

Simeon Schaub
Simeon Schaub

Reputation: 775

There is a VS Code Julia extension, which does support LaTeX-like tab completion, just like in the REPL. It should also just work in Jupyter, if you have the correct Julia kernel installed. You can find out more about that here.

In terms of a Mathematica style notebook workflow, Jupyter is probably the closest. Julia code still has to be regular Unicode text, so you can't expect your code to look exactly like free-form LaTeX, but you might want to look at Latexify.jl, which can convert Julia expressions and data structure into nice-looking LaTeX code. If you output LaTeX code generated by Latexify.jl in a Jupyter cell, it should even render correctly using MathJax. Otherwise, you can also just write LaTeX formulas inside Markdown cells with Jupyter.

Upvotes: 5

Related Questions