Is there a package which allows me to render (n)curses based output (VT100, ANSI ...) directly in LaTeX (including colors if possible)? I'm currently making screenshots and include the PNGs via graphicx. I'm just wondering whether it's possible to achieve a higher quality.
|
Jan's solution is the most direct, but, speaking from experience, writing parsers for teletype codes is a real pain. I wonder if it makes sense to reinvent such a tricky wheel, rather than use some external program to do the parsing instead. Instead, I suggest using an external curses to HTML converter, and use one of the existing HTML to Latex interpreters/translaters to generate the code for the document. I can't say which tools are right for the job, but maybe some of my thoughts are worth typing out:
|
||||
|
|
|
I don't know about a package. You would have to make TeX interpret the ANSI sequences. That should be possible by assigning catcode 13 to the ESC character. It may be tricky to figure out how long is the argument, though, since in the escape sequences it is the last character that determines what type of sequence it is, and therefore how long the argument is. |
|||||||
|
|
You could use the |
|||
|
|
This would be very useful to have, I scoured the internet unsuccessfully last week for something which would do just this. I think I decided the best approach would be (eventually) to modify http://pypi.python.org/pypi/ansi2html/ so that it could support LaTeX output too, along the lines of the Pygments syntax highlighting system which creates a generic internal representation then supports multiple output formats like HTML, LaTeX, RTF etc. |
|||
|
|