summaryrefslogtreecommitdiff
path: root/macros/xetex/latex/xgreek/xgreek.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/xetex/latex/xgreek/xgreek.dtx')
-rw-r--r--macros/xetex/latex/xgreek/xgreek.dtx74
1 files changed, 61 insertions, 13 deletions
diff --git a/macros/xetex/latex/xgreek/xgreek.dtx b/macros/xetex/latex/xgreek/xgreek.dtx
index 14a9a59496..864345aa82 100644
--- a/macros/xetex/latex/xgreek/xgreek.dtx
+++ b/macros/xetex/latex/xgreek/xgreek.dtx
@@ -16,7 +16,7 @@
%%
%\iffalse
%
-% (c) Copyright 2007-2018 Apostolos Syropoulos
+% (c) Copyright 2007-2022 Apostolos Syropoulos
% This program can be redistributed and/or modified under the
% terms of the LaTeX Project Public License Distributed from
% http://www.latex-project.org/lppl.txt; either
@@ -29,12 +29,12 @@
% Apostolos Syropoulos (asyropoulos@yahoo.com)
%
%\fi
-% \CheckSum{1913}
-% \iffalse This is a Metacomment
+% \CheckSum{1929}
+% \iffalse This is a Metacommentxel
%
%<xgreek, >\ProvidesFile{xgreek.sty}
%
-%<xgreek, > [2018/02/16 v3.0.1 Package `xgreek.sty']
+%<xgreek, > [2022/08/28 v3.1.0 Package `xgreek.sty']
%
% \begin{macrocode}
%<*driver>
@@ -57,7 +57,7 @@
%\author{Apostolos Syropoulos\\
% Xanthi, Greece\\
% \texttt{asyropoulos@yahoo.com}}
-% \date{2009/11/23\\ Last Updated 2018/02/16}
+% \date{2009/11/23\\ Last Updated 2022/08/22}
%\maketitle
% \begin{abstract}
% The \textsf{xgreek} package provides rudimentary support for Greek language
@@ -87,7 +87,7 @@
% I first need to set up the correct |\uccode|s and |\lccode|s.
% \begin{macrocode}
%<*xgreek>
-\message{Package `xgreek' version 3.0.1 by Apostolos Syropoulos}
+\message{Package 'xgreek' version 3.1.0 by Apostolos Syropoulos}
\global\lccode"0370="0371 \global\uccode"0370="0370
\global\lccode"0371="0371 \global\uccode"0371="0370
\global\lccode"0372="0373 \global\uccode"0372="0372
@@ -576,12 +576,57 @@
\let\numer@lsign\relax
}
% \end{macrocode}
-%
-% By default the |monogreek| option is activated.
+% Package \textsf{listings} does not work properly with UTF-8 encoded files. So this
+% option should be used whenever one wants to use this package and see Greek text come out
+% correctly.
+% \begin{macrocode}
+\newif\if@mylistings
+\@mylistingsfalse
+\DeclareOption{listings}{%
+ \@mylistingstrue
+}
+% \end{macrocode}
+% By default the |monogreek| option is activated.
% \begin{macrocode}
\ExecuteOptions{monogreek}
\ProcessOptions
% \end{macrocode}
+% If the user has enabled the |listings| option, then it loads the package \textsf{listings}
+% and makes a few changes to it. In particular, it redefines the command |\lst@DefEC| and the new
+% comamnd makes all characters in the range 128--255 plus the Greek letters to be treated as letters.
+% \begin{macrocode}
+\if@mylistings
+\RequirePackage{listings}
+\lstset{inputencoding=utf8}
+\lst@InputCatcodes
+\gdef\lst@DefEC{%
+ \lst@CCECUse \lst@ProcessLetter
+ ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f%
+ ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f%
+ ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af%
+ ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf%
+ ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf%
+ ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df%
+ ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef%
+ ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff%
+ ^^^^0396^^^^0388^^^^0389^^^^038a^^^^038c% <--- Begin of Greek Letters
+ ^^^^038e^^^^038f^^^^0390^^^^0391^^^^0392%
+ ^^^^0393^^^^0394^^^^0395^^^^0396^^^^0397%
+ ^^^^0398^^^^0399^^^^039a^^^^039b^^^^039c%
+ ^^^^039d^^^^039e^^^^039f^^^^03a0^^^^03a1%
+ ^^^^03a3^^^^03a4^^^^03a5^^^^03a6^^^^03a7%
+ ^^^^03a8^^^^03a9^^^^03aa^^^^03ab^^^^03ac%
+ ^^^^03ad^^^^03ae^^^^03af^^^^03b0^^^^03b1%
+ ^^^^03b2^^^^03b3^^^^03b4^^^^03b5^^^^03b6%
+ ^^^^03b7^^^^03b8^^^^03b9^^^^03ba^^^^03bb%
+ ^^^^03bc^^^^03bd^^^^03be^^^^03bf^^^^03c0%
+ ^^^^03c1^^^^03c2^^^^03c3^^^^03c4^^^^03c5%
+ ^^^^03c6^^^^03c7^^^^03c8^^^^03c9^^^^03ca%
+ ^^^^03cb^^^^03cc^^^^03cd^^^^03ce% <--- End of Greek Letters
+ ^^00}%
+\lst@RestoreCatcodes
+\fi
+% \end{macrocode}
% Now I am going to define the macros that typeset alphabetic Greek numerals. The code
% is borrowed from the greek option for the babel package.
% \begin{macro}{\gr@ill@value}
@@ -620,8 +665,8 @@
% \end{macro}
%
% \begin{macro}{\@greeknumeral}
-% This command is used to typeset Greek numerals. The command uses
-% |\numer@lsign| to typeset the NUMERAL SIGN. Obviously, when the
+% This command is used to get Greek numerals. The command uses
+% |\numer@lsign| to get the NUMERAL SIGN. Obviously, when the
% user has specified the \texttt{no\-numeral\-sign} option, then numeral
% comes out without the trailing NUMERAL SIGN. However, when a user
% wants to typeset a Greek numeral, the numeral must come out correctly,
@@ -806,11 +851,13 @@
\ifnum\@attic@num<\@ne%
\space%
\PackageWarning{xgreek}{%
- Illegal value (\the\@attic@num) for acrophonic Attic numeral}%
+ Illegal value (\the\@attic@num) for acrophonic
+ Attic numeral}%
\else\ifnum\@attic@num>249999%
\space%
\PackageWarning{xgreek}{%
- Value too large (\the\@attic@num) for acrophonic Attic numeral}%
+ Value too large (\the\@attic@num) for acrophonic
+ Attic numeral}%
\else
% \end{macrocode}
% Having done all the necessary checks, it is possible to proceed with the actual
@@ -939,7 +986,8 @@
\ifx\directlua\undefined%
\def\setlanguage#1{%
\expandafter\ifx\csname l@#1\endcsname\relax%
- \typeout{^^J Error: No hyphenation pattern for language #1 loaded,}%
+ \typeout{^^J Error: No hyphenation pattern for}%
+ \typeout{ language #1 are loaded,}%
\typeout{ default hyphenation patterns are used.^^J}%
\language=0%
\else\language=\csname l@#1\endcsname\fi}