# How to copy mixture of text and latex formulas in a comment?

Okay, I might sound lazy. When trying to copy mixture of text and latex formulas in an answer, it is always easy. I can simply click "edit" and copy the source. But when trying to do the same in a comment, either others' comment or my own comment after 5 minutes since it was posted, I can copy the source of each latex formula by "Show Source" of MathJax, but when there are more than one latex formula and/or also text to copy, doing this for each part isn't so simple. So I wonder if there is some easy way? Thanks and regards!

-
No, there is no easy way. –  GEdgar Nov 22 '11 at 16:30
Perhaps one way to go would be use api, although it is not exactly what you want. E.g. api.meta.math.stackexchange.com/1.0/questions/3234/comments or api.math.stackexchange.com/1.0/questions/80074/comments See api.math.stackexchange.com/1.0/help/method?method=questions{id}/comments –  Martin Sleziak Nov 22 '11 at 19:13
@MartinSleziak: Thanks! Where can I learn how to use those apis? –  Tim Nov 22 '11 at 20:06
@Tim see api.math.stackexchange.com –  Martin Sleziak Nov 22 '11 at 20:10
@MartinSleziak: Thanks! I may miss something. How shall I run the APIs? –  Tim Nov 22 '11 at 20:14
@Tim Simply copy my above link to browser's address bar and you can change the number of question. –  Martin Sleziak Nov 22 '11 at 20:21

I do not know whether I am supposed post this here - since this is tagged feature-request and I am not writing about a new feature. But I think there is quite a simple workaround - when you are viewing the question in your browser, choose View Source (Ctrl+U in Firefox).

You can copy the comments (including dollars) from there. You can search the source for comment or the name of the user, who posted it.

As an example, I've copied the following comments from one of your questions:

For example if $E(X|\mathcal{Q})$ is equal (a.s.) to a continuous function, then the continuous function would be a canonical version.

@QuinnCulver: Thanks! Are you saying if a random variable $Y$ equals $E(X|\mathcal{Q})$ a.e., then $Y$ is a canonical version of $E(X|\mathcal{Q})$? In other words, any version of $E(X|\mathcal{Q})$ is a canonical one?

If the poster of comment used link in his comments and you paste the text of the comment from the source, the link is not displayed unless you delete rel="nofollow". Formatting (bold, italics) seems to be copied well.

A few more experiments:

At first glance, it seems thinking of the numbers in base $p$ will help. Kummer's Theorem will probably help as well.

Comment containing formatting (italics) from here:

I am sorry for chaos confused by my earlier edits. Could you perhaps give a link to the text you're reading or at least to have a look whether the definition of period and index your text is using is the same as in my answer?

Comment containing colors from here:

Show by direct substitution that $x={\color{red}2}$ is a solution to the equation $x^2=x+2$: ${\color{red}2}^2={\color{red}2}+2$.

Probably there are many further problems which can arise with using this method - such as folded comments mentioned by Tim.

Maybe someone will suggest a more straightforward way. The only thing I was able to do was using StackPrinter where all comments are unfolded. I chose the question, but did not print it and instead of printing I viewed the source of the page. From there I was able to copy the comment. E.g. from here I copied the following

No. Since the beginning, I am referring to the fact that you assumed that $(\Omega,\mathcal F)$ is a topological space (with its Borel sigma-algebra), without saying so, although in the canonical probabilistic setting, $(\Omega,\mathcal F)$ is just any measurable space. By the way, to mention continuous random variables like you did in comments is misleading (and I think it did mislead the OP) because continuous here often refers to the distribution of the random variable having no discrete part, and not to the random variable itself, as a function on $\Omega$, being continuous.

Maybe there is a simple way how to display a question (or an answer) with all comments unfolded, but I am unaware of it.

Note that from the source you can also read comment id, which can be used to link directly to the comment in this format: "Show by direct substitution..."

There are other possible ways to do this: either get it from activity tab of that user or, as I've learned from t.b, by using SE Modifications.

EDIT: Comment id and link to a comment can now be obtained simply by clicking on it, see How to link to a comment?

-
Thanks! This is a great workaround. –  Tim Nov 23 '11 at 18:31
I found a problem. When trying to copy a comment that is folded by default, I cannot find it in the source after unfold it. If I select that comment to see its source, it only shows part of the comment not the whole. For example, Didier's comment following this reply math.stackexchange.com/q/80334/1281 "No. Since the beginning, I am referring to the fact that you assumed that (Ω,F) is a topological space (with its Borel sigma-algebra), without saying so, although in the canonical probabilistic setting, (Ω,F) ..." –  Tim Nov 23 '11 at 21:32
It's an okay workaround, but far from an easy solution. I'd still prefer a feature. –  Thomas Andrews Aug 6 at 16:45
@ThomasAndrews By a pure coincidence, I posted (what I consider) an easy solution within 12 hours of your comment... –  Thursday Aug 7 at 5:55

I got sufficiently tired of comment-copying problems to make a bookmarklet Copy all comments to answer box. When used on a question page, the bookmarklet copies all comments under the question to the answer box.

### Features

• Fixes the issue with < becoming &lt;, which was mentioned elsewhere.