summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lgrx/alphabeta.sty
blob: 637a3c0a27f02d17d4fe4bf85a39d6c811320cf9 (plain)
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
% alphabeta: Greek symbols in text and math
% *****************************************
%
% :Copyright: © 2010 Günter Milde
% :Licence:   This work may be distributed and/or modified under the
%             conditions of the `LaTeX Project Public License`_, either
%             version 1.3 of this license or any later version.
%
% :Abstract: Use ``\alpha, \beta, ...`` for Greek letters in text and math.
%
% :Identification:
%  ::

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{alphabeta}
[2013/05/03 v0.2 macros for Greek letters in text and math]

%  This package is part of the lgrx_ bundle.
%
% Changelog:
%   .. class:: borderless
%
%   ==========  ===== =========================================================
%   2012-06-26  0.1   initial version
%   2013-05-03  0.2   new accent macro names with lgrxenc.def 0.7
%   ==========  ===== =========================================================
%
% Motivation
% ==========
%
% By default, the ``\alpha, \beta, ...`` macros for Greek letters
% are only valid in mathematical mode.
%
% The `textalpha` package provides a set of macros that can be used to
% access Greek symbols from a font in LGR encoding (e.g. the `CB fonts`_)
% without the need for an explicite font-encoding switch under the names
% ``\textalpha, \textbeta``, ..., ``\textOmega``.
%
% With this package, the math macros are redefined to work in both, text and
% math mode, so that Greek letters can be specified with the established
% command names in text, too.
%
% Attention
%   While the macros work reasonably well for single letters, the automatic
%   font-encoding switches behind the doors interferes with the kerning
%   between the letters and replacement of accent+character with a
%   pre-composed character.
%
%   Therefore, Greek text should be written with the help of babel_, setting
%   the language to either ``greek`` or ``polutonikogreek`` or wrapped in the
%   provided ``\ensuregreek`` macro.
%
%
% Implementation
% ==============
%
% This package extends the `textalpha` package::

\RequirePackage{textalpha}

% It uses the ``\TextOrMath`` test from the fixltx2e_ standard LaTeX
% package::

\RequirePackage{fixltx2e}

% .. _fixltx2e: http://www.ctan.org/pkg/fixltx2e
%
%
% Save math macros
% ----------------
%
% Provide an alias for the standard math commands::

\let\mathGamma\Gamma
\let\mathDelta\Delta
\let\mathTheta\Theta
\let\mathLambda\Lambda
\let\mathXi\Xi
\let\mathPi\Pi
\let\mathSigma\Sigma
\let\mathUpsilon\Upsilon
\let\mathPhi\Phi
\let\mathPsi\Psi
\let\mathOmega\Omega
%
\let\mathalpha\alpha
\let\mathbeta\beta
\let\mathgamma\gamma
\let\mathdelta\delta
\let\mathepsilon\epsilon
\let\mathzeta\zeta
\let\matheta\eta
\let\maththeta\theta
\let\mathiota\iota
\let\mathkappa\kappa
\let\mathlambda\lambda
\let\mathmu\mu
\let\mathnu\nu
\let\mathxi\xi
\let\mathpi\pi
\let\mathrho\rho
\let\mathsigma\sigma
\let\mathvarsigma\varsigma
\let\mathtau\tau
\let\mathupsilon\upsilon
\let\mathphi\phi
\let\mathchi\chi
\let\mathpsi\psi
\let\mathomega\omega

% Commands to access Greek letters by name
% ----------------------------------------
%
% For letters defined in math mode, the commands work in both, text and math.
%
% Some Greek letters look identic to Latin letters and can therefore not be
% used as variable symbols in math formulas. These letters are not defined in
% TeX's math mode, we define just an alias to the corrsponding ``\text...``
% command.
% ::

