@@ -0,0 +1,193 @@
1+%%
2+%% This is file `trfrac.sty',
3+%% generated with the docstrip utility.
4+%%
5+%% The original source files were:
6+%%
7+%% trfrac.dtx (with options: `file')
8+%%
9+%% This is a generated file.
10+%%
11+%% Copyright (C) 2009 by Kevin W. Hamlen
12+%%
13+%% This file may be distributed and/or modified under the conditions of
14+%% the LaTeX Project Public License, either version 1.3a of this license
15+%% or (at your option) any later version. The latest version of this
16+%% license is in:
17+%%
18+%% http://www.latex-project.org/lppl.txt
19+%%
20+%% and version 1.3a or later is part of all distributions of LaTeX version
21+%% 2004/10/01 or later.
22+%%
23+\newdimen\trtopgap\trtopgap\z@
24+\newdimen\trbotgap\trbotgap\z@
25+\newcommand\TRF@startp{31415926}
26+\newcommand\TRF@endp{27182818}
27+\newif\ifTRF@first
28+\newif\ifTRF@outer\TRF@outertrue
29+\newif\ifTRF@derivok\TRF@derivoktrue
30+\newdimen\TRF@lhang\TRF@lhang\z@
31+\newdimen\TRF@rhang\TRF@rhang\z@
32+\newdimen\TRF@lsave
33+\newdimen\TRF@ni
34+\newdimen\TRF@bi
35+\newdimen\TRF@bw
36+\newbox\TRF@numbox
37+\newbox\TRF@denombox
38+\newbox\TRF@eqbox
39+\newcommand\TRF@trfrac[3]{%
40+ \begingroup%
41+ \ifnum\lastpenalty=\TRF@startp\relax%
42+ \TRF@firsttrue%
43+ \else%
44+ \TRF@firstfalse%
45+ \fi%
46+ \TRF@lsave\TRF@lhang%
47+ \setbox\TRF@eqbox\hbox{\TRF@derivokfalse#1}%
48+ \ifdim\wd\TRF@eqbox>\z@%
49+ \setbox\TRF@eqbox\hbox{\kern\p@\unhbox\TRF@eqbox}%
50+ \fi%
51+ \TRF@lhang\z@%
52+ \setbox\TRF@numbox\hbox{%
53+ \TRF@outerfalse%
54+ \m@th$\strut%
55+ \penalty\TRF@startp\relax%
56+ #2%
57+ \ifnum\lastpenalty=\TRF@endp\relax\else%
58+ \global\TRF@rhang\z@%
59+ \fi%
60+ $%
61+ }%
62+ \setbox\TRF@denombox\hbox{%
63+ \TRF@derivokfalse%
64+ \m@th$\strut#3$%
65+ }%
66+ \dimen@\wd\TRF@numbox%
67+ \advance\dimen@-\TRF@rhang%
68+ \TRF@bw\dimen@%
69+ \advance\TRF@bw-\TRF@lhang%
70+ \ifdim\wd\TRF@denombox>\TRF@bw\TRF@bw\wd\TRF@denombox\fi%
71+ \advance\dimen@\TRF@lhang%
72+ \advance\dimen@-\wd\TRF@denombox%
73+ \TRF@ni\ifdim\dimen@>\z@\z@\else-.5\dimen@\fi%
74+ \TRF@bi\TRF@ni%
75+ \advance\TRF@bi\TRF@lhang%
76+ \TRF@lhang\ifdim\dimen@<\z@\z@\else.5\dimen@\fi%
77+ \ifdim\TRF@bi>\TRF@lhang\TRF@bi\TRF@lhang\fi%
78+ \TRF@rhang\TRF@ni%
79+ \advance\TRF@rhang\wd\TRF@numbox%
80+ \dimen@\TRF@bi%
81+ \advance\dimen@\TRF@bw%
82+ \advance\dimen@\wd\TRF@eqbox%
83+ \ifdim\dimen@>\TRF@rhang\TRF@rhang\dimen@\fi%
84+ \advance\TRF@rhang-\TRF@lhang%
85+ \advance\TRF@rhang-\wd\TRF@denombox%
86+ \global\TRF@rhang\TRF@rhang%
87+ \mathinner{%
88+ \ifTRF@outer%
89+ \raise\fontdimen22\textfont\tw@\vtop%
90+ \else%
91+ \vbox%
92+ \fi%
93+ {%
94+ \offinterlineskip%
95+ \hbox{%
96+ \vbox{%
97+ \dimen@\fontdimen8\textfont\tw@%
98+ \advance\dimen@-\fontdimen22\textfont\tw@%
99+ \advance\dimen@-.5\fontdimen8\textfont\thr@@%
100+ \advance\dimen@-\dp\TRF@numbox%
101+ \ifdim\dimen@<3\fontdimen8\textfont\thr@@%
102+ \dimen@3\fontdimen8\textfont\thr@@%
103+ \fi%
104+ \advance\dimen@\trtopgap%
105+ \hbox{\kern\TRF@ni\unhbox\TRF@numbox}%
106+ \kern\dimen@%
107+ \hbox{%
108+ \kern\TRF@bi%
109+ \vrule\@width\TRF@bw%
110+ \@height.5\fontdimen8\textfont\thr@@%
111+ \@depth.5\fontdimen8\textfont\thr@@%
112+ \vbox{%
113+ \dimen@.5\ht\TRF@eqbox%
114+ \advance\dimen@.5\dp\TRF@eqbox%
115+ \kern-\dimen@%
116+ \box\TRF@eqbox%
117+ \kern-\dimen@%
118+ }%
119+ }%
120+ }%
121+ }%
122+ \dimen@\fontdimen11\textfont\tw@%
123+ \advance\dimen@\fontdimen22\textfont\tw@%
124+ \advance\dimen@-.5\fontdimen8\textfont\thr@@%
125+ \advance\dimen@-\ht\TRF@denombox%
126+ \ifdim\dimen@<3\fontdimen8\textfont\thr@@%
127+ \dimen@3\fontdimen8\textfont\thr@@%
128+ \fi%
129+ \advance\dimen@\trbotgap%
130+ \kern\dimen@%
131+ \hbox{\kern\TRF@lhang\box\TRF@denombox}%
132+ }%
133+ }%
134+ \ifTRF@outer\else%
135+ \penalty\TRF@endp\relax%
136+ \fi%
137+ \global\TRF@lhang\ifTRF@first\TRF@lhang\else\TRF@lsave\fi%
138+ \endgroup%
139+}
140+\newcommand\trfrac[3][]{%
141+ \ifTRF@derivok%
142+ \ifmmode%
143+ \TRF@trfrac{#1}{#2}{#3}%
144+ \else%
145+ \TRF@mmerr%
146+ \fi%
147+ \else%
148+ \TRF@derr%
149+ \fi%
150+}
151+\newcommand\TRF@mmerr{%
152+ \PackageError{trfrac}{\protect\trfrac\space%
153+ only allowed in math mode}%
154+ {I encountered a \protect\trfrac\space%
155+ macro without first encountering a begin-math token.}%
156+}
157+\newcommand\TRF@derr{%
158+ \PackageError{trfrac}{\protect\trfrac\space%
159+ not allowed in the consequent of another \protect\trfrac}%
160+ {\protect\trfrac\space can only appear in the premise (numerator%
161+ ) of another \protect\trfrac, not in the consequent (denominator%
162+ ) of a \protect\trfrac.}%
163+}
164+\newcommand\TRF@next{}
165+\newcommand\TRF@sep{\futurelet\TRF@next\TRF@@sep}
166+\newcommand\TRF@@sep{%
167+ \ifx[\TRF@next%
168+ \let\TRF@next\TRF@separg%
169+ \else%
170+ \let\TRF@next\TRF@sepnoarg%
171+ \fi%
172+ \TRF@next%
173+}
174+\newcommand\TRF@separg{}
175+\def\TRF@separg[#1]{\cr\noalign{\kern#1}}
176+\newcommand\TRF@sepnoarg{\cr}
177+\newenvironment{trgather}{%
178+ \vbox\bgroup%
179+ \let\\\TRF@sep%
180+ \ialign\bgroup\hfil{\m@th$##$}\hfil\cr%
181+}{%
182+ \crcr\egroup\egroup%
183+}
184+\newenvironment{tralign}{%
185+ \vbox\bgroup%
186+ \let\\\TRF@sep%
187+ \ialign\bgroup\hfil{\m@th$##\null$}&{\m@th$\null##$}\hfil\cr%
188+}{%
189+ \crcr\egroup\egroup%
190+}
191+\endinput
192+%%
193+%% End of file `trfrac.sty'.