-
Notifications
You must be signed in to change notification settings - Fork 250
/
Copy pathopen-logic-formulas.sty
59 lines (40 loc) · 1.53 KB
/
open-logic-formulas.sty
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
% OpenLogic Project
% formulas
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{open-logic-formulas}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
\RequirePackage[OMLmathsfit]{isomath}
% provide \mathexclaim
\DeclareMathSymbol{\mathexclaim}{\mathord}{operators}{`!}%
% make ! active in math mode for formula meta variables
{\catcode`!=\active
\gdef!{\formula}
\let\formula\relax % default: do nothing
}
\mathcode`\!="8000 % set ! active in math mode
% latinformulas -- switch to latin formulas A, B, C, etc.
\def\ollatinformulas{\let\formula\relax}
% greekformulas -- formula metavariables are phi, psi, etc.
% Provides !A, !B etc in math mode to produce \phi, \psi etc.
\def\olgreekformulas
{\gdef\formula{\lookup{A/\varphi,B/\psi,C/\chi,D/\theta,E/\alpha,F/\beta,G/\gamma,H/\delta,K/\xi,L/\zeta,O/\omega,R/\rho,S/\sigma,T/\tau}}}
\def\olalphagreekformulas
{\gdef\formula{\lookup{A/\alpha,B/\beta,C/\gamma,D/\delta,E/\phi,F/\psi,G/\chi,H/\theta,K/\xi,L/\zeta,O/\omega,R/\rho,S/\sigma,T/\tau}}}
% args -- format a list of arguments separated by commas without commas
\newcommand*{\args}[1]{%
\let\@argsep\@argsepinit
\@for\@arg:=#1\do{%
\@argsep\@arg}%
}
\def\@argsepinit{\let\@argsep\argsep}
\newcommand{\argsep}{}
% lookup#1#2 -- look up #2 in #1, a comma-separated list of pairs
\def\@match#1/#2{\def\match@input{#1}\def\match@result{#2}}
\newcommand*{\lookup}[2]{%
\def\lookup@input{#2}
\def\lookup@result{#2}%
\def\do##1{\@match##1\if\lookup@input\match@input
\let\lookup@result\match@result\fi}%
\docsvlist{#1}%
\lookup@result}