# How to automatically write bold commands in a bash script in Latex using listings [duplicate]

I wanna include a bash script in a black box in a pdf using latex. I achieved everything I want, except bold commands in the script using the following code:

\documentclass[11pt,a4paper,DIV=15]{scrartcl} \usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}
\usepackage{xcolor}
\usepackage{listings}

\lstset{language=bash,backgroundcolor=\color{lightgray},frame=lrbt,basicstyle=\ttfamily}

\begin{document}

\begin{lstlisting}
#!/bin/bash

pdflatex  \$1
echo Anstatt  dieses  Skriptes  haettest  Du  pdflatex
echo auch  einfach  direkt  aufrufen  koennen  ...
\end{lstlisting}

\end{document}


I dont get why listing automatically writes my comments italic, but doesnt recognize echo as an command. As commands should be written bold when using language=bash.

Simply add \usepackage{lmodern}and get bold "echo". It will be a little bit hard to discover because of the background in lightgray.
IF you remove basicstyle=\ttfamily then you should be set, it looks like setting typewriter style for strings is removing the bold formatting for key words.