[latexrefman-discuss] latexrefman / ltxref.org

Vincent Belaïche vincent.belaiche at domain.hid
Tue May 10 10:04:56 CEST 2016



Le 09/05/2016 19:56, Patrick Gundlach a écrit :
> Hello Vincent,
>
> I think I was unclear in my (hasty) mail.
>
> Take for example the command "\newcommand" (12. definitions)
>
> @item cmd
> Required; @code{\@var{cmd}} is the command name.  For @code{\newcommand}, it
> must not be already defined and must not begin with @code{\end}.  For
> @code{\renewcommand}, it must already be defined.
>
> @item nargs
> Optional; an integer from 0 to 9, specifying the number of arguments
> that the command will take.  If this argument is not present, the
> default is for the command to have no arguments.  When redefining a
> command, the new version can have a different number of arguments than
> the old version.
>
>
> I am unable to take from the texi file that "nargs" is optional. It is
> written there, but it is not extractable. This is the kind of
> information I'd like to include in ltxref.org

OK. We could modify the texi file so that it is written like this:

  @item @RequiredArg{cmd}
  @code{\@var{cmd}} is the command name.  For @code{\newcommand}, it
  must not be already defined and must not begin with @code{\end}.  For
  @code{\renewcommand}, it must already be defined.
 
  @item @OptionalArg{nargs}
  an integer from 0 to 9, specifying the number of arguments
  that the command will take.  If this argument is not present, the
  default is for the command to have no arguments.  When redefining a
  command, the new version can have a different number of arguments than
  the old version.

Both RequiredArg  and OptionalArg would be macros, defined as follows:

  @macro RequiredArg \x\
  \x\
  @argindex \x\, required
  Required;
  @end macro
  
  @macro RequiredArg \x\
  \x\
  @argindex \x\, optional
  Optional;
  @end macro

with also in the preamble

  @defindex arg

Plus some node 'Argument Index' compiled under flag condition with

  @printindex arg

So you would have the information extractable from the 'Argument index'
node page with all links to the arguments.

For the normal production of the manual the argument index flag would
not be set, so there would be no change.

  Vincent


>
> Patrick
>





More information about the latexrefman mailing list