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. 

https://de.overleaf.com/learn/latex/Code_Highlighting_with_minted

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!