[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-texinfo] Determine if an argument was supplied to a macro

From: Pantxo Diribarne
Subject: Re: [help-texinfo] Determine if an argument was supplied to a macro
Date: Sun, 29 Sep 2019 14:06:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Le 29/09/2019 à 11:33, Gavin Smith a écrit :
On Sun, Sep 29, 2019 at 2:08 AM Pantxo Diribarne
<address@hidden> wrote:
* Here is the simple version of the macro:

@macro opxref{arg1, arg2, arg3, arg4, arg5}

@pxref{\arg1\, \arg2\, \arg3\, \arg4\, \arg5\}
@end ifnotplaintext
see \arg3\
@end ifplaintext

@end macro

* And here is how it ends up being called in GNU Octave's manual:

@deftypefn  {} {@var{x} =} csvread (@var{filename})
Any optional arguments are passed directly to @code{dlmread}
@xseealso{@ref{XREFdlmread,,dlmread}, @ref{XREFtextscan,,textscan}, 
@ref{XREFcsvwrite,,csvwrite}, @ref{XREFdlmwrite,,dlmwrite}}
@end deftypefn
It works if you provide arguments for all of the macro's parameters,
with @opxref{XREFdlmread,,dlmread,,}.

I checked with an old version of Texinfo (4.13) and this was still the
case then: with TeX, you need to provide all the arguments, even
trailing ones which are empty.

Indeed this works. I'll stick to preprocessing though and automatically replace @*ref{...} by some static string. This will save me from having to add trailing arguments to all doc strings in Octave source. This will also avoid the limitation of not having a way to pass @-command arguments if necessary.

Many thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]