\newcommand{\Alpha}{\textAlpha}
\newcommand{\Beta}{\textBeta}
\renewcommand{\Gamma}{\TextOrMath{\textGamma}{\mathGamma}}
\renewcommand{\Delta}{\TextOrMath{\textDelta}{\mathDelta}}
\newcommand{\Epsilon}{\textEpsilon}
\newcommand{\Zeta}{\textZeta}
\newcommand{\Eta}{\textEta}
\renewcommand{\Theta}{\TextOrMath{\textTheta}{\mathTheta}}
\newcommand{\Iota}{\textIota}
\newcommand{\Kappa}{\textKappa}
\renewcommand{\Lambda}{\TextOrMath{\textLambda}{\mathLambda}}
\newcommand{\Mu}{\textMu}
\newcommand{\Nu}{\textNu}
\renewcommand{\Xi}{\TextOrMath{\textXi}{\mathXi}}
\newcommand{\Omicron}{\textOmicron}
\renewcommand{\Pi}{\TextOrMath{\textPi}{\mathPi}}
\newcommand{\Rho}{\textRho}
\renewcommand{\Sigma}{\TextOrMath{\textSigma}{\mathSigma}}
\newcommand{\Tau}{\textTau}
\renewcommand{\Upsilon}{\TextOrMath{\textUpsilon}{\mathUpsilon}}
\renewcommand{\Phi}{\TextOrMath{\textPhi}{\mathPhi}}
\newcommand{\Chi}{\textChi}
\renewcommand{\Psi}{\TextOrMath{\textPsi}{\mathPsi}}
\renewcommand{\Omega}{\TextOrMath{\textOmega}{\mathOmega}}
%
\renewcommand{\alpha}{\TextOrMath{\textalpha}{\mathalpha}}
\renewcommand{\beta}{\TextOrMath{\textbeta}{\mathbeta}}
\renewcommand{\gamma}{\TextOrMath{\textgamma}{\mathgamma}}
\renewcommand{\delta}{\TextOrMath{\textdelta}{\mathdelta}}
\renewcommand{\epsilon}{\TextOrMath{\textepsilon}{\mathepsilon}}
\renewcommand{\zeta}{\TextOrMath{\textzeta}{\mathzeta}}
\renewcommand{\eta}{\TextOrMath{\texteta}{\matheta}}
\renewcommand{\theta}{\TextOrMath{\texttheta}{\maththeta}}
\renewcommand{\iota}{\TextOrMath{\textiota}{\mathiota}}
\renewcommand{\kappa}{\TextOrMath{\textkappa}{\mathkappa}}
\renewcommand{\lambda}{\TextOrMath{\textlambda}{\mathlambda}}
\renewcommand{\mu}{\TextOrMath{\textmu}{\mathmu}}
\renewcommand{\nu}{\TextOrMath{\textnu}{\mathnu}}
\renewcommand{\xi}{\TextOrMath{\textxi}{\mathxi}}
\newcommand{\omicron}{\textomicron}
\renewcommand{\pi}{\TextOrMath{\textpi}{\mathpi}}
\renewcommand{\rho}{\TextOrMath{\textrho}{\mathrho}}
\renewcommand{\sigma}{\TextOrMath{\textsigma}{\mathsigma}}
\renewcommand{\varsigma}{\TextOrMath{\textvarsigma}{\mathvarsigma}}
\renewcommand{\tau}{\TextOrMath{\texttau}{\mathtau}}
\renewcommand{\upsilon}{\TextOrMath{\textupsilon}{\mathupsilon}}
\renewcommand{\phi}{\TextOrMath{\textphi}{\mathphi}}
\renewcommand{\chi}{\TextOrMath{\textchi}{\mathchi}}
\renewcommand{\psi}{\TextOrMath{\textpsi}{\mathpsi}}
\renewcommand{\omega}{\TextOrMath{\textomega}{\mathomega}}


