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 | 513 |
1 files changed, 315 insertions, 198 deletions
diff --git a/Master/texmf-dist/source/generic/babel-greek/greek.dtx b/Master/texmf-dist/source/generic/babel-greek/greek.dtx index 0581b25f996..95910561258 100644 --- a/Master/texmf-dist/source/generic/babel-greek/greek.dtx +++ b/Master/texmf-dist/source/generic/babel-greek/greek.dtx @@ -25,7 +25,7 @@ % and covered by LPPL is defined by the unpacking script (greek.ins) % which is part of the package. % \fi -% \CheckSum{660} +% \CheckSum{1218} % % \iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -36,8 +36,8 @@ %<code>\ProvidesLanguage{greek} %\fi %\ProvidesFile{greek.dtx} - [2013/05/17 v1.4 Greek support from the babel system] -%\iffalse + [2013/06/21 v1.5 Greek support for the babel system] +%\iffalse %% File `greek.dtx' %% Babel package for LaTeX version 2e %% Copyright (C) 1989 -- 2005 @@ -87,6 +87,12 @@ % \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} +% \changes{greek-1.5}{2013/06/21}{bugfixes, +% change some symbol macros to aliases, +% LGR fixes via DeclareTextCommand instead of +% extrasgreek/noextrasgreek definitions, +% LICR macros in string definitions, +% LGR font encoding not used with XeTeX/LuaTeX.} % % \section{Babel support for the Greek language} % @@ -123,19 +129,8 @@ % % \subsection{Typing conventions} % -% Entering greek text can be quite difficult because of the many -% diacritical signs that need to be added for various purposes. -% The fonts that are used to typeset Greek make this a lot -% easier by offering a lot of ligatures. But in order for this to -% work, some characters need to be considered as letters. These -% characters are |<|, |>|, |~|, |`|, |'|, |"| and -% \verb=|=. Therefore their |\lccode| is changed when Greek is in -% effect. In order to let |\uppercase| give correct results, the -% |\uccode| of these characters is set to a non-existing character -% to make them disappear. Of course not all characters are needed -% when typesetting ``modern'' $\mu o\nu o\tau o\nu -% \iota\kappa\acute{o}$. In that case we only need the |'| and |"| -% symbols which are treated in the proper way. +% The file \file{usage.pdf} explains the several input conventions +% for Greek. % % \subsection{Greek numbering} % @@ -248,68 +243,130 @@ } % \end{macrocode} % +% Next, we check if Lua\LaTeX\ or Xe\LaTeX\ is running. If so, we set +% boolean key |\if@babel@greek@unicode| to true. +% (The test code is taken from russian.ldf. We hope that a future +% version of \file{babel.sty} will do the check and provide a boolean. +% +% We don't load the \pkg{ifluatex} or \pkg{ifxetex} package because +% |\RequirePackage| is not allowed at the stage of processing options +% (note that babel loads this file right when it processes its own options) +% but we borrow code from these packages. +% +% The test requires the e-TeX extensions (provided by all TeX engines in +% contemporary TeX distributions). +% +% \changes{greek-1.5}{2013/06/21}{Check for XeTeX/LuaTeX} +% \begin{macrocode} +\ifdefined\if@bbl@greek@unicode + \PackageError{babel}{if@bbl@greek@unicode already defined.\MessageBreak + Please contact author of greek.ldf} + \relax +\fi +\newif\if@bbl@greek@unicode +\ifdefined\luatexversion \@bbl@greek@unicodetrue \else +\ifdefined\XeTeXrevision \@bbl@greek@unicodetrue \fi\fi +% \end{macrocode} +% % Typesetting Greek texts requires a font containing Greek letters. -% For 8-bit LaTeX this package uses fonts with the LGR font encoding +% With the modern XeTeX or LuaTeX engines, the user should ensure that +% the choosen font contains the required glyphs. Examples for suitable +% fonts are the ``Deja Vu'' or the ``Linux Libertine'' OpenType fonts. +% +% 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.} 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. +% The |cb| fonts created by Claudio Beccari% +% \footnote{Apostolos Syropoulos wishes to thank him for his +% patience, collaboration, comments and suggestions.} +% are a complete set of LGR encoded Greek text fonts matching +% Computer Modern. % \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'} +% \changes{greek-1.5}{2013/06/21}{LGR setup skipped with XeTeX/LuaTeX} +% \begin{macrocode} +\if@bbl@greek@unicode +% \end{macrocode} + % No font encoding switch required with Unicode fonts. + % Define dummy commands for |\textgreek| and |\greektext| (cf. below): % \begin{macrocode} -\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 - I stop here, while you get a suitable lgrenc.def file}\@@end - } + \let\greektext\relax + \let\textgreek\@firstofone +\else + \InputIfFileExists{lgrenc.def}{}{% + \errhelp{I can't find the lgrenc.def file for the Greek fonts}% + \errmessage{Since I do not know the LGR font encoding^^J + I can't typeset Greek with 8-bit TeX.^^J + Please install the "greek-fontenc" package or use XeTeX/LuaTeX.}\@@end + } % \end{macrocode} % -% We define a few commands in the \texttt{LGR} encoding +% We redefine a few commands in the 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.} +% encoding} but has Greek letters in the places of Latin ones. % \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.} +% \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}} + \ProvideTextCommand{\texttrademark}{LGR}{\textlatin{\texttrademark}} + \let\ltx@amp\& + \DeclareTextCommandDefault{\&}{\ltx@amp} + \DeclareTextCommand{\&}{LGR}{\textlatin{\ltx@amp}} + \ProvideTextCommand{\SS}{LGR}{\textlatin{\SS}} +% \end{macrocode} +% +% \begin{macro}{\greek@roman} +% \begin{macro}{\greek@Roman} +% \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}} +% \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}} +% \changes{greek-1.5}{2013/06/15}{@roman and @Roman made TextCommands} +% To prevent roman numerals being typeset in greek letters we need +% to adopt the internal \LaTeX\ commands |\@roman| and +% |\@Roman|. \textbf{The pre-1.5 definition caused errors where +% |\@roman| ends up in a situation where it needs to be expanded; +% Check whether problems persist with the AMS document classes!} % \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}} + \let\latin@roman\@roman + \DeclareTextCommandDefault{\@roman}[1]{\latin@roman{#1}} + \DeclareTextCommand{\@roman}{LGR}[1]{\textlatin{\latin@roman{#1}}} + \let\latin@Roman\@Roman + \DeclareTextCommandDefault{\@Roman}[1]{\latin@Roman{#1}} + \DeclareTextCommand{\@Roman}{LGR}[1]{\textlatin{\latin@Roman{#1}}} % \end{macrocode} +% \end{macro} +% \end{macro} % % 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| +% following character of a diphthong 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''.} +% \changes{greek-1.4}{2013/05/17}{Add TextCompositeCommands for +% ``uppercase diacritics''.} +% \changes{greek-1.5}{2013/05/27}{Bugfix: @hiatus->LGR@hiatus} % \begin{macrocode} -\DeclareTextCompositeCommand{\"}{LGR}{Ÿ}{\accdialytika} -\DeclareTextCompositeCommand{\'}{LGR}{Ÿ}{\@hiatus} -\DeclareTextCompositeCommand{\`}{LGR}{Ÿ}{\@hiatus} -\DeclareTextCompositeCommand{\<}{LGR}{Ÿ}{\@hiatus} -\DeclareTextCompositeCommand{\>}{LGR}{Ÿ}{\@hiatus} + \DeclareTextCompositeCommand{\"}{LGR}{Ÿ}{\accdialytika} + \DeclareTextCompositeCommand{\'}{LGR}{Ÿ}{\LGR@hiatus} + \DeclareTextCompositeCommand{\`}{LGR}{Ÿ}{\LGR@hiatus} + \DeclareTextCompositeCommand{\<}{LGR}{Ÿ}{\LGR@hiatus} + \DeclareTextCompositeCommand{\>}{LGR}{Ÿ}{\LGR@hiatus} % \end{macrocode} % % Now we define two commands that offer the possibility to switch @@ -322,9 +379,9 @@ % for shorter pieces of text the command |\textgreek| should be % used. % \begin{macrocode} -\DeclareRobustCommand{\greektext}{% - \fontencoding{LGR}\selectfont - \def\encodingdefault{LGR}} + \DeclareRobustCommand{\greektext}{% + \fontencoding{LGR}\selectfont + \def\encodingdefault{LGR}} % \end{macrocode} % \end{macro} % @@ -337,7 +394,7 @@ % \changes{greek-1.3k}{2003/03/19}{Added \cs{leavevmode} as was done % with \cs{latintext}} % \begin{macrocode} -\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}} + \DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}} % \end{macrocode} % \end{macro} % @@ -347,8 +404,9 @@ % outline family. In order to make it available we define the command % |\textol|. % \begin{macrocode} -\def\outlfamily{\usefont{LGR}{cmro}{m}{n}} -\DeclareTextFontCommand{\textol}{\outlfamily} + \def\outlfamily{\usefont{LGR}{cmro}{m}{n}} + \DeclareTextFontCommand{\textol}{\outlfamily} +\fi % End of LGR fixes not required with XeTeX/LuaTeX. % \end{macrocode} % \end{macro} % @@ -378,27 +436,46 @@ % as `s' instead of `c'.} % \begin{macrocode} \addto\captionsgreek{% - \def\prefacename{Pr'ologos}% - \def\refname{Anafor'es}% - \def\abstractname{Per'ilhyh}% - \def\bibname{Bibliograf'ia}% - \def\chaptername{Kef'alaio}% - \def\appendixname{Par'arthma}% - \def\contentsname{Perieq'omena}% - \def\listfigurename{Kat'alogos Sqhm'atwn}% - \def\listtablename{Kat'alogos Pin'akwn}% - \def\indexname{Euret'hrio}% - \def\figurename{Sq'hma}% - \def\tablename{P'inakas}% - \def\partname{M'eros}% - \def\enclname{Sunhmm'ena}% - \def\ccname{Koinopo'ihsh}% - \def\headtoname{Pros}% - \def\pagename{Sel'ida}% - \def\seename{bl'epe}% - \def\alsoname{bl'epe ep'ishs}% - \def\proofname{Ap'odeixh}% - \def\glossaryname{Glwss'ari}% + \def\prefacename{\textPi\textrho\'\textomicron\textlambda\textomicron% + \textgamma\textomicron\textfinalsigma}% + \def\refname{\textAlpha\textnu\textalpha% + \textphi\textomicron\textrho\'\textepsilon\textfinalsigma}% + \def\abstractname{\textPi\textepsilon\textrho\'\textiota% + \textlambda\texteta\textpsi\texteta}% + \def\bibname{\textBeta\textiota\textbeta\textlambda\textiota\textomicron% + \textgamma\textrho\textalpha\textphi\'\textiota\textalpha}% + \def\chaptername{\textKappa\textepsilon\textphi\'\textalpha% + \textlambda\textalpha\textiota\textomicron}% + \def\appendixname{\textPi\textalpha\textrho\'\textalpha\textrho% + \texttau\texteta\textmu\textalpha}% + \def\contentsname{\textPi\textepsilon\textrho\textiota% + \textepsilon\textchi\'\textomicron\textmu\textepsilon\textnu\textalpha}% + \def\listfigurename{\textKappa\textalpha\texttau\'\textalpha% + \textlambda\textomicron\textgamma\textomicron\textfinalsigma{} + \textSigma\textchi\texteta\textmu\'\textalpha\texttau\textomega\textnu}% + \def\listtablename{\textKappa\textalpha\texttau\'\textalpha% + \textlambda\textomicron\textgamma\textomicron\textfinalsigma{} + \textPi\textiota\textnu\'\textalpha\textkappa\textomega\textnu}% + \def\indexname{\textEpsilon\textupsilon\textrho\textepsilon% + \texttau\'\texteta\textrho\textiota\textomicron}% + \def\figurename{\textSigma\textchi\'\texteta\textmu\textalpha}% + \def\tablename{\textPi\'\textiota\textnu\textalpha% + \textkappa\textalpha\textfinalsigma}% + \def\partname{\textMu\'\textepsilon\textrho\textomicron\textfinalsigma}% + \def\enclname{\textSigma\textupsilon\textnu\texteta\textmu% + \textmu\'\textepsilon\textnu\textalpha}% + \def\ccname{\textKappa\textomicron\textiota\textnu\textomicron% + \textpi\textomicron\'\textiota\texteta\textsigma\texteta}% + \def\headtoname{\textPi\textrho\textomicron\textfinalsigma}% + \def\pagename{\textSigma\textepsilon\textlambda\'\textiota% + \textdelta\textalpha}% + \def\seename{\textbeta\textlambda\'\textepsilon\textpi\textepsilon}% + \def\alsoname{\textbeta\textlambda\'\textepsilon\textpi\textepsilon{} + \textepsilon\textpi\'\textiota\textsigma\texteta\textfinalsigma}% + \def\proofname{\textAlpha\textpi\'\textomicron% + \textdelta\textepsilon\textiota\textxi\texteta}% + \def\glossaryname{\textGamma\textlambda\textomega\textsigma% + \textsigma\'\textalpha\textrho\textiota}% } % \end{macrocode} % \end{macro} @@ -416,12 +493,16 @@ % \begin{macrocode} \let\captionspolutonikogreek\captionsgreek \addto\captionspolutonikogreek{% - \def\refname{>Anafor`es}% - \def\indexname{E<uret'hrio}% - \def\figurename{Sq~hma}% - \def\headtoname{Pr`os}% - \def\alsoname{bl'epe >ep'ishs}% - \def\proofname{>Ap'odeixh}% + \def\refname{\>\textAlpha\textnu\textalpha% + \textphi\textomicron\textrho\`\textepsilon\textfinalsigma}% + \def\indexname{\textEpsilon\<\textupsilon\textrho\textepsilon% + \texttau\'\texteta\textrho\textiota\textomicron}% + \def\figurename{\textSigma\textchi\~\texteta\textmu\textalpha}% + \def\headtoname{\textPi\textrho\`\textomicron\textfinalsigma}% + \def\alsoname{\textbeta\textlambda\'\textepsilon\textpi\textepsilon{} + \>\textepsilon\textpi\'\textiota\textsigma\texteta\textfinalsigma}% + \def\proofname{\>\textAlpha\textpi\'\textomicron% + \textdelta\textepsilon\textiota\textxi\texteta}% } % \end{macrocode} % \end{macro} @@ -442,9 +523,30 @@ % \begin{macrocode} \def\gr@month{% \ifcase\month\or - Ianouar'iou\or Febrouar'iou\or Mart'iou\or April'iou\or - Ma'"iou\or Ioun'iou\or Ioul'iou\or Augo'ustou\or - Septembr'iou\or Oktwbr'iou\or Noembr'iou\or Dekembr'iou\fi} + \textIota\textalpha\textnu\textomicron\textupsilon\textalpha% + \textrho\'\textiota\textomicron\textupsilon\or + \textPhi\textepsilon\textbeta\textrho\textomicron\textupsilon% + \textalpha\textrho\'\textiota\textomicron\textupsilon\or + \textMu\textalpha\textrho\texttau\'\textiota\textomicron\textupsilon\or + \textAlpha\textpi\textrho\textiota\textlambda\'\textiota% + \textomicron\textupsilon\or + \textMu\textalpha\'\"\textiota\textomicron\textupsilon\or + \textIota\textomicron\textupsilon\textnu\'\textiota% + \textomicron\textupsilon\or + \textIota\textomicron\textupsilon\textlambda\'\textiota% + \textomicron\textupsilon\or + \textAlpha\textupsilon\textgamma\textomicron\'\textupsilon\textsigma% + \texttau\textomicron\textupsilon\or + \textSigma\textepsilon\textpi\texttau\textepsilon\textmu% + \textbeta\textrho\'\textiota\textomicron\textupsilon\or + \textOmicron\textkappa\texttau\textomega\textbeta% + \textrho\'\textiota\textomicron\textupsilon\or + \textNu\textomicron\textepsilon\textmu\textbeta% + \textrho\'\textiota\textomicron\textupsilon\or + \textDelta\textepsilon\textkappa\textepsilon\textmu\textbeta% + \textrho\'\textiota\textomicron\textupsilon% + \fi% +} \def\dategreek{% \def\today{\number\day \space \gr@month\space \number\year}} % \end{macrocode} @@ -459,10 +561,31 @@ % \cs{datepolutonikogreek}} % \begin{macrocode} \def\gr@c@month{% - \ifcase\month\or >Ianouar'iou\or - Febrouar'iou\or Mart'iou\or >April'iou\or Ma"'iou\or - >Ioun'iou\or >Ioul'iou\or A>ugo'ustou\or Septembr'iou\or - >Oktwbr'iou\or Noembr'iou\or Dekembr'iou\fi} + \ifcase\month\or + \>\textIota\textalpha\textnu\textomicron\textupsilon\textalpha% + \textrho\'\textiota\textomicron\textupsilon\or + \textPhi\textepsilon\textbeta\textrho\textomicron\textupsilon% + \textalpha\textrho\'\textiota\textomicron\textupsilon\or + \textMu\textalpha\textrho\texttau\'\textiota\textomicron\textupsilon\or + \>\textAlpha\textpi\textrho\textiota\textlambda% + \'\textiota\textomicron\textupsilon\or + \textMu\textalpha\"\'\textiota\textomicron\textupsilon\or + \>\textIota\textomicron\textupsilon\textnu% + \'\textiota\textomicron\textupsilon\or + \>\textIota\textomicron\textupsilon\textlambda% + \'\textiota\textomicron\textupsilon\or + \textAlpha\>\textupsilon\textgamma\textomicron\'\textupsilon\textsigma% + \texttau\textomicron\textupsilon\or + \textSigma\textepsilon\textpi\texttau\textepsilon\textmu\textbeta% + \textrho\'\textiota\textomicron\textupsilon\or + \>\textOmicron\textkappa\texttau\textomega\textbeta% + \textrho\'\textiota\textomicron\textupsilon\or + \textNu\textomicron\textepsilon\textmu\textbeta% + \textrho\'\textiota\textomicron\textupsilon\or + \textDelta\textepsilon\textkappa\textepsilon\textmu% + \textbeta\textrho\'\textiota\textomicron\textupsilon% + \fi +} % \end{macrocode} % \end{macro} % @@ -484,13 +607,17 @@ % The macro |\extrasgreek| will perform all the extra definitions % needed for the Greek language. The macro |\noextrasgreek| is used % 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 +% macros switch the fontencoding (with 8-bit TeX) and the definition of +% the internal macros |\@alph| and |\@Alph| because in Greek we do use % the Greek numerals. -% +% \changes{greek-1.5}{2013/06/21}{LGR not used with XeTeX/LuaTeX.} % \begin{macrocode} -\addto\extrasgreek{\greektext} -\addto\noextrasgreek{\latintext} +\if@bbl@greek@unicode + \relax +\else + \addto\extrasgreek{\greektext} + \addto\noextrasgreek{\latintext} +\fi % \end{macrocode} % % \begin{macro}{\gr@ill@value} @@ -622,53 +749,6 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\greek@roman} -% \begin{macro}{\greek@Roman} -% \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}} -% \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}} -% -% To prevent roman numerals being typeset in greek letters we need -% to adopt the internal \LaTeX\ commands |\@roman| and -% |\@Roman|. \textbf{Note that this may cause errors where -% |\@roman| ends up in a situation where it needs to be expanded; -% problems are known to exist with the AMS document classes.} -% \begin{macrocode} -\let\latin@roman\@roman -\let\latin@Roman\@Roman -\def\greek@roman#1{\textlatin{\latin@roman{#1}}} -\def\greek@Roman#1{\textlatin{\latin@Roman{#1}}} -\addto\extrasgreek{% - \let\@roman\greek@roman - \let\@Roman\greek@Roman} -\addto\noextrasgreek{% - \let\@roman\latin@roman - \let\@Roman\latin@Roman} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\greek@amp} -% \begin{macro}{\ltx@amp} -% The greek fonts do not contain an ampersand, so the \LaTeX\ -% 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}} -% \changes{greek-1.3c}{1999/05/17}{Added a missing opening brace} -% \begin{macrocode} -\let\ltx@amp\& -\def\greek@amp{\textlatin{\ltx@amp}} -\addto\extrasgreek{\let\&\greek@amp} -\addto\noextrasgreek{\let\&\ltx@amp} -% \end{macrocode} -% \end{macro} -% \end{macro} -% % What is left now is the definition of a set of macros to produce % the various digits. % \begin{macro}{\gr@num@i} @@ -684,13 +764,16 @@ % about the (non-)translation of a zero. % \begin{macrocode} \def\gr@num@i#1{% - \ifcase#1\or a\or b\or g\or d\or e\or \stigma\or z\or h\or j\fi + \ifcase#1\or \textalpha\or \textbeta\or \textgamma\or \textdelta\or + \textepsilon\or \textstigma\or \textzeta\or \texteta\or \texttheta\fi \ifnum#1=\z@\else\anw@true\fi\anw@print} \def\gr@num@ii#1{% - \ifcase#1\or i\or k\or l\or m\or n\or x\or o\or p\or \qoppa\fi + \ifcase#1\or \textiota\or \textkappa\or \textlambda\or \textmu\or + \textnu\or \textxi\or \textomicron\or \textpi\or \textqoppa\fi \ifnum#1=\z@\else\anw@true\fi\gr@num@i} \def\gr@num@iii#1{% - \ifcase#1\or r\or sv\or t\or u\or f\or q\or y\or w\or \sampi\fi + \ifcase#1\or \textrho\or \textsigma\or \texttau\or \textupsilon\or + \textphi\or \textchi\or \textpsi\or \textomega\or \textsampi\fi \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii} % \end{macrocode} % \end{macro} @@ -705,42 +788,74 @@ % \begin{macrocode} \def\gr@num@iv#1{% \ifnum#1=\z@\else\katwtonos\fi - \ifcase#1\or a\or b\or g\or d\or e\or \stigma\or z\or h\or j\fi + \ifcase#1\or \textalpha\or \textbeta\or \textgamma\or \textdelta\or + \textepsilon\or \stigma\or \textzeta\or \texteta\or \texttheta\fi \gr@num@iii} \def\gr@num@v#1{% \ifnum#1=\z@\else\katwtonos\fi - \ifcase#1\or i\or k\or l\or m\or n\or x\or o\or p\or \qoppa\fi + \ifcase#1\or \textiota\or \textkappa\or \textlambda\or \textmu\or + \textnu\or \textxi\or \textomicron\or \textpi\or \textqoppa\fi \gr@num@iv} \def\gr@num@vi#1{% \katwtonos - \ifcase#1\or r\or sv\or t\or u\or f\or q\or y\or w\or \sampi\fi + \ifcase#1\or \textrho\or \textsigma\or \texttau\or \textupsilon\or + \textphi\or \textchi\or \textpsi\or \textomega\or \textsampi\fi \gr@num@v} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % +% Handling of Diacritics differs between Unicode and LGR encoding. +% \changes{greek-1.5}{2013/06/21}{Support XeTeX/LuaTeX.} + +% Greek letters drop diacritics (eccept dialytika and sub-iota) in +% UPPERCASE. This is not cared for by the Unicode standard. +% The file \file{xgreek-fixes.def} from \pkg{polyglossia} +% contains the required |\lccode| and |\uccode| corrections from the +% \pkg{xgreek} package by Apostolos Syropoulos. +% \begin{macrocode} +\if@bbl@greek@unicode + \InputIfFileExists{xgreek-fixes.def}{}{% + \PackageWarning{babel}{Can't find the file "xgreek-fixes.def".\MessageBreak + For correct up/downcasing of Greek text, + install the "polyglossia" package.}% + } +\else % 8-bit TeX +% \end{macrocode} +% The LGR encoded fonts that are used to typeset Greek with 8-bit TeX +% define ligatures for characters with diacritics. In order for this to +% work, some characters need to be considered as letters. These +% characters are |<|, |>|, |~|, |`|, |'|, |"| and +% \verb=|=. Therefore their |\lccode| is changed when Greek is in +% effect. In order to let |\uppercase| give correct results, the +% |\uccode| of these characters is set to a non-existing character +% to make them disappear. Of course not all characters are needed +% when typesetting ``modern'' $\mu o\nu o\tau o\nu +% \iota\kappa\acute{o}$. In that case we only need the |'| and |"| +% symbols which are treated in the proper way. +% % \begin{macro}{\greek@tilde} % \changes{greek-1.0c}{1997/02/19}{Added command} % The Greek script uses a number of characters with more -% than one accent. In LGR-encoded fonts combined diacritics can be +% 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 +% In text input the |~| is normally used to produce an % unbreakable space. % \changes{greek-1.3k}{2003/04/10}{Make sure the character `!' is not % 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} +% it works as expected with \file{lgrenc.def} from \pkg{greek-fontenc}.} +% \begin{macrocode} + \begingroup + \@ifundefined{active@char\string!}{}{\catcode`!=12\relax} + \catcode`\~=12 + \lccode`\!=`\~ + \lowercase{\def\x{\endgroup + \def\greek@tilde{!}}\x} % \end{macrocode} % \end{macro} % In order to get correct hyphenation we need to set the lower case @@ -762,16 +877,16 @@ % \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and % \cs{extraspolutonikogreek} should be complementary} % \begin{macrocode} -\addto\extrasgreek{% - \babel@savevariable{\lccode`v}\lccode`v=`v% - \babel@savevariable{\lccode`\'}\lccode`\'=`\'% - \babel@savevariable{\lccode`\"}\lccode`\"=`\"} -\addto\extraspolutonikogreek{% - \babel@savevariable{\lccode`\<}\lccode`\<=`\<% - \babel@savevariable{\lccode`\>}\lccode`\>=`\>% - \babel@savevariable{\lccode`\~}\lccode`\~=`\~% - \babel@savevariable{\lccode`\|}\lccode`\|=`\|% - \babel@savevariable{\lccode`\`}\lccode`\`=`\`} + \addto\extrasgreek{% + \babel@savevariable{\lccode`v}\lccode`v=`v% + \babel@savevariable{\lccode`\'}\lccode`\'=`\'% + \babel@savevariable{\lccode`\"}\lccode`\"=`\"} + \addto\extraspolutonikogreek{% + \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 @@ -794,15 +909,15 @@ % make the caret active, we can't use the double caret notation % here} % \begin{macrocode} -\addto\extrasgreek{% - \babel@savevariable{\uccode`\"}\uccode`\"=`\"% - \babel@savevariable{\uccode`\'}\uccode`\'=159} %% 159 == ^^9f -\addto\extraspolutonikogreek{% - \babel@savevariable{\uccode`\~}\uccode`\~=159% - \babel@savevariable{\uccode`\>}\uccode`\>=159% - \babel@savevariable{\uccode`\<}\uccode`\<=159% - \babel@savevariable{\uccode`\|}\uccode`\|=`\|% - \babel@savevariable{\uccode`\`}\uccode`\`=159} + \addto\extrasgreek{% + \babel@savevariable{\uccode`\"}\uccode`\"=`\"% + \babel@savevariable{\uccode`\'}\uccode`\'=159} %% 159 == ^^9f + \addto\extraspolutonikogreek{% + \babel@savevariable{\uccode`\~}\uccode`\~=159% + \babel@savevariable{\uccode`\>}\uccode`\>=159% + \babel@savevariable{\uccode`\<}\uccode`\<=159% + \babel@savevariable{\uccode`\|}\uccode`\|=`\|% + \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 @@ -817,23 +932,24 @@ % 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 +% \changes{greek-1.3j}{2001/02/03}{Use the tilde as an alias for % character 159} % \begin{macrocode} -\@tempcnta=\lccode`\~ -\lccode`\~=159 -\lowercase{% - \initiate@active@char{~}% - \declare@shorthand{greek}{~}{}} -\lccode`\~=\@tempcnta + \@tempcnta=\lccode`\~ + \lccode`\~=159 + \lowercase{% + \initiate@active@char{~}% + \declare@shorthand{greek}{~}{}} + \lccode`\~=\@tempcnta % \end{macrocode} % 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}} % \begin{macrocode} -\addto\extraspolutonikogreek{\languageshorthands{greek}}% -\declare@shorthand{greek}{~}{\greek@tilde} + \addto\extraspolutonikogreek{\languageshorthands{greek}}% + \declare@shorthand{greek}{~}{\greek@tilde} +\fi % End of LGR-specific code not required with XeTeX/LuaTeX. % \end{macrocode} % \end{macro} % \end{macro} @@ -850,17 +966,18 @@ % We now define a few symbols which are used in the typesetting of % greek numerals, as well as some other symbols which are usefull, % such as the $\epsilon\upsilon\rho\omega$ symbol, etc. -% \begin{macrocode} -\DeclareTextCommand{\anwtonos}{LGR}{\char"FE\relax} -\DeclareTextCommand{\katwtonos}{LGR}{\char"FF\relax} -\DeclareTextCommand{\qoppa}{LGR}{\char"12\relax} -\DeclareTextCommand{\stigma}{LGR}{\char"06\relax} -\DeclareTextCommand{\sampi}{LGR}{\char"1B\relax} -\DeclareTextCommand{\Digamma}{LGR}{\char"C3\relax} -\DeclareTextCommand{\ddigamma}{LGR}{\char"93\relax} -\DeclareTextCommand{\vardigamma}{LGR}{\char"07\relax} -\DeclareTextCommand{\euro}{LGR}{\char"18\relax} -\DeclareTextCommand{\permill}{LGR}{\char"19\relax} +% \changes{greek-1.5}{2013/06/11}{change symbol macros to aliases} +% \begin{macrocode} +\providecommand*{\anwtonos}{\textnumeralsigngreek} +\providecommand*{\katwtonos}{\textnumeralsignlowergreek} +\providecommand*{\qoppa}{\textqoppa} +\providecommand*{\stigma}{\textstigma} +\providecommand*{\sampi}{\textsampi} +\providecommand*{\Digamma}{\textDigamma} +\providecommand*{\ddigamma}{\textdigamma} +\providecommand*{\vardigamma}{\textvardigamma} +\providecommand*{\euro}{\texteuro} +\providecommand*{\permill}{\textperthousand} % \end{macrocode} % % Since the |~| cannot be used to produce an unbreakable white |