Re: lstlisting environment inside another environment



Didier Verna schrieb:

I want a user-defined environment to do that, but it seems that listings
environments (whether explicit or created via \lstnewenvironment) don't
like to be put inside other ones.


\documentclass{beamer}%
\usepackage[T1]{fontenc}
\usepackage{xcolor,listings}
\pagestyle{empty}
\begin{document}

\defverbatim[colored]\lst{%
\begin{lstlisting}[basicstyle=\small\ttfamily]
foo
bar
baz
\end{lstlisting}
}
\begin{frame}[fragile]
\begin{block}<1->{title}
\lst
\end{block}
\end{frame}

\end{document}


Herbert

.



Relevant Pages

  • Re: OT: Why is C so popular?
    ... > about the indent program at the time? ... if foo: ...
    (Debian-User)
  • Re: how to deserialize variable element/node
    ... string bar; ... baz[] Baz; ... Your two XML fragments would have to be represented in an XML schema by ...
    (microsoft.public.dotnet.xml)
  • Re: Regular Expressions...
    ... (foo, bar, baz) ... an object which allows access to the grouped matches as a sequence. ...
    (comp.lang.python)
  • Re: macros
    ... (:method ((foo foo) ... (baz baz)) ... in Anonymous C Lisper's post (bar bar)" ... latter so you know that this is actually the generic function you want). ...
    (comp.lang.lisp)
  • Re: explicit interface implementation does not work with events
    ... For some reason you need to perform explicit registration in this case ... Bar b = new Bar; ... private static void f_Foo ... EventHandler foo; ...
    (microsoft.public.dotnet.languages.csharp)