-
Notifications
You must be signed in to change notification settings - Fork 0
/
textgreek.sty
165 lines (154 loc) · 5.72 KB
/
textgreek.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
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
% Greek symbols in text
% *********************
%
% :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: Provide a set of ``\text*`` macros for Greek letters
% outside math.
%
% :Identification:
% ::
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{textgreek}
[2010/08/04 v0.1 macros for Greek letters in text]
% Changelog:
% .. class:: borderless
%
% ========== ===== =========================================================
% 2010-06-16 0.1 initial version
% ========== ===== =========================================================
%
% Motivation
% ==========
%
% By default, the ``\alpha`` -- ``\Omega`` macros for Greek letters
%
% * are only valid in mathematical mode
%
% * do not change shape (default shape is italic)
%
% In Greek text fonts with the LGR font encoding, letters are
% accessible by a Latin transcription.
%
% This 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.
%
% The macro names follow the established scheme to prepend ``\text*`` to
% the Adobe glyph name (if it exists) or the corresponding math-macro, so
% ``\textalpha`` -- ``\textOmega`` prints α – Ω.
%
% * In combination with the ``\text`` macro from amsmath, this can be
% used to get matching upright and bold upright Greek symbols in math
% as well.
%
% * In combination with ``\usepackage[utf8]{inputenc}`` and the
% accompanying ``lgrenc.dfu`` file, Unicode input of Greek characters
% is supported.
%
% This is done using NFSS default definitions as explained in the
% fntguide_ (section 5.3).
%
% Attention
% While the macros work reasonably well for single letters, the
% automatic font-encoding switches behind the doors destroy the
% kerning between the letters.
%
% Text composites (replacement of accent+character with a pre-composed
% character) work in LGR, but not in other encodings (due to the
% forth-and-back font encoding switch).
%
% Therefore, Greek text should be written with the help of babel_,
% setting the language to either ``greek`` or ``polutonikogreek``.
%
%
% Implementation
% ==============
%
% This package requires the extended font encoding definitions::
\input{lgrxenc.def}
% Greek Alphabet
% --------------
%
% Define the ``text*`` marcos as default for all font encodings::
\DeclareTextSymbolDefault{\textAlpha}{LGR}
\DeclareTextSymbolDefault{\textBeta}{LGR}
\DeclareTextSymbolDefault{\textGamma}{LGR}
\DeclareTextSymbolDefault{\textDelta}{LGR}
\DeclareTextSymbolDefault{\textEpsilon}{LGR}
\DeclareTextSymbolDefault{\textZeta}{LGR}
\DeclareTextSymbolDefault{\textEta}{LGR}
\DeclareTextSymbolDefault{\textTheta}{LGR}
\DeclareTextSymbolDefault{\textIota}{LGR}
\DeclareTextSymbolDefault{\textKappa}{LGR}
\DeclareTextSymbolDefault{\textLambda}{LGR}
\DeclareTextSymbolDefault{\textMu}{LGR}
\DeclareTextSymbolDefault{\textNu}{LGR}
\DeclareTextSymbolDefault{\textXi}{LGR}
\DeclareTextSymbolDefault{\textOmicron}{LGR}
\DeclareTextSymbolDefault{\textPi}{LGR}
\DeclareTextSymbolDefault{\textRho}{LGR}
\DeclareTextSymbolDefault{\textSigma}{LGR}
\DeclareTextSymbolDefault{\textTau}{LGR}
\DeclareTextSymbolDefault{\textUpsilon}{LGR}
\DeclareTextSymbolDefault{\textPhi}{LGR}
\DeclareTextSymbolDefault{\textChi}{LGR}
\DeclareTextSymbolDefault{\textPsi}{LGR}
\DeclareTextSymbolDefault{\textOmega}{LGR}
%
\DeclareTextSymbolDefault{\textalpha}{LGR}
\DeclareTextSymbolDefault{\textbeta}{LGR}
\DeclareTextSymbolDefault{\textgamma}{LGR}
\DeclareTextSymbolDefault{\textdelta}{LGR}
\DeclareTextSymbolDefault{\textepsilon}{LGR}
\DeclareTextSymbolDefault{\textzeta}{LGR}
\DeclareTextSymbolDefault{\texteta}{LGR}
\DeclareTextSymbolDefault{\texttheta}{LGR}
\DeclareTextSymbolDefault{\textiota}{LGR}
\DeclareTextSymbolDefault{\textkappa}{LGR}
\DeclareTextSymbolDefault{\textlambda}{LGR}
\DeclareTextSymbolDefault{\textmu}{LGR}
\DeclareTextSymbolDefault{\textnu}{LGR}
\DeclareTextSymbolDefault{\textxi}{LGR}
\DeclareTextSymbolDefault{\textomicron}{LGR}
\DeclareTextSymbolDefault{\textpi}{LGR}
\DeclareTextSymbolDefault{\textrho}{LGR}
\DeclareTextSymbolDefault{\textsigma}{LGR}
\DeclareTextSymbolDefault{\textvarsigma}{LGR}
\DeclareTextSymbolDefault{\texttau}{LGR}
\DeclareTextSymbolDefault{\textupsilon}{LGR}
\DeclareTextSymbolDefault{\textphi}{LGR}
\DeclareTextSymbolDefault{\textchi}{LGR}
\DeclareTextSymbolDefault{\textpsi}{LGR}
\DeclareTextSymbolDefault{\textomega}{LGR}
% Diacritics
% ----------
%
% Diacritics are defined via "named" macros in ``lgrxenc.def``. Make them
% default in any encoding::
\DeclareTextAccentDefault{\Dasia}{LGR}
\DeclareTextAccentDefault{\Psili}{LGR}
\DeclareTextAccentDefault{\Tonos}{LGR}
\DeclareTextAccentDefault{\Varia}{LGR}
\DeclareTextAccentDefault{\Perispomeni}{LGR}
\DeclareTextAccentDefault{\Dialytika}{LGR}
%
\DeclareTextAccentDefault{\DasiaOxia}{LGR}
\DeclareTextAccentDefault{\DasiaVaria}{LGR}
\DeclareTextAccentDefault{\DasiaPerispomeni}{LGR}
\DeclareTextAccentDefault{\PsiliOxia}{LGR}
\DeclareTextAccentDefault{\PsiliVaria}{LGR}
\DeclareTextAccentDefault{\PsiliPerispomeni}{LGR}
\DeclareTextAccentDefault{\DialytikaTonos}{LGR}
\DeclareTextAccentDefault{\DialytikaVaria}{LGR}
\DeclareTextAccentDefault{\DialytikaPerispomeni}{LGR}
% .. References
% ----------
% .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
% .. _babel: http://www.ctan.org/cgi-bin/ctanPackageInformation.py?id=babel
% .. _fntguide: http://www.ctan.org/tex-archive/macros/latex/doc/fntguide.pdf
% .. _CB fonts:
% http://www.ctan.org/cgi-bin/ctanPackageInformation.py?id=cbgreek-complete