我已为我的列表设置了以下内容:
\documentclass[russian,pdf]{beamer}
\mode<presentation>{}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage{graphicx, subfig, amsmath, mathtools, lmodern, listings, lipsum, courier}
\definecolor{darkred}{rgb}{0.7, 0, 0}
\definecolor{darkgreen}{rgb}{0, 0.4, 0}
\definecolor{navy}{rgb}{0, 0, 0.5}
\definecolor{purple}{rgb}{0.45, 0, 0.45}
\definecolor{codebg}{rgb}{0.95, 0.95, 0.95}
\lstset{
language=C++,
basicstyle=\ttfamily,
keywordstyle=\color{navy},
stringstyle=\color{darkred},
commentstyle=\color{darkgreen},
morecomment=[l][\color{purple}]{\#},
backgroundcolor=\color{codebg},
showspaces=false,
showstringspaces=false,
showtabs=false,
}
\begin{document}
\section{C++}
\begin{frame}[fragile]
\begin{lstlisting}
struct employee
{
char name [64] ;
long employee_id;
float salary;
char phone[10];
int office_number;
};
\end{lstlisting}
\end{frame}
\end{document}
但我希望它是 courier 字体。我的 latex 源代码有什么问题?