I want to put some LaTeX source code in my PDF output with the style like this:
Color in text mode is white, in math mode is yellow and in comments is grey. For control sequences, I divide it into four kinds with different highlight mode:
- Commands in text mode are cyan, and its argument(s) (non-optional) is/are orange and italic.
- Commands in text mode are cyan, but its argument(s) (non-optional) is/are white and upright.
- Commands in text mode are rose-color, and its optional argument(s) is/are orange and italic, non-optional argument(s) is/are cyan and italic.
- Commands in math mode are purple, its arguments (optional or non-optional) should be rose-color and upright.
Remember that backslash before a command is always highlighted with the same color of the command, but delimiters of arguments remains white (color of body text).
I tried and searched the web for about ten hours, but still failed. Any hints or clues would be appreciated.