Issue
I am reading this book where there are MathJax formulas. I am taking notes in an Ipython notebook. It is not convenient to take note from passages with Math formula. Is there an easy way to copy text with equations as a Tex command (which is render-able on Ipython)?
Solution
Update
TL;DR
- Right click on a formula > Math Settings > Math Renderer > MathML
- Create a bookmarklet from:
javascript:(function() { var inline = document.getElementsByClassName("MathJax_MathML"); for (var i = 0; i < inline.length; i++) { var math = inline[i]; math.innerHTML = '<span>$</span>' + math.innerHTML + '<span>$</span>'; } })()
- Run the bookmarklet on a page by pressing it
- Enjoy easier copy & pasting!
Long version
This Github issue has a fix for the problem. It didn't work well for this page so I changed it a bit as above. It is not a general solution, but you can tweak it depending on the specifics of a page. If you are more eager, you can elaborate on it and make a browser extension for everyone to appreciate it :).
Old Answer
I tried couple of methods on this example:
Method 1:
- Change the settings to render as MathML by: Right click on the formula > Math Settings > Math Renderer > MathML
- Open the page source e.g.
Ctrl + U
on Chrome or Right click and press 'View Source'. - Find the piece of text you are looking for. It should be displayed in the right format:
bla bla $a \ne 0$ bla bla \(ax^2 + bx + c = 0\) bla bla
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
Method 2:
Do step 1 from previous method. The example page will be rendered with formulas but without the formula-enclosing characters.
Add single or double dollar signs around TeX commands to get the format as in step 3 of the previous method.
The best would be to combine the two method; i.e. getting the right format directly in the page. Let us know if you found a way to do it.
And thanks to @nam and @PeterKrautzberger for their hints :)
Answered By - Thoran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.