summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/begingreek/begingreek.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/begingreek/begingreek.dtx')
-rw-r--r--macros/latex/contrib/begingreek/begingreek.dtx27
1 files changed, 14 insertions, 13 deletions
diff --git a/macros/latex/contrib/begingreek/begingreek.dtx b/macros/latex/contrib/begingreek/begingreek.dtx
index c5a084de0d..86e3ae46ff 100644
--- a/macros/latex/contrib/begingreek/begingreek.dtx
+++ b/macros/latex/contrib/begingreek/begingreek.dtx
@@ -39,10 +39,10 @@ etc.
%\fi
% \iffalse
%<*dtx>
-\ProvidesFile{begingreek.dtx}[2022/05/06 v.1.6 Dedescribes environment greek]
+\ProvidesFile{begingreek.dtx}[2022/05/06 v.1.7 Describes environment greek]
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[2018/01/01]
-%<package>\ProvidesPackage{begingreek}[2022/05/06 v.1.6 Defines environment greek]
+%<package>\ProvidesPackage{begingreek}[2022/05/06 v.1.7 Defines environment greek]
%
%<*driver>
\documentclass{ltxdoc}
@@ -78,7 +78,7 @@ etc.
\end{document}
%</driver>
% \fi
-%\CheckSum{86}
+%\CheckSum{77}
%\begin{multicols}{2}\tableofcontents\end{multicols}
%
% \begin{abstract}
@@ -424,15 +424,21 @@ Type X to quit}{\@ehd}
% we reset it to the default, either the overall default or the package
% defined default (saved in |\greekfontfamily|) so we can proceed without
% further problems.
+%
+% Let us define the message to be issued from the environment or the command if the |fd| file relative to the chosen font is not found and to select it or the default one:
% \begin{macrocode}
-\newenvironment{greek}[1][\greekfontfamily]{\begin{otherlanguage}{greek}%
-\edef\Greekfontfamily{#1}%
-\IfFileExists{lgr\Greekfontfamily.fd}{}%
+\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
+\fontfamily{\Greekfontfamily}\selectfont}
+% \end{macrocode}
+
+% \begin{macrocode}
+\newenvironment{greek}[1][\greekfontfamily]{\begin{otherlanguage}{greek}%
+\edef\Greekfontfamily{#1}%
+\CBverifyandselectfont
}{\end{otherlanguage}}
% \end{macrocode}
@@ -442,12 +448,7 @@ Type X to quit}{\@ehd}
% \begin{macrocode}
\newcommand*\greektxt[2][\greekfontfamily]{%
\edef\Greekfontfamily{#1}%
-\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
+\CBverifyandselectfont
\foreignlanguage{greek}{#2}}
% \end{macrocode}