Would it be possible to enable syntax highlighting (colour) for code blocks on the Mathematics site?

Example from the Stack Overflow site:

Syntax highlighting

| |
  • $\begingroup$ You mean like the highlight one uses on pdf text documents ? $\endgroup$ – allesia_b Feb 14 at 14:22
  • $\begingroup$ @Isabella I mean for code blocks. $\endgroup$ – Maggyero Feb 14 at 14:32
  • $\begingroup$ ah. I was not aware that math.stack had code blocks. Anyway I'd suggest to add the tags feature request $\endgroup$ – allesia_b Feb 14 at 14:42
  • 1
    $\begingroup$ @Isabella Done. $\endgroup$ – Maggyero Feb 14 at 14:47
  • $\begingroup$ I suppose that some users around here (including me) are not really familiar with the way syntax highlighting works on Stack Exchange sites. It might be good to give some pointers to basic info - I was able to find some links in the corresponding tag-info on Meta Stack Exchange. $\endgroup$ – Martin Sleziak Feb 14 at 15:01
  • 3
    $\begingroup$ If you're posting any substantial amount of code then your question is probably off-topic. $\endgroup$ – Eric Wofsey Feb 14 at 16:25
  • 1
    $\begingroup$ To help other confused readers: This image is an example of syntax highlighting d33wubrfki0l68.cloudfront.net/… $\endgroup$ – s.harp Feb 14 at 16:39
  • $\begingroup$ @MartinSleziak I have updated the post. $\endgroup$ – Maggyero Feb 14 at 17:22
  • 3
    $\begingroup$ It would be helpful to have your thoughts on how syntax highlighting would contribute to the site. I suspect the posts at Math.SE will mainly involve pseudo-code rather than compiler parseable code specific to a programming language, but I'll try to quantify this impression. $\endgroup$ – hardmath Feb 14 at 18:48
  • 3
    $\begingroup$ There are some instances where non-pseudocode code fits in on MSE, though, for example in computer-algebra-systems, computational-mathematics, gap, magma-cas, etc. $\endgroup$ – Alexander Gruber Feb 14 at 19:59
  • $\begingroup$ @hardmath I am just talking from my experience as a user. I was disappointed to see that the program in my post was in black and white here. $\endgroup$ – Maggyero Feb 14 at 23:30

You must log in to answer this question.

Browse other questions tagged .