I was looking at the mwe package (I haven't tested it) and I was thinking if you can have the same effect of syntax coloring and indentation as it is here in tex.stackexchange.com. For example:

Hello World!

If you notice the code is automatically colored and highlighted with possible line numbering just like the packages that deal with algorithms. Is this a possible addition or does it answer a different purpose from the mwe package?

  • How does one get TeX syntax highlighting on Meta? The usual <!-- language: lang-tex --> doesn't seem to work.
    – Caramdir
    May 26 '12 at 22:00
  • @Caramdir It doesn't. I thought it would but I was generally speaking about tex.stackexchange.com.
    – azetina
    May 26 '12 at 22:02
  • @Caramdir: There is no syntax highlighting on meta sites.
    – doncherry
    May 28 '12 at 23:16
  • While I hope @Martin's explanation helped you, I'm afraid this question is off-topic since it is about a CTAN-package (which a mod here happened to write) and not about a feature of Stack Exchange. Voted to close.
    – doncherry
    May 28 '12 at 23:19
  • When someone is writing a piece of code in LaTeX to explain something, whatever it may be, if the mwe provides environments which the user can use, it would make it easier. I see that many users here talk about ways of presenting there code etc. Why not incorporate it to the mwe. Probably its far-fetched but plausible. Just saying.
    – azetina
    May 29 '12 at 19:24

The mwe package is to help creating minimal working examples (MWE), not for displaying them. You can have syntax highlighting and line numbering of LaTeX source code in your document using the listings package. The relevant options are language=[latex]tex and numbers=left. Note that this is about source code in listings as part of your document, not for highlighting the source code in your LaTeX editor.

  • I understand its not for highlighting of the source code but when you compile, the pdf output would have the highlighted code as per tex.stackexchange.com. Its just a suggestion and while there are existing packages that may aid in it, why not create a unique display from the others in your package?
    – azetina
    May 26 '12 at 20:30
  • The mwe doesn't include any source code in the output. May 26 '12 at 20:47
  • 1
    The purpose of mwe package is to help to create MWEs, you highlight the code of the MWE by posting it in a question or answer.
    – yo'
    May 28 '12 at 8:22

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