summaryrefslogtreecommitdiff
path: root/tex/context/base/supp-box.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2005-10-27 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2005-10-27 00:00:00 +0200
commit28ba5960fc4486f4e667ee0cbd802335483e1c99 (patch)
tree364430fa36f4d3b1b254a10874b4ed369469d4c9 /tex/context/base/supp-box.tex
parenta35805505d72f60e25a5d9b96dcc5c0a83cc1ed0 (diff)
downloadcontext-28ba5960fc4486f4e667ee0cbd802335483e1c99.tar.gz
stable 2005.10.27
Diffstat (limited to 'tex/context/base/supp-box.tex')
-rw-r--r--tex/context/base/supp-box.tex33
1 files changed, 33 insertions, 0 deletions
diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex
index 7680eb6af..4b451a6bf 100644
--- a/tex/context/base/supp-box.tex
+++ b/tex/context/base/supp-box.tex
@@ -1295,6 +1295,39 @@
\else
\speciallimitatetext{#1}\leftlimit\rightlimit{#3}%
\fi}
+
+%D Undocumented bonus (see wiki):
+%D
+%D \starttyping
+%D \limitatefirstline{\input tufte\relax}{10cm}{\unknown}
+%D \stoptyping
+
+\def\limitatefirstline#1#2#3%
+ {\hbox\bgroup\strut
+ \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
+ \box\plusone
+ \fi\fi
+ \removeunwantedspaces#3}}% \removeunwantedspaces\hss#3}}%
+ \else
+ #1%
+ \fi
+ \egroup}
%D \macros
%D {processisolatedwords,