Closed beyondpie closed 6 years ago
Similar to AUCTeX's preview-latex
? I'm afraid that's not yet possible. Pull requests are welcome, though 😉
That works out of the box with https://github.com/TobiasZawada/TeXfrag/. It would be nice if sx-question-mode--print-question
would run a hook after printing is finished. Therewith I wouldn't need to advice sx-question-mode--print-question
.
Pityingly, if someone inserts some displayed formula in the middle of the text as, e.g., $$z=\sqrt{x^2 + y^2}$$ that formula is embedded within the text and therefore displaced. I think that will not change in the near future. I delegate the main work to the preview package and steal the image overlays from there. Correcting the error of others, i.e., the formatting of displayed formulas, would force quite some work on me.
@vermiculus May I insert additional newlines into the print buffer after sx-question-mode--print-question
has finished?
I agree that trying to correct bad formatting on account of display-math being inline in a paragraph is out-of-scope for this; I don't think MathJax knows how to 'continue' a paragraph as TeX does after $$
or \[
anyway.
A hook seems like a fantastic idea; would you mind opening a PR? 😄
The last version of TeXfrag fixes the display-math problem. It inserts missing newlines around display-math environments.
Thanks again for the PR 😄 should we consider this issue resolved, or is there more we can do to advertise the capability of this combo?
You wrote:
Thanks again for the PR :smile: should we consider this issue resolved, or is there more we can do to advertise the capability of this combo?
I regard this issue as resolved if https://travis-ci.org/vermiculus/sx.el/builds/321518650?utm_source=github_status&utm_medium=notification is nothing serious. Could you tell me what the failing of that test means and how serious it is?
Note: I wrote TeXfrag for other use-cases (e.g., showing math in doxygen comments and showing math of html pages with embedded MathJax in eww). When I saw sx I noted that TeXfrag can also be helpful there. I think if you use it for sx it should become part of elpa?
The tests are failing because we've neglected to update them after some fairly core markdown-mode changes our entire testing framework is temporarily broken, probably related to cask-path issues. They're nothing to worry about. The big thing we care about is whether it compiles without errors – ideally without warnings.
If you submit it to the ELPA, that would likely be a boon for the entire Emacs community – but you will need to provide copyright assignment to the FSF. Submitting to MELPA will achieve almost the same effect (and it's worthwhile to note that sx.el itself is also excluded from the ELPA).
Of course, melpa it is. Somebody already has put ~msearch.el~ html-check-frag
into melpa. I never did something like that myself before. Okay time to learn something new...
@vermiculus @TobiasZawada hi, guys, thanks a lot for your efforts, and I test it in math stack exchange. It works well! I love it. Just one small question, is it possible to set texfrag always show the preview under the math stack exchange? Songpeng
wait, I just set the texfrag global mode. and it works automatically to detect the latex fragment. Thanks!
Hi, when I enter the math topic, latex format is the original one. How can I make it possible to see the real formula? Thanks Songpeng