If your verbatim text doesn't contain Cyrillic letters, you can modify the setup macro of fancyvrb
to use the T1 encoding. The problem is that TeX distributions don't feature a Cyrillic Courier compatible font.
Similarly, you can use a similar declaration for listings
.
\documentclass[10pt]{book}
\usepackage[a5paper,left=3cm,right=2cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage{courier}
\usepackage{listings}
\usepackage{fancyvrb}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\FV@SetupFont}
{\FV@BaseLineStretch}
{\fontencoding{T1}\FV@BaseLineStretch}
{}{}
\makeatother
\lstset{
basicstyle=\fontencoding{T1}\ttfamily,
columns=fullflexible
}
\begin{document}
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
\begin{Verbatim}
some verbatim text in Courier
\end{Verbatim}
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
\begin{lstlisting}
some verbatim text in Courier
\end{lstlisting}
\end{document}

A monospaced font that has coverage for Cyrillic is PTMono; unfortunately, listings
does not behave well with UTF-8 characters (check with listings-utf8
that however requires using \lstinputlisting
).
\documentclass[10pt]{book}
\usepackage[a5paper,left=3cm,right=2cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage[scaled=0.9]{PTMono}
\usepackage{fancyvrb}
\begin{document}
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
\begin{Verbatim}
some дословно text in PTMono
\end{Verbatim}
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
\end{document}

If you're keen to switch to XeLaTeX/LuaLaTeX, then there's no big problem, if you have an OpenType/TrueType version of Courier on your system that supports Cyrillic; in my case it's called Courier New.
\documentclass[10pt]{book}
\usepackage[a5paper,left=3cm,right=2cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage{fontspec}
\usepackage[russian]{babel}
\usepackage{fancyvrb}
\setmainfont{Linux Libertine O} % or whatever
\setmonofont[Scale=MatchLowercase]{Courier New}
\begin{document}
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
\begin{Verbatim}
some дословно text in Courier
\end{Verbatim}
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
Этот текст на русском языке.
\end{document}

The same as above can be said about lstlisting
. You may also want to look at minted
.
Best Answer
pcr
is the family name, it is used with\fontfamily
, e.g.:Or
Or with a
\pcr
command: