summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/turnstile/turnstile.sty
blob: 5c116fe97d894346fdba9ca3be0526cd621093fe (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
%%
%% This is file `turnstile.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% turnstile-en.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2007 by Arthur Buchsbaum and Francisco Reinaldo
%% <arthur@inf.ufsc.br>, <reinaldo.opus@gmail.com>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%% 
\ProvidesPackage{turnstile}
    [2007/06/23 v1.0 turnstile file]
\RequirePackage{ifthen}
\newlength{\firstwidth}
\newlength{\secondwidth}

\newlength{\extrawidth}

\newlength{\leasturnstilewidth}

\newlength{\turnstilewidth}

\newlength{\turnstileheight}

\newlength{\dashthickness}

\newlength{\ddashthickness}

\newlength{\raiseup}

\newlength{\raisedown}

\newlength{\tinyverdistance}

\newlength{\verdistance}

\newlength{\lift}

\newlength{\lengthvar}
\newsavebox{\first}

\newsavebox{\second}

\newsavebox{\turnstilebox}
\newcommand{\makever}[4]
           {\ifthenelse{\equal{#1}{s}}{\rule[-0.5#3]{#2}{#3}}{}
            \ifthenelse{\equal{#1}{d}}{\rule[-0.5#3]{#2}{#3}
                                       \hspace{#4}
                                       \rule[-0.5#3]{#2}{#3}}{}
            \ifthenelse{\equal{#1}{t}}{\rule[-0.5#3]{#2}{#3}
                                       \hspace{#4}
                                       \rule[-0.5#3]{#2}{#3}
                                       \hspace{#4}
                                       \rule[-0.5#3]{#2}{#3}}{}}
\newcommand{\makehor}[4]
    {\ifthenelse{\equal{#1}{n}}{\hspace{#3}}{}
     \ifthenelse{\equal{#1}{s}}{\rule[-0.5#2]{#3}{#2}}{}
     \ifthenelse{\equal{#1}{d}}{\setlength{\lengthvar}{#2}
            \addtolength{\lengthvar}{0.5#4}
            \rule[-\lengthvar]{#3}{#2}
            \hspace{-#3}
            \rule[0.5#4]{#3}{#2}}{}
    \ifthenelse{\equal{#1}{t}}{\setlength{\lengthvar}{1.5#2}
        \addtolength{\lengthvar}{#4}
        \rule[-\lengthvar]{#3}{#2}
        \hspace{-#3}
        \rule[-0.5#2]{#3}{#2}
        \hspace{-#3}
        \setlength{\lengthvar}{0.5#2}
        \addtolength{\lengthvar}{#4}
        \rule[\lengthvar]{#3}{#2}}{}}
\newcommand{\turnstile}[6][s]
    {\ifthenelse{\equal{#1}{d}}
        {\sbox{\first}{$\displaystyle{#4}$}
        \sbox{\second}{$\displaystyle{#5}$}}{}
    \ifthenelse{\equal{#1}{t}}
        {\sbox{\first}{$\textstyle{#4}$}
        \sbox{\second}{$\textstyle{#5}$}}{}
    \ifthenelse{\equal{#1}{s}}
        {\sbox{\first}{$\scriptstyle{#4}$}
        \sbox{\second}{$\scriptstyle{#5}$}}{}
    \ifthenelse{\equal{#1}{ss}}
        {\sbox{\first}{$\scriptscriptstyle{#4}$}
        \sbox{\second}{$\scriptscriptstyle{#5}$}}{}
    \setlength{\dashthickness}{0.111ex}
    \setlength{\ddashthickness}{0.35ex}
    \setlength{\leasturnstilewidth}{0.8em}
    \setlength{\extrawidth}{0.2em}
    \ifthenelse{%
      \equal{#3}{n}}{\setlength{\tinyverdistance}{0ex}}{}
    \ifthenelse{%
      \equal{#3}{s}}{\setlength{\tinyverdistance}{0.5\dashthickness}}{}
    \ifthenelse{%
      \equal{#3}{d}}{\setlength{\tinyverdistance}{0.5\ddashthickness}
        \addtolength{\tinyverdistance}{\dashthickness}}{}
    \ifthenelse{%
      \equal{#3}{t}}{\setlength{\tinyverdistance}{1.5\dashthickness}
        \addtolength{\tinyverdistance}{\ddashthickness}}{}
        \setlength{\verdistance}{0.4ex}
        \settoheight{\lengthvar}{\usebox{\first}}
        \setlength{\raisedown}{-\lengthvar}
        \addtolength{\raisedown}{-\tinyverdistance}
        \addtolength{\raisedown}{-\verdistance}
        \settodepth{\raiseup}{\usebox{\second}}
        \addtolength{\raiseup}{\tinyverdistance}
        \addtolength{\raiseup}{\verdistance}
        \setlength{\lift}{0.8ex}
        \settowidth{\firstwidth}{\usebox{\first}}
        \settowidth{\secondwidth}{\usebox{\second}}
        \ifthenelse{\lengthtest{\firstwidth = 0ex}
            \and
            \lengthtest{\secondwidth = 0ex}}
                {\setlength{\turnstilewidth}{\leasturnstilewidth}}
                {\setlength{\turnstilewidth}{2\extrawidth}
        \ifthenelse{\lengthtest{\firstwidth < \secondwidth}}
            {\addtolength{\turnstilewidth}{\secondwidth}}
            {\addtolength{\turnstilewidth}{\firstwidth}}}
    \setlength{\turnstileheight}{3ex}
    \sbox{\turnstilebox}
    {\raisebox{\lift}{\ensuremath{
        \makever{#2}{\dashthickness}{\turnstileheight}{\ddashthickness}
        \makehor{#3}{\dashthickness}{\turnstilewidth}{\ddashthickness}
        \hspace{-\turnstilewidth}
        \raisebox{\raisedown}
        {\makebox[\turnstilewidth]{\usebox{\first}}}
            \hspace{-\turnstilewidth}
            \raisebox{\raiseup}
            {\makebox[\turnstilewidth]{\usebox{\second}}}
        \makever{#6}{\dashthickness}{\turnstileheight}{\ddashthickness}}}}
        \mathrel{\usebox{\turnstilebox}}}
\newcommand{\nntstile}[3][s]{\turnstile[#1]{n}{n}{#2}{#3}{n}}
\newcommand{\nststile}[3][s]{\turnstile[#1]{n}{s}{#2}{#3}{n}}
\newcommand{\ndtstile}[3][s]{\turnstile[#1]{n}{d}{#2}{#3}{n}}
\newcommand{\nttstile}[3][s]{\turnstile[#1]{n}{t}{#2}{#3}{n}}

\newcommand{\sntstile}[3][s]{\turnstile[#1]{s}{n}{#2}{#3}{n}}
\newcommand{\sststile}[3][s]{\turnstile[#1]{s}{s}{#2}{#3}{n}}
\newcommand{\sdtstile}[3][s]{\turnstile[#1]{s}{d}{#2}{#3}{n}}
\newcommand{\sttstile}[3][s]{\turnstile[#1]{s}{t}{#2}{#3}{n}}

\newcommand{\dntstile}[3][s]{\turnstile[#1]{d}{n}{#2}{#3}{n}}
\newcommand{\dststile}[3][s]{\turnstile[#1]{d}{s}{#2}{#3}{n}}
\newcommand{\ddtstile}[3][s]{\turnstile[#1]{d}{d}{#2}{#3}{n}}
\newcommand{\dttstile}[3][s]{\turnstile[#1]{d}{t}{#2}{#3}{n}}

\newcommand{\tntstile}[3][s]{\turnstile[#1]{t}{n}{#2}{#3}{n}}
\newcommand{\tststile}[3][s]{\turnstile[#1]{t}{s}{#2}{#3}{n}}
\newcommand{\tdtstile}[3][s]{\turnstile[#1]{t}{d}{#2}{#3}{n}}
\newcommand{\tttstile}[3][s]{\turnstile[#1]{t}{t}{#2}{#3}{n}}

\newcommand{\nnststile}[3][s]{\turnstile[#1]{n}{n}{#2}{#3}{s}}
\newcommand{\nsststile}[3][s]{\turnstile[#1]{n}{s}{#2}{#3}{s}}
\newcommand{\ndststile}[3][s]{\turnstile[#1]{n}{d}{#2}{#3}{s}}
\newcommand{\ntststile}[3][s]{\turnstile[#1]{n}{t}{#2}{#3}{s}}

\newcommand{\nndtstile}[3][s]{\turnstile[#1]{n}{n}{#2}{#3}{d}}
\newcommand{\nsdtstile}[3][s]{\turnstile[#1]{n}{s}{#2}{#3}{d}}
\newcommand{\nddtstile}[3][s]{\turnstile[#1]{n}{d}{#2}{#3}{d}}
\newcommand{\ntdtstile}[3][s]{\turnstile[#1]{n}{t}{#2}{#3}{d}}

\newcommand{\nnttstile}[3][s]{\turnstile[#1]{n}{n}{#2}{#3}{t}}
\newcommand{\nsttstile}[3][s]{\turnstile[#1]{n}{s}{#2}{#3}{t}}
\newcommand{\ndttstile}[3][s]{\turnstile[#1]{n}{d}{#2}{#3}{t}}
\newcommand{\ntttstile}[3][s]{\turnstile[#1]{n}{t}{#2}{#3}{t}}

\newcommand{\snststile}[3][s]{\turnstile[#1]{s}{n}{#2}{#3}{s}}
\newcommand{\ssststile}[3][s]{\turnstile[#1]{s}{s}{#2}{#3}{s}}
\newcommand{\sdststile}[3][s]{\turnstile[#1]{s}{d}{#2}{#3}{s}}
\newcommand{\stststile}[3][s]{\turnstile[#1]{s}{t}{#2}{#3}{s}}

\newcommand{\sndtstile}[3][s]{\turnstile[#1]{s}{n}{#2}{#3}{d}}
\newcommand{\ssdtstile}[3][s]{\turnstile[#1]{s}{s}{#2}{#3}{d}}
\newcommand{\sddtstile}[3][s]{\turnstile[#1]{s}{d}{#2}{#3}{d}}
\newcommand{\stdtstile}[3][s]{\turnstile[#1]{s}{t}{#2}{#3}{d}}

\newcommand{\snttstile}[3][s]{\turnstile[#1]{s}{n}{#2}{#3}{t}}
\newcommand{\ssttstile}[3][s]{\turnstile[#1]{s}{s}{#2}{#3}{t}}
\newcommand{\sdttstile}[3][s]{\turnstile[#1]{s}{d}{#2}{#3}{t}}
\newcommand{\stttstile}[3][s]{\turnstile[#1]{s}{t}{#2}{#3}{t}}

\newcommand{\dnststile}[3][s]{\turnstile[#1]{d}{n}{#2}{#3}{s}}
\newcommand{\dsststile}[3][s]{\turnstile[#1]{d}{s}{#2}{#3}{s}}
\newcommand{\ddststile}[3][s]{\turnstile[#1]{d}{d}{#2}{#3}{s}}
\newcommand{\dtststile}[3][s]{\turnstile[#1]{d}{t}{#2}{#3}{s}}

\newcommand{\dndtstile}[3][s]{\turnstile[#1]{d}{n}{#2}{#3}{d}}
\newcommand{\dsdtstile}[3][s]{\turnstile[#1]{d}{s}{#2}{#3}{d}}
\newcommand{\dddtstile}[3][s]{\turnstile[#1]{d}{d}{#2}{#3}{d}}
\newcommand{\dtdtstile}[3][s]{\turnstile[#1]{d}{t}{#2}{#3}{d}}

\newcommand{\dnttstile}[3][s]{\turnstile[#1]{d}{n}{#2}{#3}{t}}
\newcommand{\dsttstile}[3][s]{\turnstile[#1]{d}{s}{#2}{#3}{t}}
\newcommand{\ddttstile}[3][s]{\turnstile[#1]{d}{d}{#2}{#3}{t}}
\newcommand{\dtttstile}[3][s]{\turnstile[#1]{d}{t}{#2}{#3}{t}}

\newcommand{\tnststile}[3][s]{\turnstile[#1]{t}{n}{#2}{#3}{s}}
\newcommand{\tsststile}[3][s]{\turnstile[#1]{t}{s}{#2}{#3}{s}}
\newcommand{\tdststile}[3][s]{\turnstile[#1]{t}{d}{#2}{#3}{s}}
\newcommand{\ttststile}[3][s]{\turnstile[#1]{t}{t}{#2}{#3}{s}}

\newcommand{\tndtstile}[3][s]{\turnstile[#1]{t}{n}{#2}{#3}{d}}
\newcommand{\tsdtstile}[3][s]{\turnstile[#1]{t}{s}{#2}{#3}{d}}
\newcommand{\tddtstile}[3][s]{\turnstile[#1]{t}{d}{#2}{#3}{d}}
\newcommand{\ttdtstile}[3][s]{\turnstile[#1]{t}{t}{#2}{#3}{d}}

\newcommand{\tnttstile}[3][s]{\turnstile[#1]{t}{n}{#2}{#3}{t}}
\newcommand{\tsttstile}[3][s]{\turnstile[#1]{t}{s}{#2}{#3}{t}}
\newcommand{\tdttstile}[3][s]{\turnstile[#1]{t}{d}{#2}{#3}{t}}
\newcommand{\ttttstile}[3][s]{\turnstile[#1]{t}{t}{#2}{#3}{t}}
\endinput
%%
%% End of file `turnstile.sty'.