## LaTeX forum ⇒ General ⇒ why my newenvironment doesnot accept more than 1 parameters?

LaTeX specific issues not fitting into one of the other forums of this category.
zell08v
Posts: 3
Joined: Mon Aug 17, 2009 8:18 am

### why my newenvironment doesnot accept more than 1 parameters?

Hello everyone,

Here is my first question. I am a newbie and trying out the newenvironment.

The following newenvironment does not compile. Anyone can explain me why? Thanks a lot.

\newenvironment{add_head_tail}[2]{Head of \emph{#1}}{Head of \emph{#2}}

zell08v
Posts: 3
Joined: Mon Aug 17, 2009 8:18 am
Sorry I had forgotten posting error messages:

--- TeX said ---
2

--- HELP ---
\newenvironment, or \renewenvironment command in which a # is used
incorrectly. A # character, except as part of the command name \#,
can be used only to indicate an argument parameter, as in #2, which
denotes the second argument. This error is also caused by nesting one
of the above four commands inside another, or by putting a parameter
like #2 in the last argument of a \newenvironment or \renewenvironment
command.

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

... or by putting a parameter like #2 in the last argument of a \newenvironment or \renewenvironment command.

So, you cannot use parameters like #2 in the ending part of the definition of a new environment. Perhaps, if you describe what you expect to achieve with the environment that you want to define, we could give you some indications.
1,1,2,3,5,8,13,21,34,55,89,144,233,...

zell08v
Posts: 3
Joined: Mon Aug 17, 2009 8:18 am

You are totally right. Latex doesnot permet the use of parameters in its ending part of definition. Maybe it's a designing issue who knows.

Thank you.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm
It is indeed a design issue (which is known about).
Joseph Wright