Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for latex output in VSCode Jupyter notebook #136

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rstanuwijaya
Copy link

Background

While jupyterlab and jupyter notebook able to detect the latex output automatically, VSCode Jupyter could not do the same. VSCode Jupyter will only render latex equation if the output mimetype is text/latex, whereas the current version only supports text/html and text/plain as a fallback

I added changes such that it will enable text/latex mimetype output when the evaluation result allows. On my changes, I added toTeX method, which will wrap the result with $$ to allow proper rendering from VSCode.

Comparison

image
image

@BinaryQuantumSoul
Copy link

This is awesome.
It works perfectly for one line results.
It also works nice for simple results one above each other.

A little caveat I saw though,
If you print the outputs from inside a single function call,
it will give only one output which is composed of two different TeXForm, therefore it's not detected and not formatted. What I wanted to try is to use CellPrint[ExpressionCell[expr//TeXForm]] instead of print. However, CellPrint doesn't work inside vscode jupyter.

Another question is how could we automatically add TeXForm to math equations to not have to write it on each cell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants