问题
I'm using the following LaTeX code in a Beamer presentation:
\begin{frame}
\begin{figure}
\centering
\tiny
\lstset{language=python}
\lstinputlisting{code/get_extent.py}
\end{figure}
\end{frame}
Is it possible to select specific lines from my get_extent.py file rather than displaying it all?
回答1:
This has nothing to do with beamer
; it's about a listings
feature. Its excellent manual has more. For example:
\lstinputlisting[firstline=2,lastline=5]{code/get_extent.py}
来源:https://stackoverflow.com/questions/2135339/using-latex-beamer-to-display-code