summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/kdgreek/209/lgreek.3.0c
blob: f5506d2bec27a97c6243ff9d803a2f2238413af8 (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
%
%				LGREEK.TEX
%				---------
%
%			      K J Dryllerakis
%
%				Sep 18, 1991
%
%				VERSION: 3.0c
%
%	This is the source file for building the greek format for the
%	kd fsmily of fonts.
%	This is based on Greek.tex
%	
% 	Greek is defined to be language 1 or actually last_language+1.
%
%	Pleaaaaaaaaase don't modify this file
%
%		Note: Used in conjunction with KD Fonts
%
% 
% \input plain% 			Load the standard macro package
% For GreekLatex we need to preload the lplain format
\input lplain%
%
% Add some LaTeX Information
%
\everyjob{\typeout{Greek LaTeX Version 2.09-3.0[c] <9 Oct 1991>}}
\immediate\write10{Greek LaTeX Version 2.09-3.0[c] <9 Oct 1991>}
%
\message{Greek Definitions:}
%
\message{general definitions,}
%
\catcode`\@=11			% We will access TeX private macros
%\newwrite\@screen		% Define a screen ouput
%\def\showstring#1{\immediate\write\@screen{#1}}
\let\showstring\typeout
\def\sp@{ }\def\sp@s{\sp@\sp@\sp@\sp@\sp@\sp@\sp@\sp@\sp@}
\def\c@p{\showstring{}\showstring{\sp@s\sp@s\sp@s GreekTeX -- Version 3.0[c]}%
\showstring{\sp@s\sp@s\sp@s  ---------------------------}
\showstring{\sp@s GreekTeX is a macro package for typesetting greek texts.}
\showstring{\sp@s It is maily compatible with the haralambous package,}
\showstring{\sp@s from which it inherits the top level macros.}
\showstring{\sp@s GreekTeX includes easy access to font families, a choise}
\showstring{\sp@s of delimiters, and makes typesetting scientific papers}
\showstring{\sp@s in greek as easy as in TeX itself.}
\showstring{\sp@s}
\showstring{\sp@s\sp@s\sp@s Copyright K J Dryllerakis 1991}
\showstring{\sp@s\sp@s\sp@s ------------------------------}%
}
\c@p
%
%	A List of Reserved Keywords that should not be redefined
%	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%
%		a. accesible from the document
%
%	\|		The character |
%	\begingreek	Begin a group of greek text
%	\endgreek	End a group of greek text
%	\greek		A new language definition
%	\gr		switch to classical greek font
%	\gbf		switch to classical boldface font
%	\git		switch to classical italics font
%	\gsl		switch to classical slanted font
%	\gtt		switch to classical typewritter font
%	\gt		Greater than > symbol
%	\lt		Less than < symbol
%	\math		If we are using $ as del. it is equiv to $
%	\setgreek	Select greek mode to be the primary mode
%	\setlatin	Restore standard mode (at any stage)
%	\showstring	Log a string on the terminal
%
%		b. Internal Control Sequences
%
%	\gr@@kdelimsbar Use | as begin- and end-greek
%	\gr@@kdelimsdol Use $ as begin- and end-greek
%	\@ldend		A copy of plain TeX's \end
%	\@screen	Screen Output for messages
%	\t@f@nt		Remembers greek font used last
%	\t@f@m		Remembers greek family used last
%	\t@size		Remembers greek point size used last
%	\c@p		Product Copyright Notice
%	\grfam		Greek classic font family register
%	\grslfam	Greek slanted font family register
%	\grttfam	Greek typewriter font family register
%	\grbffam	Greek boldface font family register
%	\grifam		Greek italics font family register
%	\l@tinm@de	Definition to restore plain TeX's mode
%
%			Start Up Definitions
%			--------------------
%
\ifx\gr@@kformatloaded\relax\catcode`\@=\active%
 \endinput\else\let\gr@@kformatloaded\relax\fi
\newif\ifdelimsbar\delimsbarfalse	% Check for | as delimiter
\chardef\|=`\|				% A way to access |
\gdef\t@f@nt{\gr}			% Remember font used last
%\gdef\t@size{\grtenpoint}		% Remember size used last
%
\gdef\t@f@m{\fam\grfam}			% Remember family used last
% ^ THESE ARE INITIAL VALUES. DO NOT ALTER!
\newlanguage\greek			% Define Greek as a new language
\def\lt{<}				% Remember Less than
\def\gt{>}				% and greater than signs
\language0				% Switch to default language
%
\message{fonts,}
%
\input grfonts.tex
%
%		   		Greek Font Bits
%				_______________
%
%	First we load the greek fonts and declare the families
%	Then we define point sizes for typesetting greek texts
%
%		Classic Greek Family
%		^^^^^^^^^^^^^^^^^^^^
%\newfam\grfam
%\font\tengr=kdgr10		% 10 point Classic Greek Font
%\font\ninegr=kdgr9		%  9 point Classic Greek Font
%\font\eightgr=kdgr8		%  8 point Classic Greek Font
%\font\sixgr=kdgr8 at 6truept	%  6 point simulated Classic Greek (x.75)
%\def\gr{\tengr\fam\grfam}
%%
%		Slanted Greek Family
%		^^^^^^^^^^^^^^^^^^^^
%\newfam\grslfam
%\font\tengrsl=kdsl10		% 10 Point Slanted Greek Font
%\font\ninegrsl=kdsl10 at 9truept% 9 point (sim.) Slanted Greek
%\font\eightgrsl=kdsl10 at 8truept%8 point (sim.) Slanted Greek
%\def\gsl{\tengrsl\fam\grslfam}
%%
%		Boldface Greek Family
%		^^^^^^^^^^^^^^^^^^^^^
%\newfam\grbffam
%\font\tengrbf=kdbf10		% 10 Point Boldface Greek Font
%\font\ninegrbf=kdbf10 at 9truept% 9 Point (sim.) Boldface Greek
%\font\eightgrbf=kdbf10 at 8truept% 8 Point (sim.) Boldface Greek
%\def\gbf{\tengrbf\fam\grbffam}
%
%		Italic Greek Family
%		^^^^^^^^^^^^^^^^^^^
%\newfam\grifam
%\font\tengri=kdti10		% 10 Point Italic Greek Font
%\font\ninegri=kdti10 at 9truept	%  9 Point (sim.) Italic Greek
%\font\eightgri=kdti10 at 8truept%  8 Point (sim.) Italic Greek
%\def\git{\tengri\fam\grifam}
%
%		Typerwriter Greek Family
%		^^^^^^^^^^^^^^^^^^^^^^^^
%\newfam\grttfam
%\font\tengrtt=kdtt10		% 10 Point Typewritter Greek Font
%\font\ninegrtt=kdtt10 at 9truept%  9 Point (sim.) Typewritter Greek 
%\font\eightgrtt=kdtt10 at 8truept% 8 Point (sim.) Typewritter Greek 
%\hyphenchar\eightgrtt=-1 \hyphenchar\tengrtt=-1
%\hyphenchar\ninegrtt=-1		% Supress Hyphenation
%\def\gtt{\tengrtt\fam\grttfam}
%
% 		Greek Point Size Conventions
%		^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%
%\def\grtenpoint{%		GREEK TENPOINT
%\gdef\t@size{\grtenpoint}% Make a note of the font size
%\textfont\grfam=\tengr\scriptfont\grfam=\eightgr\scriptscriptfont\grfam=\sixgr%
%\textfont\grbffam=\tengrbf\scriptfont\grbffam=\ninegrbf%
%\textfont\grifam=\tengri\scriptfont\grbffam=\ninegri%
%\textfont\grttfam=\tengrtt%
%\textfont\grslfam=\tengrsl%
%\def\gr{\fam\grfam\tengr}%		Switch for classic greek
%\let\rg\gr%				Also rg for compatibility
%\def\it{\fam\grifam\tengri}%		Switch for Greek Italics
%\def\sl{\fam\grslfam\tengrsl}%		Switch for Greek Slanted
%\def\tt{\fam\grttfam\tengrtt}%		Switch for Greek Typerwriter
%\def\bf{\fam\grbffam\tengrbf}%		Switch for Greek Boldface
%\let\git\it\let\gsl\sl%
%\let\gbf\bf\let\gtt\tt%			Retain LaTeX compatibility
%\def\rm{\fam0\tenrm}%			Switch For latin roman
%\def\lit{\fam\itfam\tenit}%		Switch for latin italics
%\def\lsl{\fam\slfam\tensl}%		Switch for latin slanted
%\def\ltt{\fam\ttfam\tentt}%		Switch for latin typewriter
%\def\lbf{\fam\bffam\tenbf}%		Switch for latin boldface
%\normalbaselineskip=.6cm%		Normal Base Line distance
%\setbox\strutbox=\hbox{\vrule height8.5pt width0pt depth4.5pt}%
%\normalbaselines\gr%
%}
%\def\grninepoint{%		GREEK NINEPOINT
%\%gdef\t@size{\grninepoint}% Make a note of the font size
%\textfont\grfam=\ninegr\scriptfont\grfam=\eightgr\scriptscriptfont\grfam=\sixgr%
%\textfont\grbffam=\ninegrbf\scriptfont\grbffam=\eightgrbf%
%\%textfont\grifam=\ninegri\scriptfont\grbffam=\eightgri%
%\textfont\grttfam=\ninegrtt%
%\textfont\grslfam=\ninegrsl%
%\def\gr{\fam\grfam\ninegr}%		Switch for classic greek
%\let\rg\gr%				Also rg for compatibility
%\def\it{\fam\grifam\ninegri}%		Switch for Greek Italics
%\def\sl{\fam\grslfam\ninegrsl}%		Switch for Greek Slanted
%\def\tt{\fam\grttfam\ninegrtt}%		Switch for Greek Typerwriter
%\def\bf{\fam\grbffam\ninegrbf}%		Switch for Greek Boldface
%\let\git\it\let\gsl\sl%
%\let\gbf\bf\let\gtt\tt%			Retain LaTeX compatibility
%\def\rm{\fam0\tenrm}%			Switch For latin roman
%\def\lit{\fam\itfam\nineit}%		Switch for latin italics
%\def\lsl{\fam\slfam\ninesl}%		Switch for latin slanted
%\def\ltt{\fam\ttfam\ninett}%		Switch for latin typewriter
%\def\lbf{\fam\bffam\ninebf}%		Switch for latin boldface
%\normalbaselineskip=.52cm%		Normal Base Line distance
%\setbox\strutbox=\hbox{\vrule height8pt width0pt depth3pt}%
%\normalbaselines\gr%
%}
%\def\greightpoint{%		GREEK EIGHTPOINT
%\gdef\t@size{\greightpoint}% Make a note of the font size
%\textfont\grfam=\eightgr\scriptfont\grfam=\sixgr\scriptscriptfont\grfam=\sixgr%
%\textfont\grbffam=\eightgrbf\scriptfont\grbffam=\eightgrbf%
%\textfont\grifam=\eightgri\scriptfont\grbffam=\eightgri%
%\textfont\grttfam=\eightgrtt%
%\textfont\grslfam=\eightgrsl%
%\def\gr{\fam\grfam\eightgr}%		Switch for classic greek
%\let\rg\gr%				Also rg for compatibility
%\def\it{\fam\grifam\eightgri}%		Switch for Greek Italics
%\def\sl{\fam\grslfam\eightgrsl}%	Switch for Greek Slanted
%\def\tt{\fam\grttfam\eightgrtt}%	Switch for Greek Typerwriter
%\def\bf{\fam\grbffam\eightgrbf}%	Switch for Greek Boldface
%\let\git\it\let\gsl\sl%
%\let\gbf\bf\let\gtt\tt%			Retain LaTeX compatibility
%\def\rm{\fam0\eightrm}%			Switch For latin roman
%\def\lit{\fam\itfam\eightit}%		Switch for latin italics
%\def\lsl{\fam\slfam\eightsl}%		Switch for latin slanted
%\def\ltt{\fam\ttfam\eighttt}%		Switch for latin typewriter
%\def\lbf{\fam\bffam\eightbf}%		Switch for latin boldface
%\normalbaselineskip=.35cm%		Normal Base Line distance
%\setbox\strutbox=\hbox{\vrule height7pt width0pt depth2pt}%
%\normalbaselines\gr%
%}
%%
%%			Hyphenation Patterns
%%			^^^^^^^^^^^^^^^^^^^^
\message{hyphenation,}
%
{\language\greek
\lefthyphenmin=2 \righthyphenmin=2 % disallow x- or -x breaks
\def\lt{<}%
\def\gt{>}%
\catcode`\|=11%
\catcode`\<=11%
\catcode`\>=11%
\catcode`\'=11%
\catcode`\~=11%
\catcode`\"=11%
\lccode`\<=`\<%
\lccode`\>=`\>%
\lccode`\'=`\'%
\lccode`\~=`\~%
\lccode`\"=`\"%
\lccode`\|=`\|%
%
\input grkhyphen%
\catcode`\~=13%
}
%
\def\showgreekhyphens#1{{\setbox0\vbox{\parfillskip\z@skip\hsize\maxdimen%
\language\greek\tengr\pretolerance\m@ne\hbadness0\showboxdepth0\ #1}}}
%
%
\message{miscellaneous macros}
%
%		Macros For entering greek mode,
%		and delimiter preferences.
%		-------------------------------
%
%	\begingreek : Begin a group of Greek Text.
%	^^^^^^^^^^^^  Everything is enclosed in a group to keep
%	              changes local. Then we switch to greek hyphenation
%		      and iniciate the greekmode. This assigns the correct
%	              \catcode values to punctuation and accentuation marks.
%	              We then reload the information of the point
%	              size used last and switch to the family needed.
%	              The \t@f@nt and \t@f@m macro is used to ensure that 
%	              or fonts and families are remembered.
%
%	\endgreek :   Ends a group of Greek Text.
%	^^^^^^^^^^    Before ending the group we save information
%	              about the current font, to be used when we re-enter 
%	              greek mode.
%
%	\gr@@km@de :  Switches to greek interpretation of ascii characters
%	^^^^^^^^^^^   Normally changes are kept local but can be used
%	              as a general macro to obtain a global greek mode.
%	              Note the different use of | if this is chosen
%	              to be a delimiter.
%
%\def\begingreek{\bgroup\language\greek\gr@@km@de%
%\t@size\t@f@m\t@f@nt\ignorespaces}
% We add the currentsize info
%\def\endgreek{\xdef\t@f@nt{\the\font}\xdef\t@f@m{\noexpand\fam\the\fam}%
%\xdef\t@size{\@currsize}\egroup}
%
% Create a new LaTeX Environment
%
\newenvironment{greektext}{\language\greek\gr@@km@de%
\t@f@m\t@f@nt\ignorespaces}%
{\xdef\t@f@nt{\the\font}\xdef\t@f@m{\noexpand\fam\the\fam}}

\def\gr@@km@de{%
\ifdelimsbar\else\catcode`\|=11\fi%
\catcode`\<=11% 	Turn Everything to letters!
\catcode`\>=11% 	All accents are done through ligatures
\catcode`\'=11%
\catcode`\`=11%
\catcode`\~=11%
\catcode`\"=11%
\lccode`\<=`\<%
\lccode`\>=`\>%
\lccode`\'=`\'%
\lccode`\~=`\~%
\lccode`\"=`\"%
}
%
\def\l@tinm@de{%
\catcode`\|=12%
\catcode`\<=12% 	Turn Everything to what plain tex has
\catcode`\>=12%
\catcode`\'=12%
\catcode`\`=12%
\catcode`\~=13%
\catcode`\"=12%
\catcode`\$=3%	% Restore the math symbol!
}
%
% Switch Permenantly do greek mode
%
\def\setgreek{\delimsbarfalse\gr@@km@de\language\greek}
%
% and to latin as well
%
\def\setlatin{\l@tinm@de\language0}
%
%	It is very frequent that the user will ask to \end the document
%	before a greek group was closed. In order to prevent this we 
%	redefine the \end command after saving the old one in \@ldend.
%	The new \end checks for un-ended greek groups and if it is found
%	a warning message is issued and the group is automatically closed.
%
%	LaTeX: This is not needed in Latex since the greek environment is
%	defined to be a LaTeX Environment so that Latex takes care of that.
%\let\@ldend=\end
%\gdef\end{\ifnum\language=\greek\endgreek%
%\showstring{GreekTeX Warning: A group of greek text was automatically closed}%
%\fi\@ldend}
%
%	Since it is possible that switching from one language to
%	the other is very frequent, a special way to avoid \begingreek
%	and \endgreek is defined. This is done through the definition of
%	delimiters; available delims are | and $. If \greekdelims{bar}
%	is chosen then a greek block is marked as | ..greek text.. |
%	In order to access |, use \|.
%	If $ is used, use \math for math mode and \math\math for
%	display mode.
%
\gdef\greekdelims#1{\edef\c@mp@re{#1}\def\t@st@a{bar}\def\t@st@b{dollar}%
\ifx\c@mp@re\t@st@a\gr@@kdelimsbar\else%
\ifx\c@mp@re\t@st@b\gr@@kdelimsdol\fi\fi}
%
% 	Bar as delimeter
%
{\catcode`\|=13\gdef\gr@@kdelimsbar{\catcode`\|=13\delimsbartrue%
\def|{\ifnum\language=\greek\end{greektext}\else\begin{greektext}\fi}}
}
%
%	Dollar as delimiter
%
\let\m@thm@de=$
{\catcode`\$=13%
\gdef\gr@@kdelimsdol{\catcode`\$=13%
\def${\ifnum\language=\greek\end{greektext}\else\begin{greektext}\fi}%
\global\let\math=\m@thm@de%
\gdef\display{\math\math}\gdef\enddisplay{\math\math}}%
}

