summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/begingreek/begingreek.sty
blob: ab2001ed4e472dd719df986f136203dafd088d65 (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
%%
%% This is file `begingreek.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% begingreek.dtx  (with options: `package')
%% Copyright 2015-2022 Claudio Beccari All rights reserved.
%% 
%%  This system is distributed in the hope that it will be useful,
%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%% This file beginngreek.sty, derived from the begingreek.dtx file,
%% is distributed under the LPPL licence, version 1.3c dated 2008-05-04 or
%% later as it appears in CTAN/macros/latex/base/lppl.tex.
%% 
%% IMPORTANT NOTICE:
%% 
%% You are allowed to modify this file ONLY if you change its name and the name of the source .dtx file. You cannot distribute a modified version of the source and the derived files under the same original name. According to the LPPL, you must keep the original author name, but you must assume the role of the modified version maintenance.
%% 
%% You are allowed to distribute this file under the condition that it is
%% specified in the source file begingreek.dtx.
%% 
%% If you receive only some of these files from someone, complain!
%% 
%% You are NOT ALLOWED to distribute this file alone. You are NOT
%% ALLOWED to take money for the distribution or use of either this
%% file or a modified version, except for a nominal charge for copying
%% etc.
\NeedsTeXFormat{LaTeX2e}[2018/01/01]
\ProvidesPackage{begingreek}[2022/05/06 v.1.7 Defines environment greek]

\usepackage{iftex}
\unless\ifPDFTeX
\PackageError{begingreek}{\MessageBreak
Package `begingreek' works only with `pdfLaTeX'\MessageBreak
Nothing done\MessageBreak
\MessageBreak
Type X to quit}{\@ehd}
\expandafter\endinput
\fi
\unless\ifcsname captionsgreek\endcsname
\PackageError{begingreek}{%
****************************************\MessageBreak
Package `begingreek' may be used only   \MessageBreak
if language `greek' is already defined. \MessageBreak
Check that `begingreek' is loaded after \MessageBreak
`babel' and that the language `greek'   \MessageBreak
has been specified                      \MessageBreak
****************************************\MessageBreak
Type X to quit}{\@ehd}
\expandafter\endinput
\fi
\def\greekfontfamily{lmr}

\DeclareOption*{%
  \IfFileExists{lgr\CurrentOption.fd}%
  {\edef\greekfontfamily{\CurrentOption}}%
  {\PackageWarning{begingreek}{%
    The file lgr\CurrentOption.fd does not exist\MessageBreak
    Either provide such a file, or specify a    \MessageBreak
    valid Greek font family to the              \MessageBreak
    \string\begin\string{greek\string} package  \MessageBreak
    I continue with the default font family     \MessageBreak}%
  }%
}
\ProcessOptions\relax

\def\CBverifyandselectfont{\IfFileExists{lgr\Greekfontfamily.fd}{}%
  {\PackageWarning{begingreek}{\MessageBreak
   Font family lgr\Greekfontfamily.fd does not exist\MessageBreak
   Default fonts used\MessageBreak}%
\def\Greekfontfamily{\greekfontfamily}}%
\fontfamily{\Greekfontfamily}\selectfont}

\newenvironment{greek}[1][\greekfontfamily]{\begin{otherlanguage}{greek}%
\edef\Greekfontfamily{#1}%
\CBverifyandselectfont
}{\end{otherlanguage}}

\newcommand*\greektxt[2][\greekfontfamily]{%
\edef\Greekfontfamily{#1}%
\CBverifyandselectfont
\foreignlanguage{greek}{#2}}


\endinput
%%
%% End of file `begingreek.sty'.