diff options
Diffstat (limited to 'Master/texmf-dist/source/generic/babel-greek/greek.dtx')
-rw-r--r-- | Master/texmf-dist/source/generic/babel-greek/greek.dtx | 220 |
1 files changed, 130 insertions, 90 deletions
diff --git a/Master/texmf-dist/source/generic/babel-greek/greek.dtx b/Master/texmf-dist/source/generic/babel-greek/greek.dtx index 0e878bf22d4..0581b25f996 100644 --- a/Master/texmf-dist/source/generic/babel-greek/greek.dtx +++ b/Master/texmf-dist/source/generic/babel-greek/greek.dtx @@ -1,11 +1,11 @@ % \iffalse meta-comment % -% Copyright 1989-2008 Johannes L. Braams and any individual authors -% listed elsewhere in this file. All rights reserved. -% -% This file is part of the Babel system. -% -------------------------------------- -% +% Copyright 1989-2008 Apostolos Syropoulos, Johannes L. Braams +% and the authors listed elsewhere in this file. All rights reserved. +% +% This file is part of the babel-greek package. +% --------------------------------------------- +% % It may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. @@ -13,20 +13,19 @@ % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2003/12/01 or later. -% +% % This work has the LPPL maintenance status "maintained". -% -% The Current Maintainer of this work is Johannes Braams. -% -% The list of all files belonging to the Babel system is -% given in the file `manifest.bbl. See also `legal.bbl' for additional -% information. -% -% The list of derived (unpacked) files belonging to the distribution -% and covered by LPPL is defined by the unpacking scripts (with -% extension .ins) which are part of the distribution. +% +% The Current Maintainer of this work is G\"unter Milde <milde@users.sf.net>. +% +% Babel-greek is a contributed package providing support for the Greek +% language and script via the Babel system (http://www.ctan.org/pkg/babel). +% +% The list of derived (unpacked) files belonging to this work +% and covered by LPPL is defined by the unpacking script (greek.ins) +% which is part of the package. % \fi -% \CheckSum{636} +% \CheckSum{660} % % \iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -37,8 +36,8 @@ %<code>\ProvidesLanguage{greek} %\fi %\ProvidesFile{greek.dtx} - [2005/03/30 v1.3l Greek support from the babel system] -%\iffalse + [2013/05/17 v1.4 Greek support from the babel system] +%\iffalse %% File `greek.dtx' %% Babel package for LaTeX version 2e %% Copyright (C) 1989 -- 2005 @@ -49,19 +48,17 @@ %% by Apostolos Syropoulos %% Johannes Braams, TeXniek % -%% Please report errors to: Apostolos Syropoulos -%% apostolo at platon.ee.duth.gr or -%% apostolo at obelix.ee.duth.gr -%% (or J.L. Braams <babel at braams.cistron.nl) +%% Please report errors to: G\"unter Milde <milde@users.sf.net> % -% This file is part of the babel system, it provides the source +% This file is part of the babel-greek package, it provides the source % code for the greek language definition file. The original % version of this file was written by Apostolos Syropoulos. % It was then enhanced by adding code from kdgreek.sty from David % Kastrup <dak@neuroinformatik.ruhr-uni-bochum.de> with his -% consent. +% consent. %<*filedriver> \documentclass{ltxdoc} +% \usepackage{lmodern} \newcommand*{\TeXhax}{\TeX hax} \newcommand*{\babel}{\textsf{babel}} \newcommand*{\langvar}{$\langle \mathit lang \rangle$} @@ -78,19 +75,20 @@ % % \changes{greek-1.0b}{1996/07/10}{Replaced \cs{undefined} with % \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency -% with \LaTeX} +% with \LaTeX} % \changes{greek-1.0b}{1996/10/10}{Moved the definition of % \cs{atcatcode} right to the beginning} % \changes{greek-1.2}{1997/10/28}{Classical Greek is now a dialect} -% \changes{greek-1.2b}{1997/11/01}{Classical Greek is now called +% \changes{greek-1.2b}{1997/11/01}{Classical Greek is now called % ``Polutoniko'' Greek. The previous name was at least misleading} % \changes{greek-1.2c}{1998/06/26}{This version conforms to version -% 2.0 of the CB fonts and consequently we added a few new -% symbol-producing commands} +% 2.0 of the CB fonts and consequently we added a few new +% symbol-producing commands} % \changes{greek-1.3a}{1998/07/04}{polutoniko is now an attribute to % Greek, no longer a `dialect'} +% \changes{greek-1.4}{2013/05/17}{new maintainer} % -% \section{The Greek language} +% \section{Babel support for the Greek language} % % The file \file{\filename}\footnote{The file described in this % section has version number \fileversion\ and was last revised on @@ -121,7 +119,7 @@ % while the command |\textol| typests a short text in outline font. % A number of extra greek characters are made available through the % added text commands |\stigma|, |\qoppa|, |\sampi|, |\ddigamma|, -% |\Digamma|, |\euro|, |\permill|, and |\vardigamma|. +% |\Digamma|, |\euro|, |\permill|, and |\vardigamma|. % % \subsection{Typing conventions} % @@ -141,19 +139,19 @@ % % \subsection{Greek numbering} % -% The Greek alphabetical numbering system, like the Roman one, is -% still used in everyday life for short enumerations. Unfortunately +% The Greek alphabetical numbering system, like the Roman one, is +% still used in everyday life for short enumerations. Unfortunately % most Greeks don't know how to write Greek numbers bigger than 20 or % 30. Nevertheless, in official editions of the last century and % beginning of this century this numbering system was also used for % dates and numbers in the range of several thousands. Nowadays % this numbering system is primary used by the Eastern Orthodox % Church and by certain scholars. It is hence necessary to be able -% to typeset any Greek numeral up to \hbox{999\,999}. Here are the +% to typeset any Greek numeral up to \hbox{999\,999}. Here are the % conventions: % \begin{itemize} % \item There is no Greek numeral for any number less than or equal -% to $0$. +% to $0$. % \item Numbers from $1$ to $9$ are denoted by letters alpha, beta, % gamma, delta, epsilon, stigma, zeta, eta, theta, followed by a % mark similar to the mathematical symbol ``prime''. (Nowadays @@ -161,7 +159,7 @@ % $6$. Mainly because the letter stigma is not always available, so % people opt to write down the first two letters of its name as an % alternative. In our implementation we produce the letter stigma, -% not the digraph sigma tau.) +% not the digraph sigma tau.) % \item Decades from $10$ to $90$ are denoted by letters iota, % kappa, lambda, mu, nu, xi, omikron, pi, qoppa, again followed by % the numeric mark. The qoppa used for this purpose has a special @@ -169,7 +167,7 @@ % `q'-like qoppa. % \item Hundreds from $100$ to $900$ are denoted by letters rho, % sigma, tau, upsilon, phi, chi, psi, omega, sampi, followed by the -% numeric mark. +% numeric mark. % \item Any number between $1$ and $999$ is obtained by a group of % letters denoting the hundreds decades and units, followed by a % numeric mark. @@ -177,27 +175,29 @@ % the mark is placed in front of the letter, and under the baseline % (it is inverted by 180 degrees). When a group of letters denoting % thousands is followed by a group of letters denoting a number -% under $1000$, then both marks are used. +% under $1000$, then both marks are used. % \end{itemize} % -% Using these conventions one obtains numbers up to \hbox{999\,999}. +% Using these conventions one obtains numbers up to \hbox{999\,999}. % \DescribeMacro{\greeknumeral} % The command |\greeknumeral| makes it possible to typeset Greek % numerals. There is also an -% \DescribeMacro{\Greeknumeral} +% \DescribeMacro{\Greeknumeral} % ``uppercase'' version of this macro: |\Greeknumeral|. % % Another system which was in wide use only in Athens, could -% express any positive number. This system is implemented in -% package |athnum|. +% express any positive number. This system is implemented in +% package |athnum|. % % \StopEventually{} % +% \subsection{Implementation} +% % The macro |\LdfInit| takes care of preventing that this file is % loaded more than once, checking the category code of the % \texttt{@} sign, etc. % \changes{greek-1.0b}{1996/11/02}{Now use \cs{LdfInit} to perform -% initial checks} +% initial checks} % \begin{macrocode} %<*code> \LdfInit\CurrentOption{captions\CurrentOption} @@ -248,19 +248,22 @@ } % \end{macrocode} % -% Typesetting Greek texts implies that a special set of fonts needs -% to be used. The current support for greek uses the |cb| fonts +% Typesetting Greek texts requires a font containing Greek letters. +% For 8-bit LaTeX this package uses fonts with the LGR font encoding +% (see the `greek-fontenc' package http://www.ctan.org/pkg/greek-fontenc). +% The |cb| fonts % created by Claudio Beccari\footnote{Apostolos Syropoulos wishes % to thank him for his patience, collaboration, cooments and -% suggestions.}. The |cb| fonts provide all sorts of \textit{font -% combinations}. In order to use these fonts we define the Local -% GReek encoding (LGR, see the file \file{greek.fdd}). We make sure -% that this encoding is known to \LaTeX, and if it isn't we abort. +% suggestions.} are a set of Greek text fonts matching +% Computer Modern. They provide all sorts of \textit{font +% combinations}. We make sure +% that the LGR encoding is known to \LaTeX, and if it isn't we abort. % \changes{greek-1.2a}{1997/10/31}{filename \file{lgrenc.def} now % lowercase} +% \changes{greek-1.4}{2013/05/17}{\file{lgrenc.def} moved to the +% separate package `greek-fontenc'} % \begin{macrocode} -\InputIfFileExists{lgrenc.def}{% - \message{Loading the definitions for the Greek font encoding}}{% +\InputIfFileExists{lgrenc.def}{}{% \errhelp{I can't find the lgrenc.def file for the Greek fonts}% \errmessage{Since I do not know what the LGR encoding means^^J I can't typeset Greek.^^J @@ -268,13 +271,54 @@ } % \end{macrocode} % +% We define a few commands in the \texttt{LGR} encoding +% to work around problems because LGR is no \emph{standard text +% encoding}.\footnote{% +% The current implementation has the disadvantage that it makes +% the symbols from the package `textcomp' inaccessible if the active font +% encoding is LGR.} +% \changes{greekfdd-2.2c}{1999/04/05}{Fixed typos, \cs{textrademark} +% misses a `t', \cs{copyright} should be \cs{textcopyright}} +% \changes{greekfdd-2.2d}{1999/04/25}{removed redefinition of \cs{\&}} +% \changes{greek-1.4}{2013/05/17}{moved here from \file{lgrenc.def} because +% the definitions require the \texttt{\textbackslash latintext} macro +% defined by Babel.} +% \begin{macrocode} +\ProvideTextCommand{\textcopyright}{LGR}{% + \textcircled{\textlatin{c}}} +\ProvideTextCommand{\textregistered}{LGR}{% + \textcircled{\textlatin{\textsc r}}} +\ProvideTextCommand{\texttrademark}{LGR}{% + \textsuperscript{\textlatin{TM}}} +\ProvideTextCommand{\SS}{LGR}{% + \textlatin{SS}} +% \end{macrocode} +% +% Later in this file, the charcter No 159 is defined as uppercase of +% |<|, |>|, |~|, |`|, |'|, |"| and \verb=|=. +% Add composite commands, so that the dialytika is kept or put on the +% following character with |\MakeUppercase| +% (see lgrdef.enc from the the greek-fontenc package for details). +% As a the TextCompositeCommand mechanism compares the +% unexpanded literal strings, we need the literal character in the +% declarations, too. +% \changes{greek-1.4}{2013/05/17}{Add TextCompositeCommands for ``uppercase +% diacritics''.} +% \begin{macrocode} +\DeclareTextCompositeCommand{\"}{LGR}{Ÿ}{\accdialytika} +\DeclareTextCompositeCommand{\'}{LGR}{Ÿ}{\@hiatus} +\DeclareTextCompositeCommand{\`}{LGR}{Ÿ}{\@hiatus} +\DeclareTextCompositeCommand{\<}{LGR}{Ÿ}{\@hiatus} +\DeclareTextCompositeCommand{\>}{LGR}{Ÿ}{\@hiatus} +% \end{macrocode} +% % Now we define two commands that offer the possibility to switch -% between Greek and Roman encodings. +% to the LGR font encoding. Babel defines corresponding macros +% to switch to a Latin font encoding. % % \begin{macro}{\greektext} -% The command |\greektext| will switch from Latin font encoding to -% the Greek font encoding. This assumes that the `normal' font -% encoding is a Latin one. This command is a \emph{declaration}, +% The command |\greektext| will switch to +% a Greek font encoding. This command is a \emph{declaration}, % for shorter pieces of text the command |\textgreek| should be % used. % \begin{macrocode} @@ -289,9 +333,9 @@ % requested font encoding. In order to avoid many encoding switches % it operates in a local scope. % \changes{greek-1.0b}{1996/09/23}{Added a level of braces to keep -% encoding change local} +% encoding change local} % \changes{greek-1.3k}{2003/03/19}{Added \cs{leavevmode} as was done -% with \cs{latintext}} +% with \cs{latintext}} % \begin{macrocode} \DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}} % \end{macrocode} @@ -321,7 +365,7 @@ \providehyphenmins{\CurrentOption}{\@ne\@ne} % \end{macrocode} % \end{macro} -% +% % \changes{greek-1.1e}{1997/10/12}{Added caption name for proof} % \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe ep'ishc} % instead of \texttt{bl'pe ep'ishc}} @@ -354,7 +398,7 @@ \def\seename{bl'epe}% \def\alsoname{bl'epe ep'ishs}% \def\proofname{Ap'odeixh}% - \def\glossaryname{Glwss'ari}% + \def\glossaryname{Glwss'ari}% } % \end{macrocode} % \end{macro} @@ -392,7 +436,7 @@ % \changes{greek-1.1a}{1997/03/03}{Fixed typo, \texttt{Oktwbr'iou} % instead of \texttt{Oktobr'iou}} % \changes{greek-1.1d}{1997/10/12}{Macro \cs{gr@month} now produces -% the name of the month} +% the name of the month} % \changes{greek-1.2a}{1997/10/31}{Use \cs{edef} to define \cs{today}} % \changes{greek-1.2b}{1998/03/28}{use \cs{def} instead of \cs{edef}} % \begin{macrocode} @@ -442,7 +486,7 @@ % to cancel the actions of |\extrasgreek|. For the moment these % macros switch the fontencoding used and the definition of the % internal macros |\@alph| and |\@Alph| because in Greek we do use -% the Greek numerals. +% the Greek numerals. % % \begin{macrocode} \addto\extrasgreek{\greektext} @@ -534,7 +578,7 @@ % \end{macro} % % \begin{macro}{\Greeknumeral} -% The command |\Greeknumeral| prints uppercase greek numerals. +% The command |\Greeknumeral| prints uppercase greek numerals. % The parsing is performed by the macro |\greeknumeral|. % \begin{macrocode} \def\Greeknumeral#1{% @@ -558,7 +602,7 @@ % \end{macrocode} % Then we define the Greek versions; the additional |\expandafter|s % are needed in order to make sure the table of contents will be -% correct, e.g., when we have appendixes. +% correct, e.g., when we have appendixes. % \begin{macrocode} \def\greek@alph#1{\expandafter\greeknumeral\expandafter{\the#1}} \def\greek@Alph#1{\expandafter\Greeknumeral\expandafter{\the#1}} @@ -583,7 +627,7 @@ % \changes{greek-1.2e}{1999/04/16}{Moved redefinition of \cs{@roman} % back to the language specific file} % \changes{greek-1.3d}{1999/08/27}{\cs{@roman} and \cs{@Roman} need to -% be added to \cs{extraspolutonikogreek}} +% be added to \cs{extraspolutonikogreek}} % \changes{greek-1.3e}{1999/09/24}{\cs{@roman} and \cs{@Roman} need % \emph{not} be in \cs{extraspolutonikogreek} when they are already % in \cs{extrasgreek}} @@ -614,7 +658,7 @@ % command |\&| dosn't give the expected result if we do not do % something about it. % \changes{greek-1.2f}{1999/04/25}{Now switch the definition of -% \cs{\&} from \cs{extrasgreek}} +% \cs{\&} from \cs{extrasgreek}} % \changes{greek-1.3c}{1999/05/17}{Added a missing opening brace} % \begin{macrocode} \let\ltx@amp\& @@ -635,7 +679,7 @@ % expandable} % As there is no representation for $0$ in this system the zeros % are simply discarded. When we have a large number with three -% \emph{trailing} zero's also the numeric mark is discarded. +% \emph{trailing} zero's also the numeric mark is discarded. % Therefore these macros need to pass the information to each other % about the (non-)translation of a zero. % \begin{macrocode} @@ -678,29 +722,25 @@ % % \begin{macro}{\greek@tilde} % \changes{greek-1.0c}{1997/02/19}{Added command} -% In greek typesetting we need a number of characters with more -% than one accent. In the underlying family of fonts (the -% |cb| fonts) this is solved using Knuth's ligature -% mechanism. +% The Greek script uses a number of characters with more +% than one accent. In LGR-encoded fonts combined diacritics can be +% obtained using Knuth's ligature mechanism (see usage.pdf). % Characters we need to have ligatures with are the tilde, the % acute and grave accent characters, the rough and smooth breathings, % the subscript, and the double quote character. % In text input the |~| is normaly used to produce an -% unbreakable space. The command |\~| normally produces a tilde -% accent. For polytonic Greek we change the definition of |\~| -% to produce the tilde character itself, making sure it has category -% code 12. +% unbreakable space. % \changes{greek-1.3k}{2003/04/10}{Make sure the character `!' is not -% active during the definition of \cs{greek@tilde}} +% active during the definition of \cs{greek@tilde}} % \begin{macrocode} +% \changes{greek-1.4}{2013/05/17}{do not re-define the tilde accent macro: +% it works as expected with the new lgrenc.def file.} \begingroup \@ifundefined{active@char\string!}{}{\catcode`!=12\relax} \catcode`\~=12 \lccode`\!=`\~ \lowercase{\def\x{\endgroup \def\greek@tilde{!}}\x} -\addto\extraspolutonikogreek{% - \babel@save\~\let\~\greek@tilde} % \end{macrocode} % \end{macro} % In order to get correct hyphenation we need to set the lower case @@ -716,9 +756,9 @@ % \changes{greek-1.1c}{1997/04/30}{fixed two typos} % \changes{greek-1.1e}{1997/10/12}{Added lowercase code for v} % \changes{greek-1.2}{1997/10/28}{Definitions for ``modern'' Greek are -% now the definitions of ``Polutoniko'' Greek} +% now the definitions of ``Polutoniko'' Greek} % \changes{greek-1.2}{1997/10/28}{Added lowercase codes for ``modern'' -% greek} +% greek} % \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and % \cs{extraspolutonikogreek} should be complementary} % \begin{macrocode} @@ -735,14 +775,14 @@ % \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 -% codes. +% codes. % \changes{greek-1.1b}{1997/03/06}{Added setting of \cs{uccode}s % (after \file{kdgreek.sty})} % \changes{greek-1.1e}{1997/10/12}{Added uppercase code for special % letter ``v''. Uppercase code for accents is now \texttt{9f}, % instead of \texttt{ff}} % \changes{greek-1.2}{1997/10/28}{Added uppercase codes for ``modern'' -% Greek. The old codes are now for ``Polutoniko'' Greek} +% Greek. The old codes are now for ``Polutoniko'' Greek} % \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and % \cs{extraspolutonikogreek} should be complementary} % {\catcode`|=12\relax\gdef\indexbar{\cs{|}}} @@ -774,7 +814,7 @@ % we're done. % \changes{greek-1.1b}{1997/03/06}{Added shorthand for \cs{char255}} % \changes{greek-1.1e}{1997/10/12}{Shorthand is changed. Active -% character is now \cs{char159}} +% character is now \cs{char159}} % \changes{greek-1.2a}{1997/10/31}{Need shorthand to exist for % ``monotoniko'' Greek, not ``polutoniko'' Greek} % \changes{greek-1.3j}{2001/02/03}{Ues the tilde as an alias for @@ -790,20 +830,20 @@ % We can also make the tilde character itself expand to a tilde with % category code 12 to make the typing of texts easier. % \changes{greek-1.1b}{1997/03/06}{Made tilde expand to a tilde with -% \cs{catcode 12}} +% \cs{catcode 12}} % \begin{macrocode} \addto\extraspolutonikogreek{\languageshorthands{greek}}% \declare@shorthand{greek}{~}{\greek@tilde} % \end{macrocode} % \end{macro} % \end{macro} -% -% +% +% % % \changes{greek-1.1c}{1997/03/10}{Added a couple of symbols, needed % for \cs{greeknumeral}} % \changes{greek-1.1e}{1997/10/12}{Most symbols are removed and are -% now defined in package grsymb} +% now defined in package grsymb} % \changes{greek-1.2c}{1998/06/26}{Package grsymb has been eliminated % because the CB fonts v2.0 do not inlcude certain symbols and so % the remaining symbol definitions have been moved here} @@ -826,10 +866,10 @@ % Since the |~| cannot be used to produce an unbreakable white % space we must redefine at least the commands |\fnum@figure| and % |\fnum@table| so they do not produce a |~| instead of white -% space. +% space. % \changes{greek-1.3l}{2004/02/19}{Commented these lines out as this -% change has made it into \LaTeX{} itself.} -% \begin{macrocode} +% change has made it into \LaTeX{} itself.} +% \begin{macrocode} %\def\fnum@figure{\figurename\nobreakspace\thefigure} %\def\fnum@table{\tablename\nobreakspace\thetable} % \end{macrocode} |