Document Classes ⇒ command scope
command scope
How do I create a command that can only be used in a certain environment? Like how \item can only be used in either \enumerate and \itemize.
NEW: TikZ book now 40% off at Amazon.com for a short time.
command scope
Define the command in the environment initialization code, then it's only available in the environment:
Code: Select all
\newenvironment{abcdef}{\newcommand*{\ghijkl}{...}}{}
Re: command scope
Hmm... odd. I tried that before and it kept saying that the command was already defined. Works now though.