% Here we define some handy LaTeX Use macros
\message{LaTeX greek macros,}
%
%	List Enumeration. For more details see the LaTeX explanations
%
\def\alphgr#1{\@alph{\@nameuse{c@#1}}}   
\def\Alphgr#1{\@Alph{\@nameuse{c@#1}}}   

\def\@alphgr#1{\ifcase#1\or a\or b\or g\or d\else\@ialphgr{#1}\fi}
\def\@ialphgr#1{\ifcase#1\or \or \or \or \or e\or st\or z\or h\or j\or i\or
   k\or l\or m\or n\or x\or o\or p\or r\or s\or t\or u\or f\or q\or y\or 
   w\else\@ctrerr\fi}
\def\@Alphgr#1{\ifcase#1\or A\or B\or G\or D\else\@Ialphgr{#1}\fi}
\def\@Ialphgr#1{\ifcase#1\or \or \or \or \or E\or ST\or Z\or H\or J\or I\or
   K\or L\or M\or N\or X\or O\or P\or R\or S\or T\or U\or F\or Q\or Y\or
   W\else\@ctrerr\fi}






\catcode`\@=12 % at signs are no longer letters

%
\def\fmtname{lgreek}\def\fmtversion{LaTeX 2.09 - Greek 3.0[c]} % identifies the current format

\message{version \fmtversion .)}