I thought this would be simple, and it may be but I'm missing something. The following (non-functional code) gives this error:
./mwe-environments.tex:28: LaTeX Error: \begin{innerii} on input line 28 ended by \end{inneri}.
What am I missing? I'd like outer
to begin inneri
, have innerii
conclude inner1
and, finally have \end{outer}
finish innerii
. (This is a bare-bones MWE -- there is a lot going in in the environments.)
\documentclass{article}
\usepackage{xparse}
\usepackage{calc}
\NewDocumentEnvironment{myouter}{}{%
\begin{inneri}
}{%
\end{innerii}
}
\NewDocumentEnvironment{inneri}{}{%
\bfseries
}{%
}
\NewDocumentEnvironment{innerii}{}{%
\end{inneri}
\itshape
}{%
%
}
\begin{document}
\begin{myouter}
Bla bla bla
\begin{innerii}
BLA bLA bLA
\end{myouter}
\end{document}
\begin{innerii} BLA bLA bLA \end{myouter}
be valid it defeats the entire point of the environment syntax with matching named group delimiters. – David Carlisle Oct 16 '17 at 20:09\begin
without the matching\end
? This seems like an XY question. – egreg Oct 16 '17 at 21:10\begin{myouter}
starts the formatting,\begin{innerii}
formats another section and\end{myouter}
completes the formatting with a touch of sicut erat in principio for good measure. I'm sure there are other ways to do this, but having started down that path I was determined to persevere. – sgmoye Oct 17 '17 at 0:06