|
From: | Vincent Lefevre |
Subject: | Re: paragraph justification issue on @url with "texi2dvi --pdf" in texinfo.tex 2019-09-20.22 |
Date: | Wed, 25 Sep 2019 16:03:43 +0200 |
User-agent: | Mutt/1.12.1+19 (078654a4) vl-117499 (2019-06-15) |
On 2019-09-24 14:30:50 +0100, Gavin Smith wrote: > It was done this way because of the difficulty of breaking lines in a > good place with long URL's. > > https://lists.gnu.org/archive/html/bug-texinfo/2019-03/msg00007.html Yes, but even in this case, this is not sarisfactory (see below). Thus the user should do the page layout in such a case. > I agree a short space at the end of the line doesn't look good. I've > worked out the following change which means that the extra space at > the end of the line won't always be added: > > diff --git a/doc/texinfo.tex b/doc/texinfo.tex > index af857cbbb..40fa95c49 100644 > --- a/doc/texinfo.tex > +++ b/doc/texinfo.tex > @@ -3099,11 +3099,14 @@ end > \def\wordbefore{before} > \def\wordnone{none} > > -% Allow a ragged right output to aid breaking long URL's. Putting stretch in > -% between characters of the URL doesn't look good. > +% Allow a ragged right output to aid breaking long URL's. There can > +% be a break at the \allowbreak with no extra glue (if the existing stretch > in > +% the line is sufficent), a break at the \penalty100 with extra glue added > +% at the end of the line, or no break at all here. > \def\urefallowbreak{% > - \hskip 0pt plus 4 em\relax > \allowbreak > + \hskip 0pt plus 4 em\relax > + \penalty100 > \hskip 0pt plus -4 em\relax > } This fixes some cases, but not others. I've attached a url-break.texi file with 4 cases. And I've tested 4 different texinfo.tex solutions (the old one, the new one, the new one with this patch, and another one with just a \allowbreak). As a summary: * url-break-2018.pdf obtained with texinfo.tex 2018-02-12.17 (from automake) Issue: stretch in between characters of the URL. * url-break-2019a.pdf obtained with texinfo.tex 2019-09-24.13 (from texinfo) with the unpatched \urefallowbreak macro: \def\urefallowbreak{% \hskip 0pt plus 4 em\relax \allowbreak \hskip 0pt plus -4 em\relax } Issues: - stretch not avoided in the 1st case (though output is ragged right); - ragged right output even in the 3rd and 4th cases. * url-break-2019b.pdf obtained with texinfo.tex 2019-09-24.13, where the \urefallowbreak macro has been patched: \def\urefallowbreak{% \allowbreak \hskip 0pt plus 4 em\relax \penalty100 \hskip 0pt plus -4 em\relax } Issues: - stretch not avoided in the 1st case (though output is ragged right); - ragged right output even in the 3rd case; i.e. only the 4th case has been fixed. * url-break-2019c.pdf obtained with texinfo.tex 2019-09-24.13, where the \urefallowbreak macro has been simplified to: \def\urefallowbreak{% \allowbreak } Issue: more stretch in the 1st case, but this case has not been satisfactory with any of the tested solutions anyway. Currently I find that just a \allowbreak is the best compromise: the cases that can be output nicely are OK; the problematic case is a bit worse than with the new solution (patched or not), but to fix it in a satisfactory way, it is up to the user. -- Vincent Lefèvre <address@hidden> - 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)
url-break.texi
Description: TeXInfo document
url-break-2018.pdf
Description: Adobe PDF document
url-break-2019a.pdf
Description: Adobe PDF document
url-break-2019b.pdf
Description: Adobe PDF document
url-break-2019c.pdf
Description: Adobe PDF document
[Prev in Thread] | Current Thread | [Next in Thread] |