lhs2TeX.fmt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. %subst verb a = "\text{\tt " a "}"
  2. %subst verbatim a = "\begin{tabbing}\tt'n" a "'n\end{tabbing}'n"
  3. %subst verbnl = "\\'n\tt "
  4. %if style == tt
  5. %subst inline a = "\text{\texfamily " a "}"
  6. %subst thinspace = "\Sp "
  7. %subst code a = "\begin{tabbing}\texfamily'n" a "'n\end{tabbing}'n"
  8. %subst comment a = "{\rmfamily-{}- " a "}"
  9. %subst nested a = "{\rmfamily\enskip\{- " a " -\}\enskip}"
  10. %subst pragma a = "{\rmfamily\enskip\{-\#" a " \#-\}\enskip}"
  11. %subst spaces a = a
  12. %subst special a = a
  13. %subst space = "~"
  14. %subst newline = "\\'n\texfamily "
  15. %subst conid a = "{\itshape " a "}"
  16. %subst varid a = a
  17. %subst consym a = a
  18. %subst varsym a = a
  19. %subst numeral a = a
  20. %subst char a = "''" a "''"
  21. %subst string a = "\char34 " a "\char34 "
  22. %if underlineKeywords
  23. %subst keyword a = "\uline{" a "}"
  24. %else
  25. %subst keyword a = "{\bfseries " a "}"
  26. %endif
  27. %format \ = "\char''10"
  28. %format . = "\char''00"
  29. %if not spacePreserving
  30. %format alpha = "\char''02"
  31. %format beta = "\char''03"
  32. %format gamma = "\char''11"
  33. %format delta = "\char''12"
  34. %format pi = "\char''07"
  35. %format infty = "\char''16"
  36. %format intersect = "\char''22"
  37. %format union = "\char''23"
  38. %format forall = "\char''24"
  39. %format exists = "\char''25"
  40. %format not = "\char''05"
  41. %format && = "\char''04"
  42. %format || = "\char''37"
  43. %format <- = "\char''06"
  44. %format -> = "\char''31"
  45. %format == = "\char''36"
  46. %format /= = "\char''32"
  47. %format <= = "\char''34"
  48. %format >= = "\char''35"
  49. %endif
  50. %if meta
  51. %format M.a = "\ensuremath{a}"
  52. %format M.b = "\ensuremath{b}"
  53. %format M.c = "\ensuremath{c}"
  54. %format M.d = "\ensuremath{d}"
  55. %format M.e = "\ensuremath{e}"
  56. %format M.f = "\ensuremath{f}"
  57. %format M.g = "\ensuremath{g}"
  58. %format M.h = "\ensuremath{h}"
  59. %format M.i = "\ensuremath{i}"
  60. %format M.j = "\ensuremath{j}"
  61. %format M.k = "\ensuremath{k}"
  62. %format M.l = "\ensuremath{l}"
  63. %format M.m = "\ensuremath{m}"
  64. %format M.n = "\ensuremath{n}"
  65. %format M.o = "\ensuremath{o}"
  66. %format M.p = "\ensuremath{p}"
  67. %format M.q = "\ensuremath{q}"
  68. %format M.r = "\ensuremath{r}"
  69. %format M.s = "\ensuremath{s}"
  70. %format M.t = "\ensuremath{t}"
  71. %format M.u = "\ensuremath{u}"
  72. %format M.v = "\ensuremath{v}"
  73. %format M.w = "\ensuremath{w}"
  74. %format M.x = "\ensuremath{x}"
  75. %format M.y = "\ensuremath{y}"
  76. %format M.z = "\ensuremath{z}"
  77. %format M.A = "\ensuremath{A}"
  78. %format M.B = "\ensuremath{B}"
  79. %format M.C = "\ensuremath{C}"
  80. %format M.D = "\ensuremath{D}"
  81. %format M.E = "\ensuremath{E}"
  82. %format M.F = "\ensuremath{F}"
  83. %format M.G = "\ensuremath{G}"
  84. %format M.H = "\ensuremath{H}"
  85. %format M.I = "\ensuremath{I}"
  86. %format M.J = "\ensuremath{J}"
  87. %format M.K = "\ensuremath{K}"
  88. %format M.L = "\ensuremath{L}"
  89. %format M.M = "\ensuremath{M}"
  90. %format M.N = "\ensuremath{N}"
  91. %format M.O = "\ensuremath{O}"
  92. %format M.P = "\ensuremath{P}"
  93. %format M.Q = "\ensuremath{Q}"
  94. %format M.R = "\ensuremath{R}"
  95. %format M.S = "\ensuremath{S}"
  96. %format M.T = "\ensuremath{T}"
  97. %format M.U = "\ensuremath{U}"
  98. %format M.V = "\ensuremath{V}"
  99. %format M.W = "\ensuremath{W}"
  100. %format M.X = "\ensuremath{X}"
  101. %format M.Y = "\ensuremath{Y}"
  102. %format M.Z = "\ensuremath{Z}"
  103. %format M.alpha = "\ensuremath{\alpha}"
  104. %format M.beta = "\ensuremath{\beta}"
  105. %format M.gamma = "\ensuremath{\gamma}"
  106. %format M.delta = "\ensuremath{\delta}"
  107. %format M.epsilon = "\ensuremath{\epsilon}"
  108. %format M.zeta = "\ensuremath{\zeta}"
  109. %format M.eta = "\ensuremath{\eta}"
  110. %format M.theta = "\ensuremath{\theta}"
  111. %format M.iota = "\ensuremath{\iota}"
  112. %format M.kappa = "\ensuremath{\kappa}"
  113. %format M.lambda = "\ensuremath{\lambda}"
  114. %format M.mu = "\ensuremath{\mu}"
  115. %format M.nu = "\ensuremath{\nu}"
  116. %format M.xi = "\ensuremath{\xi}"
  117. %format M.pi = "\ensuremath{\pi}"
  118. %format M.rho = "\ensuremath{\rho}"
  119. %format M.sigma = "\ensuremath{\sigma}"
  120. %format M.tau = "\ensuremath{\tau}"
  121. %format M.upsilon = "\ensuremath{\upsilon}"
  122. %format M.phi = "\ensuremath{\phi}"
  123. %format M.chi = "\ensuremath{\chi}"
  124. %format M.psi = "\ensuremath{\psi}"
  125. %format M.omega = "\ensuremath{\omega}"
  126. %format M.Gamma = "\ensuremath{\Gamma}"
  127. %format M.Delta = "\ensuremath{\Delta}"
  128. %format M.Theta = "\ensuremath{\Theta}"
  129. %format M.Lambda = "\ensuremath{\Lambda}"
  130. %format M.Xi = "\ensuremath{\Xi}"
  131. %format M.Pi = "\ensuremath{\Pi}"
  132. %format M.Sigma = "\ensuremath{\Sigma}"
  133. %format M.Upsilon = "\ensuremath{\Upsilon}"
  134. %format M.Phi = "\ensuremath{\Phi}"
  135. %format M.Psi = "\ensuremath{\Psi}"
  136. %format M.Omega = "\ensuremath{\Omega}"
  137. %format M.forall = "\ensuremath{\forall}"
  138. %format M.exists = "\ensuremath{\exists}"
  139. %format M.not = "\ensuremath{\neg}"
  140. %format ==> = "\ensuremath{\Longrightarrow}"
  141. %format <== = "\ensuremath{\Longleftarrow}"
  142. %format /\ = "\ensuremath{\wedge}"
  143. %format \/ = "\ensuremath{\vee}"
  144. %format M.= = "\ensuremath{=}"
  145. %format M./= = "\ensuremath{\neq}"
  146. %format M.< = "\ensuremath{<}"
  147. %format M.<= = "\ensuremath{\leq}"
  148. %format M.>= = "\ensuremath{\geq}"
  149. %format M.> = "\ensuremath{>}"
  150. %endif
  151. %elif style == newcode
  152. %subst comment a = "-- " a
  153. %subst nested a = "{- " a " -}"
  154. %subst code a = a "'n"
  155. %subst newline = "'n"
  156. %subst dummy =
  157. %subst pragma a = "{-# " a " #-}"
  158. %subst numeral a = a
  159. %subst keyword a = a
  160. %subst spaces a = a
  161. %subst special a = a
  162. %subst space = " "
  163. %subst conid a = a
  164. %subst varid a = a
  165. %subst consym a = a
  166. %subst varsym a = a
  167. %subst char a = "''" a "''"
  168. %subst string a = "'d" a "'d"
  169. %elif style == math
  170. %subst phantom a = "\phantom{" a "\mbox{}}"
  171. %subst comment a = "\mbox{\qquad-{}- " a "}"
  172. %subst nested a = "\mbox{\enskip\{- " a " -\}\enskip}"
  173. %if array
  174. %subst code a = "\[\begin{array}{@{}lcl}'n\hspace{\lwidth}&\hspace{\cwidth}&\\[-10pt]'n" a "'n\end{array}\]"
  175. %subst column3 l c r = "{}" l " & " c " & {" r "}"
  176. %subst column1 a = "\multicolumn{3}{@{}l}{" a "}"
  177. %else
  178. %subst code a = "\begin{tabbing}'n\qquad\=\hspace{\lwidth}\=\hspace{\cwidth}\=\+\kill'n" a "'n\end{tabbing}"
  179. %subst column3 l c r = "$" l "$ \> \makebox[\cwidth]{$" c "$} \> ${" r "}$"
  180. %subst column1 a = "${" a "}$"
  181. %endif
  182. %subst newline = "\\'n"
  183. %subst blankline = "\\[1mm]'n"
  184. %let anyMath = True
  185. %elif style == poly
  186. %subst comment a = "\mbox{\onelinecomment " a "}"
  187. %subst nested a = "\mbox{\commentbegin " a " \commentend}"
  188. %if array
  189. %subst code a = "\['n\begin{parray}\SaveRestoreHook'n" a "\ColumnHook'n\end{parray}'n\]\resethooks'n"
  190. %else
  191. %subst code a = "\begingroup\par\noindent\advance\leftskip\mathindent\('n\begin{pboxed}\SaveRestoreHook'n" a "\ColumnHook'n\end{pboxed}'n\)\par\noindent\endgroup\resethooks'n"
  192. %endif
  193. %subst column c a = "\column{" c "}{" a "}'n"
  194. %subst fromto b e t = "\fromto{" b "}{" e "}{{}" t "{}}'n"
  195. %subst left = "@{}l@{}"
  196. %subst centered = "@{}c@{}"
  197. %subst dummycol = "@{}l@{}"
  198. %subst newline = "\nextline'n"
  199. %subst blankline = "\nextline[\blanklineskip]'n"
  200. %subst indent n = "\hsindent{" n "}"
  201. %let anyMath = True
  202. %endif
  203. %if anyMath
  204. %let autoSpacing = True
  205. %subst dummy = "\cdot "
  206. %subst inline a = "\ensuremath{" a "}"
  207. %subst hskip a = "\hskip" a "em\relax"
  208. %subst pragma a = "\mbox{\enskip\{-\#" a " \#-\}\enskip}"
  209. %if latex209
  210. %subst numeral a = "{\mathrm " a "}"
  211. %subst keyword a = "{\mathbf " a "}"
  212. %else
  213. %subst numeral a = "\mathrm{" a "}"
  214. %subst keyword a = "\mathbf{" a "}"
  215. %endif
  216. %subst spaces a = a
  217. %subst special a = a
  218. %subst space = "\;"
  219. %subst conid a = "\Conid{" a "}"
  220. %subst varid a = "\Varid{" a "}"
  221. %subst consym a = "\mathbin{" a "}"
  222. %subst varsym a = "\mathbin{" a "}"
  223. %subst char a = "\text{\tt ''" a "''}"
  224. %subst string a = "\text{\tt \char34 " a "\char34}"
  225. %format _ = "\anonymous "
  226. %format -> = "\to "
  227. %format <- = "\leftarrow "
  228. %format => = "\Rightarrow "
  229. %format \ = "\lambda "
  230. %format | = "\mid "
  231. %format { = "\{\mskip1.5mu "
  232. %format } = "\mskip1.5mu\}"
  233. %format [ = "[\mskip1.5mu "
  234. %format ] = "\mskip1.5mu]"
  235. %format = = "\mathrel{=}"
  236. %format .. = "\mathinner{\ldotp\ldotp}"
  237. %format ~ = "\mathord{\sim}"
  238. %format @ = "\mathord{@}"
  239. %format . = "\mathbin{\circ}"
  240. %format !! = "\mathbin{!!}"
  241. %format ^ = "\mathbin{\uparrow}"
  242. %format ^^ = "\mathbin{\uparrow\uparrow}"
  243. %format ** = "\mathbin{**}"
  244. %format / = "\mathbin{/}"
  245. %format `quot` = "\mathbin{\Varid{`quot`}}"
  246. %format `rem` = "\mathbin{\Varid{`rem`}}"
  247. %format `div` = "\mathbin{\Varid{`div`}}"
  248. %format `mod` = "\mathbin{\Varid{`mod`}}"
  249. %format :% = "\mathbin{:\%}"
  250. %format % = "\mathbin{\%}"
  251. %format : = "\mathbin{:}"
  252. %format ++ = "\plus "
  253. %format == = "\equiv "
  254. %% ODER: format == = "\mathrel{==}"
  255. %format /= = "\not\equiv "
  256. %% ODER: format /= = "\neq "
  257. %format <= = "\leq "
  258. %format >= = "\geq "
  259. %format `elem` = "\in "
  260. %format `notElem` = "\notin "
  261. %format && = "\mathrel{\wedge}"
  262. %format || = "\mathrel{\vee}"
  263. %format >> = "\sequ "
  264. %format >>= = "\bind "
  265. %format $ = "\mathbin{\$}"
  266. %format `seq` = "\mathbin{\Varid{`seq`}}"
  267. %format ! = "\mathbin{!}"
  268. %format // = "\mathbin{//}"
  269. %format undefined = "\bot "
  270. %format not = "\neg "
  271. %if meta
  272. %format M.a = "a"
  273. %format M.b = "b"
  274. %format M.c = "c"
  275. %format M.d = "d"
  276. %format M.e = "e"
  277. %format M.f = "f"
  278. %format M.g = "g"
  279. %format M.h = "h"
  280. %format M.i = "i"
  281. %format M.j = "j"
  282. %format M.k = "k"
  283. %format M.l = "l"
  284. %format M.m = "m"
  285. %format M.n = "n"
  286. %format M.o = "o"
  287. %format M.p = "p"
  288. %format M.q = "q"
  289. %format M.r = "r"
  290. %format M.s = "s"
  291. %format M.t = "t"
  292. %format M.u = "u"
  293. %format M.v = "v"
  294. %format M.w = "w"
  295. %format M.x = "x"
  296. %format M.y = "y"
  297. %format M.z = "z"
  298. %format M.A = "A"
  299. %format M.B = "B"
  300. %format M.C = "C"
  301. %format M.D = "D"
  302. %format M.E = "E"
  303. %format M.F = "F"
  304. %format M.G = "G"
  305. %format M.H = "H"
  306. %format M.I = "I"
  307. %format M.J = "J"
  308. %format M.K = "K"
  309. %format M.L = "L"
  310. %format M.M = "M"
  311. %format M.N = "N"
  312. %format M.O = "O"
  313. %format M.P = "P"
  314. %format M.Q = "Q"
  315. %format M.R = "R"
  316. %format M.S = "S"
  317. %format M.T = "T"
  318. %format M.U = "U"
  319. %format M.V = "V"
  320. %format M.W = "W"
  321. %format M.X = "X"
  322. %format M.Y = "Y"
  323. %format M.Z = "Z"
  324. %format M.alpha = "\alpha "
  325. %format M.beta = "\beta "
  326. %format M.gamma = "\gamma "
  327. %format M.delta = "\delta "
  328. %format M.epsilon = "\epsilon "
  329. %format M.zeta = "\zeta "
  330. %format M.eta = "\eta "
  331. %format M.theta = "\theta "
  332. %format M.iota = "\iota "
  333. %format M.kappa = "\kappa "
  334. %format M.lambda = "\lambda "
  335. %format M.mu = "\mu "
  336. %format M.nu = "\nu "
  337. %format M.xi = "\xi "
  338. %format M.pi = "\pi "
  339. %format M.rho = "\rho "
  340. %format M.sigma = "\sigma "
  341. %format M.tau = "\tau "
  342. %format M.upsilon = "\upsilon "
  343. %format M.phi = "\phi "
  344. %format M.chi = "\chi "
  345. %format M.psi = "\psi "
  346. %format M.omega = "\omega "
  347. %format M.Gamma = "\Gamma "
  348. %format M.Delta = "\Delta "
  349. %format M.Theta = "\Theta "
  350. %format M.Lambda = "\Lambda "
  351. %format M.Xi = "\Xi "
  352. %format M.Pi = "\Pi "
  353. %format M.Sigma = "\Sigma "
  354. %format M.Upsilon = "\Upsilon "
  355. %format M.Phi = "\Phi "
  356. %format M.Psi = "\Psi "
  357. %format M.Omega = "\Omega "
  358. %format M.forall = "\forall "
  359. %format M.exists = "\exists "
  360. %format M.not = "\neg "
  361. %format ==> = "\enskip\Longrightarrow\enskip "
  362. %format <== = "\enskip\Longleftarrow\enskip "
  363. %format /\ = "\enskip\mathrel{\wedge}\enskip "
  364. %format \/ = "\enskip\mathrel{\vee}\enskip "
  365. %format M.= = "="
  366. %format M./= = "\neq "
  367. %format M.< = "<"
  368. %format M.<= = "\leq "
  369. %format M.>= = "\geq "
  370. %format M.> = ">"
  371. %endif
  372. %endif