Say I have the following key-value file I want to highlight using the listings package:

some.key=Some value

I want the key to be red, the equal sign to be black and the value to be blue. How do I define a language in listings that does that? I am aware of the moredelim, morekeywords but I can't figure out how to use their options to do what I want.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Mar 21, 2014 at 14:50
  • Perhaps there is a language that uses this syntax? Mar 21, 2014 at 14:50
  • @SeanAllred: Perhaps the language is TeX or LaTeX itself?
    – user31729
    Mar 21, 2014 at 14:52
  • It may be possible. It depends on the language you're using. What is it? Could you post a longer code sample and list all your syntax highlighting specs? Related: tex.stackexchange.com/questions/81646/…, tex.stackexchange.com/questions/152829/…
    – jub0bs
    Mar 21, 2014 at 14:53
  • 1
    @johnrl Should we close this question as a duplicate?
    – jub0bs
    Mar 21, 2014 at 14:59


Browse other questions tagged .