Re: Parole chiave in grassetto con listings [Risolto]

#12995
Up
0
Down
::

Non capisco perchè, ma con queste impostazioni:`% Gestione dei listati di codice
\usepackage{color}
\definecolor{grayback}{rgb}{0.9,0.9,0.9}
\definecolor{grayrows}{rgb}{0.3,0.3,0.3}
\usepackage{listings}
\lstdefinestyle{num_righe}
{ numbers=left,
stepnumber=1,
numberstyle=\footnotesize\color{grayrows},
numbersep=5pt }

% Definizione dei linguaggi – – – – – – – – – –
\lstdefinelanguage{JavaScript}
{ keywords={function, new, true, false, var, for, do, while, if, break, return},
basicstyle=\footnotesize\ttfamily,
keywordstyle=\color{blue}\bfseries\footnotesize,
backgroundcolor=\color{grayback},
sensitive=false,
showspaces=false,
showstringspaces=false,emph={3}
showtabs=false,
style=num_righe,
morecomment=[l]{//},
morecomment={/*}{*/},
morestring=,
breaklines=true,
breakindent=132pt
}`
non riesco ad ottenere le parole chiave in grassetto…tutto il resto, invece, funziona molto bene.

Perché non esiste il Computer Modern Typewriter nero. Se infatti cambi in
`basicstyle=\fontfamily{pcr}\footnotesize,`
ottieni il nero perché Courier ce l’ha. Puoi usare il pacchetto lmodern, ma la differenza fra lmtt (Latin Modern Typewriter) e lmtk (Latin Modern Typewriter Dark) non è molta, soprattutto se usi il colore blu per il Dark.

Ciao
Enrico

Go to top