Debian Codegraph @

texmf-dist/source/latex/elmath/elmath.dtx

raw
1 %% \CharacterTable
2 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
3 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
4 %% Digits \0\1\2\3\4\5\6\7\8\9
5 %% Exclamation \! Double quote \" Hash (number) \#
6 %% Dollar \$ Percent \% Ampersand \&
7 %% Acute accent \' Left paren \( Right paren \)
8 %% Asterisk \* Plus \+ Comma \,
9 %% Minus \- Point \. Solidus \/
10 %% Colon \: Semicolon \; Less than \<
11 %% Equals \= Greater than \> Question mark \?
12 %% Commercial at \@ Left bracket \[ Backslash \\
13 %% Right bracket \] Circumflex \^ Underscore \_
14 %% Grave accent \` Left brace \{ Vertical bar \|
15 %% Right brace \} Tilde \~}
16 %\iffalse
17 %
18 % (c) copyright 2004 Yannis Potamianos and Apostolos Syropoulos
19 % This program can be redistributed and/or modified under the terms
20 % of the LaTeX Project Public License Distributed from CTAN
21 % archives in directory macros/latex/base/lppl.txt; either
22 % version 1 of the License, or any later version.
23 %
24 % Please report errors or suggestions for improvement to
25 %
26 % Yannis Potamianos and/or Apostolos Syropoulos
27 % [email protected] [email protected]
28 %
29 %\fi
30 % \CheckSum{1030}
31 % \iffalse This is a Metacomment
32 %
33 %<elmath, >\ProvidesFile{elmath.sty}
34 %
35 %<elmath, >[2004/11/20 v1.2 Package `elmath.sty']
36 %
37 % \begin{macrocode}
38 %<*driver>
39 \documentclass{ltxdoc}
40 \GetFileInfo{elmath.drv}
41 \begin{document}
42 \DocInput{elmath.dtx}
43 \end{document}
44 %</driver>
45 % \end{macrocode}
46 % \fi
47 %\StopEventually{}
48 %\MakeShortVerb{\|}
49 %\title{The `elmath' package}
50 %\author{Yannis Potamianos and Apostolos Syropoulos}
51 % \date{2004/11/20}
52 %\maketitle
53 % \begin{abstract}
54 % This package has been designed to partially implement the elmath-new input
55 % encoding in both and text and math modes. As such it supersedes package
56 % \textsf{elmath}, which was designed by the same authors. Note that if package
57 % \textsf{elmath-new} is used, then one should not use the (unofficial)
58 % \texttt{elmath-new} option of the \textsf{inputenc} package.
59 %\end{abstract}
60 %
61 % \section{Introduction and Usage}
62 % The package has been designed so to allow users with a Greek keyboard to
63 % type both Greek text and Greek mathematical symbols without any need to
64 % use special commands.
65 %
66 % Users of the package need only a standard ISO8859-7 keyboard, but obviously
67 % it is not difficult to adapt the package for other encoding.
68 %
69 % \section{The Implementation}
70 %
71 % Initially, we need to make sure that all the Greek letters are actually
72 % active. We assume that |~| is actually an active character.
73 % \begin{macrocode}
74 %<*elmath>
75 \ifcat\noexpand~\noexpand^^e1\relax\else\catcode`\^^e1=\active\fi
76 \ifcat\noexpand~\noexpand^^e2\relax\else\catcode`\^^e2=\active\fi
77 \ifcat\noexpand~\noexpand^^e3\relax\else\catcode`\^^e3=\active\fi
78 \ifcat\noexpand~\noexpand^^e4\relax\else\catcode`\^^e4=\active\fi
79 \ifcat\noexpand~\noexpand^^e5\relax\else\catcode`\^^e5=\active\fi
80 \ifcat\noexpand~\noexpand^^e6\relax\else\catcode`\^^e6=\active\fi
81 \ifcat\noexpand~\noexpand^^e7\relax\else\catcode`\^^e7=\active\fi
82 \ifcat\noexpand~\noexpand^^e8\relax\else\catcode`\^^e8=\active\fi
83 \ifcat\noexpand~\noexpand^^e9\relax\else\catcode`\^^e9=\active\fi
84 \ifcat\noexpand~\noexpand^^ea\relax\else\catcode`\^^ea=\active\fi
85 \ifcat\noexpand~\noexpand^^eb\relax\else\catcode`\^^eb=\active\fi
86 \ifcat\noexpand~\noexpand^^ec\relax\else\catcode`\^^ec=\active\fi
87 \ifcat\noexpand~\noexpand^^ed\relax\else\catcode`\^^ed=\active\fi
88 \ifcat\noexpand~\noexpand^^ee\relax\else\catcode`\^^ee=\active\fi
89 \ifcat\noexpand~\noexpand^^ef\relax\else\catcode`\^^ef=\active\fi
90 \ifcat\noexpand~\noexpand^^f0\relax\else\catcode`\^^f0=\active\fi
91 \ifcat\noexpand~\noexpand^^f1\relax\else\catcode`\^^f1=\active\fi
92 \ifcat\noexpand~\noexpand^^f3\relax\else\catcode`\^^f3=\active\fi
93 \ifcat\noexpand~\noexpand^^f2\relax\else\catcode`\^^f2=\active\fi
94 \ifcat\noexpand~\noexpand^^f4\relax\else\catcode`\^^f4=\active\fi
95 \ifcat\noexpand~\noexpand^^f5\relax\else\catcode`\^^f5=\active\fi
96 \ifcat\noexpand~\noexpand^^f6\relax\else\catcode`\^^f6=\active\fi
97 \ifcat\noexpand~\noexpand^^f7\relax\else\catcode`\^^f7=\active\fi
98 \ifcat\noexpand~\noexpand^^f8\relax\else\catcode`\^^f8=\active\fi
99 \ifcat\noexpand~\noexpand^^f9\relax\else\catcode`\^^f9=\active\fi
100 \ifcat\noexpand~\noexpand^^c1\relax\else\catcode`\^^c1=\active\fi
101 \ifcat\noexpand~\noexpand^^c2\relax\else\catcode`\^^c2=\active\fi
102 \ifcat\noexpand~\noexpand^^c3\relax\else\catcode`\^^c3=\active\fi
103 \ifcat\noexpand~\noexpand^^c4\relax\else\catcode`\^^c4=\active\fi
104 \ifcat\noexpand~\noexpand^^c5\relax\else\catcode`\^^c5=\active\fi
105 \ifcat\noexpand~\noexpand^^c6\relax\else\catcode`\^^c6=\active\fi
106 \ifcat\noexpand~\noexpand^^c7\relax\else\catcode`\^^c7=\active\fi
107 \ifcat\noexpand~\noexpand^^c8\relax\else\catcode`\^^c8=\active\fi
108 \ifcat\noexpand~\noexpand^^c9\relax\else\catcode`\^^c9=\active\fi
109 \ifcat\noexpand~\noexpand^^ca\relax\else\catcode`\^^ca=\active\fi
110 \ifcat\noexpand~\noexpand^^cb\relax\else\catcode`\^^cb=\active\fi
111 \ifcat\noexpand~\noexpand^^cc\relax\else\catcode`\^^cc=\active\fi
112 \ifcat\noexpand~\noexpand^^cd\relax\else\catcode`\^^cd=\active\fi
113 \ifcat\noexpand~\noexpand^^ce\relax\else\catcode`\^^ce=\active\fi
114 \ifcat\noexpand~\noexpand^^cf\relax\else\catcode`\^^cf=\active\fi
115 \ifcat\noexpand~\noexpand^^d0\relax\else\catcode`\^^d0=\active\fi
116 \ifcat\noexpand~\noexpand^^d1\relax\else\catcode`\^^d1=\active\fi
117 \ifcat\noexpand~\noexpand^^d3\relax\else\catcode`\^^d3=\active\fi
118 \ifcat\noexpand~\noexpand^^d4\relax\else\catcode`\^^d4=\active\fi
119 \ifcat\noexpand~\noexpand^^d5\relax\else\catcode`\^^d5=\active\fi
120 \ifcat\noexpand~\noexpand^^d6\relax\else\catcode`\^^d6=\active\fi
121 \ifcat\noexpand~\noexpand^^d7\relax\else\catcode`\^^d7=\active\fi
122 \ifcat\noexpand~\noexpand^^d8\relax\else\catcode`\^^d8=\active\fi
123 \ifcat\noexpand~\noexpand^^d9\relax\else\catcode`\^^d9=\active\fi
124 \ifcat\noexpand~\noexpand^^a2\relax\else\catcode`\^^a2=\active\fi
125 \ifcat\noexpand~\noexpand^^b6\relax\else\catcode`\^^b6=\active\fi
126 \ifcat\noexpand~\noexpand^^b8\relax\else\catcode`\^^b8=\active\fi
127 \ifcat\noexpand~\noexpand^^b9\relax\else\catcode`\^^b9=\active\fi
128 \ifcat\noexpand~\noexpand^^ba\relax\else\catcode`\^^ba=\active\fi
129 \ifcat\noexpand~\noexpand^^bc\relax\else\catcode`\^^bc=\active\fi
130 \ifcat\noexpand~\noexpand^^be\relax\else\catcode`\^^be=\active\fi
131 \ifcat\noexpand~\noexpand^^bf\relax\else\catcode`\^^bf=\active\fi
132 \ifcat\noexpand~\noexpand^^c0\relax\else\catcode`\^^c0=\active\fi
133 \ifcat\noexpand~\noexpand^^da\relax\else\catcode`\^^da=\active\fi
134 \ifcat\noexpand~\noexpand^^db\relax\else\catcode`\^^db=\active\fi
135 \ifcat\noexpand~\noexpand^^dc\relax\else\catcode`\^^dc=\active\fi
136 \ifcat\noexpand~\noexpand^^dd\relax\else\catcode`\^^dd=\active\fi
137 \ifcat\noexpand~\noexpand^^de\relax\else\catcode`\^^de=\active\fi
138 \ifcat\noexpand~\noexpand^^df\relax\else\catcode`\^^df=\active\fi
139 \ifcat\noexpand~\noexpand^^e0\relax\else\catcode`\^^e0=\active\fi
140 \ifcat\noexpand~\noexpand^^fa\relax\else\catcode`\^^fa=\active\fi
141 \ifcat\noexpand~\noexpand^^fb\relax\else\catcode`\^^fb=\active\fi
142 \ifcat\noexpand~\noexpand^^fc\relax\else\catcode`\^^fc=\active\fi
143 \ifcat\noexpand~\noexpand^^fd\relax\else\catcode`\^^fd=\active\fi
144 \ifcat\noexpand~\noexpand^^fe\relax\else\catcode`\^^fe=\active\fi
145 \ifcat\noexpand~\noexpand^^ab\relax\else\catcode`\^^ab=\active\fi
146 \ifcat\noexpand~\noexpand^^bb\relax\else\catcode`\^^bb=\active\fi
147 % \end{macrocode}
148 % Now we define a command that defines all Greek characters as commands, which when
149 % expanded produce the expected command.
150 % \begin{macrocode}
151 \def\el@math{%
152 \def^^e1{\relax\ifmmode\alpha\else\textgreek{a}\fi}%
153 \def^^c1{\relax\ifmmode{A}\else\textgreek{A}\fi}%
154 \def^^dc{\textgreek{'a}}%
155 \def^^a2{\textgreek{'A}}%
156 \def^^b6{\textgreek{'A}}%
157 \def^^e2{\relax\ifmmode\beta\else\textgreek{b}\fi}%
158 \def^^c2{\relax\ifmmode{B}\else\textgreek{B}\fi}%
159 \def^^e3{\relax\ifmmode\gamma\else\textgreek{g}\fi}%
160 \def^^c3{\relax\ifmmode\Gamma\else\textgreek{G}\fi}%
161 \def^^e4{\relax\ifmmode\delta\else\textgreek{d}\fi}%
162 \def^^c4{\relax\ifmmode\Delta\else\textgreek{D}\fi}%
163 \def^^e5{\relax\ifmmode\epsilon\else\textgreek{e}\fi}%
164 \def^^c5{\relax\ifmmode{E}\else\textgreek{E}\fi}%
165 \def^^dd{\textgreek{'e}}%
166 \def^^b8{\textgreek{'E}}%
167 \def^^e6{\relax\ifmmode\zeta\else\textgreek{z}\fi}%
168 \def^^c6{\relax\ifmmode{Z}\else\textgreek{Z}\fi}%
169 \def^^e7{\relax\ifmmode\eta\else\textgreek{h}\fi}%
170 \def^^c7{\relax\ifmmode{H}\else\textgreek{H}\fi}%
171 \def^^de{\textgreek{'h}}%
172 \def^^b9{\textgreek{'H}}%
173 \def^^e8{\relax\ifmmode\theta\else\textgreek{j}\fi}%
174 \def^^c8{\relax\ifmmode{\Theta}\else\textgreek{J}\fi}%
175 \def^^e9{\relax\ifmmode\iota\else\textgreek{i}\fi}%
176 \def^^c9{\relax\ifmmode{I}\else\textgreek{I}\fi}%
177 \def^^df{\textgreek{'i}}%
178 \def^^fa{\textgreek{"i}} %
179 \def^^c0{\textgreek{"'i}} %
180 \def^^ba{\textgreek{'I}}%
181 \def^^da{\textgreek{"I}}%
182 \def^^ea{\relax\ifmmode\kappa\else\textgreek{k}\fi}%
183 \def^^ca{\relax\ifmmode{K}\else\textgreek{K}\fi}%
184 \def^^eb{\relax\ifmmode\lambda\else\textgreek{l}\fi}%
185 \def^^cb{\relax\ifmmode\Lambda\else\textgreek{L}\fi}%
186 \def^^ec{\relax\ifmmode\mu\else\textgreek{m}\fi}%
187 \def^^cc{\relax\ifmmode{M}\else\textgreek{M}\fi}%
188 \def^^ed{\relax\ifmmode\nu\else\textgreek{n}\fi}%
189 \def^^cd{\relax\ifmmode{N}\else\textgreek{N}\fi}%
190 \def^^ee{\relax\ifmmode\xi\else\textgreek{x}\fi}%
191 \def^^ce{\relax\ifmmode\Xi\else\textgreek{X}\fi}%
192 \def^^ef{\relax\ifmmode{o}\else\textgreek{o}\fi}%
193 \def^^cf{\relax\ifmmode{O}\else\textgreek{O}\fi}%
194 \def^^fc{\textgreek{'o}}%
195 \def^^bc{\textgreek{'O}}%
196 \def^^f0{\relax\ifmmode\pi\else\textgreek{p}\fi}%
197 \def^^d0{\relax\ifmmode\Pi\else\textgreek{P}\fi}%
198 \def^^f1{\relax\ifmmode\rho\else\textgreek{r}\fi}%
199 \def^^d1{\relax\ifmmode{P}\else\textgreek{R}\fi}%
200 \def^^f2{\relax\ifmmode\varsigma\else\textgreek{c}\fi}%
201 \def^^f3{\relax\ifmmode\sigma\else\textgreek{sv}\fi}%
202 \def^^d3{\relax\ifmmode\Sigma\else\textgreek{S}\fi}%
203 \def^^f4{\relax\ifmmode\tau\else\textgreek{t}\fi}%
204 \def^^d4{\relax\ifmmode{T}\else\textgreek{T}\fi}%
205 \def^^f5{\relax\ifmmode\upsilon\else\textgreek{u}\fi}%
206 \def^^d5{\relax\ifmmode{Y}\else\textgreek{U}\fi}%
207 \def^^fd{\textgreek{'u}}%
208 \def^^fb{\textgreek{"u}} %
209 \def^^e0{\textgreek{"'u}} %
210 \def^^be{\textgreek{'U}}%
211 \def^^f6{\relax\ifmmode\phi\else\textgreek{f}\fi}%
212 \def^^d6{\relax\ifmmode{\Phi}\else\textgreek{F}\fi}%
213 \def^^f7{\relax\ifmmode\chi\else\textgreek{q}\fi}%
214 \def^^d7{\relax\ifmmode{X}\else\textgreek{Q}\fi}%
215 \def^^f8{\relax\ifmmode\psi\else\textgreek{y}\fi}%
216 \def^^d8{\relax\ifmmode{\Psi}\else\textgreek{Y}\fi}%
217 \def^^f9{\relax\ifmmode\omega\else\textgreek{w}\fi}%
218 \def^^d9{\relax\ifmmode{\Omega}\else\textgreek{W}\fi}%
219 \def^^fe{\textgreek{'w}}%
220 \def^^bf{\textgreek{'W}}%
221 }%
222 % \end{macrocode}
223 % Now, we need to invoke the command |\el@math| every time we enter a math mode. For
224 % this reason we redefine the tokens |\everymath| and |\everydisplay| as follows:
225 % \begin{macrocode}
226 \everymath\expandafter{\the\everymath
227 \relax\el@math}
228 \everydisplay\expandafter{\the\everydisplay
229 \relax\el@math}
230 %</elmath>
231 % \end{macrocode}
232 % \Finale
233 % That's all!