views:

736

answers:

1

Hello,

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?

+2  A: 

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.

Thomas
Aha! Thanks Thomas!
Lex
@Lex: If this answer fixes your problem, you need to hit the check mark by it to "accept" the answer. See http://stackoverflow.com/faq for how to ask a good question. Welcome to SO!
Seth Johnson
Right, I think I oversaw it yesterday, but thanks for the hint!
Lex