GeneralI want an environment that saves its contents to a macro.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
gbrunick
Posts: 1
Joined: Fri Apr 04, 2008 10:46 pm

I want an environment that saves its contents to a macro.

Post by gbrunick »

I would like an environment that saves its contents into a macro. The obvious thing
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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

I want an environment that saves its contents to a macro.

Post by gmedina »

A possible solution was given in this thread from another forum. Please inform when you post in more than one board.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply