summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/widetable
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-09-28 23:57:48 +0000
committerKarl Berry <karl@freefriends.org>2009-09-28 23:57:48 +0000
commit56ba94d1d3a01b11a10578f66d461dac3aad2b0e (patch)
tree8ab55bd68e7017335787a929fbdd055647704822 /Master/texmf-dist/tex/latex/widetable
parente1ad2371d28982edecd1e4f12ff42cdb6f15dcd6 (diff)
new latex package widetable 1.0 (28sep09)
git-svn-id: svn://tug.org/texlive/trunk@15540 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/widetable')
-rw-r--r--Master/texmf-dist/tex/latex/widetable/widetable.sty114
1 files changed, 114 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/widetable/widetable.sty b/Master/texmf-dist/tex/latex/widetable/widetable.sty
new file mode 100644
index 00000000000..6e16a1f9b8c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/widetable/widetable.sty
@@ -0,0 +1,114 @@
+%%
+%% This is file `widetable.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% widetable.dtx (with options: `package')
+%%
+%% Copyright 2009 Claudio Beccari All rights reserved.
+%%
+%% This system 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.
+%%
+%%
+%% IMPORTANT NOTICE:
+%%
+%% You are not allowed to change this file.
+%%
+%% You are allowed to distribute this file under the condition that
+%% it is distributed together with widetable.dtx.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%% You are NOT ALLOWED to distribute this file alone. You are NOT
+%% ALLOWED to take money for the distribution or use of either this
+%% file or a changed version, except for a nominal charge for copying
+%% etc.
+%%
+%% File `widetable.dtx'.
+%% Copyright (C) 2009 Claudio Beccari all rights reserved.
+%%
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{widetable}%
+ [2009/07/21 v.1.0 Package for typesetting specified width tables]
+\dimendef\wt@Numer=2
+\dimendef\wt@Denom=4
+\countdef\wt@Num=2
+\countdef\wt@Den=4
+\countdef\wt@I=6
+\def\wt@segno{}
+\def\dividi#1\per#2\in#3{%
+ \begingroup
+ \wt@Numer #1\relax \wt@Denom #2\relax
+ \ifdim\wt@Denom<\z@ \wt@Denom -\wt@Denom \wt@Numer -\wt@Numer\fi
+ \ifdim\wt@Numer<\z@ \def\wt@segno{-}\wt@Numer -\wt@Numer\fi
+ \ifdim\wt@Denom=\z@
+ \edef\wt@Q{\ifdim\wt@Numer<\z@-\fi\strip@pt\maxdimen}%
+ \else
+ \wt@Num=\wt@Numer \wt@Den=\wt@Denom \divide\wt@Num\wt@Den
+ \edef\wt@Q{\number\wt@Num.}%
+ \advance\wt@Numer -\wt@Q\wt@Denom \wt@I=6
+ \@whilenum \wt@I>\z@ \do{\wt@dividiDec\advance\wt@I\m@ne}%
+ \fi
+ \edef\x{\noexpand\endgroup\noexpand\def\noexpand#3{\wt@segno\wt@Q}}
+ \x
+}
+\def\wt@dividiDec{%
+ \wt@Numer=10\wt@Numer \wt@Num=\wt@Numer \divide\wt@Num\wt@Den
+ \edef\wt@q{\number\wt@Num}\edef\wt@Q{\wt@Q\wt@q}%
+ \advance\wt@Numer -\wt@q\wt@Denom}
+\newdimen\wt@width
+\def\wt@starttabular{\expandafter\tabular\expandafter{\wt@preamble}}
+\def\widetable#1#2{%
+ \def\@tempC{widetable}\setlength{\wt@width}{#1}%
+ \def\wt@preamble{#2}\wt@getTable}
+\newif\ifwt@scartare\wt@scartarefalse
+\def\endwidetable{%
+ \ifwt@scartare
+ \noindent\null
+ \else
+ \tabcolsep=\z@
+ \setbox\z@=\hbox{\wt@starttabular\the\toks@\endtabular}%
+ \tabcolsep=1cm\relax
+ \setbox\tw@=\hbox{\wt@starttabular\the\toks@\endtabular}%
+ \advance\wt@width-\wd\z@
+ \@tempdimb=\wd\tw@
+ \advance\@tempdimb-\wd\z@
+ \dividi\wt@width\per\@tempdimb\in\@tempA
+ \tabcolsep=\@tempA\tabcolsep
+ \wt@starttabular\the\toks@\endtabular
+ \fi
+ \ignorespacesafterend
+}
+\def\wt@finetabella{\end{widetable}}%
+\def\wt@getTable#1\end#2{\def\@tempB{#2}%
+ \ifx\@tempB\@tempC
+ \toks@={#1}%
+ \expandafter\wt@finetabella
+ \else
+ \PackageWarning{widetable}{%
+ The table contains environment `\@tempB' %
+ \MessageBreak
+ not enclosed in braces. This is expressly forbidden!%
+ \MessageBreak
+ The table is not typeset and is substituted%
+ \MessageBreak
+ with a framed box}
+ \noindent\framebox[\wt@width]{The table was not typeset because
+ it contains a visible \texttt{\char`\\end} in one or more cells.}\par
+ \expandafter\wt@finishTable
+ \fi
+}
+\def\wt@finishTable#1\end#2{%
+ \def\@tempB{#2}%
+ \ifx\@tempB\@tempC
+ \wt@scartaretrue\expandafter\wt@finetabella
+ \else
+ \expandafter\wt@finishTable
+ \fi
+}
+\endinput
+%%
+%% End of file `widetable.sty'.