如何展示 lstlisting 环境

已邀请:

OsbertWang

赞同来自:

参考 https://tex.stackexchange.com/questions/168043/how-can-i-use-the-lstsample-environment-lstdoc-package-in-article

listings.dtx
给出如下代码:
\documentclass{article}
\usepackage{lstdoc}
\usepackage{xcolor}
\usepackage{lipsum}

\def\MakePercentIgnore{\catcode`\%9\relax}
\def\MakePercentComment{\catcode`\%14\relax}

\begin{document}
\begin{lstsample}{\lstset{frame=trbl,framesep=0pt}}{}
% \begin{lstlisting}[language=Fortran]
% program main
% implicit none
% real(kind=8) :: em,kmax,rkmax
% end
% \end{lstlisting}
\end{lstsample}
\end{document}

要回复问题请先 登录注册