10
$\begingroup$

How do you view the source of a question, to see how the LaTeX was specified as markup?

$\endgroup$
0

4 Answers 4

12
$\begingroup$

Have you tried right-clicking on it and selecting "Show source?"

$\endgroup$
6
  • 1
    $\begingroup$ You do have to make sure that it was rendered by MathJax, though. Before the site had TeX support, some users would use a rendering engine on another site and link to the generated images. $\endgroup$
    – Larry Wang Mod
    Commented Aug 14, 2010 at 22:59
  • $\begingroup$ doh! never mind. Could one of you admins put this in the faq? $\endgroup$
    – Jason S
    Commented Aug 14, 2010 at 23:03
  • 7
    $\begingroup$ We need a [status-already-working] :) $\endgroup$
    – kennytm Mod
    Commented Aug 14, 2010 at 23:04
  • $\begingroup$ @Jason: Ability to edit the FAQ is "in the works" $\endgroup$
    – Larry Wang Mod
    Commented Aug 14, 2010 at 23:07
  • $\begingroup$ hmmm. I don't want to edit the FAQ directly, but would be willing to propose snippets to add to it. $\endgroup$
    – Jason S
    Commented Aug 14, 2010 at 23:29
  • $\begingroup$ Since "right-click" on Windows (with a mouse or trackpad) has different equivalent operations on other operating systems and touchscreen devices, one can see more details on how to pull up the MathJax contextual menu here: How do I change Math Renderer for MathJax? $\endgroup$ Commented Sep 23, 2022 at 10:58
7
$\begingroup$

$\text{Steps:} \\ \begin{align}1.& \text{Right click this.} \\ 2. & \text{“Show Math As"} \\ 3. & \text{Click on }\TeX \ Commands. \end{align}$

$\endgroup$
7
  • 2
    $\begingroup$ Oh man, am I glad this got asked and answered! I just realized how useful this will be! $\endgroup$ Commented Dec 20, 2012 at 23:55
  • $\begingroup$ This is great--I didn't know about it--but it doesn't work with comments. $\endgroup$
    – Mars
    Commented Nov 8, 2017 at 17:08
  • $\begingroup$ @Mars Actually it works also for comments. You can try it on this formula if you want to test it: $x^2+y^2=z^2$. $\endgroup$ Commented Nov 8, 2017 at 17:22
  • $\begingroup$ It's not working for me, @MartinSleziak. Maybe it's browser or OS specific? $\endgroup$
    – Mars
    Commented Nov 8, 2017 at 17:27
  • $\begingroup$ @Mars Here is a post with screenshots if it helps: How do I view, but not edit, the markup for any given comment on any given StackExchange site? $\endgroup$ Commented Nov 8, 2017 at 17:31
  • $\begingroup$ @MartinSleziak--Oh, sorry--it seems to depend on context in ways I don't understand. Sometimes I have to click on the math expression itself, not just on the comment or answer. I was misled because for some reason the special popup menu (as opposed to the default browser menu) seems to appear when right-clicking on any part of Parth Kohli's answer. Other answers don't have this property. $\endgroup$
    – Mars
    Commented Nov 8, 2017 at 17:44
  • 2
    $\begingroup$ @Mars That's because all of this answer is written using MathJax :) $\endgroup$ Commented Feb 4, 2022 at 21:31
6
$\begingroup$

The answers posted so far focus mainly on the source for one individual formula.

Another possibility (if you want to copy a large chunk of text with several formulas) is to click on edit (and, of course, not save the edits you make, just copy the part you need).

If you do not want to click on edit - to make sure that you do not change something by mistake - you can still get to the source through the revision history. You can get to the revision history easily if the post has been edited at least once - just click on the timestamp saying "edited Date". If the post wasn't edited, you can use the button next to the post to display the timeline and then manually change the timeline to revisions in the URL.

Viewing source of the webpage also sometimes works (View/Source in Internet Explorer, Ctrl+U in Mozilla Firefox). This way has some flaws - you don't see markup, but html. If TeX-contains & (ampersound) it is changed.


The above is explicitly about getting the MathJax source from a post. (This is what was actually asked in the question.) There were a few comments asking how to view the source in comments. For this, see: Seeing the MathJax mark-up for a comment and How to copy mixture of text and latex formulas in a comment? (Although some of the suggestions given in the answers to this question - namely using MathJax menu and displaying source of the website - work for comments, too.)

$\endgroup$
5
  • $\begingroup$ If you want to cut and paste the entire source code of somebody else's comments, including all the latex, view source seems to be the only method. $\endgroup$
    – user13618
    Commented Dec 14, 2016 at 16:35
  • $\begingroup$ Also a bookmarklet mentioned here could be used. The link in that post is now that, but you can recover that bookmarklet, for example, from Wayback Machine. (Perhaps we should collect somewhere the bookmarklets which were on that site - at least some of them are often handy.) $\endgroup$ Commented Dec 14, 2016 at 17:14
  • $\begingroup$ To be more specific, you could try this to see for the whole collection and probably you should also be able copy individual bookmarklets from there. $\endgroup$ Commented Dec 14, 2016 at 17:25
  • $\begingroup$ Edit isn't an option for comments. $\endgroup$
    – Mars
    Commented Nov 8, 2017 at 17:10
  • $\begingroup$ @Mars The question explicitly asks about LaTeX source in a question. If you are interested in comments, you can look at How to copy mixture of text and latex formulas in a comment? and some of the posts linked there. (And, in fact, the other method - viewing source - does work for comments.) $\endgroup$ Commented Nov 8, 2017 at 17:15
-4
$\begingroup$

First, decide if you...

  1. want to view the $\mathcal{MathJax}$ source code for one short simple equation such as $f(x) = 5*x^{2} + 72$
  2. want to view the $\mathcal{MathJax}$ source code for an entire stack exchange question or answer.

How to View $\mathcal{MathJax}$ Source for a Single Short Equation

Right-click on the equation with your computer mouse and select
$\qquad$ Show Math As$TeX$ commands

$\begin{aligned} 63_{10} &= \displaystyle{\sum_{k=0}^{5}} \\ &= \begin{pmatrix}2^{5}+2^{4}+2^{3}+2^{2}+2^{1}+2^{0}\end{pmatrix}_{10} \\ &= 111111_{2} \\ \end{aligned}$

SCREEN CAPTURE OF A MATHJAX FORMULA AND THE CONTEXT MENU

How to View $\mathcal{MathJax}$ Source for a An Entire Question or Answer

  1. Look at the URL (web address) at the the top of your web-browser

screen capture of a URL box

  1. Delete everything from the URL to the right of questions/65992 The number 65992 might be different for you.

  2. Type revisions or /revisions at the end of the URL. Do not forget the letter "s" at the end of revisions. The result will look something like:

$\qquad\quad$ https://math.meta.stackexchange.com/questions/659/revisions

  1. press the enter key on your keyboard.

  2. Copy and paste the mark-down language source code of the question or answer.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .