summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-parcolumns.sty
blob: cef4d69bd916d3ddd8e254d236939e4c312cb33f (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
%%
%% This is file `lwarp-parcolumns.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `parcolumns')
%% This is a generated file.
%% Copyright 2016-2020 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
\RequirePackage{keyval}%

\LWR@ProvidesPackageDrop{parcolumns}[2004/11/25]
\newcounter{LWR@parcolumns@numcols}
\newcounter{LWR@parcolumns@thiscol}
\newcounter{LWR@parcolumns@width}
\newbool{LWR@parcolumns@started}
\newbool{LWR@parcolumns@rule}

\define@key{LWRparcols}{colwidths}{}
\define@key{LWRparcols}{distance}{}
\define@key{LWRparcols}{rulebetween}[true]{%
    \setbool{LWR@parcolumns@rule}{#1}%
}
\define@key{LWRparcols}{nofirstindent}{}
\define@key{LWRparcols}{sloppy}{}
\define@key{LWRparcols}{sloppyspaces}{}

\newenvironment*{parcolumns}[2][]
    {%
        \begin{LWR@setvirtualpage}*[#2]%
        \setcounter{LWR@parcolumns@numcols}{#2}%
        \setcounter{LWR@parcolumns@thiscol}{1}%
        \boolfalse{LWR@parcolumns@started}%
        \boolfalse{LWR@parcolumns@rule}%
        \setcounter{LWR@parcolumns@width}{%
            85/#2
        }%
        \setkeys{LWRparcols}{#1}%
    }
    {\end{LWR@setvirtualpage}}

\newcommand{\LWR@parcolumns@onecol}[1]{%
    \ifbool{LWR@parcolumns@started}%
        {}%
        {%
            \LWR@htmldivclass{parcolumns}%
            \booltrue{LWR@parcolumns@started}%
        }%
    \ifboolexpr{%
        bool {LWR@parcolumns@rule} and
        test {%
            \ifnumgreater
                {\value{LWR@parcolumns@thiscol}}
                {1}
        }%
    }%
        {\renewcommand{\LWR@tempone}{ ; border-left: 2px solid black}}%
        {\renewcommand{\LWR@tempone}{}}%
    \begin{BlockClass}[%
        width:\arabic{LWR@parcolumns@width}\% ; % space
        padding: .5ex 1\% ; % space
        \LWR@tempone%
    ]{minipage}%
    #1%
    \end{BlockClass}%
    \addtocounter{LWR@parcolumns@thiscol}{1}%
}

\newcommand{\colchunk}[2][\value{LWR@parcolumns@thiscol}]{%
    \whileboolexpr{%
        test {%
            \ifnumcomp%
                {\value{LWR@parcolumns@thiscol}}
                {<}
                {#1}%
        }%
    }{%
        \LWR@parcolumns@onecol{}%
    }%
    \LWR@parcolumns@onecol{#2}%
}

\newcommand*{\colplacechunks}{%
    \ifbool{LWR@parcolumns@started}%
        {%
            \LWR@htmldivclassend{div}%
            \boolfalse{LWR@parcolumns@started}%
        }%
        {}%
    \setcounter{LWR@parcolumns@thiscol}{1}%
}
\endinput
%%
%% End of file `lwarp-parcolumns.sty'.