
코드 환경에 맞게 작은 줄 간격을 얻을 수 없습니다. 강제하는 방법은 무엇입니까? basicstyle=\linespread{0.8}
아무것도 바꾸지 않습니다.
\documentclass[12pt, a4paper]{report}
\usepackage{listings}
\linespread{1.5}
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{10pt}
\lstset{
basicstyle=\ttm\linespread{0.8},
}
\begin{document}
The line spacing is perfect here.
The line spacing is perfect here too.
\begin{lstlisting}
The code has
too high
line spacing
\end{lstlisting}
The line spacing is perfect here.
The line spacing is perfect here too.
\end{document}