Latex minted: Source Code Highlighting without defining listings
You can also use the latex minted
package for pretty formatting.
However it requires calling out to a python script, so you need to compile
with latexmk -pdf -shell-escape file.tex
, and install the python-pygments
package.
\usepackage{minted}
/* configure minted */
\setminted{
linenos,
frame=lines,
fontsize=\footnotesize
}
/* german listing headings */
\renewcommand*{\listingscaption}{Quelltext}
\renewcommand*{\listoflistingscaption}{Quelltexte}
/* include source file */
\begin{code}
\inputminted{sh}{inc/sh/vk01a.sh}
\caption{Shellskript zur Kodierung mit x264 mit unterschiedlichen Bitraten}
\label{lst:vk01a}
\end{code}
/* include source inline */
\mintinline{sh}{vk01a.sh foreman.yuv 352x288}