-
Notifications
You must be signed in to change notification settings - Fork 28
/
lhs2TeX.sty.lit
200 lines (172 loc) · 5.35 KB
/
lhs2TeX.sty.lit
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
\begin{code}
%if False
%
% Permission is granted to include this file (or parts of this file)
% literally into other documents, regardless of the conditions or
% license applying to these documents.
%
%endif
%if not lhs2tex_lhs2tex_sty_read
%let lhs2tex_lhs2tex_sty_read = True
%include lhs2TeX.fmt
%
%if (style /= newcode) && (style /= markdown)
%
\makeatletter
\@@ifundefined{lhs2tex.lhs2tex.sty.read}%
{\@@namedef{lhs2tex.lhs2tex.sty.read}{}%
\newcommand\SkipToFmtEnd{}%
\newcommand\EndFmtInput{}%
\long\def\SkipToFmtEnd#1\EndFmtInput{}%
}\SkipToFmtEnd
\newcommand\ReadOnlyOnce[1]{\@@ifundefined{#1}{\@@namedef{#1}{}}\SkipToFmtEnd}
\end{code}
%-------------------------------= --------------------------------------------
\section{\TeX\ definitions}
%-------------------------------= --------------------------------------------
\begin{code}
%if latex209
\input{amstext.sty}
\input{amssymb.sty}
\input{stmaryrd.sty}
\newcommand\ensuremath[1]{\ifmmode#1\else\mbox{$#1$}\fi}
%if euler
\input{euler.sty}
%endif
%else
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{stmaryrd}
%if euler
\usepackage{euler}
%endif
%endif
\end{code}
%
\NB Die bedingte Formatierung wird \emph{nicht} verwendet, um
gleichzeitig Math und Verbatim formatieren zu k"onnen.
%-------------------------------= --------------------------------------------
\subsection{Typewriter style}
%-------------------------------= --------------------------------------------
ks, 17.07.2003: Added a conditional that only includes this part
if the selected style is typewriter style.
ks, 28.07.2003: Removed the conditional again as it breaks
compatibility. Not sure what to do here. Maybe create a new,
clean @lhs2TeX.sty@ that should be included into new documents.
\begin{code}
%if not latex209
\DeclareFontFamily{OT1}{cmtex}{}
\DeclareFontShape{OT1}{cmtex}{m}{n}
{<5><6><7><8>cmtex8
<9>cmtex9
<10><10.95><12><14.4><17.28><20.74><24.88>cmtex10}{}
\DeclareFontShape{OT1}{cmtex}{m}{it}
{<-> ssub * cmtt/m/it}{}
\newcommand{\texfamily}{\fontfamily{cmtex}\selectfont}
%if underlineKeywords
\usepackage{ulem}\normalem
%else
\DeclareFontShape{OT1}{cmtt}{bx}{n}
{<5><6><7><8>cmtt8
<9>cmbtt9
<10><10.95><12><14.4><17.28><20.74><24.88>cmbtt10}{}
\DeclareFontShape{OT1}{cmtex}{bx}{n}
{<-> ssub * cmtt/bx/n}{}
\newcommand{\tex}[1]{\text{\texfamily#1}} % NEU
%endif
%endif
\newcommand{\Sp}{\hskip.33334em\relax}
\end{code}
%-------------------------------= --------------------------------------------
\subsection{Math style}
%-------------------------------= --------------------------------------------
ks, 17.07.2003: As with the typewriter path, this is now conditionally
included for math or poly mode.
\begin{code}
%if (style == math) || (style == poly)
%if times
\usepackage{times}\renewcommand{\ttdefault}{cmtt}
\SetMathAlphabet{\mathrm}{normal}{OT1}{ptm}{m}{n}
\SetMathAlphabet{\mathbf}{normal}{OT1}{ptm}{bx}{n}
\SetMathAlphabet{\mathit}{normal}{OT1}{ptm}{m}{it}
%endif
%if style == math
\newlength{\lwidth}\setlength{\lwidth}{4.5cm}
\newlength{\cwidth}\setlength{\cwidth}{8mm} % 3mm
%endif
%if latex209
\newcommand{\Conid}[1]{{\mathit #1}}
\newcommand{\Varid}[1]{{\mathit #1}}
\newcommand{\anonymous}{\_}
%else
\newcommand{\Conid}[1]{\mathit{#1}}
\newcommand{\Varid}[1]{\mathit{#1}}
\newcommand{\anonymous}{\kern0.06em \vbox{\hrule\@@width.5em}}
%endif
\newcommand{\plus}{\mathbin{+\!\!\!+}}
\newcommand{\bind}{\mathbin{>\!\!\!>\mkern-6.7mu=}}
\newcommand{\rbind}{\mathbin{=\mkern-6.7mu<\!\!\!<}}% suggested by Neil Mitchell
\newcommand{\sequ}{\mathbin{>\!\!\!>}}
%if not standardsymbols
\renewcommand{\leq}{\leqslant}
\renewcommand{\geq}{\geqslant}
%endif
%endif
\end{code}
The following definitions facilitate the saving and restoring
of column width information as well as the redefinition of
column specifiers. It only works for @poly@ style.
\begin{code}
%if style == poly
\usepackage{polytable}
%mathindent has to be defined
\@@ifundefined{mathindent}%
{\newdimen\mathindent\mathindent\leftmargini}%
{}%
\def\resethooks{%
\global\let\SaveRestoreHook\empty
\global\let\ColumnHook\empty}
\newcommand*{\savecolumns}[1][default]%
{\g@@addto@@macro\SaveRestoreHook{\savecolumns[#1]}}
\newcommand*{\restorecolumns}[1][default]%
{\g@@addto@@macro\SaveRestoreHook{\restorecolumns[#1]}}
\newcommand*{\aligncolumn}[2]%
{\g@@addto@@macro\ColumnHook{\column{#1}{#2}}}
\resethooks
%if standardsymbols
\newcommand{\onelinecommentchars}{\quad--- }
%else
\newcommand{\onelinecommentchars}{\quad-{}- }
%endif
\newcommand{\commentbeginchars}{\enskip\{-}
\newcommand{\commentendchars}{-\}\enskip}
\newcommand{\visiblecomments}{%
\let\onelinecomment=\onelinecommentchars
\let\commentbegin=\commentbeginchars
\let\commentend=\commentendchars}
\newcommand{\invisiblecomments}{%
\let\onelinecomment=\empty
\let\commentbegin=\empty
\let\commentend=\empty}
\visiblecomments
\newlength{\blanklineskip}
\setlength{\blanklineskip}{0.66084ex}
\newcommand{\hsindent}[1]{\quad}% default is fixed indentation
\let\hspre\empty
\let\hspost\empty
%endif
\end{code}
%-------------------------------= --------------------------------------------
\subsection{Some useful definitions}
%-------------------------------= --------------------------------------------
\begin{code}
\newcommand{\NB}{\textbf{NB}}
\newcommand{\Todo}[1]{$\langle$\textbf{To do:}~#1$\rangle$}
\EndFmtInput
\makeatother
\end{code}
\begin{code}
%
%endif
%endif
\end{code}