summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-26 23:34:28 +0000
committerKarl Berry <karl@freefriends.org>2010-11-26 23:34:28 +0000
commitfe6482d3468ca040e53f8e5347548495db754e98 (patch)
tree316b38cc413c275b5bd568b1d95a68bbda85f5ea /Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty
parent4ccf49d7715d013e1de70c6a44384aeb940c1589 (diff)
interfaces 2.4 (25nov10)
git-svn-id: svn://tug.org/texlive/trunk@20577 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty')
-rw-r--r--Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty46
1 files changed, 27 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty b/Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty
index d3e3c069d44..7822dbdf80a 100644
--- a/Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty
+++ b/Master/texmf-dist/tex/latex/interfaces/interfaces-truncate.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% interfaces : 2010/11/21 v2.3 - interfaces : interfaces with keys for other packages (FC)
+%% interfaces : 2010/11/26 v2.4 - interfaces : interfaces with keys for other packages (FC)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -47,12 +47,14 @@
\newrobustcmd\trunctext[3][\TruncateMarker]{% do nothing if width of #3 is less than #2
\begingroup
\hbadness\maxdimen\hfuzz\vsize
- \setbox\z@=\hbox to\dimexpr#2\relax{\ignorespaces#3\unskip}%
- \ifnum\badness>\@M
- \def\next{\truncate[{#1}]{#2}{#3}}%
- \else \def\next{#3}%
+ \setbox\z@=\hbox to\dimexpr#2\relax\bgroup\color@begingroup
+ \ignorespaces#3\unskip
+ \color@endgroup\egroup
+ \ifnum\badness>\@M \truncate[{#1}]{#2}{#3}%
+%% \def\next{\truncate[{#1}]{#2}{#3}}%
+ \else #3%\def\next{#3}%
\fi
- \expandafter\endgroup\next
+ \endgroup
}% \trunctext
\newrobustcmd\htruncadjust[1]{\@testopt
{\itf@htruncadjust{#1}}{}%
@@ -67,7 +69,9 @@
{%
\@for\x:=#3\do{%
\advance \count@ \@ne
- \setbox\z@=\hbox{\ignorespaces\x\unskip}%
+ \setbox\z@\hbox\bgroup\color@begingroup
+ \ignorespaces\x\unskip
+ \color@endgroup\egroup
\dimen\count@ = \wd\z@
\toks\count@\expandafter{\the\dimen\count@}%
\advance\dimen@ \dimen\count@}%
@@ -86,18 +90,22 @@
\itf@freespace\z@ % free space left when w_i < x_i/sum(x_i) * total
\@for\x:=#3\do{%
\advance \count@ \@ne
- \ifdim \dimen\count@<\z@ % not measured before
- \setbox\z@=\hbox{\ignorespaces\x\unskip}%
- \dimen\count@ = \wd\z@
- \fi
- \itf@tempdim = \itf@scaledimen{#1}*\the\toks\count@/\dimen@\relax
- \ifdim \dimen\count@ > \itf@tempdim
- \dimen\count@ = \itf@tempdim
- \edef\itf@istruncated{\itf@istruncated,\the\count@}%
- \advance\itf@sum by\the\toks\count@
- \else
- \advance\itf@freespace \itf@tempdim
- \advance\itf@freespace -\dimen\count@
+ \ifdim\dimen@=\z@ \else
+ \ifdim \dimen\count@<\z@ % not measured before
+ \setbox\z@\hbox\bgroup\color@begingroup
+ \ignorespaces\x\unskip
+ \color@endgroup\egroup
+ \dimen\count@ = \wd\z@
+ \fi
+ \itf@tempdim = \itf@scaledimen{#1}*\the\toks\count@/\dimen@\relax
+ \ifdim \dimen\count@ > \itf@tempdim
+ \dimen\count@ = \itf@tempdim
+ \edef\itf@istruncated{\itf@istruncated,\the\count@}%
+ \advance\itf@sum by\the\toks\count@
+ \else
+ \advance\itf@freespace \itf@tempdim
+ \advance\itf@freespace -\dimen\count@
+ \fi
\fi
\edef\itf@trunc@width{\itf@trunc@width\the\count@{\the@dimen\the\count@}}%
}%