summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/textgreek/textgreek.dtx
blob: e4f8763021687df3c36996041e723cb874b57be7 (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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
% \iffalse meta-comment
% Copyright 2010,2011 Leonard Michlmayr
%
% 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 (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% 
% This work has the LPPL maintenance status `author-maintained'.
%  
% The Current Maintainer of this work is Leonard Michlmayr
% <leonard.michlmayr at gmail.com>.
% 
% This work consists of the file textgreek.dtx
% and the derived files textgreek.sty and textgreek.pdf
% \fi
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2009/09/24]
%<package>\ProvidesPackage{textgreek}
%<package>   [2011/03/30 v0.4 greek symbols in text]
%
%<*batchfile>
\begingroup
\input docstrip.tex
\keepsilent
\usedir{tex/latex/lm}
\preamble

This is a generated file.

Copyright 2010,2011 Leonard Michlmayr

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 (at your option) any later version.
The latest version of this license is in
  http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.

This work has the LPPL maintenance status `author-maintained'.
 
The Current Maintainer of this work is Leonard Michlmayr
<leonard.michlmayr at gmail.com>.

This work consists of the file textgreek.dtx
and the derived files textgreek.sty and textgreek.pdf

\endpreamble
\askforoverwritefalse
\generate{\file{textgreek.sty}{\from{textgreek.dtx}{package}}}
\endgroup
%</batchfile>
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage{textgreek}[2011/03/30]
\usepackage[american]{babel}
\usepackage{upgreek}
\usepackage{amstext}
\usepackage{microtype}
\usepackage[numbered]{hypdoc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{textgreek.dtx}
  \PrintChanges
  \makeatletter\c@IndexColumns = 2\makeatother
  \PrintIndex
\end{document}
%</driver>
% \fi
%
% \iffalse\OnlyDescription\fi
% \CheckSum{329}
%
% \CharacterTable
%  {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
%   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
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v0.1}{2010/10/17}{Initial Version}
%
% \GetFileInfo{textgreek.sty}
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ } \DoNotIndex{\@ne}
% \DoNotIndex{\advance,\begingroup,\catcode,\closein}
% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
% \DoNotIndex{\if,\fi}
% \DoNotIndex{\edef,\csname,\endcsname,\expandafter,\gdef,\xdef}
% \DoNotIndex{\ifcat,\ifmmode,\ifx,\mbox,\noexpand,\protect,\relax}
% \DoNotIndex{\texorpdfstring}
% \DoNotIndex{\bfseries,\centering,\@xiipt,\@xivpt,\@xpt,\@xviipt,\@xxvpt}
% \DoNotIndex{\DeclareOption,\ExecuteOptions,\fontfamily,\fontsize}
% \DoNotIndex{\footskip,\hbox,\headheight,\headsep,\hfil,\hfill}
% \DoNotIndex{\hoffset,\hsize,\hspace,\kern,\MakeUppercase,\mdseries}
% \DoNotIndex{\MessageBreak,\newcommand,\newpage,\space,\noindent}
% \DoNotIndex{\oddsidemargin,\PackageError,\PackageWarning}
% \DoNotIndex{\paperwidth,\paperheight,\par,\parbox,\parindent,\parsep}
% \DoNotIndex{\ProcessOptions,\rmfamily,\selectfont,\setlength}
% \DoNotIndex{\sfdefault,\sffamily,\space,\string,\textheight,\textwidth}
% \DoNotIndex{\thinspace,\thispagestyle,\topmargin,\ttfamily,\upshape}
% \DoNotIndex{\vbox,\vfil,\voffset,\vsize,\vskip}
% \DoNotIndex{\ce,\char,\curr@fontshape,\DeclareFontEncoding}
% \DoNotIndex{\DeclareRobustCommand,\f@family,\f@series,\fontencoding}
% \DoNotIndex{\fontseries,\providecommand,\renewcommand}
% \DoNotIndex{\RequirePackage,\romannumeral,\usefont}
% \DoNotIndex{\DeclareTextCommandDefault,\@@end}
%
% \title{The \textsf{\jobname} package\thanks{This document
%     corresponds to \textsf{textgreek}~\fileversion, dated~\filedate.}}
% \author{Leonard Michlmayr \\ \texttt{leonard.michlmayr at gmail.com}}
% \date{\filedate}
%
% \maketitle
%
% \section{Introduction}
%
% The usual way to print greek letters in \LaTeX{} uses the math
% mode. E.g. |$\beta$| produces $\beta$. With the default math
% fonts, the greek letters produced this way are
% \textit{italic}. Generally, this is ok, since they represent
% variables and variables are typeset italic with the default math
% font settings. In some circumstances, however, greek letters don't
% represent variables and should be typeset upright. E.g. in
% ``\textbeta-decay'' or ``\textmugreek A''.
% 
% The package \textsf{upgreek} provides commands to set upright greek
% letters in math mode, but it does not provide text symbols. You
% could use them in text with |$\upbeta$-decay|, for example,
% which gives $\upbeta$-decay, but the font will always be the
% same and will not be adapted to the surrounding font.
%
% The package \textsf{textgreek} provides text commands for greek
% letters in text that adapt to the surrounding font. For example in
% bold text, {\bf the command \verb|\textbeta| gives \textbeta{} while
%   \verb|$\upbeta$| gives $\upbeta$}. {\sf In sans-serif text it is,
%   \textbeta{} vs.\ $\upbeta$.}
%
% \tableofcontents
% \section{Usage}
% The following list shows the commands provided by this package. You
% can use these commands in any context.
% \begin{multicols}{4}
% \begin{tabbing}
% |\textmugreek|\quad\=\textOmega\quad\kill
% |\textalpha|\>\textalpha\\
% |\textbeta|\>\textbeta\\
% |\textgamma|\>\textgamma\\
% |\textdelta|\>\textdelta\\
% |\textepsilon|\>\textepsilon\\
% |\textzeta|\>\textzeta\\
% |\texteta|\>\texteta\\
% |\texttheta|\>\texttheta\\
% |\textiota|\>\textiota\\
% |\textkappa|\>\textkappa\\
% |\textlambda|\>\textlambda\\
% |\textmu|\>\textmu\\
% |\textmugreek|\>\textmugreek\\
% |\textnu|\>\textnu\\
% |\textxi|\>\textxi\\
% |\textomikron|\>\textomikron\\
% |\textpi|\>\textpi\\
% |\textrho|\>\textrho\\
% |\textsigma|\>\textsigma\\
% |\texttau|\>\texttau\\
% |\textupsilon|\>\textupsilon\\
% |\textphi|\>\textphi\\
% |\textchi|\>\textchi\\
% |\textpsi|\>\textpsi\\
% |\textomega|\>\textomega\\
% |\textAlpha|\>\textAlpha\\
% |\textBeta|\>\textBeta\\
% |\textGamma|\>\textGamma\\
% |\textDelta|\>\textDelta\\
% |\textEpsilon|\>\textEpsilon\\
% |\textZeta|\>\textZeta\\
% |\textEta|\>\textEta\\
% |\textTheta|\>\textTheta\\
% |\textIota|\>\textIota\\
% |\textKappa|\>\textKappa\\
% |\textLambda|\>\textLambda\\
% |\textMu|\>\textMu\\
% |\textNu|\>\textNu\\
% |\textXi|\>\textXi\\
% |\textOmikron|\>\textOmikron\\
% |\textPi|\>\textPi\\
% |\textRho|\>\textRho\\
% |\textSigma|\>\textSigma\\
% |\textTau|\>\textTau\\
% |\textUpsilon|\>\textUpsilon\\
% |\textPhi|\>\textPhi\\
% |\textChi|\>\textChi\\
% |\textPsi|\>\textPsi\\
% |\textOmega|\>\textOmega\\
% \end{tabbing}
% \end{multicols}
% \subsection{Advanced commands}
% The package provides a number of options that allows to select a
% font that will be used instead of \texttt{cmr/m/n}. The list of font
% substitutions is written to the log
% file. \DescribeMacro{\textgreekfontmap} If you need to customize the
% font substitutions, you can redefine |\textgreekfontmap|. For example, the font map for the option \textsf{artemisia} may also be set by:
% \begin{verbatim}
% \renewcommand*{\textgreekfontmap}{
%   {eur/m/n}{U/eur/m/n}
%   {eur/b/n}{U/eur/b/n}
%   {cmr/m/n}{LGR/artemisia/m/n}
%   {cmr/b/n}{LGR/artemisia/b/n}
%   {cmr/bx/n}{LGR/artemisia/bx/n}
%   {lmr/m/n}{LGR/artemisia/m/n}
%   {lmr/b/n}{LGR/artemisia/b/n}
%   {lmr/bx/n}{LGR/artemisia/bx/n}
%   {phv/m/n}{U/psy/m/n}}
% \end{verbatim}
% The list contains pairs of options: the font spec (without the
% encoding) of the font to be replaced and the font spec (with
% encoding) of the font to be used as substitute. Fonts not listed
% will be substituted with the same font-family, font-series, and
% font-shape in the encoding LGR\@. Since the Euler font (eur) does
% not use the encoding LGR, it has to be replaced by U/eur/m/n.
% \section{Package Options}
% You can choose the greek fonts used.
% \begin{description}
% \item[cbgreek] use the default fonts. This is the
%   default. Font sample: {\usefont{LGR}{cmr}{m}{n}
%     \makeatletter\renewcommand*{\textgreekfontmap}{}
%     \makeatother \textalpha \textbeta \textgamma \textdelta
%     \textepsilon{} \textzeta\texteta\texttheta\textiota\textkappa{}
%     \textlambda\textmugreek\textnu\textxi\textomikron{}
%     \textpi\textrho\textsigma\texttau\textupsilon{}
%     \textphi\textchi\textpsi\textomega{}
%     \textAlpha\textBeta\textGamma\textDelta\textEpsilon{}
%     \textZeta\textEta\textTheta\textIota\textKappa{}
%     \textLambda\textMu\textNu\textXi\textOmikron{}
%     \textPi\textRho\textSigma\textTau\textUpsilon{}
%     \textPhi\textChi\textPsi\textOmega}
% \item[euler] use the Euler fonts as a companion for CM Roman and LM
%   Roman. Font sample:
%   { \usefont{U}{eur}{m}{n} \textalpha \textbeta \textgamma
%     \textdelta \textepsilon{}
%     \textzeta\texteta\texttheta\textiota\textkappa{}
%     \textlambda\textmugreek\textnu\textxi\textomikron{}
%     \textpi\textrho\textsigma\texttau\textupsilon{}
%     \textphi\textchi\textpsi\textomega{}
%     \textAlpha\textBeta\textGamma\textDelta\textEpsilon{}
%     \textZeta\textEta\textTheta\textIota\textKappa{}
%     \textLambda\textMu\textNu\textXi\textOmikron{}
%     \textPi\textRho\textSigma\textTau\textUpsilon{}
%     \textPhi\textChi\textPsi\textOmega}
% \item[artemisia] use Artemisia fonts as a companion for CM Roman and
%   LM Roman. Font sample
%   {\makeatletter\renewcommand*{\textgreekfontmap}{}
%     \makeatother \usefont{LGR}{artemisia}{m}{n} \textalpha \textbeta
%     \textgamma \textdelta \textepsilon{}
%     \textzeta\texteta\texttheta\textiota\textkappa{}
%     \textlambda\textmugreek\textnu\textxi\textomikron{}
%     \textpi\textrho\textsigma\texttau\textupsilon{}
%     \textphi\textchi\textpsi\textomega{}
%     \textAlpha\textBeta\textGamma\textDelta\textEpsilon{}
%     \textZeta\textEta\textTheta\textIota\textKappa{}
%     \textLambda\textMu\textNu\textXi\textOmikron{}
%     \textPi\textRho\textSigma\textTau\textUpsilon{}
%     \textPhi\textChi\textPsi\textOmega}
% \end{description}
%
% \section{Compatibility}
%
% If you use the package \textsf{hyperref} I recommend to use the
% option \textsf{unicode}, i.e.\ 
% |\usepackage[unicode]{hyperref}|. Hyperref will recognize the
% textgreek letters and replace them with unicode in PDF-strings.
%
% You can use \textsf{upgreek} and \textsf{textgreek} in the same
% document. If you want to use a textgreek letter inside a math
% environment, you can place it into an |\mbox| or |\textnormal|, but
% I use |\text| from the package \textsf{amstext},
% e.g. |$\lambda_{\text{\textbeta}}$|: $\lambda_{\text{\textbeta}}$.
%
% \section{Examples}
%
% {\usefont{T1}{phv}{m}{n} Using Helvetica, the font ``Symbol'' is
%   used for greek letters. Let's try \textgamma{}.}
%
% \section{Copyright}
% Copyright 2010,2011 Leonard Michlmayr
%
% 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 (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% 
% This work has the LPPL maintenance status `author-maintained'.
%  
% The Current Maintainer of this work is Leonard Michlmayr.
% 
% This work consists of the file textgreek.dtx
% and the derived files textgreek.sty and textgreek.pdf
% \StopEventually{}
% \section{Implementation}
% Load the LGR font encoding.
%    \begin{macrocode}
\InputIfFileExists{lgrenc.def}{%
  \PackageInfo{textgreek}{Loading the definitions for the Greek font%
    encoding.}}{%
  \PackageError{textgreek}{Cannot find the file lgrenc.def}{%
    lgrenc.def is a file that contains the definitions for the Greek
    font encoding LGR. Maybe it comes with the babel package.}}
%    \end{macrocode}
% \subsection{Package Options}
%    \begin{macrocode}
\DeclareOption{cbgreek}{%
\renewcommand*{\textgreekfontmap}{%
{eur/m/n}{U/eur/m/n}
{eur/b/n}{U/eur/b/n}
{phv/m/n}{U/psy/m/n}}}%
%    \end{macrocode}
%    \begin{macrocode}
\DeclareOption{euler}{%
\renewcommand*{\textgreekfontmap}{%
{eur/m/n}{U/eur/m/n}
{eur/b/n}{U/eur/b/n}
{cmr/m/n}{U/eur/m/n}
{cmr/b/n}{U/eur/b/n}
{cmr/bx/n}{U/eur/b/n}
{lmr/m/n}{U/eur/m/n}
{lmr/b/n}{U/eur/b/n}
{lmr/bx/n}{U/eur/b/n}
{phv/m/n}{U/psy/m/n}}}%
%    \end{macrocode}
%    \begin{macrocode}
\DeclareOption{artemisia}{%
\renewcommand*{\textgreekfontmap}{%
{eur/m/n}{U/eur/m/n}
{eur/b/n}{U/eur/b/n}
{cmr/m/n}{LGR/artemisia/m/n}
{cmr/b/n}{LGR/artemisia/b/n}
{cmr/bx/n}{LGR/artemisia/bx/n}
{lmr/m/n}{LGR/artemisia/m/n}
{lmr/b/n}{LGR/artemisia/b/n}
{lmr/bx/n}{LGR/artemisia/bx/n}
{phv/m/n}{U/psy/m/n}}}%
%    \end{macrocode}
% Initialize |\textgreekfontmap|, set the default option and process
% the options.
% \begin{macro}{\textgreekfontmap}
%    \begin{macrocode}
\newcommand*{\textgreekfontmap}{}%
\ExecuteOptions{cbgreek}
\ProcessOptions\relax%
\PackageInfo{textgreek}{Loaded fontmap: \textgreekfontmap.}
%    \end{macrocode}
% \end{macro}
% \subsection{Font substitutions}
% \begin{macro}{\textgreek@substfont}
% Substitute a font.
%    \begin{macrocode}
\def\textgreek@setfont#1/#2/#3/#4\relax{\usefont{#1}{#2}{#3}{#4}}%
\def\textgreek@skipencoding#1/#2\relax{#2}%
\def\textgreek@substfont#1#2{%
\begingroup\edef\tempa{#1}\edef\tempb{\curr@fontshape}%
\edef\tempc{\expandafter\textgreek@skipencoding\tempb\relax}%
\def\spit##1##2\endgroup{\fi\endgroup##1}%
\ifx\tempa\tempc\spit{\expandafter\textgreek@setfont #2\relax}\fi\endgroup}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\textgreek@substfonts}
%   \changes{v0.3}{2010/10/30}{Make font substitutions customizable.}
%   Process a list of font substitutions.
%    \begin{macrocode}
\def\textgreek@eof{}%
\def\textgreek@return#1#2\textgreek@eof{%
\fi #1}
\newcommand{\textgreeksubstfonts}[1]{%
  \ifx#1\textgreek@eof%
  \else\textgreek@return{\textgreek@substfonts#1\textgreek@eof}%
  \fi\textgreek@eof}
\def\textgreek@substfonts#1#2#3\textgreek@eof{%
  \textgreek@substfont{#1}{#2}%
  \def\textgreek@temp{#3}\ifx\textgreek@temp\textgreek@eof\else%
  \textgreek@return{\textgreek@substfonts#3\textgreek@eof}%
  \fi\textgreek@eof}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\textgreekfont}
%   Select the greek font encoding and apply font replacements.
% \changes{v0.2}{2010/10/20}{apply font replacements before \textbackslash setfont}
%    \begin{macrocode}
\newcommand*{\textgreekfont}{%
  \fontencoding{LGR}%
  \expandafter\textgreeksubstfonts\expandafter{\textgreekfontmap}%
  \selectfont}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\lgrtoeuler}
%   Convert LGR encoded characters to Euler's U encoding.
%    \begin{macrocode}
\newcommand*{\lgrtoeuler}[1]{%
\if G#1\textgreek@return{\char0}\fi%
\if D#1\textgreek@return{\char1}\fi%
\if J#1\textgreek@return{\char2}\fi%
\if L#1\textgreek@return{\char3}\fi%
\if X#1\textgreek@return{\char4}\fi%
\if P#1\textgreek@return{\char5}\fi%
\if S#1\textgreek@return{\char6}\fi%
\if U#1\textgreek@return{\char7}\fi%
\if F#1\textgreek@return{\char8}\fi%
\if Y#1\textgreek@return{\char9}\fi%
\if W#1\textgreek@return{\char10}\fi%
\if a#1\textgreek@return{\char11}\fi%
\if b#1\textgreek@return{\char12}\fi%
\if g#1\textgreek@return{\char13}\fi%
\if d#1\textgreek@return{\char14}\fi%
\if 3#1\textgreek@return{\char15}\fi% element-of style epsilon
\if z#1\textgreek@return{\char16}\fi%
\if h#1\textgreek@return{\char17}\fi%
\if 0#1\textgreek@return{\char18}\fi% temperature style theta
\if i#1\textgreek@return{\char19}\fi%
\if k#1\textgreek@return{\char20}\fi%
\if l#1\textgreek@return{\char21}\fi%
\if m#1\textgreek@return{\char22}\fi%
\if n#1\textgreek@return{\char23}\fi%
\if x#1\textgreek@return{\char24}\fi%
\if p#1\textgreek@return{\char25}\fi%
\if r#1\textgreek@return{\char26}\fi%
\if s#1\textgreek@return{\char27}\fi%
\if t#1\textgreek@return{\char28}\fi%
\if u#1\textgreek@return{\char29}\fi%
\if v#1\textgreek@return{\char30}\fi% o-slash style phi
\if q#1\textgreek@return{\char31}\fi%
\if y#1\textgreek@return{\char32}\fi%
\if w#1\textgreek@return{\char33}\fi%
%    \end{macrocode}
% Euler provides two variants of epsilon:
% {\usefont{U}{eur}{m}{n}\char15} and
% {\usefont{U}{eur}{m}{n}\char34}. Use {\usefont{U}{eur}{m}{n}\char34} by default.
%    \begin{macrocode}
\if e#1\textgreek@return{\char34}\fi%
%    \end{macrocode}
% Euler provides two variants of theta:
% {\usefont{U}{eur}{m}{n}\char18} and
% {\usefont{U}{eur}{m}{n}\char35}. Use {\usefont{U}{eur}{m}{n}\char35} by default.
%    \begin{macrocode}
\if j#1\textgreek@return{\char35}\fi%
%    \end{macrocode}
% Euler provides two variants of phi:
% {\usefont{U}{eur}{m}{n}\char30} and
% {\usefont{U}{eur}{m}{n}\char39}. Use {\usefont{U}{eur}{m}{n}\char39} by default.
%    \begin{macrocode}
\if f#1\textgreek@return{\char39}\fi%
%    \end{macrocode}
% Use the default font for the LGR encoding, if the character is not
% present in Euler.
%    \begin{macrocode}
\fontencoding{LGR}\selectfont #1%
\textgreek@eof}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\TextGreek}
%   Produce a greek letter using the correct font. If the font is
%   Euler, convert to Euler's generic font encoding U.
%   \changes{v0.4}{2011/03/30}{Avoid the ligature that changes sigma
%     to a word-final sigma with the help of \texttt{\textbackslash
%       noboundary}}
%    \begin{macrocode}
\DeclareRobustCommand*{\TextGreek}[1]{%
\begingroup%
\textgreekfont%
\def\tempa{eur}\edef\tempb{\f@family}%
\ifx\tempa\tempb\expandafter\lgrtoeuler\expandafter#1\else#1\noboundary\fi%
\endgroup}
%    \end{macrocode}
% \end{macro}
% \subsection{List of greek letters}
% \begin{macro}{\DeclareTextGreekSymbol}
% Define the symbol name with |\DeclareTextCommandDefault|.
%    \begin{macrocode}
\newcommand*{\DeclareTextGreekSymbol}[2]{%
\expandafter\DeclareTextCommandDefault\csname text#1\endcsname%
{\TextGreek#2}}%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\DeclareTextGreekSymbol{alpha}{a}
\DeclareTextGreekSymbol{beta}{b}
\DeclareTextGreekSymbol{gamma}{g}
\DeclareTextGreekSymbol{delta}{d}
\DeclareTextGreekSymbol{epsilon}{e}
\DeclareTextGreekSymbol{zeta}{z}
\DeclareTextGreekSymbol{eta}{h}
\DeclareTextGreekSymbol{theta}{j}
\DeclareTextGreekSymbol{iota}{i}
\DeclareTextGreekSymbol{kappa}{k}
\DeclareTextGreekSymbol{lambda}{l}
%    \end{macrocode}
% \begin{macro}{\textmu}
%   \changes{v0.4}{2010/11/07}{Don't override \textsf{textcomp}'s
%     textmu} \changes{v0.4}{2010/11/07}{Don't provide
%     \texttt{\textbackslash textmicro} anymore.}
% \begin{macro}{\textmugreek}
% Don't redefine |\textmu| if it is also provided by another
% package. Use |\textmugreek| if you mean the greek letter rather than
% the micro symbol of the \textsf{textcomp} package.
%    \begin{macrocode}
\expandafter\ifx\csname?\string\textmu\endcsname\relax%
\DeclareTextGreekSymbol{mu}{m}\fi
\DeclareTextGreekSymbol{mugreek}{m}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%    \begin{macrocode}
\DeclareTextGreekSymbol{nu}{n}
\DeclareTextGreekSymbol{xi}{x}
\DeclareTextGreekSymbol{omikron}{o}
\DeclareTextGreekSymbol{pi}{p}
\DeclareTextGreekSymbol{rho}{r}
\DeclareTextGreekSymbol{sigma}{s}
\DeclareTextGreekSymbol{tau}{t}
\DeclareTextGreekSymbol{upsilon}{u}
\DeclareTextGreekSymbol{phi}{f}
\DeclareTextGreekSymbol{chi}{q}
\DeclareTextGreekSymbol{psi}{y}
\DeclareTextGreekSymbol{omega}{w}
\DeclareTextGreekSymbol{Alpha}{A}
\DeclareTextGreekSymbol{Beta}{B}
\DeclareTextGreekSymbol{Gamma}{G}
\DeclareTextGreekSymbol{Delta}{D}
\DeclareTextGreekSymbol{Epsilon}{E}
\DeclareTextGreekSymbol{Zeta}{Z}
\DeclareTextGreekSymbol{Eta}{H}
\DeclareTextGreekSymbol{Theta}{J}
\DeclareTextGreekSymbol{Iota}{I}
\DeclareTextGreekSymbol{Kappa}{K}
\DeclareTextGreekSymbol{Lambda}{L}
\DeclareTextGreekSymbol{Mu}{M}
\DeclareTextGreekSymbol{Nu}{N}
\DeclareTextGreekSymbol{Xi}{X}
\DeclareTextGreekSymbol{Omikron}{O}
\DeclareTextGreekSymbol{Pi}{P}
\DeclareTextGreekSymbol{Rho}{R}
\DeclareTextGreekSymbol{Sigma}{S}
\DeclareTextGreekSymbol{Tau}{T}
\DeclareTextGreekSymbol{Upsilon}{U}
\DeclareTextGreekSymbol{Phi}{F}
\DeclareTextGreekSymbol{Chi}{Q}
\DeclareTextGreekSymbol{Psi}{Y}
\DeclareTextGreekSymbol{Omega}{W}
%    \end{macrocode}
% \Finale
% {\obeyspaces
% \typeout{*************************************************************}
% \typeout{*                                                           *}
% \typeout{* To finish the installation you have to move the following *}
% \typeout{* file into a directory searched by TeX:                    *}
% \typeout{*                                                           *}
% \typeout{*     textgreek.sty                                         *}
% \typeout{*                                                           *}
% \typeout{* To produce the documentation run the file textgreek.dtx   *}
% \typeout{* through LaTeX. Typically the following commands will do   *}
% \typeout{* the job:                                                  *}
% \typeout{*                                                           *}
% \typeout{*     pdflatex textgreek.dtx                                *}
% \typeout{*     pdflatex textgreek.dtx                                *}
% \typeout{*     makeindex -s gglo.ist -o textgreek.gls textgreek.glo  *}
% \typeout{*     makeindex -s gind.ist -o textgreek.ind textgreek.idx  *}
% \typeout{*     pdflatex textgreek.dtx                                *}
% \typeout{*     makeindex -s gglo.ist -o textgreek.gls textgreek.glo  *}
% \typeout{*     makeindex -s gind.ist -o textgreek.ind textgreek.idx  *}
% \typeout{*     pdflatex textgreek.dtx                                *}
% \typeout{*                                                           *}
% \typeout{* Happy TeXing!                                             *}
% \typeout{*                                                           *}
% \typeout{*************************************************************}
% }
\endinput