我怎样才能使使用 listing 包的文档部分以 alltt 中使用的字体显示?
现在我有
\begin{lstlisting}[language = SAS]
proc hpsplit data = autompg2 seed = 123 plots = zoomedtree(nodes = ("0") depth = 2
fracprec = 2 predictorprec = 2);
class origin cylinders;
model mpg = cylinders displacement weight acceleration year origin;
output out=mpgout;
rules file = "\path\mpgrule.txt";
run;
proc means data = mpgout;
class _NODE_;
var MPG;
run;
\end{lstlisting}
答案1
listings
您可以使用获取打字机字体basicstyle = \ttfamily
。要全局启用此设置,您可以使用
\lstset{basicstyle=\ttfamily}