12

I just posted, in Meta, a bug report about wrong syntax highlighting on the main site. However, my example code showing the wrong behavior is not very useful because there seems to be no syntax highlighting on Meta itself. I would like to suggest that it is added for such cases.

Example code which shows status of syntax highlighting on Meta:

\documentclass{article}
\begin{document}
Syntax highlighting? \relax 
\end{document}
1

2 Answers 2

7

2 days ago syntax highlighting was turned on on Meta Stack Overflow so to be fair I think it should be turned on here as well.

1
  • 1
    No, still (or again?) no syntax highlighting. See the code example in the question.
    – Martin Scharrer Mod
    Commented Jan 23, 2019 at 10:55
5
\documentclass{article}
\begin{document}
Syntax highlighting? \relax 
  \begin{tabular}[t]{ccc}
    a&b\\
  \end{tabular}
\end{document}
\documentclass{article}
\begin{document}
Syntax highlighting? \relax 
  \begin{tabular}[t]{ccc}
    a&b\\
  \end{tabular}
\end{document}

You can force syntax highlighting by prefixing the block with <!-- language: lang-latex --> as in the second block here, although the styling is so slight it's hard to see the difference but if you view the source of the generated hml in your browser you see the first starts

<code>\documentclass{article}

and the second starts

<code><span class="kwd">\documentclass</span><span class="pun">{</span><span class="pln">article</span><span class="pun">}</span><span class="pln">

2
  • you are holding a trident aren't you ;) Commented Jan 24, 2019 at 20:13
  • Same language keys also work with github-like code blocks. I don't know how to input this in a comment, so please see my deleted answer. Commented Jan 24, 2019 at 21:55

You must log in to answer this question.

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