[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rethinking @def*
From: |
Gavin Smith |
Subject: |
Re: rethinking @def* |
Date: |
Thu, 11 Aug 2022 11:56:22 +0100 |
On Thu, Aug 11, 2022 at 11:14:06AM +0200, Patrice Dumas wrote:
> On Wed, Aug 10, 2022 at 04:44:17PM +0100, Gavin Smith wrote:
> >
> > I don't see any hope of fixing this, so we have to do more protection,
> > perhaps outputting something like \texttt{a :\ b} instead of \texttt{a : b}.
>
> The regexp you used misses the case of a punctuation at the end of a
> text element, followed by space in the next element, which happens in
> @def* arguments because the argument is 'parsed' and split in little
> bits of text with specific types. I haven't checked, but a construct
> like the following may also be missed, although it depends on what LaTeX
> does in such a context:
>
> @code{@var{?} a}.
>
> Maybe also protect the first leading space in code context? Would that
> be too 'invasive'?
Probably not, as it wouldn't appear everywhere, only where there was
a leading space. It is only an extra \ in the output.
We could also protect trailing punctuation. I believe this is the
problem you described:
@deftypefn Function {} foo (@var{one} @var{two?} @var{three})
ddddddddddd
@end deftypefn
The output currently has
\noindent\texttt{ foo (\GNUTexinfocommandstyletextvar{one} \GNUTexinfocommandsty
+letextvar{two?} \GNUTexinfocommandstyletextvar{three})}\hfill[Function]
which produces extra space after "two?". This could be fixed using \@, so
\noindent\texttt{ foo (\GNUTexinfocommandstyletextvar{one} \GNUTexinfocommandsty
+letextvar{two?\@} \GNUTexinfocommandstyletextvar{three})}\hfill[Function]
This wouldn't be too invasive either as we would not insert the \@ at the
end of all elements, only when they ended with the problematic
punctuation.
- Re: rethinking @def*, (continued)
- Re: rethinking @def*, Gavin Smith, 2022/08/14
- Re: rethinking @def*, Patrice Dumas, 2022/08/16
- Re: rethinking @def*, Gavin Smith, 2022/08/16
- Re: rethinking @def*, Patrice Dumas, 2022/08/16
- Re: rethinking @def*, Gavin Smith, 2022/08/17
- Re: rethinking @def*, Patrice Dumas, 2022/08/17
- Re: rethinking @def*, Gavin Smith, 2022/08/17
- Re: rethinking @def*, Patrice Dumas, 2022/08/10
- Re: rethinking @def*, Gavin Smith, 2022/08/10
- Re: rethinking @def*, Patrice Dumas, 2022/08/11
- Re: rethinking @def*,
Gavin Smith <=
- Re: rethinking @def*, Gavin Smith, 2022/08/11
- Re: rethinking @def*, Gavin Smith, 2022/08/11
Re: rethinking @def*, Gavin Smith, 2022/08/10