diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-10 01:05:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-10 01:05:30 +0000 |
commit | 905da44baf20b22b84b86c1a4cded85beb111531 (patch) | |
tree | 1e531365a333d3a1dc0508334c9c6e305601793e /Master/texmf-dist/source/latex/pbox | |
parent | e510f05066983751f72a1db0dd4d43796f637340 (diff) |
pbox (8dec11)
git-svn-id: svn://tug.org/texlive/trunk@24807 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pbox')
-rw-r--r-- | Master/texmf-dist/source/latex/pbox/pbox.dtx | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/latex/pbox/pbox.dtx b/Master/texmf-dist/source/latex/pbox/pbox.dtx index 6094487c2b5..e437175d785 100644 --- a/Master/texmf-dist/source/latex/pbox/pbox.dtx +++ b/Master/texmf-dist/source/latex/pbox/pbox.dtx @@ -18,7 +18,7 @@ % \fi % \iffalse %<style>\NeedsTeXFormat{LaTeX2e} -%<style>\ProvidesPackage{pbox}[2011/11/24 v1.1 Dynamic parboxes] +%<style>\ProvidesPackage{pbox}[2011/12/07 v1.2 Dynamic parboxes] %<*driver> \NeedsTeXFormat{LaTeX2e}[1995/12/01] \documentclass{ltxdoc} @@ -46,7 +46,7 @@ % \fi % % \StopEventually{\PrintIndex \PrintChanges} -% \CheckSum{78} +% \CheckSum{77} % % \DoNotIndex{\begin} % \DoNotIndex{\columnwidth} @@ -112,14 +112,14 @@ % \makeatletter % \begingroup\center % \begin{minipage}[c]{\ExampleWidth-5mm} -% \parbox[b]{2cm}{Hello\\World!}^^A -% \parbox[t]{2cm}{Bonjour\\monde!} +% \parbox[b]{1.5cm}{Hello\\World!}^^A +% \parbox[t]{1.5cm}{Bonjour\\monde!} % \end{minipage} % \begin{minipage}{\textwidth-\ExampleWidth} % \fvset{xrightmargin=0pt} % \begin{Verbatim} -% \parbox[b]{2cm}{Hello\\World!}% -% \parbox[t]{2cm}{Bonjour\\monde!} +% \parbox[b]{1.5cm}{Hello\\World!}% +% \parbox[t]{1.5cm}{Bonjour\\monde!} % \end{Verbatim} % \end{minipage} % \endcenter\endgroup @@ -146,11 +146,34 @@ % \end{minipage} % \endcenter\endgroup % \makeatother -% \end{DescribeMacro} % Notice how the exclaimation mark and the capital B have no extra % space between each other, implying that |\pbox| creates minimal-width % boxes. % +% If the provided width argument is smaller than the minimal-width, +% then |\pbox| acts just like a regular |\parbox|. By minimal-width, +% we mean the width of the unwrapped piece of text. You will have to +% put in line breaks, to make |\pbox| create the tightest bounding box. +% +% For instance, the following example tries to get |\pbox| to wrap its +% lines automatically. +% \makeatletter +% \begingroup\center +% \begin{minipage}[c]{\ExampleWidth-5mm} +% \pbox[b]{1.5cm}{Hello World!}^^A +% \pbox[t]{1.5cm}{Bonjour monde!} +% \end{minipage} +% \begin{minipage}{\textwidth-\ExampleWidth} +% \fvset{xrightmargin=0pt} +% \begin{Verbatim} +% \pbox[b]{1.5cm}{Hello World!}% +% \pbox[t]{1.5cm}{Bonjour monde!} +% \end{Verbatim} +% \end{minipage} +% \endcenter\endgroup +% \makeatother +% \end{DescribeMacro} +% % \section{Determining minimum widths} % % This is all well and good, but how does one measure the width of one @@ -245,6 +268,7 @@ % % \begin{macro}{\settominwidth} % \changes{v1.1}{2011/11/24}{Always return a robust value.} +% \changes{v1.2}{2011/12/07}{Really fix the result.} % The minimum length is determined by the clever use of the % \textbf{tabular} environment. It knows how to calculate the minimum % requisite width for a column, and the way determines the end of a @@ -268,7 +292,7 @@ % Finally, I wish to make sure that the length I have set in |#2| is % not larger than the maximum stored in |#1|. % \begin{macrocode} - \ifthenelse{\lengthtest{#1<#2}}{\setlength{#2}{\protect{#1}}}} + \ifthenelse{\lengthtest{#1<#2}}{\setlength{#2}{#1}}{}} % \end{macrocode} % \end{macro} % |