TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider this example:





The example does not work. What I am aiming to achieve is concatenating all parameters used with foo, so I can output them at the end of the document. What is the correct approach for that?

share|improve this question
You cannot access the arguments from within the second body of \newenvironment. – xport Jun 7 '11 at 0:08
Somewhat unrelated to this problem: you can't use \makeatletter etc. inside command arguments because they are parsed when they are read, not when they are executed. – Philipp Jun 7 '11 at 5:08
up vote 7 down vote accepted

It would be easier to store the parameters at the start of the environment, rather than at the end.



If you need to do it at the end, you might find the solutions to this question useful.

share|improve this answer
I can make it work that way. The original problem required I add some information calculated at the end of the environment as well. I have now added the argument information at the beginning, and the calculated information at the end of the environment. Thanks. – ipavlic Jun 7 '11 at 0:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.