% TextCompositeCommands for the generic macros
% --------------------------------------------
%
% The NFSS TextComposite mechanism looks for the next token without expanding
% it. In order to let compositions like ``\TextGreek{\'\Alpha}`` or
% ``\TextGreek{\>"\alpha}`` work as expected we define TextComposites with the
% `letter name commands`. (Composition only works if the active font encoding
% is LGR). ::

\DeclareTextComposite{\accvaria}{LGR}{\alpha}{128}
\DeclareTextComposite{\accdasia}{LGR}{\alpha}{129}
\DeclareTextComposite{\accpsili}{LGR}{\alpha}{130}
\DeclareTextComposite{\accdasiavaria}{LGR}{\alpha}{131}
\DeclareTextComposite{\acctonos}{LGR}{\alpha}{136}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\alpha}{137}
\DeclareTextComposite{\accpsilioxia}{LGR}{\alpha}{138}
\DeclareTextComposite{\accpsilivaria}{LGR}{\alpha}{139}
\DeclareTextComposite{\accperispomeni}{LGR}{\alpha}{144}
\DeclareTextComposite{\accdasiaperispomeni}{LGR}{\alpha}{145}
\DeclareTextComposite{\accpsiliperispomeni}{LGR}{\alpha}{146}
\DeclareTextComposite{\accvaria}{LGR}{\eta}{152}
\DeclareTextComposite{\accdasia}{LGR}{\eta}{153}
\DeclareTextComposite{\accpsili}{LGR}{\eta}{154}
\DeclareTextComposite{\acctonos}{LGR}{\eta}{160}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\eta}{161}
\DeclareTextComposite{\accpsilioxia}{LGR}{\eta}{162}
\DeclareTextComposite{\accdasiavaria}{LGR}{\eta}{163}
\DeclareTextComposite{\accperispomeni}{LGR}{\eta}{168}
\DeclareTextComposite{\accdasiaperispomeni}{LGR}{\eta}{169}
\DeclareTextComposite{\accpsiliperispomeni}{LGR}{\eta}{170}
\DeclareTextComposite{\accpsilivaria}{LGR}{\eta}{171}
\DeclareTextComposite{\accvaria}{LGR}{\omega}{176}
\DeclareTextComposite{\accdasia}{LGR}{\omega}{177}
\DeclareTextComposite{\accpsili}{LGR}{\omega}{178}
\DeclareTextComposite{\accdasiavaria}{LGR}{\omega}{179}
\DeclareTextComposite{\acctonos}{LGR}{\omega}{184}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\omega}{185}
\DeclareTextComposite{\accpsilioxia}{LGR}{\omega}{186}
\DeclareTextComposite{\accpsilivaria}{LGR}{\omega}{187}
\DeclareTextComposite{\accperispomeni}{LGR}{\omega}{192}
\DeclareTextComposite{\accdasiaperispomeni}{LGR}{\omega}{193}
\DeclareTextComposite{\accpsiliperispomeni}{LGR}{\omega}{194}
\DeclareTextComposite{\accvaria}{LGR}{\iota}{200}
\DeclareTextComposite{\accdasia}{LGR}{\iota}{201}
\DeclareTextComposite{\accpsili}{LGR}{\iota}{202}
\DeclareTextComposite{\accdasiavaria}{LGR}{\iota}{203}
\DeclareTextComposite{\acctonos}{LGR}{\iota}{208}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\iota}{209}
\DeclareTextComposite{\accpsilioxia}{LGR}{\iota}{210}
\DeclareTextComposite{\accpsilivaria}{LGR}{\iota}{211}
\DeclareTextComposite{\accperispomeni}{LGR}{\iota}{216}
\DeclareTextComposite{\accdasiaperispomeni}{LGR}{\iota}{217}
\DeclareTextComposite{\accpsiliperispomeni}{LGR}{\iota}{218}
\DeclareTextComposite{\accdialytika}{LGR}{\iota}{240}
\DeclareTextComposite{\accdialytikavaria}{LGR}{\iota}{241}
\DeclareTextComposite{\accdialytikatonos}{LGR}{\iota}{242}
\DeclareTextComposite{\accdialytikaperispomeni}{LGR}{\iota}{243}
\DeclareTextComposite{\accvaria}{LGR}{\upsilon}{204}
\DeclareTextComposite{\accdasia}{LGR}{\upsilon}{205}
\DeclareTextComposite{\accpsili}{LGR}{\upsilon}{206}
\DeclareTextComposite{\accdasiavaria}{LGR}{\upsilon}{207}
\DeclareTextComposite{\acctonos}{LGR}{\upsilon}{212}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\upsilon}{213}
\DeclareTextComposite{\accpsilioxia}{LGR}{\upsilon}{214}
\DeclareTextComposite{\accpsilivaria}{LGR}{\upsilon}{215}
\DeclareTextComposite{\accperispomeni}{LGR}{\upsilon}{220}
\DeclareTextComposite{\accdasiaperispomeni}{LGR}{\upsilon}{221}
\DeclareTextComposite{\accpsiliperispomeni}{LGR}{\upsilon}{222}
\DeclareTextComposite{\accdialytika}{LGR}{\upsilon}{244}
\DeclareTextComposite{\accdialytikavaria}{LGR}{\upsilon}{245}
\DeclareTextComposite{\accdialytikatonos}{LGR}{\upsilon}{246}
\DeclareTextComposite{\accdialytikaperispomeni}{LGR}{\upsilon}{247}
\DeclareTextComposite{\accvaria}{LGR}{\epsilon}{224}
\DeclareTextComposite{\accdasia}{LGR}{\epsilon}{225}
\DeclareTextComposite{\accpsili}{LGR}{\epsilon}{226}
\DeclareTextComposite{\accdasiavaria}{LGR}{\epsilon}{227}
\DeclareTextComposite{\acctonos}{LGR}{\epsilon}{232}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\epsilon}{233}
\DeclareTextComposite{\accpsilioxia}{LGR}{\epsilon}{234}
\DeclareTextComposite{\accpsilivaria}{LGR}{\epsilon}{235}
\DeclareTextComposite{\accvaria}{LGR}{\omicron}{228}
\DeclareTextComposite{\accdasia}{LGR}{\omicron}{229}
\DeclareTextComposite{\accpsili}{LGR}{\omicron}{230}
\DeclareTextComposite{\accdasiavaria}{LGR}{\omicron}{231}
\DeclareTextComposite{\acctonos}{LGR}{\omicron}{236}
\DeclareTextComposite{\accdasiaoxia}{LGR}{\omicron}{237}
\DeclareTextComposite{\accpsilioxia}{LGR}{\omicron}{238}
\DeclareTextComposite{\accpsilivaria}{LGR}{\omicron}{239}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Alpha}{<A}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Alpha}{<`A}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Alpha}{<'A}
\DeclareTextCompositeCommand{\accdasiaperispomeni}{LGR}{\Alpha}{<\char126A}
\DeclareTextCompositeCommand{\accpsili}{LGR}{\Alpha}{>A}
\DeclareTextCompositeCommand{\accpsilivaria}{LGR}{\Alpha}{>`A}
\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\Alpha}{>'A}
\DeclareTextCompositeCommand{\accpsiliperispomeni}{LGR}{\Alpha}{>\char126A}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Alpha}{'A}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Alpha}{`A}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Epsilon}{<E}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Epsilon}{<'E}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Epsilon}{<`E}
\DeclareTextCompositeCommand{\accpsili}{LGR}{\Epsilon}{>E}
\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\Epsilon}{>'E}
\DeclareTextCompositeCommand{\accpsilivaria}{LGR}{\Epsilon}{>`E}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Epsilon}{'E}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Epsilon}{`E}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Eta}{<H}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Eta}{<`H}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Eta}{<'H}
\DeclareTextCompositeCommand{\accdasiaperispomeni}{LGR}{\Eta}{<\char126H}
\DeclareTextCompositeCommand{\accpsili}{LGR}{\Eta}{>H}
\DeclareTextCompositeCommand{\accpsilivaria}{LGR}{\Eta}{>`H}
\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\Eta}{>'H}
\DeclareTextCompositeCommand{\accpsiliperispomeni}{LGR}{\Eta}{>\char126H}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Eta}{'H}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Eta}{`H}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Iota}{<I}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Iota}{<`I}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Iota}{<'I}
\DeclareTextCompositeCommand{\accdasiaperispomeni}{LGR}{\Iota}{<\char126I}
\DeclareTextCompositeCommand{\accpsili}{LGR}{\Iota}{>I}
\DeclareTextCompositeCommand{\accpsilivaria}{LGR}{\Iota}{>`I}
\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\Iota}{>'I}
\DeclareTextCompositeCommand{\accpsiliperispomeni}{LGR}{\Iota}{>\char126I}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Iota}{'I}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Iota}{`I}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Omicron}{<O}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Omicron}{<`O}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Omicron}{<'O}
\DeclareTextCompositeCommand{\accpsili}{LGR}{\Omicron}{>O}
\DeclareTextCompositeCommand{\accpsilivaria}{LGR}{\Omicron}{>`O}
\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\Omicron}{>'O}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Omicron}{'O}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Omicron}{`O}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Upsilon}{<U}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Upsilon}{<`U}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Upsilon}{<'U}
\DeclareTextCompositeCommand{\accdasiaperispomeni}{LGR}{\Upsilon}{<\char126U}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Upsilon}{'U}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Upsilon}{`U}
\DeclareTextCompositeCommand{\accdasia}{LGR}{\Omega}{<W}
\DeclareTextCompositeCommand{\accdasiavaria}{LGR}{\Omega}{<`W}
\DeclareTextCompositeCommand{\accdasiaoxia}{LGR}{\Omega}{<'W}
\DeclareTextCompositeCommand{\accdasiaperispomeni}{LGR}{\Omega}{<\char126W}
\DeclareTextCompositeCommand{\accpsili}{LGR}{\Omega}{>W}
\DeclareTextCompositeCommand{\accpsilivaria}{LGR}{\Omega}{>`W}
\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\Omega}{>'W}
\DeclareTextCompositeCommand{\accpsiliperispomeni}{LGR}{\Omega}{>\char126W}
\DeclareTextCompositeCommand{\acctonos}{LGR}{\Omega}{'W}
\DeclareTextCompositeCommand{\accvaria}{LGR}{\Omega}{`W}
\DeclareTextComposite{\accdialytika}{LGR}{\Iota}{219}
\DeclareTextComposite{\accdialytika}{LGR}{\Upsilon}{223}
\DeclareTextCompositeCommand{\@hiatus}{LGR}{\Alpha}{\A@hiatus}
\DeclareTextCompositeCommand{\@hiatus}{LGR}{\Epsilon}{\E@hiatus}


% .. References
%    ----------
% .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
% .. _CB Fonts: http://www.ctan.org/pkg/cbgreek-complete
% .. _babel: http://www.ctan.org/cgi-bin/ctanPackageInformation.py?id=babel
% .. _lgrx: http://www.ctan.org/pkg/lgrx
% .. _fixltx2e: http://www.ctan.org/pkg/fixltx2e