Render latex equations inside atom


#1

With atom, hydrogen and jupitor i can view variables and plots inside the editor:

Is it possible to render out an equation in the editor? I know it’s possible with sublime:

But when i try it with hydrogen in atom, it says “No kernel for language latex found Check that the language for this file is set in Atom and that you have a Jupyter kernel installed for it.”

Would love your help.


#2

There does not appear to be a Jupyter kernel for LaTeX, and a bit of skimming (I don’t use Jupyter or Hydrogen) suggests that the LaTeX functionality of Jupyter resides in IPython. So you would want to have the language set as Python and use the IPython methods for displaying LaTeX.

Emulating the Sublime functionality would also be possible, and much of the display code could be copied from Hydrogen, but I don’t know that it exists in the Atom ecosystem.


#3

Thank you :slight_smile:


#4

According to the documentation, Hydrogen can do this too.


#5

Any idea how?


#6

If you watch the demo on the Hydrogen web site, you can see an example. It goes by pretty fast though. It appears to use sympy.


#7

Ah i see. Nicely spotted!
Thank you. My problem is that my whole document is a .tex file. i’m guessing that’s why i’m getting the error:

  • “No kernel for language latex found Check that the language for this file is set in Atom and that you have a Jupyter kernel installed for it.”

#8

If your whole document is a .tex file, then there are LaTeX packages for atom which can compile the document and render to PDF which you can view using the atom PDF viewer package. Is that not what you are after?


#9

Oh. I see. No that’s not my problem. I only view the pdf to check typos in the equation. That’s why i’m looking for a solution so i can chck the equation in the editor :smiley:


#10

Using the latex and the pdf-view packages you can setup a two pane workspace with your LaTeX document in one pane and the PDF output in the other. When you compile the document with SyncTeX enabled it will automatically sync your cursor location to the output PDF (and vice versa). You can also set up the latex package to automatically compile on save, etc.


#11

I just remembered that the preview-inline package does this for MarkDown files already. Although it is not advertised in the description, it appears that it works for LaTeX files also.


#12

Thank you. This is perfect and exactly what i was looking for :smiley: !


#13

I personally discovered both these very useful packages today, however I cannot seem to get the synctex working with pdf-view to automatically scroll the pdf to the edit cursor location. Reverse SyncTeX works in the editor, pointing my Latex document’s cursor. Any ideas on plugging in synctex when opening pdf-view?


#14

In order for forward sync to work pdf-view should be the default viewer in the latex settings page. Also, the sync is not continuous, but is done by the latex:sync command which is usually bound to ctrl-alt-s.