What is the difference between newcommand and newcommand* (or, similarly, renewcommand and renewcommand*)? I read on TeX Frequently Asked Questions that newcommand "defines a \long version of the command," but I'm not certain what they mean.
Perhaps the biggest issue is that I need to learn what \long does....
General ⇒ newcommand vs newcommand*
NEW: TikZ book now 40% off at Amazon.com for a short time.
newcommand vs newcommand*
Hi,
The \long prefix indicates that the arguments of the macro being defined may contain \par tokens.
\newcommand* behaves like \newcommand, but it defines a command that is not long; i.e., it does not accept empty lines or \par in its argument.
In TeX terms, \def is equivalent to \newcommand* and \long\def is equivalent to \newcommand.
The \long prefix indicates that the arguments of the macro being defined may contain \par tokens.
\newcommand* behaves like \newcommand, but it defines a command that is not long; i.e., it does not accept empty lines or \par in its argument.
In TeX terms, \def is equivalent to \newcommand* and \long\def is equivalent to \newcommand.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: newcommand vs newcommand*
For most purposes, you should use \newcommand*. The \long nature of \newcommand is normally not needed for user macros. (In the same way, using the TeX primitives I prefer \def to \long\def unless I really need to accept paragraphs.)
Joseph Wright