diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-04 00:01:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-04 00:01:17 +0000 |
commit | dc3645665fd98e15f4a251d1e78c283e37658119 (patch) | |
tree | 683d375cb36213d0cd367fc59e6cb1c22ba84498 /Master/texmf-dist/source/generic | |
parent | 5b0be858da5f93a678e7665f67921f8e63559f5a (diff) |
babel-greek (3dec13)
git-svn-id: svn://tug.org/texlive/trunk@32309 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.dtx (renamed from Master/texmf-dist/source/generic/babel-greek/greek.dtx) | 432 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/babel-greek/babel-greek.ins (renamed from Master/texmf-dist/source/generic/babel-greek/greek.ins) | 10 |
2 files changed, 270 insertions, 172 deletions
diff --git a/Master/texmf-dist/source/generic/babel-greek/greek.dtx b/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx index de29fa78b45..aaacb299664 100644 --- a/Master/texmf-dist/source/generic/babel-greek/greek.dtx +++ b/Master/texmf-dist/source/generic/babel-greek/babel-greek.dtx @@ -16,39 +16,34 @@ % % This work has the LPPL maintenance status "maintained". % -% The Current Maintainer of this work is G\"unter Milde <milde@users.sf.net>. +% The Current Maintainer of this work is Günter 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) +% and covered by LPPL is defined by the unpacking script (babel-greek.ins) % which is part of the package. % \fi -% \CheckSum{1216} +% \CheckSum{1218} % % \iffalse % Tell the \LaTeX\ system who we are and write an entry on the % transcript. %<*dtx> -\ProvidesFile{greek.dtx} +\ProvidesFile{babel-greek.dtx} %</dtx> %<code>\ProvidesLanguage{greek} %\fi -%\ProvidesFile{greek.dtx} - [2013/10/01 v1.7b Greek support for the babel system] +%\ProvidesFile{babel-greek.dtx} + [2013/12/03 v1.8a Greek support for the babel system] %\iffalse -%% File `greek.dtx' -%% Babel package for LaTeX version 2e -%% Copyright (C) 1989 -- 2005 -%% by Johannes Braams, TeXniek -% +%% File `babel-greek.dtx' %% Greek language Definition File -%% Copyright (C) 1997, 2005 -%% by Apostolos Syropoulos -%% Johannes Braams, TeXniek +%% Copyright © 1997, 2005 Apostolos Syropoulos, Johannes Braams +%% Copyright © 2013 Günter Milde % -%% Please report errors to: G\"unter Milde <milde@users.sf.net> +%% Please report errors to: Günter Milde <milde@users.sf.net> % % This file is part of the babel-greek package, it provides the source % code for the greek language definition file. The original @@ -59,6 +54,9 @@ %<*filedriver> \documentclass{ltxdoc} % \usepackage{lmodern} +\usepackage[utf8]{inputenc} +\usepackage{hyperref,bookmark} +\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=black} \newcommand*{\TeXhax}{\TeX hax} \newcommand*{\babel}{\textsf{babel}} \newcommand*{\langvar}{$\langle \mathit lang \rangle$} @@ -67,11 +65,11 @@ \newcommand*{\file}[1]{\texttt{#1}} \newcommand*{\pkg}[1]{\texttt{#1}} \begin{document} - \DocInput{greek.dtx} + \DocInput{babel-greek.dtx} \end{document} %</filedriver> %\fi -% \GetFileInfo{greek.dtx} +% \GetFileInfo{babel-greek.dtx} % % \changes{greek-1.0b}{1996/07/10}{Replaced \cs{undefined} with % \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency @@ -104,8 +102,21 @@ % \changes{greek-1.7a}{2013/09/13}{bugfix: remove spurious ``fi''.} % \changes{greek-1.7b}{2013/10/01}{bugfix: correct upcasing of babel strings % with Xe/LuaTeX.} +% \changes{greek-1.8}{2013/11/27}{Rename to ``babel-greek.dtx''. +% Restore compatibility with Xe/LuaTeX in 8-bit and Unicode mode. +% Load ``euenc.def'' if EU1 or EU2 font encoding is detected. +% 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.} +% +% \title{Babel support for the Greek language} +% \author{Apostolos Syropoulos, Günter Milde} +% \maketitle % -% \section{Babel support for the Greek language} +% Babel-greek is a contributed package providing support for the Greek +% language and script via the \href{http://www.ctan.org/pkg/babel}{Babel} +% system. See the \href{README.html}{README} file for an overwiew of the +% \pkg{babel-greek} package and links to requirements and related packages. % % The file \file{\filename}\footnote{The file described in this % section has version number \fileversion\ and was last revised on @@ -119,27 +130,32 @@ % \Lopt{polutoniko} for typesetting greek text with all accents % (classical and polytonic Greek). % -% \DescribeMacro\greektext -% \DescribeMacro\latintext -% With 8-bit LaTeX, Greek text fonts use a non-standard font encoding -% (LGR) that misses Latin letters. Latin characters in the source are -% instead interpreted as a transcription for Greek symbols. -% The commands |\greektext| and |\latintext| can be used to switch -% to Greek or Latin font encodings but do not change the active language. -% These are declarations. -% \DescribeMacro\textgreek -% \DescribeMacro\textlatin -% The commands |\textgreek| and |\textlatin| both take one argument -% which is then typeset using the requested font encoding. -% -% \DescribeMacro\textol -% The command |\greekol| switches to the greek outline font family, -% 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|. -% -% \subsection{Usage} +% \section{Requirements} +% +% 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 +% 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 +% font families. +% The \pkg{\href{http://www.ctan.org/pkg/substitutefont}{substitutefont}} +% package can be used to set up Greek supplements for other +% font families (like Times or Palatino). +% +% The \href{http://ctan.org/pkg/lm}{Latin Modern} OpenType font that is the +% 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} % % To activate Greek support with babel, specify the option % \Lopt{greek}, either as global option or as option to the @@ -154,6 +170,14 @@ % sets the document language to Greek with ``polytonic'' % spelling of auto-generated strings. % +% \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 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 backwards compatibility, ``polytonic'' spelling can also be % selected via the dummy language \Lopt{polutonikogreek}. In this % case, the language name \Lopt{polutonikogreek} must also be @@ -161,18 +185,69 @@ % |\foreignlanguage|. However, it is not possible to use % both options, \Lopt{greek} and \Lopt{polutonikogreek} in one document. % -% \subsubsection{Input of Greek text} +% \subsection{Input of Greek text} +% +% There are several alternatives for input of 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. +% +% \item The Latin transliteration defined by the LGR font encoding +% is explained in the file \file{\href{usage.pdf}{usage.pdf}}. +% +% \item The package +% \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. +% +% \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} +% The \href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} bundle +% has details and examples for all these input methods. +% +% \subsection{Greek vs. Latin script} +% When switching the language to Greek, \pkg{babel-greek} ensures that the +% 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).} +% (LGR) that misses Latin letters. Latin characters in the source are +% instead interpreted as a transcription for Greek symbols. +% The following macros allow the use of Greek vs. Latin script without +% changing the active language. +% \DescribeMacro\greekscript +% \DescribeMacro\greektext +% The \emph{TextCommand}\footnote{For a discussion of TextCommands, see +% the \emph{LaTeX font guide} (fntguide.pdf), too.} +% |\greekscript| switches to a font encoding +% supporting the Greek script. +% The declaration |\greektext| always switches the font encoding +% to LGR. Both declarations do not change the active language. +% \DescribeMacro\latintext +% |\latintext| (defined by the Babel +% core) can be used to switch back to an encoding supporting the Latin +% script. % -% There are several alternatives for input of Greek text. -% The required package \pkg{greek-fontenc} defines -% \emph{LaTeX internal character representation} (LICR) macros -% for Greek letters and text symbols. -% With the packages \pkg{inputenc} and \pkg{greek-inputenc}, -% Greek characters can be input using the utf-8, iso-8859-7, -% or macgreek encoding. The file \file{usage.pdf} explains a Latin -% transliteration defined by the LGR font encoding. +% \DescribeMacro\ensuregreek +% \DescribeMacro\textgreek +% The macros |\ensuregreek| and |\textgreek| take one argument +% which is typeset using a font encoding supporting the Greek +% script. While |\ensuregreek| only switches the +% font encoding if required, |\textgreek| always uses the LGR font +% encoding. +% \DescribeMacro\textlatin +% The Babel core defines a corresponding |\textlatin| macro. % -% \subsection{Greek numbering} +% \section{Greek numbering} % % The Greek alphabetical numbering system, like the Roman one, is % still used in everyday life for short enumerations. Unfortunately @@ -226,7 +301,7 @@ % % \StopEventually{} % -% \subsection{Implementation} +% \section{Implementation} % % The macro |\LdfInit| takes care of preventing that this file is % loaded more than once, checking the category code of the @@ -283,43 +358,18 @@ } % \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. +% \section{Font setup} % -% 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. +% Typesetting Greek texts requires a font with Greek characters: % -% The test requires the e-TeX extensions (provided by all TeX engines in -% contemporary TeX distributions). +% 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. +% LGR-encoded fonts can also be used alongside Unicode fonts with XeTeX/LuaTeX +% to enable the input of Greek letters via the Latin transcription provided by +% this font encoding. % -% \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. -% 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, 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 @@ -327,29 +377,85 @@ % \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 +% instead of engine} +% +% \DescribeMacro\greekfontencoding +% We test for available font encodings and set |\greekfontencoding| +% and the internal macro |\bbl@greek@fontencdef| with the name of the +% font definition file with Greek LICR macros. The fallback is LGR. +% \begin{macrocode} +\@ifl@aded{def}{eu1enc}{ + \providecommand*{\greekfontencoding}{EU1} + \providecommand*{\bbl@greek@fontencdef}{greek-euenc} + \renewcommand*{\LastDeclaredEncoding}{EU1} +}{} +\@ifl@aded{def}{eu2enc}{ + \providecommand*{\greekfontencoding}{EU2} + \providecommand*{\bbl@greek@fontencdef}{greek-euenc} + \renewcommand{\LastDeclaredEncoding}{EU2} +}{} +\providecommand*{\greekfontencoding}{LGR} +\providecommand*{\bbl@greek@fontencdef}{lgrenc} +% \end{macrocode} +% Ensure that the Greek LICR macros are available: % \begin{macrocode} -\if@bbl@greek@unicode +\@ifl@aded{def}{\bbl@greek@fontencdef}{}{ + \InputIfFileExists{\bbl@greek@fontencdef .def}{}{ + \errhelp{I can't find the \bbl@greek@fontencdef .def file + for the Greek fonts}% + \errmessage{Font support for the Greek script missing.^^J + babel-greek can't typeset Greek.^^J + Install the "greek-fontenc" package^^J + or use XeTeX/LuaTeX with polyglossia.}% + \@@end + } +} % \end{macrocode} - % No font encoding switch required with Unicode fonts. - % Define dummy commands for |\textgreek| and |\greektext| (cf. below): +% \begin{macro}{\greekscript} +% The TextCommand |\greekscript| is a declaration that switches the font +% encoding to |\greekfontencoding| if the current font encoding does not +% provide a (typically empty) local variant. +% \changes{greek-1.8.1}{2013/12/03}{Set `encodingdefault' in `greekscript' +% to fix Greek in footnotes etc. with document language Greek. +% TODO: This is from `greektext' but are there side effects?} % \begin{macrocode} - \let\greektext\relax - \let\textgreek\@firstofone -\else - \@ifundefined{ver@lgrenc.def}{ - \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 - } - }{} +\ProvideTextCommandDefault{\greekscript}{% + \fontencoding{\greekfontencoding}\selectfont + \def\encodingdefault{\greekfontencoding}} % \end{macrocode} +% \end{macro} +% \begin{macro}{\ensuregreek} +% The TextCommand |\ensuregreek| sets it argument in |\greekfontencoding| +% if the current font encoding does not provide a (typically empty) local +% variant. +% \begin{macrocode} +\ProvideTextCommandDefault{\ensuregreek}[1]{% + \leavevmode{\greekscript #1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\latinencoding} +% The babel core defines the macro |\latinencoding| and sets it to either +% OT1 or (if available) T1. We extend the choice with the Unicode encodings +% EU1 and EU2 so that |\latintext| under XeTeX/LuaTeX does not prevent the +% use of Unicode fonts. +% \begin{macrocode} +\AtBeginDocument{ + \@ifl@aded{def}{eu1enc}{\xdef\latinencoding{EU1}}{}% XeTeX + \@ifl@aded{def}{eu2enc}{\xdef\latinencoding{EU2}}{}% LuaTeX +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Fixes for the LGR font encoding} % -% We redefine a few commands in the LGR encoding -% to work around problems because LGR is no \emph{standard text -% encoding} but has Greek letters in the places of Latin ones. +% \begin{macrocode} +\@ifl@aded{def}{lgrenc}{% +% \end{macrocode} +% +% We redefine a few commands in the LGR encoding to work around problems +% because LGR is no \emph{standard text 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{\&}} @@ -359,6 +465,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}} @@ -396,35 +503,13 @@ % \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 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.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).} -% \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} -% \end{macrocode} -% -% Now we define two commands that offer the possibility to switch -% to the LGR font encoding. Babel defines corresponding macros +% Now we define two commands that switch +% to the LGR font encoding. The Babel core defines corresponding commands % to switch to a Latin font encoding. % % \begin{macro}{\greektext} -% 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 +% The declaration |\greektext| switches to LGR. +% For shorter pieces of text the |\textgreek| macro should be % used. % \begin{macrocode} \DeclareRobustCommand{\greektext}{% @@ -435,7 +520,7 @@ % % \begin{macro}{\textgreek} % This command takes an argument which is then typeset using the -% requested font encoding. In order to avoid many encoding switches +% LGR 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} @@ -447,17 +532,20 @@ % \end{macro} % % \begin{macro}{\textol} -% A last aspect of the set of fonts provided with this version of -% support for typesetting Greek texts is that it contains an -% outline family. In order to make it available we define the command -% |\textol|. +% The \href{http://www.ctan.org/pkg/cbgreek-complete}{CB Greek fonts} +% contain an outline family. In order to make it available, +% we define the command |\textol|. (This font-specific macro does not +% fit in a language defintion file is and only kept for backwards +% compatibility.) % \begin{macrocode} \def\outlfamily{\usefont{LGR}{cmro}{m}{n}} \DeclareTextFontCommand{\textol}{\outlfamily} -\fi % End of LGR fixes not required with XeTeX/LuaTeX. +}{} % End of LGR fixes. % \end{macrocode} % \end{macro} % +% \section{Definitions for the Greek language} +% % The next step consists in defining commands to switch to (and % from) the Greek language. % @@ -484,8 +572,8 @@ % as `s' instead of `c'.} % \begin{macrocode} \addto\captionsgreek{% - \def\prefacename{\textPi\textrho\acctonos\textomicron\textlambda\textomicron - \textgamma\textomicron\textfinalsigma}% + \def\prefacename{\textPi\textrho\acctonos\textomicron\textlambda + \textomicron\textgamma\textomicron\textfinalsigma}% \def\refname{\textAlpha\textnu\textalpha \textphi\textomicron\textrho\acctonos\textepsilon\textfinalsigma}% \def\abstractname{\textPi\textepsilon\textrho\acctonos\textiota @@ -626,8 +714,8 @@ \acctonos\textiota\textomicron\textupsilon \or \>\textIota\textomicron\textupsilon\textlambda \acctonos\textiota\textomicron\textupsilon \or - \textAlpha\>\textupsilon\textgamma\textomicron\acctonos\textupsilon - \textsigma\texttau\textomicron\textupsilon \or + \textAlpha\>\textupsilon\textgamma\textomicron\acctonos + \textupsilon\textsigma\texttau\textomicron\textupsilon \or \textSigma\textepsilon\textpi\texttau\textepsilon\textmu\textbeta \textrho\acctonos\textiota\textomicron\textupsilon \or \>\textOmicron\textkappa\texttau\textomega\textbeta @@ -663,13 +751,12 @@ % 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.} +% \changes{greek-1.8}{2013/11/27}{use font-encoding specific TextCommands. +% Use EU1 or EU2 for Latin script if available} % \begin{macrocode} -\if@bbl@greek@unicode - \relax -\else - \addto\extrasgreek{\greektext} - \addto\noextrasgreek{\latintext} -\fi +\addto\extrasgreek{\greekscript} +\addto\noextrasgreek{\latintext} +% \addto\noextrasgreek{\RestoreFontEncoding} % \end{macrocode} % % \begin{macro}{\gr@ill@value} @@ -858,23 +945,25 @@ % \end{macro} % \end{macro} % -% Handling of Diacritics differs between Unicode and LGR encoding. -% \changes{greek-1.5}{2013/06/21}{Support XeTeX/LuaTeX.} - +% \section{Character codes} +% % 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. +% \changes{greek-1.5}{2013/06/21}{Support XeTeX/LuaTeX.} % \begin{macrocode} -\if@bbl@greek@unicode +\@ifl@aded{def}{greek-euenc}{ \InputIfFileExists{xgreek-fixes.def}{}{\PackageWarningNoLine{babel}{% - Can't find the file "xgreek-fixes.def".\MessageBreak - For correct up/downcasing of Greek text,\MessageBreak - install the "polyglossia" package}% - } -\else % 8-bit TeX + Can't find the file "xgreek-fixes.def".\MessageBreak + For correct up/down-casing of Greek text,\MessageBreak + install the "polyglossia" package}% + } + \addto\extraspolutonikogreek{} % prevent command missing error. +}{} % \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 @@ -902,6 +991,7 @@ % \changes{greek-1.4}{2013/05/17}{do not re-define the tilde accent macro: % it works as expected with \file{lgrenc.def} from \pkg{greek-fontenc}.} % \begin{macrocode} +\@ifl@aded{def}{lgrenc}{% \begingroup \@ifundefined{active@char\string!}{}{\catcode`!=12\relax} \catcode`\~=12 @@ -976,7 +1066,7 @@ % character look like |^^9f| in \TeX's eyes. The trick is to have % another character and assign it a different lowercase code. The % execute the macros needed in a |\lowercase| environment. Usually -% the tile |~| character is used for such purposes. Before we do +% the tilde |~| character is used for such purposes. Before we do % this we save it's original lowercase code to restore it once % we're done. % \changes{greek-1.1b}{1997/03/06}{Added shorthand for \cs{char255}} @@ -994,6 +1084,22 @@ \declare@shorthand{greek}{~}{}} \lccode`\~=\@tempcnta % \end{macrocode} +% Add composite commands, so that the dialytika is kept or put on the +% following character of a diphthong with |\MakeUppercase| +% (see lgrdef.enc from the the greek-fontenc package for details). +% \changes{greek-1.4}{2013/05/17}{Add TextCompositeCommands for +% ``uppercase diacritics''.} +% \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).} +% \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} +% \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 @@ -1003,12 +1109,13 @@ % \begin{macrocode} \addto\extraspolutonikogreek{\languageshorthands{greek}}% \declare@shorthand{greek}{~}{\greek@tilde} -\fi % End of LGR-specific code not required with XeTeX/LuaTeX. -\addto\extraspolutonikogreek{} % set up \extraspolutonikogreek for Xe/LuaTeX +}{} % End of LGR-specific code. % \end{macrocode} % \end{macro} % \end{macro} % +% \section{symbol name aliases} +% For backwards compatibility, we keep aliases for a few symbols. % \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 @@ -1016,9 +1123,6 @@ % \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} -% 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. % \changes{greek-1.5}{2013/06/11}{change symbol macros to aliases} % \begin{macrocode} \providecommand*{\anwtonos}{\textdexiakeraia} @@ -1033,16 +1137,10 @@ \providecommand*{\permill}{\textperthousand} % \end{macrocode} % -% 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. % \changes{greek-1.3l}{2004/02/19}{Commented these lines out as this % change has made it into \LaTeX{} itself.} -% \begin{macrocode} -%\def\fnum@figure{\figurename\nobreakspace\thefigure} -%\def\fnum@table{\tablename\nobreakspace\thetable} -% \end{macrocode} +% \changes{greek-1.8}{2013/11/27}{Remove the redefintion of fnum@figure +% and fnum@table.} % % The macro |\ldf@finish| takes care of looking for a % configuration file, setting the main language to be switched on diff --git a/Master/texmf-dist/source/generic/babel-greek/greek.ins b/Master/texmf-dist/source/generic/babel-greek/babel-greek.ins index 8ea536d1ffd..40690f0f58a 100644 --- a/Master/texmf-dist/source/generic/babel-greek/greek.ins +++ b/Master/texmf-dist/source/generic/babel-greek/babel-greek.ins @@ -25,13 +25,13 @@ %% The Current Maintainer of this work is Günter Milde <milde@users.sf.net>. %% %% The list of derived (unpacked) files belonging to the package -%% and covered by LPPL is defined by the unpacking script (greek.ins) +%% and covered by LPPL is defined by the unpacking script (babel-greek.ins) %% which is part of the distribution. %% %% --------------- start of docstrip commands ------------------ %% \def\filedate{2013/09/10} -\def\batchfile{greek.ins} +\def\batchfile{babel-greek.ins} \input docstrip.tex {\ifx\generate\undefined @@ -74,7 +74,7 @@ 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) +and covered by LPPL is defined by the unpacking script (babel-greek.ins) which is part of the package. \endpreamble @@ -84,7 +84,7 @@ which is part of the package. \usedir{tex/generic/babel} \usepreamble\mainpreamble -\generate{\file{greek.ldf}{\from{greek.dtx}{code}} +\generate{\file{greek.ldf}{\from{babel-greek.dtx}{code}} \file{athnum.sty}{\from{athnum.dtx}{package}} \file{grmath.sty}{\from{grmath.dtx}{package}} \file{grsymb.sty}{\from{grsymb.dtx}{package}} @@ -97,7 +97,7 @@ which is part of the package. \Msg{* ending with `.sty' into a directory searched by TeX.} \Msg{*} \Msg{* To produce the documentation run the files ending with} -\Msg{* '.dtx' and `.fdd' through LaTeX.} +\Msg{* '.dtx' through LaTeX.} \Msg{*} \Msg{* Happy TeXing} \Msg{***********************************************************} |