I'm familiar with typesetting script code in my documents, however, I have been unable to obtain nice highlighting for shell code (e.g. similar to that afforded to me by my gnome-terminal
).
Basically this is what I would like to get:
The best I can do with listings
is the following code:
\definecolor{tlg}{gray}{0.9}
\lstset{frame=tb,
backgroundcolor = \color{tlg},
language=bash,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\footnotesize\ttfamily},
numbers=none,
rulecolor=\color{tlg},
backgroundcolor=\color{tlg},
fillcolor=\color{tlg},
rulesepcolor=\color{tlg},
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
\begin{lstlisting}
chymera@quiethost ~/myfolder $ ls -lh
total 0
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_final.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_final_version2.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:57 mytext.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_version2.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_version3.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_version4.txt
\end{lstlisting}
which produces:
And the best I can do with minted
is the following code:
\begin{minted}{bash}
chymera@quiethost ~/myfolder $ ls -lh
total 0
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_final.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_final_version2.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:57 mytext.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_version2.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_version3.txt
-rw-r--r-- 1 chymera chymera 0 1. Mai 23:58 mytext_version4.txt
\end{minted}
which produces