TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on the implementation of a HTML5 code style for \listings.

Currently I have the problem that there are different ways to define HTML tags. In my example, I don't get /p in <p></p> marked.


enter image description here

My keyword definition looks like this:


If I add /p to the list, then </p> is not marked anymore.

Here is my language definition:


For a complete example I've created this document: https://www.writelatex.com/74567mmxwkw

share|improve this question
Shouldn't it work if you omit >< from the keyword list? – clemens Feb 24 '13 at 12:40
Wow. That was easy. I missed the forest for the trees. Thank you! You can write this as a solution, so that I can check off the question. – Benny Neugebauer Feb 24 '13 at 16:36
@cgnieder Please write a short answer (or cast the first closing vote). – lockstep Mar 6 '13 at 12:18
up vote 3 down vote accepted

You're declaring the keyword >< which leads to the wrong coloring. The line


is interpreted as the keywords <p and >< followed by /p (which is no keyword) and then again a keyword, >.

Leaving the >< keyword out should suffice. The line the would be interpreted as the keywords <p, >, </p, and >, which should be what you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.