-
Notifications
You must be signed in to change notification settings - Fork 0
/
tableUtil.sty
50 lines (42 loc) · 1.47 KB
/
tableUtil.sty
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tableUtil}[2018 v1.0 John Berlin latex table tool box]
\RequirePackage{kvoptions}
\RequirePackage{xparse}
\DeclareStringOption[.5em]{topSpace}[.5em] % amount of top space to be applied
\DeclareStringOption[1em]{doubleTopSpace}[1em] % amount of double top space to be applied
\DeclareBoolOption[false]{disable} % disables the additional top space added via \tableTopSpace and \tableTopDoubleSpace
\ProcessKeyvalOptions*
%%%
% Macro to change the amount of \arraystretch used for a single table
% Required Arguments 1: the amount of array stretch
%%%
\NewDocumentCommand{\ra}{m}{\renewcommand{\arraystretch}{#1}}
%%%
% Macro to add vspace (.5em) above a table
% Usage:
% \begin{table}
% \tableTopSpace
% .... table code ....
% \end{table}
%%%
\NewDocumentCommand{\tableTopSpace}{}{%
\iftableUtil@disable\else\vspace{\tableUtil@topSpace}\fi%
}
%%%
% Macro to add vspace (1em) above a table
% Usage:
% \begin{table}
% \tableTopDoubleSpace
% .... table code ....
% \end{table}
%%%
\NewDocumentCommand{\tableTopDoubleSpace}{}{%
\iftableUtil@disable\else\vspace{\tableUtil@doubleTopSpace}\fi%
}
%%%
% Macro to print the configuration of \tableTopSpace, \tableTopDoubleSpace,
% and if those macros are disabled to the log file
%%%
\NewDocumentCommand{\showtableUtilConfig}{}{%
\wlog{tableUtil: The table top space = \tableUtil@topSpace, double top space = \tableUtil@doubleTopSpace, top space is \iftableUtil@disable\else not \fi disabled}
}