Thursday, April 02, 2009

colorful latex




Neato way to color source code listings in Latex.

Reproduced here for your convenience:


\documentclass[12pt]{article}
\usepackage{listings,color}
\begin{document}

\newcommand{\Hilight}{\makebox[0pt][l]{\color{cyan}\rule[-4pt]{0.65\linewidth}{14pt}}}
\begin{lstlisting}[escapechar=\%]
start:$
%\Hilight%mov r1, xF0 -- Reset ptr value$
mov r2, x00 -- Reset total value$
\end{lstlisting}
\end{document}