Subsection 4.18 of the current listings documentation (2013/08/26 Version 1.5b) describes a key called tag. That key is used in lstdrvrs.dtx, which is a file that ships with listings and takes care of predefining languages. More specifically, the tag key is used in the definition of the HTML and XML languages , as follows:

  % ...
  % ...

Why, then, can't I use the tag key in the definition of a custom language? For instance, the code below throws the following error:

!Package keyval Error: tag undefined.

My TeX distribution is up-to-date. I don't understand...




1 Answer 1


The documentation neglects to mention that the tag key is defined (in lstmisc.sty) only within the html "aspect" (not language). Loading this aspect with


(or as package option) will place the tag key at your disposal. You could also load it in the last optional argument of \lstdefinelanguage:


You must log in to answer this question.

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