This question already has an answer here:

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} 




pdflatex  $1
echo Anstatt  dieses  Skriptes  haettest  Du  pdflatex
echo auch  einfach  direkt  aufrufen  koennen  ...


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.

marked as duplicate by Tiuri, Romain Picot, Stefan Pinnow, Phelype Oleinik, Mensch Dec 12 '18 at 12:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from stackoverflow.com Dec 12 '18 at 9:13

This question came from our site for professional and enthusiast programmers.


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.

Removing that gives me this. enter image description here