Is there a way to include supplemental code in a math.se post, without necessarily displaying the code as part of an answer - perhaps, as a comment in the markdown itself?

For example, we often see images in posts generated by a short (or even not so short) sequence of computer commands in Mathematica or Matlab or some other tool. The code is typically not immediately relevant the question at hand but might often be of secondary interest to some readers anyway. Thus, it would be nice to be able to make the code available, without being so intrusive as to make it part of the answer.

According to this stackoverflow discussion, this should be possible, but the technique described there doesn't seem to work on math.se.


1 Answer 1


Check the edit link to this post. There is an HTML comment in this post, written like

<!-- this post contains a comment, you could use this in theory, though the discoverability and usability are rather bad -->
  • $\begingroup$ @MarkMcClure Mad Scientist is pointing out the usage of HTML comments in his answer. The usability of such a feature for including large amounts of text is fairly poor, but it is a possibility. $\endgroup$
    – apnorton
    Commented May 6, 2013 at 20:15
  • $\begingroup$ @anorton I see. Unfortunately, when I click on the link, I get a message that there is an edit awaiting approval. Presumably, I don't have enough reputation to see the edit. Or, perhaps, there really is an edit waiting approval and I'll be able to see it after that? At any rate, that's the source of my comment. $\endgroup$ Commented May 6, 2013 at 20:21
  • $\begingroup$ @MarkMcClure It seems other users without edit privilege can't access edits on per-site metas, I've added the source to the post itself without hiding it in a comment. $\endgroup$
    – user9733
    Commented May 7, 2013 at 12:16
  • $\begingroup$ OK, I understand now - thanks! I had actually tried this and it didn't work. After experimenting a bit more, I discovered that the problem was that Mathematica frequently includes the character sequence -> as an option to plot commands. Unfortunately, this ends the HTML comment and whatever comes after spews out onto the page. And, you're right about the usability, particularly if folks under 2000 reputation can't generally see it. Thanks, anyway! $\endgroup$ Commented May 7, 2013 at 13:03

You must log in to answer this question.

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