This might be a long shot, but I'm planning to include a roughly 300-line block of python code as an appendix to my undergraduate thesis, and I was wondering if there's a way to make it display with colored highlighting the way it would in Emacs or another text editor. I just find that I personally can't read code well when it's not colored, so I don't want to inflict that upon the reader. I know about the fancyvrb package, but I don't want to go through character by character and declare colors for everything, and as far as I can tell that would be the only way to use it to get the desired effect.
Asked
Active
Viewed 120 times
1
-
5listings or minted package, perhaps minted is most natural in this case as it uses the pygmentize python library to apply the syntax highlighting, – David Carlisle Mar 02 '18 at 00:06
-
1«I'm planning to include a roughly 300-line block of python code» Just don't. Nobody wants to read printed out code. – Henri Menke Mar 02 '18 at 00:41
-
1@HenriMenke I actually agree with you, but the program is about half of the original work that I've done for my thesis, so my advisor says I should include it as an appendix. – Jules Randolph Mar 04 '18 at 17:12
-
Possible duplicate of Syntax Coloring in LaTeX – Andrew Swann Oct 20 '18 at 09:52