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

The following code works in the minimal example but not in my document

  \pgfplotsinvokeforeach{1,2,...,10} {

i get the error

! Illegal parameter number in definition of \pgffor@body.
<to be read again> 
l.143 }

somebody knows this problem?

share|improve this question

closed as not a real question by lockstep, Joseph Wright Sep 18 '11 at 15:29

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I know we always ask about a minimal working example (MWE), but the "working" means more "compilable by us". We would need an example which actually shows the mentioned issue. Try to minimize your document to the part which uses the code but still shows the issue. – Martin Scharrer Apr 20 '11 at 9:53
Just guessing blindly: did you try to double the hash sign, i.e. did you try ##1 instead (or perhaps even more hashes)? This is the typical way how to solve nested macro definitions – Christian Feuersänger Apr 21 '11 at 20:50
If your application is actually that easy, you may also use \forach \nursery in {1,2,...,10} {\nursery} instead. In the (rare) case that you need control over TeX groups, you can also use \pgfplotsforeachungrouped \nursery in {1,2,...,10} {\nursery}. – Christian Feuersänger Apr 21 '11 at 20:52