[texhax] Checking the length of paragraph last line [fun]

Uwe Lück uwe.lueck at web.de
Sun Nov 13 14:14:26 CET 2005


At 15:30 10.11.05, William F. Adams wrote:
>On Nov 10, 2005, at 7:29 AM, Joel wrote:
>
>>Many years ago there was a posting to comp.text.tex that my disk drive
>>and memory were to small to hold. There was a set of macros to have the
>>indent of a paragraph start where the last paragraph ended. I've looked
>>for it on google without luck. (Can't say I was much motivated to
>>really
>>find it) I'm sure this could be apapted for this task. If anyone
>>locates
>>this posting it would be nice to see it again.
>
>Was this it?
>
>http://groups.google.com/group/comp.text.tex/msg/6e262148f84eb574? 
>dmode=source
>
>It was in the first thread found be searching on ``latex start
>paragraph indent where last paragraph line ended''

William, Joel,

thanks to both of you. I won't study and try what the link contains.
Indeed I would try to adapt such a facility as follows:

1. Simple way: If the first paragraph ought to be continued,
pull the second one up similarly as LaTeX's \@centercr
(\\ in {center} environment) does. I.e., \unskip (namely \parskip)
and \vskip-\baselineskip. The second indent must be extended
by some interword glue, or better: The space factor may get lost --
unless one closes the first paragraph with a space and an arbitrary
skip, so \par gobbles the latter instead of the interword glue.

The apparent "continued" paragraph may be suboptimal.
Most glaringly, the interword glues in the "continued" line
will differ. So better:

2. As in my first proposal: typeset in some \vbox, measure,
\unskip (\baselineskip) \unskip (\parskip) \setbox0\lastbox
(I hope there hasn't been any \vadjust or ...), \unvbox the
\vbox to the main vertical list (or ... depending on ...),
\unhbox0, continue with following material in horizontal mode.

This way, the interword glue of the continuing line is properly
balanced, but one could do better still:

3. Unwrap all the lines of the first paragraph, \unhbox them
all for contuining the paragraph in horizontal mode.

... well, when we do it this way, we can measure the final
line ourselves, not needing other people's macros.

My earlier proposal aimed at too much, in measuring
after continuing in the paragraph. The previous procedure
suffices propably in any case (exept there are whatsits
etc. in the vertical list).

Best,
   Uwe.



More information about the texhax mailing list