I'm working on a LaTeX document and using lstlisting to display my Java source code. My setup looks like this:
\lstset{
basicstyle=\ttfamily,
keywordstyle=\bfseries,
language=Java,
frame=single,
aboveskip=11pt,
belowskip=11pt,
breaklines=true,
breakatwhitespace=false,
showspaces=false,
showstringspaces=false
}
The keywords are not highlighted bold when using ttfamily, but if I use small or don't specify the basic style, they're highlighted fine.
What am I missing?
The default font in LaTeX, Computer Modern, does not provide a bold version of the teletype family. You can install this as the bold-extra
package; see this FAQ entry for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With