On 2022-10-14 21:27:22 -0500, Jacob Bachmeyer wrote: > Vincent Lefevre wrote: > > I assumed that this was for commands that exist in plain TeX, which > > is not the case of @var. > > Since "var" actually is a TeX macro (Texinfo works by adjusting TeX's > configuration to make @ introduce commands, like backslash does in plain > TeX), would the correct syntax be "@math{\var{base} \le 16}" for the example > above?
And @math should accept @ as a synonym, e.g. @math{@var{base} @le{} 16} which could also be used for Info. This is what is currently done in the MPFR manual for this particular formula and some other ones (but instead of @math, one could also use a macro that would expand to @math{\ARG\} for PDF output and just \ARG\ otherwise). So one just needs to write the formula once. > TeX has an \ifmmode conditional that is true in math mode; @var/\var and > other marking macros could be adjusted to mark their arguments appropriately > when invoked in math mode. Are there other macros that would be appropriate > in @math? At first glance, @var seems unique here. Also user macros. The MPFR manual currently has: @tex \gdef\GMPabs#1{\ensuremath{|#1|}} @end tex @ifnottex @macro GMPabs {X} @abs{}(\X\) @end macro @end ifnottex @tex \gdef\abs{\mathop{\rm abs}} @end tex @ifnottex @macro abs abs @end macro @end ifnottex (this has been copied on the GMP manual, with minor changes). The idea is still to write code that would be valid for HTML, Info and PDF output at the same time. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)