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

formulas not undone back to LaTeX when editing re-opened draft #7

Open
eudoxos opened this issue Sep 6, 2011 · 3 comments
Open

formulas not undone back to LaTeX when editing re-opened draft #7

eudoxos opened this issue Sep 6, 2011 · 3 comments

Comments

@eudoxos
Copy link

eudoxos commented Sep 6, 2011

When re-opening draft e-mail (or sent e-mail, then selecting "Edit as new"), old formulas will not be converted back to LaTeX source, instead they remain as images in the text. I am not sure whether it is a bug on my side or design decision/issue of LatexIt.

@protz
Copy link
Owner

protz commented Sep 6, 2011

This is not unfeasible, but clearly requires more energy that what's
done already. LatexIt has its own undo stack, which is basically a
stack of closures. Re-editing a saved draft creates a completely new
Javascript environment, so naturally, the undo stack does not persist.
What you could do is:

  • add a class on all latexit-generated images
  • add an item on the compose window context menu that's enabled when
    you right-click on an image that has the right class,
  • the associated action would be: take the image, and replace it with a
    text node that contains its alt text (the alt text is the original
    formula).

A little bit of work, but nothing that can't be solved over a week-end.
I'm waiting for your patch! :-)

(I'm swamped with other stuff so I don't have any more time/energy to
devote to LatexIt).

On Tuesday, September 06, 2011 2:23:55 PM, eudoxos wrote:

When re-opening draft e-mail (or sent e-mail, then selecting "Edit as new"), old formulas will not be converted back to LaTeX source, instead they remain as images in the text. I am not sure whether it is a bug on my side or design decision/issue of LatexIt.

@eudoxos
Copy link
Author

eudoxos commented Sep 6, 2011

Thanks for your comments, I will have a look. I have unfortunately no experience with javascript, but hope python skills will not betray me. I will first just try to find all IMG nodes in the DOM which have ALT text beginning with $, that's a reasonable approach I guess.

@drevicko
Copy link

It may be a good idea to use this approach instead of / in combination with, the undo stack, as strange effects can occur if you, for example, "latexit" an email, delete one of the images, then try to use "undo latexit" - I found that latex generated images after the deleted images were not undone.

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

No branches or pull requests

3 participants