At 19:24 17/09/2003 +0200, you wrote:
Hi
one complication is that the last line width is not available outside math mode (which is a pain)
If really needed one can use quite old plain macro which try to soften this pain... However for short paragraphs it needs some changes (\prevgraf can't be less then zero). Meybe this is not very nice but...
\newif\ifmeasdisp \measdispfalse \newcount\lineno \newdimen\linesize \def\measline{\ifhmode \bgroup \parfillskip=0pt plus 1fil \predisplaypenalty=10000 \postdisplaypenalty=10000 \displaywidowpenalty=\widowpenalty \abovedisplayskip=-\baselineskip \belowdisplayskip=-\baselineskip \abovedisplayshortskip=-\baselineskip \belowdisplayshortskip=-\baselineskip $$\global\linesize=\predisplaysize$$ \global\advance\linesize by -2em \global\lineno=\prevgraf \global\advance\lineno by -3 \ifmeasdisp\immediate\write16{>>\the\lineno: \the\linesize}\fi \global\advance\lineno by -1 \global\prevgraf=\lineno \kern\linesize \egroup \else \immediate\write16{! I'M IN VMODE---MEASURING IGNORED}% \fi} % ------------------------------------------------------------------------ % Author: B. Jackowski, 22 V 1990. % ------------------------------------------------------------------------
this 'using a fake formula' is more or less the way i determine the last line length, but keep in mind that this only works in situations like: some text \measline and not in some text \par (or empty line) \measline Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------