help-texinfo
[Top][All Lists]
 Le 24/09/2019 à 20:41, Gavin Smith a écrit : ```On Tue, Sep 24, 2019 at 4:41 PM Pantxo Diribarne wrote: ``` ```Now how would I go if I want to display the third argument in case it's supplied and the first in case arg3 is empty? ``` ```It's not very easy. The best I could come up was the following: @c use arg1 if present, otherwise use arg2 @macro choosearg{arg1, arg2} @set dummyflag @inlineifclear{dummyflag\arg1\, \arg1\} @inlineifset{dummyflag\arg1\, \arg2\} @end macro I tested that this works with spaces in the arguments, but this doesn't work if arg1 has any @-commands in it: this could be avoided if the node names don't have @-commands in them. ``` 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? Pantxo