ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \limitatefirstline and the new beta
@ 2005-09-15 10:06 Peter Rolf
  0 siblings, 0 replies; only message in thread
From: Peter Rolf @ 2005-09-15 10:06 UTC (permalink / raw)


Hi Hans,

I just installed the latest beta (14.09.2005) and realised, that
\limitatefirstline is still unchanged. Just read my last mail from the
12th for the details. Sorry for stealing your time.

So I have either to change the description on the wiki, or you have to
change the macro :)

Greetings,

Peter


P.S.:

This is the version I'am currently using (but with 6ex instead of 2ex
tolerance). Using a variable value for the tolerance would make it even
more flexible and user friendly.


\def\limitatefirstline#1#2#3%
 {\hbox\bgroup\strut\dontcomplain
  \setbox\scratchbox\hbox{\begstrut#1\endstrut}%
  \ifdim\wd\scratchbox>#2\relax
    \setbox\scratchbox\hbox{#3}%
    \hsize#2\relax
    \advance\hsize-\wd\scratchbox
    \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}%
    \setbox\scratchbox\vsplit\scratchbox to \lineheight
    \vbox
      {\unvbox\scratchbox
       \global\setbox\plusone\lastbox
       \global\setbox\plusone\hbox{\strut\unhbox\plusone}%
       \hbox % to #2
         {\ifx\clip\undefined
            \box\plusone
          \else\ifdim\wd\plusone>\hsize

\lower\strutdepth\hbox{\clip[\c!width=\hsize,\c!height=\lineheight]{\hbox{\raise\strutdepth\box\plusone}}}%
          \else\ifdim\wd\plusone<\dimexpr\hsize-6ex\relax

\lower\strutdepth\hbox{\clip[\c!width=\hsize,\c!height=\lineheight]{\hbox{\raise\strutdepth\hbox{\begstrut#1\endstrut}}}}%
          \else
            \box\plusone
          \fi\fi\fi
          \removeunwantedspaces#3}}% \removeunwantedspaces\hss#3}}%
  \else
    #1%
  \fi
  \egroup}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-15 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-15 10:06 \limitatefirstline and the new beta Peter Rolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).