I want to create a new environment the make my TeX works easier:
\begin{latin}
\begin{lstlisting}[language=python]
In [1]: x = 1
In [2]: x
Out[2]: 1
\end{lstlisting}
\end{latin}
I know listings
has some problem for making new environment so it has its own \newlstenvironment
, I tried to make new environment using this methods which I find in StackOverflow
and on listings
documentation but I get same error.
method 1:
\newenvironment{ppp}{%
\begin{latin} \begin{lstlisting}}{%
\end{lstlisting} \end{latin}}
method 2:
\lstnewenvironment{ppp}
{\begin{latin}
\lstset{language=python}} { \end{latin}}
Is it possible to create a new environment? How can I do that?
latin
environment?lstlisting
, or any other package that typesets stuff verbatim such asfancyvrb
, you should strictly adhere to the package documentation.