Text FormattingListings package and regular expressions

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
-Robin-
Posts: 31
Joined: Tue May 20, 2008 3:07 pm

Listings package and regular expressions

Post by -Robin- »

Does anybody knows a way of specifying keywords for the listings package using regular expressions ?

For example the standard XML tags which are coloured are rather limited, and it would be nice to just be able to let the listings package recognize everything between <> as an XML keyword instead of having to add every used tag as a keyword individually

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Listings package and regular expressions

Post by 5gon12eder »

Define a new "comment" type enclosed by < and > as described in section 3.3 (p. 22) in the listings documentation.
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
Post Reply