Hacker News new | past | comments | ask | show | jobs | submit login
JupyterLab LaTeX – live-editing of LaTeX documents in JupyterLab (github.com/jupyterlab)
94 points by gjvc 8 months ago | hide | past | favorite | 21 comments

I took a different architectural approach with my plain text editor, KeenWrite[0]. Edit the document in plain text and plain TeX with a real-time preview, then generate the final stylized PDF using ConTeXt. In the screenshots[1], the "pdf themes" section shows a single source of truth being edited in the background with three different PDFs in the foreground: a manuscript format, a format using Baskerville, and a plain Times Roman-esque version.

This approach allows complete separation of content versus presentation, thanks to ConTeXt. (Although separating the two is possible with LaTeX, seldom does anybody do so.)

The motivation behind building yet another text editor, though, wasn't TeX integration; rather, I wanted a text editor that allows me to quickly and easily reference variables organized hierarchically[2].

[0]: https://github.com/DaveJarvis/keenwrite

[1]: https://github.com/DaveJarvis/keenwrite/blob/master/docs/scr...

[2]: https://www.youtube.com/watch?v=u_dFd6UhdV8

Plug: If you're an Emacs user, I've written an emacs LaTeX editing environment with automatic live rendering of LaTeX math, tables, and TikZ images. The images are rendered asynchronously using emacs-aio.


Your project looks super interesting. I unfortunately haven't been able to get it to work with native-comp.

Hi, thanks. I hadn't tried emacs 28 with native-comp but I just tried it now and I did encounter some problems. They looked like problems with (unreleased) emacs 28, not native comp issues specifically, right? Do feel free to open an issue or let me know what problems you encountered in case I can help.

Anyone that wants actually wysiwyg* editing for latex should use lyx which is absolutely fantastic. I've been writing latex for >10 years and I wish someone told me about it on day 1. It even integrates with a CAS if you're so inclined.

*Technically "what you see is what you mean" but I have no idea what the difference and whatever the subtle difference is, it has never affected my paper/presentation/hw work flow.

This looks interesting, and I like to see LaTeX made easier to work with. I recently used Overleaf [1] which was a pretty smooth experience.

[1] https://www.overleaf.com/

The Overleaf source code is available online [0], so you could even run your own instance.

[0] https://github.com/overleaf/overleaf

How complete is this? What features are in the paid-for edition that are not in the open source version?

As a potential user, I am quite unsure as to why I would use this over something like TexStudio or even VSCode enabled with some LaTeX plugins. Could you tell me/us some pro/cons of this?

I am the co-author of a very similar application (CoCalc for LaTeX) and our landing page https://cocalc.com/doc/latex-editor.html lists many of the reasons people use it. A number of the reasons apply also to JupyterLab LaTeX, or will soon. A quick summary: realtime collaboration, having the paper you're writing and the data you're computing in the same place, having a very high-resolution history of edits, using latex in course management, using a Chromebook or other lightweight client, and zero configuration support for PythonTex and R (knitr). Note that some of these reasons for using JupyterLab or CoCalc are things that https://www.overleaf.com/ doesn't provide.

Having your data and your reports all in one place seems like the big selling point and I see this as pretty exciting.

> realtime collaboration, ... having a very high-resolution history of edits

It's my understanding that JupyterLab doesn't support concurrent editing or version control, unless these are baked into this extension?

Coming soon - they just closed their concurrent editing ticket! :-). https://github.com/jupyterlab/jupyterlab/issues/5382#event-4...

Same here. It's the most painful limitation of Jupyter, in my experience.

May be you could host it like overleaf? Eliminates the need to install latex which can be quite space consuming.

Using texlive package manager plus a python auto-package installer wrapper for latexmk I was able to get my latex install down to a 300MB.

I don't quite understand the value of using a LaTeX editor in JupyterLab. For most purposes, JupyterLab already supports a subset of LaTeX within the Markdown cells.

Perhaps, the objective is to make JupyterLab the IDE for everything. I just hope JupyterLab doesn't go down the path of becoming everything for everything because honestly, I just don't see why the community's attention should be divided to solve problems that they aren't in the business of in the first place. But as a demonstration that you can run a latex compiler with JupyterLab plugins, great!

I recently started using Texpad [1]. A pretty fair $30/year/seat price point, if you want a local alternative to Overleaf [2]. Their incremental compilation is delightfully real-time; the lag from typing to rendering the PDF is virtually zero.

There are a few unsupported packages which I think are mostly not needed [3]. For instance, the minted package for code highlighting is something that I felt I needed, but then almost never do. The support for microtype package is hopefully coming soon. In any case, the usual fallback is available to MacTex and is supported within Texpad.

[1]: https://www.texpad.com

[2]: https://www.overleaf.com

[3]: https://www.texpad.com/docs/tutorials/tex/typesetters/texpad...

I think this is one area where rstudio has the lead.


I wonder if this could be extended to provide a live preview of the LaTeX export of an '.ipynb' notebook?

The ease of creating custom nbconvert templates is slowly getting better, and that makes notebooks a pretty interesting platform for technical documents.

I use overleaf to write latex and collaborate. It’s pricy at 15$ a month though.

Overleaf is open source, so you could run it locally.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact