summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/widetable/widetable.sty
blob: ec8cd70b472770ba76f061bcd7237c41979b127c (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
63
64
65
66
%%
%% This is file `widetable.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% widetable.dtx  (with options: `package')
%%   ______________________________________________________
%%   The WIDETABLE bundle
%%   Copyright (C) 2009-2020 Claudio Beccari
%%   All rights reserved
%% 
%%   License information appended
%% 
\NeedsTeXFormat{LaTeX2e}[2018/01/01]
\ProvidesPackage{widetable}%
   [2020-01-13 v.2.1 Package for typesetting specified width tables]

\RequirePackage{xparse}[2019-05-01]
\DeclareDocumentEnvironment{widetabular}{m O{c} m +b}
{% OPENING WIDETABLE COMMANDS
}%
{% CLOSING WIDETABLE
    \dimen0=#1 % required width
    \tabcolsep=\z@
    \setbox\z@=\hbox{\tabular{#3}#4\endtabular}%
    \tabcolsep=6pt\relax
    \setbox\tw@=\hbox{\tabular{#3}#4\endtabular}%
    \ifdim\dimen0>\wd\z@
      \tabcolsep=%
          \dimexpr\tabcolsep*(\dimen0-\wd\z@)/(\wd\tw@-\wd\z@)\relax
    \else
      \ifdim\dimen0<\wd\z@
         \PackageWarning{widetable}{%
         The minimum width of the tabular material\MessageBreak
         amounts to \the\wd\z@,  and is larger\MessageBreak
         than the required width  of \the\dimen0\MessageBreak
         \MessageBreak
         The table is typeset with the default\MessageBreak
         column spacing}%
       \fi
    \fi
    \tabular[#2]{#3}#4\endtabular
  \ignorespacesafterend
}
\let\widetable\widetabular \let\endwidetable\endwidetabular

%% 
%% Copyright 2009-2020 Claudio Beccari
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "author-maintained"
%% 
%% This work consists of this file widetable.dtx, a README file
%% the manifest.txt file, and the derived files:
%%     widetable.sty and widetable.pdf.
%% 
%% 
%% By running pdflatex on widetable.dtx the user gets both
%% the sty file and the English documentation PDF file.
%% 
%%
%% End of file `widetable.sty'.