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
I gather your computer runs MacOSX, possibly (likely?) MacOSX 10.12 "Sierra". If so,
Futura Medium
may be installed by default in the file/Library/Fonts/Futura.ttc
. By the way, Futura is a fairly large family of fonts, with 6 weights -- Light, Book, Medium, Heavy, Bold, and Extra Bold -- in the "regular" category and 4 more weights -- Light, Medium, Bold, and Extra Bold -- in the "condensed" category. For each weight, there's both an upright and an oblique (aka slanted) font shape.Assuming you have access to just the system selection of Futura weight/shape/(non)condensed combinations, the following program -- to be run under either XeLaTeX or LuaLaTeX -- should give you access to both the upright and the oblique font shape of
Futura Medium
.