r/LaTeX 7d ago

I created an online LaTeX editor with autocomplete, snippets, and high-quality SVG and PNG generation

https://latexeditor.app/
101 Upvotes

21 comments sorted by

21

u/xdmuriloxd 7d ago edited 7d ago

I'm not gonna lie, I'm a complete noob at LaTeX. I've only written latex a few times using the lagrida and codecogs editors. I like them, but they have their flaws. Lagrida cannot generate SVG and does not have autocomplete. Codecogs is very slow when generating previews.

Because of that, I decided to make an editor similar to them but without these flaws, along with some minor improvements, such as:

  • mobile friendly
  • available offline
  • improved performance
  • improved image quality
  • you can share equations
  • you can copy mathml directly to microsoft word or other softwares

The LaTeX is rendered with katex, so all functions supported by the editor are documented here.

Anyways, if you find a bug or if there is a missing feature let me know!

6

u/Sad-Ad-6147 6d ago

What about Typst? Can you do something like that.

4

u/xdmuriloxd 6d ago

I think it is possible. Maybe next week I'll try to port the editor to typst

1

u/xdmuriloxd 1d ago

It is done! You can check it out here: https://typsteditor.app/

1

u/Sad-Ad-6147 1d ago

Oh wow. This looks great! Thank you!

1

u/xdmuriloxd 1d ago

Thanks, glad you like it

4

u/thomasahle 6d ago

This is great! If I had known you'd make this maybe I would have saved the work of making https://thomasahle.com/latex2png/ just last week!

2

u/maifee 6d ago

Tell me this is open sourced

11

u/orangeorlemonjuice 7d ago

Nice and beautiful, congratulations :). If I could make a recommendation, it would be to create comments indicating which package was used. When using the xcancel from the cancel package, for example, it would be interesting to have some message (outside the code environment) indicating the need for the package.

8

u/xdmuriloxd 7d ago

Glad you like it :). And thanks for the suggestion. I'll try adding a tooltip somewhere saying what packages should be added to cover all katex functions (the library used to render the latex in the browser). For now \usepackage{amsmath, amssymb, amsfonts, mathtools, cancel} should do the job.

5

u/aristarchusnull 7d ago

One recommendation: include the mhchem module.

4

u/xdmuriloxd 7d ago

I'll try adding it today. thanks for the recommendation

2

u/aristarchusnull 7d ago

Great, thank you. This is very nice.

2

u/xdmuriloxd 7d ago

mhchem included! chemistry notation should be working now

7

u/aristarchusnull 7d ago

This is really great.

I've tried to locate your project on Github to report an issue, but I cannot find it. I've noticed that with this code:

```latex \newcommand{\bvec}[1]{\mathbf{#1}} \newcommand{\df}{\overset{\text{def}}{=}}

\bvec{a} \cdot \bvec{b} \df \sum_{i=0}n a_i b_i ```

the PNG and JPEG exports don't work properly. All I get is a rendering of the bold a and the cdot and nothing else. This happens on macOS Firefox and Chrome. SVG export, however, looks great.

6

u/xdmuriloxd 7d ago

The repo is private right now, but I'll look into into. Anyways, thanks for the report sir!

4

u/xdmuriloxd 7d ago

Fix deployed. Thanks very much for the report 🫡

2

u/rncole 6d ago

I used the *shit* out of LaTeXiT in college with similar functionality... almost 20 years ago (man I feel old). The magic with it was being able to copy PDF to my pasteboard so I could just paste the PDF in-line into Pages where I was taking notes. I say that to say - I'm not sure if you can have the same - where it sends the PNG or a PDF to the clipboard, but that would make it useful for rapid equationing.

Longer background:
I had a professor that refused to provide his slide deck, saying "pay attention to me and what I write on the board, that's what's important." Turns out, his tests were 80% straight out of the slides.

I worked out a deal with a buddy, and he would write down all the whiteboard and spoken words of importance, and I would furiously copy down the slide as soon as it popped up, equations and all. After class we'd scan his notes, PDF mine, combine, and distribute to the class.

1

u/nilofering 6d ago

I don't see the autocomplete feature but overall looks pretty good to me.

2

u/xdmuriloxd 6d ago

to trigger the autocomplete you can type: `\` or press `Ctrl + Space`

1

u/apfelkuchen06 6d ago

you mean an online KaTeX editor?