summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-08-06 22:50:27 +0000
committerKarl Berry <karl@freefriends.org>2014-08-06 22:50:27 +0000
commita6e66f64c0294a969fc47bfa9c784cad40d0555c (patch)
tree3d908f5929a89a8c8b83103f0f522064ebac824d /Master/texmf-dist/source/generic
parentc29bf84e74c53725373f5ae4f092b4864dbfa1d6 (diff)
babel-greek (5aug14)
git-svn-id: svn://tug.org/texlive/trunk@34857 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic')
-rw-r--r--Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx241
1 files changed, 197 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx b/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx
index aaacb299664..e3ccbf74ec0 100644
--- a/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx
+++ b/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx
@@ -1,4 +1,5 @@
% \iffalse meta-comment
+% !TEX encoding = UTF-8 Unicode
%
% Copyright 1989-2008 Apostolos Syropoulos, Johannes L. Braams
% and the authors listed elsewhere in this file. All rights reserved.
@@ -25,7 +26,7 @@
% and covered by LPPL is defined by the unpacking script (babel-greek.ins)
% which is part of the package.
% \fi
-% \CheckSum{1218}
+% \CheckSum{1558}
%
% \iffalse
% Tell the \LaTeX\ system who we are and write an entry on the
@@ -36,12 +37,12 @@
%<code>\ProvidesLanguage{greek}
%\fi
%\ProvidesFile{babel-greek.dtx}
- [2013/12/03 v1.8a Greek support for the babel system]
+ [2014/07/20 v1.9 Greek support for the babel system]
%\iffalse
%% File `babel-greek.dtx'
%% Greek language Definition File
%% Copyright © 1997, 2005 Apostolos Syropoulos, Johannes Braams
-%% Copyright © 2013 Günter Milde
+%% Copyright © 2013-2014 Günter Milde
%
%% Please report errors to: Günter Milde <milde@users.sf.net>
%
@@ -108,6 +109,8 @@
% New TextCommands ``greekscript'' and ``ensuregreek''.}
% \changes{greek-1.8a}{2013/12/03}{Set `encodingdefault' in `greekscript'
% to fix Greek in footnotes etc. with document language Greek.}
+% \changes{greek-1.9}{2014/07/20}{Added attribute for ancient Greek.
+% Load correct hyphenation patterns. Patch by Claudio Beccari.}
%
% \title{Babel support for the Greek language}
% \author{Apostolos Syropoulos, Günter Milde}
@@ -126,22 +129,22 @@
% \texttt{dak@neuroinformatik.ruhr-uni-bochum.de} was used to
% enhance the support for typesetting greek texts.} defines all the
% language definition macros for the Greek language, i.e.,
-% as it used today with only one accent, and the attribute
+% as it is used today with only one accent, and the attribute
% \Lopt{polutoniko} for typesetting greek text with all accents
% (classical and polytonic Greek).
%
% \section{Requirements}
-%
-% Typesetting Greek with Babel requires (of course) the
+%
+% Typesetting Greek with Babel requires (of course) the
% \href{http://www.ctan.org/pkg/babel}{Babel core}, support for Greek font
% encodings (\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc})
% and a font supporting the Greek script.
-%
+%
% The \href{http://www.ctan.org/pkg/cbgreek-complete}{CB Greek fonts}
% created by \textsc{Claudio Beccari}\footnote{Apostolos Syropoulos
% wishes to thank Claudio Beccari for his
% patience, collaboration, comments and suggestions.}
-% are a complete set of 8-bit TeX fonts matching \textsc{Knuth}'s
+% are a complete set of 8-bit TeX fonts matching \textsc{Knuth}'s
% Computer Modern.
% The package \pkg{\href{http://www.ctan.org/pkg/cbfonts-fd}{cbfonts-fd}}
% sets them up as Greek substitute for the Computer Modern and Latin Modern
@@ -154,8 +157,8 @@
% default font for XeTeX/LuaTeX does not support the Greek script. The user
% needs to set up an alternative font like Linux Libertine or DejaVu with
% \pkg{\href{http://www.ctan.org/pkg/fontspec}{fontspec}}.
-
-% \section{Usage}
+%
+% \section{Usage}
%
% To activate Greek support with babel, specify the option
% \Lopt{greek}, either as global option or as option to the
@@ -163,20 +166,45 @@
% option determines the document language, e.g.
% \begin{verbatim}
% \usepackage[greek,english]{babel}\end{verbatim}
-% activates support for Greek in an English document while
+% activates support for Greek in an English document.
+% The default is modern ``monotonic'' Greek, while
+% \begin{verbatim}
+% \usepackage[english,greek]{babel}
+% \languageattribute{greek}{polutoniko}
+% \end{verbatim}
+% sets the document language to modern Greek with ``polytonic''
+% spelling and
+% \begin{verbatim}
+% \usepackage[english,greek]{babel}
+% \languageattribute{greek}{ancient}
+% \end{verbatim}
+% sets the document language to ancient Greek.
+%
+% Both attributes may also be used as modifiers as in
+% \begin{verbatim}
+% \usepackage[greek.polytoniko,english]{babel}
+% \end{verbatim}
+% and similarly
% \begin{verbatim}
-% \usepackage[english,greek]{babel}
-% \languageattribute{greek}{polutoniko}\end{verbatim}
-% sets the document language to Greek with ``polytonic''
-% spelling of auto-generated strings.
+% \usepackage[greek.ancient,english]{babel}
+% \end{verbatim}
+%
+% Version 1.9 fixes the activation of hyphenation patterns: By default,
+% \pkg{babel-greek} activates the modern Greek monotonic hyphenation;
+% the attribute/modifier |polutoniko| activates the modern Greek
+% polytonic hyphenation and the attribute/modifier |ancient| activates
+% the ancient Greek hyphenation. 8-bit TeX and XeTeX requires the
+% hyphenation patterns to be pre-loaded in the format file.
+% This is a limitation by TeX, common to all languages.
+% The LuaTeX engine loads hyphenation patterns on demand.
%
% \DescribeMacro\selectlanguage
% \DescribeMacro\foreignlanguage
% The Babel core provides two commands to switch the active language:
-% The declaration \verb|\selectlanguage{greek}| switches to the Greek languages.
+% The declaration |\selectlanguage{greek}| switches to the Greek language.
% The macro \verb|\foreignlanguage{greek}{<some text>}| sets its second argument
% in the Greek language. This is intended for short text parts.
-% For details see the \href{http://www.ctan.org/pkg/babel}{Babel} documentation.
+% For details see the \href{http://www.ctan.org/pkg/babel}{Babel} documentation.
%
% For backwards compatibility, ``polytonic'' spelling can also be
% selected via the dummy language \Lopt{polutonikogreek}. In this
@@ -187,13 +215,13 @@
%
% \subsection{Input of Greek text}
%
-% There are several alternatives for input of Greek text.
+% There are several alternatives to write Greek text.
% \begin{itemize}
% \item With the packages \pkg{inputenc} and
% \pkg{\href{http://www.ctan.org/pkg/greek-inputenc}{greek-inputenc}},
% literal Greek characters can be input using the utf-8, iso-8859-7,
% or macgreek encoding.
-%
+%
% Literal input using the utf-8 encoding is also the standard input
% method if compiling with the XeTeX and LuaTeX engines.
%
@@ -204,10 +232,10 @@
% \pkg{\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc}}
% defines \emph{LaTeX internal character representation} (LICR) macros
% for Greek letters and text symbols. It is required by \pkg{babel-greek},
-% so the |\textAlpha| \ldots |\textomega|
-% macros are a save but cumbersome method to input Greek characters.
+% so the |\textAlpha| \ldots |\textomega|
+% macros are a safe but cumbersome method to input Greek characters.
%
-% \item The \pkg{alphabeta} package bundled with
+% \item The \pkg{alphabeta} package bundled with
% \href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} makes the
% short macro names |\Alpha| \ldots |\omega| available in text mode, too.
% \end{itemize}
@@ -219,9 +247,9 @@
% Greek script is supported.
% With 8-bit LaTeX, Greek text fonts use a non-standard
% font encoding\footnote{LaTeX font encodings are described in
-% the \emph{LaTeX font guide} (fntguide.pdf).}
+% the \emph{LaTeX font guide} (fntguide.pdf).}
% (LGR) that misses Latin letters. Latin characters in the source are
-% instead interpreted as a transcription for Greek symbols.
+% instead interpreted as a transcription for Greek characters.
% The following macros allow the use of Greek vs. Latin script without
% changing the active language.
% \DescribeMacro\greekscript
@@ -318,16 +346,35 @@
\gdef\CurrentOption{greek}%
% \end{macrocode}
%
+% Hyphenation patterns:
% When this file is read as an option, i.e. by the |\usepackage|
% command, \texttt{greek} could be an `unknown' language in
% which case we have to make it known. So we check for the
-% existence of |\l@greek| to see whether we have to do
-% something here.
-%
+% existence of the three variants of the Greek language
+% |\l@greek|, |\l@monogreek|, and |l@ancientgreek| to see whether
+% we have to do something here.
+% \changes{greek-1.9}{2014/07/20}{Support all 3 language (hyphenation)
+% variants.}
% \begin{macrocode}
\ifx\l@greek\@undefined
\@nopatterns{greek}
- \adddialect\l@greek0\fi
+ \adddialect\l@greek 0\fi
+\ifx\l@monogreek\@undefined
+ \adddialect\@monogreek 0\fi
+\ifx\l@ancientgreek\@undefined
+ \adddialect\@ancientgreek 0\fi
+\newcount\bbl@monogreek \bbl@monogreek=\l@monogreek
+\newcount\bbl@polygreek \bbl@polygreek=\l@greek
+\newcount\bbl@ancientgreek \bbl@ancientgreek=\l@ancientgreek
+% \end{macrocode}
+% The |\extrasgreek| macro is called when switching the language to Greek.
+% We collect code for polytonic and ancient greek in the macros
+% |extraspolutonikogreek| and |extrasancientgreek| and it later to
+% |extrasgreek|.
+% \begin{macrocode}
+\addto\extrasgreek{\let\l@greek\bbl@monogreek\relax}
+\addto\extraspolutonikogreek{\l@greek=\bbl@polygreek}
+\addto\extrasancientgreek{\l@greek=\bbl@ancientgreek}
% \end{macrocode}
%
% Now we declare the |polutoniko| language attribute.
@@ -336,16 +383,19 @@
% \end{macrocode}
% This code adds the expansion of |\extraspolutonikogreek| to
% |\extrasgreek| and changes the definition of |\today| for Greek
-% to produce polytonic month names.
+% to produce polytonic month names (by re-defining |\gr@month|).
% \begin{macrocode}
\expandafter\addto\expandafter\extrasgreek
- \expandafter{\extraspolutonikogreek}%
+ \expandafter{\extraspolutonikogreek}%
\let\captionsgreek\captionspolutonikogreek
\let\gr@month\gr@c@month
% \end{macrocode}
% We need to take some extra precautions in order not to break
% older documents which still use the old \Lopt{polutonikogreek}
-% option.
+% pseuso-language option: language switching commands like
+% |\selectlanguage{polutonikogreek}|, call the
+% |extraspolutonikogreek| macro, set the language to |\l@polutonikogreek|
+% and use |\datepolutonikogreek| for |\today|. We define aliases:
% \changes{greek-1.3f}{1999/09/29}{Added some code to make older
% documents work}
% \changes{greek-1.3g}{2000/02/04}{\cs{noextraspolutonikogreek} was
@@ -357,12 +407,32 @@
\let\noextraspolutonikogreek\noextrasgreek
}
% \end{macrocode}
+% The |ancient| language attribute is used for classical Greek.
+% \changes{greek-1.9}{2014/07/20}{Add support for ancient Greek.}
+% \begin{macrocode}
+\bbl@declare@ttribute{greek}{ancient}{%
+% \end{macrocode}
+% This attribute adds the expansion of |\extraspolutonikogreek| and
+% |\extrasancientgreek| to |\extrasgreek| to set up support for
+% multi-accented characters and ancient hyphenation patterns.
+% Auto-strings (captions) are specific to ancient Greek while |\today|
+% uses modern polytonic month names (as there existed incompatible
+% sets of month names and no common calendar in ancient Greece.
+% \begin{macrocode}
+ \expandafter\addto\expandafter\extrasgreek
+ \expandafter{\extraspolutonikogreek}% multi-accented letters
+ \expandafter\addto\expandafter\extrasgreek
+ \expandafter{\extrasancientgreek}%
+ \let\captionsgreek\captionsancientgreek
+ \let\gr@month\gr@c@month % (modern) polytonic month names
+ }
+% \end{macrocode}
%
% \section{Font setup}
%
% Typesetting Greek texts requires a font with Greek characters:
%
-% For 8-bit LaTeX, this package uses fonts with the
+% For 8-bit LaTeX, this package uses fonts with the
% \href{http://www.ctan.org/pkg/greek-fontenc}{LGR font encoding}.
% With the XeTeX or LuaTeX engines and Unicode fonts, the user must ensure
% that the selected font contains the required glyphs.
@@ -377,7 +447,7 @@
% \changes{greek-1.5}{2013/06/21}{LGR setup skipped with XeTeX/LuaTeX}
% \changes{greek-1.7}{2013/09/09}{Do not load euenc.def with XeTeX/LuaTeX
% (too complicated to get it right).}
-% \changes{greek-1.8}{2013/11/30}{Check for EU1/EU2 font encoding
+% \changes{greek-1.8}{2013/11/30}{Check for EU1/EU2 font encoding
% instead of engine}
%
% \DescribeMacro\greekfontencoding
@@ -465,7 +535,7 @@
% \changes{greek-1.5}{2013/05/27}{enable use of "textcomp" characters
% for "textcopyright" and "textregistered" macros}
% \changes{greek-1.5}{2013/06/15}{\textbackslash & made TextCommand}
-%
+%
% \begin{macrocode}
\ProvideTextCommand{\textcopyright}{LGR}{\textlatin{\textcopyright}}
\ProvideTextCommand{\textregistered}{LGR}{\textlatin{\textregistered}}
@@ -544,7 +614,7 @@
% \end{macrocode}
% \end{macro}
%
-% \section{Definitions for the Greek language}
+% \section{Definitions for the Greek language}
%
% The next step consists in defining commands to switch to (and
% from) the Greek language.
@@ -646,6 +716,59 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{babel-greek-1.9}{2014/07/20}{Added caption names for
+% \cs{ancientgreek}}
+%
+% \begin{macro}{\captionsancientgreek}
+% For texts written in ancient Greek, we took
+% the translations from Apostolos Syropoulos' |xgreek| package. For
+% now we just add extra definitions to |\captionsgreek| in order to
+% override the earlier definitions.
+% \begin{macrocode}
+\let\captionsancientgreek\captionsgreek
+\addto\captionsancientgreek{%
+ \def\prefacename{\textPi\textrho\textomicron\textomicron\acctonos\textiota\textmu
+ \textiota\textomicron\textnu}%
+ \def\refname{\>\textAlpha\textnu\textalpha\textphi\textomicron\textrho
+ \textalpha\accvaria\textiota}%
+ \def\abstractname{\textPi\textepsilon\textrho\acctonos\textiota\textlambda\texteta
+ \textpsi\textiota\textvarsigma}%
+ \def\bibname{\textBeta\textiota\textbeta\textlambda\textiota\textomicron
+ \textgamma\textrho\textalpha\textphi\acctonos\textiota\textalpha}%
+ \def\chaptername{\textKappa\textepsilon\textphi\acctonos\textalpha\textlambda
+ \textalpha\textiota\textomicron\textnu}%
+ \def\appendixname{\textPi\textalpha\textrho\acctonos\textalpha\textrho\texttau
+ \texteta\textmu\textalpha}%
+ \def\contentsname{\textPi\textepsilon\textrho\textiota\textepsilon\textchi
+ \acctonos\textomicron\textmu\textepsilon\textnu\textalpha}%
+ \def\listfigurename{\textKappa\textalpha\texttau\acctonos\textalpha\textlambda
+ \textomicron\textgamma\textomicron\textvarsigma{}
+ \textsigma\textchi\texteta\textmu\acctonos\textalpha\texttau\textomega\textnu}%
+ \def\listtablename{\textKappa\textalpha\texttau\acctonos\textalpha\textlambda
+ \textomicron\textgamma\textomicron\textvarsigma{}
+ \textpi\textiota\textnu\acctonos\textalpha\textkappa\textomega\textnu}%
+ \def\indexname{\textEpsilon\<\textupsilon\textrho\textepsilon\texttau
+ \acctonos\texteta\textrho\textiota\textomicron\textnu}%
+ \def\figurename{\textSigma\textchi\accperispomeni\texteta\textmu\textalpha}%
+ \def\tablename{\textPi\acctonos\textiota\textnu\textalpha\textxi}%
+ \def\partname{\textMu\acctonos\textepsilon\textrho\textomicron\textvarsigma}%
+ \def\enclname{\textSigma\textupsilon\textnu\texteta\textmu\textmu
+ \acctonos\textepsilon\textnu\textomega\textvarsigma}%
+ \def\ccname{\textKappa\textomicron\textiota\textnu\textomicron\textpi
+ \textomicron\acctonos\textiota\texteta\textsigma\textiota\textvarsigma}%
+ \def\headtoname{\textPi\textrho\accvaria\textomicron\textvarsigma}%
+ \def\pagename{\textSigma\textepsilon\textlambda\accvaria\textiota\textvarsigma}%
+ \def\seename{\<`\textomicron\textrho\textalpha}%
+ \def\alsoname{\<`\textomicron\textrho\textalpha{} \<\textomega\textsigma
+ \textalpha\acctonos\textupsilon\texttau\textomega\textvarsigma}%
+ \def\proofname{\>\textAlpha\textpi\acctonos\textomicron\textdelta\textepsilon
+ \textiota\textxi\textiota\textvarsigma}%
+ \def\glossaryname{\textGamma\textlambda\textomega\textsigma\textsigma
+ \acctonos\textalpha\textrho\textiota\textomicron\textnu}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\gr@month}
% \changes{greek-1.1e}{1997/10/12}{Macro added}
% \begin{macro}{\dategreek}
@@ -960,7 +1083,6 @@
For correct up/down-casing of Greek text,\MessageBreak
install the "polyglossia" package}%
}
- \addto\extraspolutonikogreek{} % prevent command missing error.
}{}
% \end{macrocode}
%
@@ -1018,17 +1140,45 @@
% greek}
% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
% \cs{extraspolutonikogreek} should be complementary}
+% \changes{babel-greek-1.9}{2014/07/20}{Added lc codes for chars 128 to 255}
+% In order to process the suitable characters and in such a way that
+% hyphenation patterns work also with precomposed characters, it is
+% necessary to declare the lc code for all characters, that can be part
+% of a word. We do this in |\extrasgreek| because this is a feature of
+% the LGR font encoding (which is the same in all language variants).
+% This means that multi-accented characters are regarded parts of a word
+% (and not non-word characters) also in monotonic spelling.
+%
% \begin{macrocode}
\addto\extrasgreek{%
\babel@savevariable{\lccode`v}\lccode`v=`v%
\babel@savevariable{\lccode`\'}\lccode`\'=`\'%
- \babel@savevariable{\lccode`\"}\lccode`\"=`\"}
+ \babel@savevariable{\lccode`\"}\lccode`\"=`\"%
+ % ``high bit characters'': set in a loop and correct exceptions
+ \@tempcnta=128
+ \@whilenum\@tempcnta<253\do{%
+ \babel@savevariable{\lccode\@tempcnta}\lccode\@tempcnta=\@tempcnta
+ \advance\@tempcnta\@ne
+ }
+ % Fix non-word characters:
+ \lccode151=0
+ \lccode155=0
+ \lccode159=0
+ \lccode199=0
+ % Fix capital letters:
+ \lccode195=147 % GREEK LETTER DIGAMMA
+ \lccode219=240 % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+ \lccode223=244 % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+ }
+
\addto\extraspolutonikogreek{%
+ % \l@greek=\bbl@polygreek
\babel@savevariable{\lccode`\<}\lccode`\<=`\<%
\babel@savevariable{\lccode`\>}\lccode`\>=`\>%
\babel@savevariable{\lccode`\~}\lccode`\~=`\~%
\babel@savevariable{\lccode`\|}\lccode`\|=`\|%
- \babel@savevariable{\lccode`\`}\lccode`\`=`\`}
+ \babel@savevariable{\lccode`\`}\lccode`\`=`\`
+ }
% \end{macrocode}
% And in order to get rid of all accents and breathings when a
% string is |\uppercase|d we also change a number of uppercase
@@ -1059,7 +1209,8 @@
\babel@savevariable{\uccode`\>}\uccode`\>=159%
\babel@savevariable{\uccode`\<}\uccode`\<=159%
\babel@savevariable{\uccode`\|}\uccode`\|=`\|%
- \babel@savevariable{\uccode`\`}\uccode`\`=159}
+ \babel@savevariable{\uccode`\`}\uccode`\`=159
+ }
% \end{macrocode}
% For this to work we make the character |^^9f| a shorthand that
% expands to nothing. In order for this to work we need to make a
@@ -1092,12 +1243,14 @@
% \changes{greek-1.5}{2013/05/27}{Bugfix: @hiatus->LGR@hiatus}
% \changes{greek-1.5a}{2013/07/02}{Replaced non-printable literal character
% with ^^-notation (thanks to Heiko Oberdiek for the hint).}
+% \changes{greek-1.9}{2014/07/20}{The |^^|-notation seems to require lower case
+% letters. |^^9F| failed.}
% \begin{macrocode}
- \DeclareTextCompositeCommand{\"}{LGR}{^^9F}{\accdialytika}
- \DeclareTextCompositeCommand{\'}{LGR}{^^9F}{\LGR@hiatus}
- \DeclareTextCompositeCommand{\`}{LGR}{^^9F}{\LGR@hiatus}
- \DeclareTextCompositeCommand{\<}{LGR}{^^9F}{\LGR@hiatus}
- \DeclareTextCompositeCommand{\>}{LGR}{^^9F}{\LGR@hiatus}
+ \DeclareTextCompositeCommand{\"}{LGR}{^^9f}{\accdialytika}
+ \DeclareTextCompositeCommand{\'}{LGR}{^^9f}{\LGR@hiatus}
+ \DeclareTextCompositeCommand{\`}{LGR}{^^9f}{\LGR@hiatus}
+ \DeclareTextCompositeCommand{\<}{LGR}{^^9f}{\LGR@hiatus}
+ \DeclareTextCompositeCommand{\>}{LGR}{^^9f}{\LGR@hiatus}
% \end{macrocode}
%
% We can also make the tilde character itself expand to a tilde with