On 2022-10-14 21:42:27 +0100, Gavin Smith wrote: > On Fri, Oct 14, 2022 at 01:15:03PM +0200, Vincent Lefevre wrote: > > FYI, the goal is to have @ttie{} equivalent to @tie{} except for > > PDF output (where @tie{} also gives incorrect spacing). > > I see. As ever, using Texinfo commands inside @math is not advisable.
Here, @ttie{} is a macro that doesn't contain any Texinfo command. > Even defining ttie as a simple \gdef had the same spacing problem. > > It appears you are are right abut TeX treating the minus sign as a binary > operator. You can format it correctly using \mathord: > > @deftypefun int f3 () > @math{@var{n}@ttie{}=@ttie{}\mathord-2} > @end deftypefun This doesn't solve the issue, where the goal is to write the same text for Info, HTML and PDF. That's precisely why I needed the @ttie{} macro, whose expansion depends on the output type. > In your use case, you can avoid line breaks using the @w command: > > @deftypefun int f4 () > @w{@math{@var{n} = -2}}. > @end deftypefun If the @w ignored in math mode? The manual just says: The space from '@w{ }', as well as being non-breakable, also will not stretch or shrink. Sometimes that is what you want, for instance if you're doing manual indenting. However, usually you want a normal interword space that does stretch and shrink (in the printed output); for that, see the '@tie' command in the next section. For PDF output, I want the spaces to be the usual ones that are generated in math mode. -- 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)