blob: 286bdd545b25cbf0a170a86adcd496812101943b (
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
61
62
|
%%
%% This is file `warpcol.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% warpcol.dtx (with options: `package')
%%
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{warpcol}
[2007/11/21 v1.0c Numerical column definition]
\RequirePackage{array}
\newcount\WPC@digcnt
\newbox\WPC@patbox
\newbox\WPC@valbox
\def\WPC@digval#1{%
\ifx#100%
\else\ifx#111%
\else\ifx#122%
\else\ifx#133%
\else\ifx#144%
\else\ifx#155%
\else\ifx#166%
\else\ifx#177%
\else\ifx#188%
\else\ifx#199%
\else x\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
\def\WPC@digstr{%
\loop 0\advance\WPC@digcnt by-1 \ifnum\WPC@digcnt>0 \repeat}
\def\WPC@expandpat#1{%
\ifx#1\end
\ifnum\WPC@digcnt>0 \WPC@digstr\fi
\let\WPC@next=\relax
\else
\edef\WPC@dv{\WPC@digval#1}%
\if x\WPC@dv
\ifnum\WPC@digcnt>0 \WPC@digstr\fi
#1%
\else
\multiply\WPC@digcnt by10 \advance\WPC@digcnt by\WPC@dv
\fi
\let\WPC@next=\WPC@expandpat
\fi
\WPC@next}
\def\pcolbegin#1#2{%
\WPC@digcnt=0
\edef\WPC@just{#1}%
\setbox\WPC@patbox=\hbox{$\WPC@expandpat#2\end$}%
\setbox\WPC@valbox=\hbox to\wd\WPC@patbox\bgroup
\if#1r\hfil\else\if#1c\hfil\fi\fi$}
\newcommand{\pcolend}{$%
\if l\WPC@just\hfil\else\if c\WPC@just\hfil\fi\fi
\egroup\box\WPC@valbox}
\newcolumntype{P}[1]{>{\pcolbegin{r}{#1}}c<{\pcolend}}
\endinput
%%
%% End of file `warpcol.sty'.
|