[TxMt] How to publish highlighted code with line numbers?

Thomas Krajacic thomas.krajacic at gmail.com
Fri Apr 15 16:19:07 UTC 2011


I am sure it was asked before, but a search in the archives didn't turn up a solution.
I am writing my master's thesis and I need to include C-code in my document.
I would like it to be colored and have line numbers.

There is a nice Copy as RTF command in Textmate that would do everything I need, except it doesn't
work, if I add line numbers manually because this obviously breaks the code structure and highlighting 
breaks. So the line numbering will have to be done after the code is colorized.

I would like to have RTF text since I want to paste it into Word later. (Maybe I shouldn't use Word O_o )

I am sure some of you have had the same problem and maybe someone has a working solution.
I also couldn't find any commandline tool that would read and write rtf line by line, which would 
be a simple post-processing step then to add the numbering.
It might be possible to change the original Copy as RTF Bundle, but having a quick look inside it was 
a bit tricky to find where to add the necessary code.

Help is greatly appreciated.

Thomas


More information about the textmate mailing list