This code works:
\documentclass{book}
\newenvironment{testenvironment}[1][]
{\begin{quote}#1}
{\end{quote}}
\begin{document}
\begin{testenvironment}[testargument]
test text
\end{testenvironment}
\end{document}
This code doesn't:
\documentclass{book}
\newenvironment{testenvironment}[1][]
{\begin{quote}}
{#1\end{quote}}
\begin{document}
\begin{testenvironment}[testargument]
test text
\end{testenvironment}
\end{document}
The only difference is whether #1
is written within the first vs. the second bracket of the \newenvironment
command.
How do I pass the argument to the second bracket, to the content after the input?