I'm dealing with some data that I would like to apply a automatic formatter. I'm trying to use the listings package in order to define a "language" that fits in my model, but I'm not having success.
For example, I would like to format this:
3 HHHHHHHHHHHHHHLLLHH 21
||| | |
3 LLHHHHHHHHHHHHLLLLL 21
To something like this:
I.e., the letter H with a specific color, letter L with another color and so on. It would be pretty simple if there is spaces between the letters, since
\lstdefinelanguage{MyKindOfLanguage}
{morekeywords={H,L,E},
sensitive=true,
}
Would recognize H, L and E as keywords, but in my case there is not spaces between those characters. Maybe I'm using the wrong package to do this, so I'm asking if there is a way to do this. If I would use regex to specify the patters it would be better. I could write a program to translate this code to a formated one using \textcolor, but I would like to let the compiler do this for me.