0

I'd like to be able to edit equations as it is done in Lyx, that is, for example, being able to change a sub- or superscript without losing the rendering of the equation (even if it's a mid-low quality render as in Lyx). In general, being able to edit any equation directly in the rendering.

I've been digging around auctex manuals, but I don't see how can this be done, and I think there must be a way, as I can read the following from the auctex manual:

Current uses of the package include the preview-latex package for WYSIWYG functionality in the AUCTeX editing environment, generation of previews in LyX, as part of the operation of the pst-pdf package, the tbook XML system and some other tools.

Thanks!

  • I've got a setup where the old preview is kept above the source code as long as I edit the equation. Would that be sufficient? For answering the question with that solution I would need to extract that setup from my init files. – Tobias Feb 5 '18 at 12:23
  • No... that's not what I'm looking for, because usually equations are so complicated that it doesn't help me so much like that. Thanks for your interest. ;) Maybe you can put the answer anyway in case it helps other people. – josealberto4444 Feb 5 '18 at 15:05
  • Do you know prettify-symbols-mode? It also works with LaTeX (in emacs 25.3 at least). It improves a bit the readability. – Tobias Feb 5 '18 at 15:47
  • Yes, a bit, but it's missing a lot of things (fractions, for example). Lyx does a quite good job in that way, I can't believe emacs cannot achieve that. – josealberto4444 Feb 5 '18 at 18:35
  • The weakest part of Emacs is the graphical user interface, while you can abuse its image support to make simple games, nobody made a LyX-like thing. – wasamasa Feb 5 '18 at 20:00
3

The preview-latex package does a much cruder thing, it replaces LaTeX code with a preview image. You can then toggle back to the text view, edit your code and re-render it. If this is enough for your needs, check out the preview info manual for more details. If you want more than that, you're out of luck and have to make your own.

1

After searching several packages and getting more experience with emacs, I finally chose a configuration (two, indeed) proposed in comments:

  • prettify-symbols-mode for semi-WYSIWYG editing.
  • preview-latex for changing the equations to actual images inside emacs.

The latter lets me explore documents and find quickly the part I'm looking for, while the former lets me do the same inside a particular equation. Something more similar to Lyx, specially with fractions, seems to be impossible, as people said in comments.


I also tried several other packages, and maybe they are useful for any other person trying to make something similar, so I'll let the best ones (in my opinion) here:

  • latex-math-preview: same visualization as preview-latex but below its code. Similar to what was mentioned in comments.
  • magic-latex-buffer: extends prettify-symbols-mode further. This is the one I liked most, but ended up using prettify-symbols-mode as it switches dynamically while moving the point along the equation.
  • Given that there already were more answers than this one, I don't like tagging mine as the correct one, but I think it's the most useful for anyone searching something related with this. Thanks for your time to all people who answered! – josealberto4444 Oct 15 '18 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.