I've defined an environment with \newenvironment, which I am mainly using for tikz diagrams. I have it set to dynamically change the margins, vertically and horizontally center the diagrams, and put each diagram on its own page by calling \clearpage and the end of the environment. That all works well.

My question is how can I output the verbatim contents of the environment automatically at the end of the environment? Ideally after the tikz diagram is finished, I'd like to put the markup that generates that diagram on a new page. So if you were to print it double-sided, you'd have the diagram on one side, and the markup on the other.

I am not sure if this is possible. Here is what I currently have defining the environment. It's working well currently—although please let me know if I am doing something incorrectly.

\usepackage[letterpaper, landscape, margin=0in]{geometry}

        \newgeometry{top=#1in, bottom=#1in, left=#2in, right=#2in}
        % Something here that will print the content of the environment

            \draw[ultra thick] (-1, 0) -- (1, 0);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.