bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: wrong font shape for `@var` in `@example`


From: Gavin Smith
Subject: Fwd: wrong font shape for `@var` in `@example`
Date: Sun, 21 Aug 2022 13:12:13 +0100

----- Forwarded message from Gavin Smith <GavinSmith0123@gmail.com> -----

Date: Sun, 21 Aug 2022 10:18:39 +0100
From: Gavin Smith <GavinSmith0123@gmail.com>
To: Werner LEMBERG <wl@gnu.org>
Subject: Re: wrong font shape for `@var` in `@example`

On Sun, Aug 21, 2022 at 05:16:17AM +0000, Werner LEMBERG wrote:
> 
> [texinfo.tex 2022-08-20.19]
> 
> I'm *very* unhappy that `@var` in `@example` environments no longer
> produce slanted typewriter but slanted roman – with ligatures!
> Besides being extremely ugly, it completely ruins the fixed-width
> spacing, which is of paramount importance.  Please, PLEASE revert
> this.
> 
> The attached images show the output of
> 
> ```
> \input texinfo.tex
> 
> @example
> flubb flabb flubb flabb flubb flabb
> flubb flabb @var{flubb} @var{flabb} flubb flabb
> flubb flabb flubb flabb flubb flabb
> @end example
> 
> @bye
> ```
> 

Slanted typewriter may be better in this context but there are at least
two other contexts where slanted roman is better for @var (on definition
lines, and in @table @code which is used for definitions).  It's not
possible to tell just from what is visually appealing in an isolated example.
The context and purpose is important.  Why is the fixed-width spacing
important here?

Specifically, I felt that matching the font style between typewriter and
non-typewriter environments was important, so that when documents referred
to @var{flubb} in a paragraph it would look the same as @var{flubb} in
the code, so that readers could easily look back and forth between the
two.

Another option is to change your document to use  @t{@slanted{...}, which
produces the slanted typewriter font.  Obviously, we don't want to be
telling users to make lots of changes to documents but maybe it is
limited.

If fixed-width spacing is necessary for alignment, then we could
use the alignment of the fixed-width font even if we used slanted roman.
One effect of this would be that it would stop @var breaking across
lines inside @example.  I've attached an image of what this would
look like.

(My code to produce this is below.  I'm not recommending this
for documents but it shows how it would be implemented in texinfo.tex.)


@tex
\newbox\horiz
\gdef\hstrut#1#2{%
\setbox\horiz=\hbox{#1}%
\hbox to \wd\horiz{#2\hfil}%
}
@end tex

@example
flubb flabb flubb flabb flubb flabb
flubb flabb @hstrut{@t{@slanted{flubb}}}{@var{flubb}} @hstrut{@t{@slanted{flabb}
}}{@var{flabb}} flubb flabb
flubb flabb flubb flabb flubb flabb
@end example


> The 'old' image was produced with `texinfo.tex` version 2022-04-10.11.
> 
> I can only repeat my strong concerns that I've already voiced on the
> 'texinfo' mailing list: Patrice's ideas of redesigning some commands
> and its affected font changes should be done by adding new commands,
> leaving the old ones unchanged for backward compatibility.  Otherwise
> chances are very high that you get such unwanted collateral damage as
> demonstrated here.
> 
> 
>     Werner






----- End forwarded message -----

Attachment: slanted-align-example.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]