I am using showexpl.sty to display side by side the code snippet and its corresponding output.
Because of the paper size limit, I intentionally want to remove the "redundant" rows, i.e., the first n rows and the last m rows from the code snippet.
Is it possible to do that in showexpl.sty ?
\documentclass{article}
\usepackage{showexpl}
\lstset{%
% any setting goes here.
}
\begin{document}
\begin{LTXexample}[%
%any option goes here.
]
%redundant n rows begin
% one
% two
% ...
% n th rows
Important parts go here.
Again... it is important!
...
%redundant m rows begin
% one
% ...
% m th rows
\end{LTXexample}
% others important parts go here.
\end{document}
I reopen this question because using linerange is not possible when I don't know the number of lines until at "runtime".
I will use @Herbert's solution for inline code inclusion and @TH's solution for external code inclusion. Unfortunately I cannot make 2 green-checked.
linerangeargument for inline or external code. The external code can also be marked with\STARTor%STARTand same for STOP. – Herbert Dec 29 '10 at 19:15