I'm using the fancyvrb
package and the Verbatim
(with an uppercase V) environment. However, the font I'm using is to light for my taste, so I'd like to make it bold without having to write \textbf{}
on every line.
My code looks like this:
\documentclass[11pt,oneside]{book}
% preamble
\usepackage{fontspec}
\setmonofont[Ligatures={NoRequired,NoCommon,NoContextual},Numbers={Lining,Monospaced},Scale=0.8]{Courier New}
% more preamble
\usepackage{verbatim}
\usepackage{fancyvrb}
% final part of the preamble
\begin{document}
\begin{Verbatim}[commandchars=\\\{\}]
this text is in a monospace font
\end{Verbatim}
\end{document}
I've tried adding something like Uppercase=Bold,Lowercase=Bold,Numbers=Bold
to the \setmonofont
options, but I haven't been able to get it to work. I've also tried using the command \verbatimfont
, but that didn't work for me either.
Thnks in advance for any help.
fancyvrb
for other reasons than shown in your MWE? For example, you make no use ofcommandchars
, etc.Verbatim
for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied tofancyvrb
.cm-unicode
andLatin Modern
have.