# Can you copy paste MathJax? [duplicate]

I am a big procrastinator when it comes to learning MathJax. I happened to remember that only before asking a question. Is there perhaps a shortcut to simply copy an equation from one part of the site and then edit according to our own question (hope this doesn't count as plagiarism for not doing the MathJax part), much like in desmos where you copy a part of an equation and then insert it somewhere else on the site.

Or maybe this feature might cause a headache, but is there a any better technique

• Right-clicking on a MathJax formula (using the desktop site) brings up a menu of Math Formatting options, the top one being "Show Math As..." The "TeX Commands" subitem allows you to select the $\LaTeX$ commands that gave rise to the displayed mathematics, and you can copy and paste it between dollar signs to reproduce that formula. Try this formula: $e^{i\pi} = -1$. To avoid plagiarism, you can provide a link to that older post for context. Feb 28 at 6:44
• @hardmath oh thanks for letting me know about th dollar sign Feb 28 at 6:54
• Whenever I want to copy/paste a MathJax snippet from a question or an answer on our site I follow the procedure of 1) click the "Edit"-button under the post, 2) copy the formula from the source to the clipboard, 3) close the edit window without saving, 4) go and paste the snippet wherever it is needed. Hardmath's method is the only option when you want to copy from a comment. Somehow it feels unnatural to me, but that may say more about me rather than what is the best workflow. Feb 28 at 7:02
• You should probably explain where do you want to copy equation from. For example, it won't be easy to get the formula from a pdf file, if you had something like that in mind. If you meant copying something from another post on this site, this was explained in previous comments and you can also check this older post on meta: How to view LaTeX source of equations? Feb 28 at 7:37
• You can also hit the edit button on the post in question and copy to clipboard on your computer the relevant part (e.g. Ctrl+C on Windows). This is actually explained in the answer that Martin Sleziak gave to the linked question.
– Fizz
Mar 4 at 4:39
• On a Mac, control and click to show the MathJax formula. Mar 13 at 4:04

### For posts or comments on MathSE:

Right click on the formula and select Show Math As > TeX Commands

### For external sites that use MathJax:

Try the same trick as above.

Otherwise use right click on the formula and select View Page source/ Inspect Element and copy from there.

### For other external sites:

Unfortunately, websites like Wikipedia or Woltram mathworld embed formulae as images. However, we can use the methods suggested by Martin Sleziak and PedroSánchezTerraf in the comments:

Right click on the image and select View Source or Inspect Element. The math code can be seen in the alt text for the image, as shown in the screenshot.

You can also find it by clicking Edit for the article or section.

Where this does not work, one can use Mathpix to obtain the Tex commands from an OCR file.

The last resort, as always, is to look for the elsewhere or type it yourself!

• Hmmm.... from Wikipedia you can often copy the source of math formula, if it is embedded in [itex]...</,math>. For example, if I go to the article Leibniz formula for determinants and click on edit, I can see: this: :[itex]\det(A)=\epsilon_{i_1\cdots i_n}{a}_{1i_1}\cdots {a}_{ni_n},</math> in the Wikipedia source code. In I can see the same in the HTML source code, but it is more difficult to find there. (I think it is also used as the alt-text for the image.) Mar 8 at 20:01
• I have been using Mathpix to OCR images, it works pretty well with LaTeX (re: “For other external sites”) Mar 9 at 2:04
• Thanks! These seem to be very useful methods and are new to me! @MartinSleziak Mar 9 at 3:50
• @PedroSánchezTerraf Mar 9 at 3:50
• Since Mathpix was mentioned, I'll add links to some older posts: Mathpix Snip Tool: Automatic $\rm\LaTeX$ code generation from typed or handwritten math! and What tools can be used to extract MathJax/LaTeX from scanned input? Mar 9 at 5:47

As a coda to the existing answer/comments, let me mention a useful last resort. If there's a tex symbol you don't know, and the site you're looking at doesn't reveal its code in a useful way (or you're reading a physical text!), you can always try the site detexify. Of course this is limited, since latex doesn't exactly line up with mathjax, but it's still very useful to know about.