Re: Customizing @var?
Raymond Toy <[email protected]>
| Newsgroups | gmane.comp.tex.texinfo.general |
|---|---|
| Message-ID | <CAG14z1HzRpG-v+k_MOMEGeViuBOjx28XZO+W4-Sx_62uUeTXHA@mail.gmail.com> |
On Sat, Sep 24, 2022 at 2:07 AM Patrice Dumas <[email protected]> wrote: > On Tue, Sep 20, 2022 at 04:31:08PM -0700, Raymond Toy wrote: > > Is it possible to customize what @var does (for info files) without > > redefining @var? > > Maxima redefines @var to > > > > @macro var {expr} > > <\expr\> > > @end macro > > This is not recommended, and could even be forbidden, in my opinion, to > redefine existing Texinfo @-commands. That puts the maxima docs in a precarious position. I don't know the full history but someone wanted @var{foo}) to be <foo> instead of FOO. It's been that way for quite some time now. > > > > This breaks things like > > > > @table @var > > > > So I'm curious if there's some way to customize @var without defining it. > > There is @definfoenclose, but it is deprecated. I just tested that it > leads to a warning, but otherwise formats the output as you expected, > I think. > This works fine. I used @definfoenclose var,<,> and @var{foo} now produces <FOO> instead of <foo>. Perhaps that's ok to whoever redefined @var. He also suggested using @table @asis @item @var{foo} AFAIK, there was only once case for @table @var which was quickly changed to @table @code, which is good enough for me, even if it's not really quite right. However, we're kind of stuck if you disallow redefining @var and also deprecate and remove @definfoenclose. > > As a side note, this is documented: > > The '@table' command works with other commands besides those > explicitly mentioned here. However, you can only use predefined Texinfo > commands that take an argument in braces. You cannot reliably use a new > command defined with '@macro', although an '@alias' (for a suitable > predefined command) is acceptable. > > It does not seems to me to be a good thing to accept @-commands defined > by @macro as @table argument, for two reasons > * it would not be possible to know if the command should be expanded > immediatly like macro defined command usually are, or be expanded later > * the use of commands in argument to @table to format table @item is > done during conversion, and not during parsing, at wihch time > @-commands defined by @macro have all been expanded. > > -- > Pat > -- Ray