blob: 22d0dd1451ce0d5dc00af67cb1d445f4fbee3f7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
%%
%% This is file `pbox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pbox.dtx (with options: `style')
%%
%% Copyright (C) 2003,2011 Simon Law
%%
%% This program is free software: you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
%% the Free Software Foundation, either version 3 of the License, or
%% (at your option) any later version.
%%
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%% GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with this program. If not, see <http://www.gnu.org/licenses/>.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pbox}[2011/12/07 v1.2 Dynamic parboxes]
\RequirePackage{calc}
\RequirePackage{ifthen}
\newcommand{\settominwidth}[3][\columnwidth]{%
\settowidth{#2}{\begin{tabular}{@{}l@{}}#3\end{tabular}}%
\ifthenelse{\lengthtest{#1<#2}}{\setlength{#2}{#1}}{}}
\newcommand{\widthofpbox}[1]{%
\widthof{\begin{tabular}{@{}l@{}}#1\end{tabular}}}
\DeclareRobustCommand*{\pbox}[1][]{%
\def\pb@xargi{#1}%
\pb@xi}
\DeclareRobustCommand*{\pb@xi}[1][]{%
\def\pb@xargii{#1}%
\pb@xii}
\DeclareRobustCommand*{\pb@xii}[1][]{%
\def\pb@xargiii{#1}%
\pb@xiii}
\newlength{\pb@xlen}
\DeclareRobustCommand{\pb@xiii}[2]{%
\settominwidth[#1]{\pb@xlen}{#2}%
\ifthenelse{\equal{\pb@xargi}{}}
{\parbox{\pb@xlen}{#2}}
{\ifthenelse{\equal{\pb@xargii}{}}
{\ifthenelse{\equal{\pb@xargiii}{}}
{\parbox[\pb@xargi]{\pb@xlen}{#2}}
{\parbox[\pb@xargi][][\pb@xargiii]{\pb@xlen}{#2}}}
{\ifthenelse{\equal{\pb@xargiii}{}}
{\parbox[\pb@xargi][\pb@xargii]{\pb@xlen}{#2}}
{\parbox[\pb@xargi][\pb@xargii][\pb@xargiii]{\pb@xlen}{#2}}}}%
\def\pb@xargi\relax
\def\pb@xargii\relax
\def\pb@xargiii\relax
\makebox[0pt]{}}
\endinput
%%
%% End of file `pbox.sty'.
|