-
网上找到的一种方法是 \begin{figure}[htbp]
\begin{center}
\lstinputlisting{path/filename.list}
\end{center}
\caption{xxx}
\label{xxx}
\end{figure} 但是这种方式在代码块很长时无法跨页 |
Beta Was this translation helpful? Give feedback.
Answered by
note286
Mar 21, 2023
Replies: 1 comment 2 replies
-
\lstinputlisting[caption={My Caption}, captionpos=b]{foo.list} 导言区可以稍微设置一下以符合我们的使用习惯: \renewcommand\lstlistingname{代码}
\renewcommand\lstlistingnamestyle{\small\bfseries} 这里的代码块使用单独计数器,如果要跟 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
大段代码(超一页肯定算大段代码)建议放在附录,如果是小段代码,直接放在
figure
浮动体里,你就认为这是图即可。