Cache Object Script LaTeX highlighting

At the moment I am trying to write a documentation file for a project and intend to use LaTeX for it.
Has anyone already had experience with this? I haven't found syntax highlighting with the LaTeX packages I know yet.
I found a request on Pygment but it was from 2016 and there was no reply on it since then.

Does anyone know a simple way for syntax highlighting COS in LaTeX?
Thanks for your input!


  • 0
  • 0
  • 146
  • 6
  • 3


At the moment I am working with %Syntax Color and a self built pipeline. 
If I have the time I will try to finish syntax highlighting in pygments and post it on here if it is finished.

Very interesting, I did not now that LaTex maybe used in such a way. How it is used Syntax Highlighting, maybe I can help? 

How Pygments related? Some time ago I started to do Syntax highlightings to Pygments but did not finished it, yet. But I have textmate grammar, which can be used in many places.

I would like to generate a documentation PDF via LaTeX.
In LaTeX you can define code listings where you copy the source code into and LaTeX styles them accordingly on compilation.
The only other way I could think of was screenshotting my code and then integrate those pictures into my LaTeX file. 
Changes in code or copying the code out of the document wouldn't be that easy anymore then though.

The minted package used in this example uses Pygments to generate highlighted code for LaTeX.
I only knew the minted and lstlisting packages for LaTeX but I will look for a package that can maybe interpret textmate grammar.
Thanks for your fast reply!


I've seen this post to. It would also be an idea yes.
I'd have to generate html out of my code then transform it to LaTeX and use it in my file.
Converting to html and parsing html has room for errors or missinterpretation egain. 
And of course I'd have try to make my own LaTeX package or compile everything by hand everytime which is also kind of an overkill.