bug-texinfo
[Top][All Lists]
Advanced

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

Re: @deftypefn PDF font issue with brackets and parentheses


From: Gavin Smith
Subject: Re: @deftypefn PDF font issue with brackets and parentheses
Date: Wed, 16 Nov 2022 23:22:27 +0000

On Tue, Nov 15, 2022 at 02:54:45PM +0100, Vincent Lefevre wrote:
> Consider
> 
> ------------------------------------------------------------
> \input texinfo    @c -*-texinfo-*-
> 
> @code{char *t[]}
> 
> @code{char *t()}
> 
> @code{char *t__}
> 
> @deftypefn  Macro int f (char *t[])
> @deftypefnx Macro int f (char *t())
> @deftypefnx Macro int f (char *t__)
> @end deftypefn
> 
> @deftypefun  int f (char *t[])
> @deftypefunx int f (char *t())
> @deftypefunx int f (char *t__)
> @end deftypefun
> 
> @bye
> ------------------------------------------------------------
> 
> For @code, this is OK, but for @deftypefn and variants, the
> square brackets and parentheses are rendered in a variable
> width font instead of the monospace font. Note that in addition
> to unusual style, the "[]" looks like a rectangle.

The square brackets can also be used to mark optional arguments in
other programming languages, so it may not be better to change the
font for these.  You can get the regular monospace font with @t:

@deftypefun  int f (char *t@t{[]})

The outer brackets may not look too bad in the larger size, but
for the function pointer, the following may be an improvement:

@deftypefunx int f (char *t@t{()})

The larger brackets for function parameter lists in definitions are
the style long-used for Texinfo.  You can make the outer brackets small
too using @t, although this would be laborious to do for every
definition.


> In practice, the issue can be seen in the GNU MPFR manual, which has
> 
> @deftypefun int mpfr_sum (mpfr_t @var{rop}, const mpfr_ptr @var{tab}[], 
> unsigned long int @var{n}, mpfr_rnd_t @var{rnd})
> 
> -- 
> Vincent Lefèvre <vincent@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)
> 



reply via email to

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