Re: Customizing @var?

Patrice Dumas <[email protected]>
Newsgroups gmane.comp.tex.texinfo.general
Message-ID <[email protected]>
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. 

> 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.

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.