I am using Inconsolata for code in paragraphs, and would like to use it for code in verbatim environments as well. I have tried using fancyvrb's Verbatim environment to do this, but cannot get any font except Courier. My document starts like this:
\documentclass{book}
\usepackage{fancyvrb}
\usepackage{inconsolata}
\DefineVerbatimEnvironment{VerbOut}{Verbatim}{fontfamily=courier}
\begin{document}
Normal paragraph with \texttt{code using texttt}.
\begin{VerbOut}
VerbOut environment.
\end{VerbOut}
\end{document}
- If I change the
fontfamily
in the definition ofVerbOut
toinconsolata
, the verbatim block displays the normal (Times Roman) font. - If I change it to
\sffamily
, I get an error:! Missing \endcsname inserted.
- I get the same error with
{\sffamily}
,\protect\sffamily
, and other variations.
Questions:
- What's the right way to change the font to Inconsolata?
- What's the right way to change it to whatever is being used by
\texttt
(in case we change our minds about fonts again)?