Re: [NTG-context] Length range control of the last line of paragraph
Perhaps this? (I'm still better at Plain TeX than ConTeXt.) %%%%%%%%%%%%%%%% \starttext \setupindenting[yes,40pt] \dimen0=\hsize \advance\dimen0 by -\parindent \advance\dimen0 by -2em \parfillskip=2em plus \dimen0 \tolerance=0 % strictly enforces glue dimensions/stretching - may have unwanted side effects \dorecurse{41}{wxyz }\par \dorecurse{42}{wxyz }\par \dorecurse{26}{wxyz } \blank \hrule \blank % compare \parfillskip=0ptplus1fill \dorecurse{35}{wxy x } xy.\par \dorecurse{42}{wxyz }\par \dorecurse{26}{wxyz } \stoptext %%%%%%%%%%%%%%%% - Michael
On Mar 21, 2016, at 3:14 PM, Jan Tosovsky
wrote: Dear All,
when paragraphs are separated by indenting the first line (instead of an empty line), these rules should be followed:
(1) the last line lenght is greater than the left indent xxxxxxxxxxxxxxxx xxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
(2) the last line is shorter than block width xxxxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
(ad 1) Some suggestions can be found in http://tex.stackexchange.com/questions/28357/ensure-minimal-length-of-last-l ine - but to be honest, it is not very clear to me how to apply it and even combine with (2)
(ad 2) This can be done using \parfillskip XXpt plus 1fil (where XX is required gap)
I'd be grateful for any command which would set this globally for all paragraphs. Partly requested here http://tracker.luatex.org/view.php?id=885
One could set (a) minimum length - default=2*indent (b) minimum gap - default=indent (c) minimum block width where (a) and (b) are still to be applied - default=2*a+b
(ad c) if there are narrower blocks within the document (e.g. blockquotes), we should still have some room for typesetting the last line content. If the area width is insufficient, the last line would be typeset without these (a+b) restrictions.
In meantime, any suggestion how to combine a+b manually are welcome.
Thanks, Jan
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
________________________________ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments).
Hi Michael, On 2016-03-22 Rogers, Michael K wrote:
Perhaps this? (I'm still better at Plain TeX than ConTeXt.)
%%%%%%%%%%%%%%%% \starttext \setupindenting[yes,40pt] \dimen0=\hsize \advance\dimen0 by -\parindent \advance\dimen0 by -2em \parfillskip=2em plus \dimen0 \tolerance=0 % strictly enforces glue dimensions/stretching - may have unwanted side effects
\dorecurse{41}{wxyz }\par \dorecurse{42}{wxyz }\par \dorecurse{26}{wxyz }
thanks, if I understand correctly, this follows my original idea to dynamically get the actual block width, simply substract indentation and use the variable for defining \parfillskip I modified it slightly, but it doesn't seem to have desired effect. The last line of third paragraph is still too short: \starttext \hsize 15.37cm \input tufte \parfillskip30pt plus 1fil \input tufte \dimen0\hsize \advance\dimen0 by -60pt \parfillskip=30pt plus \dimen0 %\tolerance=0 % strictly enforces glue dimensions/stretching - may have unwanted side effects \input tufte \parfillskip0pt plus 1fil \input tufte hsize is \the\hsize{}\par dimen0 is \the\dimen0{} \stoptext I disabled that tolerance as it caused overflowing the text to the margin. Was that the key for the functionality? Jan
participants (2)
-
Jan Tosovsky
-
Rogers, Michael K