summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/plain/yannisgr/rgreekmacros.tex
blob: 3aad8fd1ac044a8025ca502cb0424364be321d8e (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
\def\lt{<}
\def\gt{>}
\newcount\fontnumber
\fontnumber=0
\newif\ifoneaccent\oneaccenttrue
\def\ifnextchar#1#2#3{\let\tempe #1\def\tempa{#2}\def\tempb{#3}\futurelet
  \tempc\ifnch}
\def\ifnch{\ifx\tempc\tempe\let\tempd\tempa\else\let\tempd\tempb\fi\tempd}
\def\gobble#1{}
\def\greekmode{%
\catcode`\<=13%
\catcode`\>=13%
\catcode`\'=11%
\catcode`\`=13%
\catcode`\~=11%
\catcode`\"=13%
\lccode`\<=`\<%
\lccode`\>=`\>%
\lccode`\'=`\'%
\lccode`\~=`\~%
\lccode`\"=`\"%
\def\rg{\fontnumber=1\tengr}%
\def\sl{\fontnumber=2\tengrsl}%
\def\it{\fontnumber=3\tengrit}%
\def\bf{\fontnumber=4\tengrbf}%
\def\smc{\fontnumber=5\tengrsmc}%
\def\I##1{\setbox0\hbox{##1}\ifdim\ht0=1ex\accent'174 ##1%
  \else{\ooalign{\hidewidth\char'174\hidewidth\crcr\unhbox0}}\fi}}%
\newcount\vwl
\newcount\acct
{
  \greekmode
  \gdef>{\ifnextchar ~{\expandafter\smoothcircumflex\gobble}{\char\lq\>}}
  \gdef<{\ifnextchar ~{\expandafter\roughcircumflex\gobble}{\char\lq\<}}
  \gdef\smoothcircumflex#1{\acct=\rq134 \vwl=\lq#1 \dobreathingcircumflex}
  \gdef\roughcircumflex#1{\acct=\rq100 \vwl=\lq#1 \dobreathingcircumflex}
  \gdef\dobreathingcircumflex{\ifnum\vwl\lt\rq140 %if uppercase
    \char\the\acct\kern -.2em\char\the\vwl\else
    \doaccent\fi}
  \gdef\doaccent{\accent\the\acct \char\the\vwl\relax}
  \gdef"{\ifnextchar '{\expandafter\diaeresisacute\gobble}{\accent\lq\"}}
  \gdef\diaeresisacute#1{\accent\rq043 #1}
  \gdef`{'}
}
 
\newif\ifgreek\greekfalse
 
\def\begingreek{\bgroup\font\tengr=rgrrg10\font\tengrsl=rgrsl10%
\font\tengrbf=rgrbf10\font\tengrit=rgrti10\font\tengrsmc=rgrsc10%
\greektrue\greekmode\rg}
\def\beginmgreek{\bgroup\font\tengr=mrgrrg10\font\tengrsl=mrgrsl10%
\font\tengrbf=mrgrbf10\font\tengrit=mrgrti10\font\tengrsmc=rgrsc10%
\greektrue\greekmode\rg}
\def\endgreek{\egroup}
\def\endmgreek{\egroup}
\def\monotoniko{%
\font\tengr=mrgrrg10\font\tengrsl=mrgrsl10%
\font\tengrbf=mrgrbf10\font\tengrit=mrgrti10%
\ifnum\fontnumber=5\smc%
  \else\ifnum\fontnumber=4\bf%
    \else\ifnum\fontnumber=3\it%
      \else\ifnum\fontnumber=2\sl%
        \else\rg%
      \fi%
    \fi%
  \fi%
\fi%
}
\def\polutoniko{%
\font\tengr=rgrrg10\font\tengrsl=rgrsl10%
\font\tengrbf=rgrbf10\font\tengrit=rgrti10%
\ifnum\fontnumber=5\smc%
  \else\ifnum\fontnumber=4\bf%
    \else\ifnum\fontnumber=3\it%
      \else\ifnum\fontnumber=2\sl%
        \else\rg%
      \fi%
    \fi%
  \fi%
\fi%
}
\let\math=$%
{\catcode`\$=13%
\gdef\greekdelims{\catcode`\$=13%
\def${\ifgreek\endgreek\else\begingreek\fi}
\def\display{\math\math}\def\enddisplay{\math\math}}}
\def\grave#1{{\edef\next{\the\font}\smc\accent\rq001\next#1}}
\def\roughgrave#1{{\edef\next{\the\font}\smc\accent\rq002\next#1}}
\def\smoothgrave#1{{\edef\next{\the\font}\smc\accent\rq003\next#1}}
\def\diaeresisgrave#1{{\edef\next{\the\font}\smc\accent\rq004\next#1}}
\def\diaeresiscircumflex#1{{\edef\next{\the\font}\smc\accent\rq005\next#1}}
\def\breve#1{{\edef\next{\the\font}\smc\accent\rq006\next#1}}
\def\macron#1{{\edef\next{\the\font}\smc\accent\rq007\next#1}}
\def\rhorough{{\tengrsmc
\ifnum\fontnumber=5\char\rq162
  \else\ifnum\fontnumber=4\char\rq016
    \else\ifnum\fontnumber=3\char\rq014
      \else\ifnum\fontnumber=2\char\rq012
        \else\char\rq010
      \fi
    \fi
  \fi
\fi
}}
\def\rhosmooth{{\tengrsmc
\ifnum\fontnumber=5\char\rq162
  \else\ifnum\fontnumber=4\char\rq017
    \else\ifnum\fontnumber=3\char\rq015
      \else\ifnum\fontnumber=2\char\rq013
        \else\char\rq011
      \fi
    \fi
  \fi
\fi
}}
\def\digamma{{\smc\char\rq135}}
\def\smallDigamma{{\smc\char\rq140}}
\def\Digamma{{\tengrsmc
\ifnum\fontnumber=5\char\rq021
  \else\ifnum\fontnumber=4\char\rq027
    \else\ifnum\fontnumber=3\char\rq025
      \else\ifnum\fontnumber=2\char\rq023
        \else\char\rq021
      \fi
    \fi
  \fi
\fi
}}
\def\vardigamma{{\tengrsmc
\ifnum\fontnumber=5\char\rq020
  \else\ifnum\fontnumber=4\char\rq026
    \else\ifnum\fontnumber=3\char\rq024
      \else\ifnum\fontnumber=2\char\rq022
        \else\char\rq020
      \fi
    \fi
  \fi
\fi
}}
\def\understroke{{\smc\char\rq046}}
\def\overstroke{{\smc\char\rq044}}
\def\sanpi{{\smc\char\rq136}}
\def\Sanpi{{\smc\char\rq137}}
\def\qoppa{{\smc\char\rq133}}
\def\varqoppa{{\smc\char\rq134}}
\def\Qoppa{{\smc\char\rq103}}
\def\Tao{{\smc\char\rq177}}
\def\ssh{\breve{s}}\def\SSH{\breve{S}}
\def\dz{\breve{z}}\def\DZ{\breve{Z}}
\def\psh{\breve{y}}\def\PSH{\breve{Y}}
\def\ksh{\breve{x}}\def\KSH{\breve{X}}
\def\inviota{{\smc\char\rq126}}
\def\grMF{{\smc\char\rq030\char\rq031\char\rq032\char\rq033}\-{\smc%
\char\rq034\char\rq036\char\rq037\char\rq032}}
\def\MF{{\smc\char\rq030\char\rq031\char\rq032\char\rq033}\-{\smc%
\char\rq040\char\rq036\char\rq037\char\rq032}}
 
\endinput