General ⇒ I want an environment that saves its contents to a macro.
I want an environment that saves its contents to a macro.
to try:
""
\newenvironment{defmacro}[0]{\def \mymacro \bgroup}{\egroup}
\begin{defmacro}
this is inside
\end{defmacro}
mymacro: \mymacro
"""
but latex says "\begin{defmacro} ended by \end{document}". Does anyone have any ideas?
-Gerard
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis