help-texinfo
[Top][All Lists]

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 03:08:05 +0200

Le jeu. 26 sept. 2019 à 21:04, Gavin Smith <address@hidden> a écrit :
On Tue, Sep 24, 2019 at 9:14 PM Pantxo Diribarne
> Thank you very much for your fast answer, there won't be any @-command in the arguments so your solution should work in principle.
>
> Unfortunately, in the mean time I found out that I was unable to generate valid tex output with this macro. The @myref macro is used within a @deftypefn block environment and, while running texi2dvi, I get an error similar to the one mentioned in  [1], something like "Paragraph ended before @deftypefn was complete".
>
> So this approach for partly aliasing the @*ref macros doesn't look like the right one. I guess I'll need to preprocess my texi strings based on the output format. Or is there another way?

I don't see why a macro shouldn't work within a @deftypefn block
although appearing on the actual @deftypefn command line might not
work. I'd have to have an example of the input that fails to see if I
can suggest another way that it could be done.

Sorry for the delay.

* Here is the simple version of the macro:

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

@ifnotplaintext
@pxref{\arg1\, \arg2\, \arg3\, \arg4\, \arg5\}
@end ifnotplaintext
@ifplaintext
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}
@end deftypefn

* Then when running texi2dvi on the above string I get:

io.texi:1119: Paragraph ended before @xrefXX was complete.
@par
l.6

@scanmacro ...@\=@active @scantokens {#1@texinfoc}
@catcode `@@=@savedcatcode...
l.1119 ...ta from can be read from, or written to, text files as well.

Am I doing something obviously wrong?

Pantxo