Currently, executable code chunks in LaTeX are specified like this:
\begin{lstlisting}[language=Python, exec]
# some executable Python code
\end{listing}
this cannot be compiled by LaTeX, however. Here's a possible solution:
% start exec
\begin{lstlisting}[language=Python, exec]
# some executable Python code
\end{listing}
% end exec
Having a start and end string makes parsing easy.
Note that % marks commented for LaTeX (so it doesn't cause compilation errors).
Currently, executable code chunks in LaTeX are specified like this:
this cannot be compiled by LaTeX, however. Here's a possible solution:
Having a start and end string makes parsing easy.
Note that
%marks commented for LaTeX (so it doesn't cause compilation errors).