diff options
author | Karl Berry <karl@freefriends.org> | 2014-12-29 23:24:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-12-29 23:24:17 +0000 |
commit | 9a0f0d057b7f36dcc8f060ed5efdcdf0408ad201 (patch) | |
tree | fc17e9fd17d0395d4b5b7b6b0a77803cf38824d1 /Master/texmf-dist/tex/latex | |
parent | e8520f340f5558c580fc5f6cc601cc4361ad5970 (diff) |
greek-fontenc (25dec14)
git-svn-id: svn://tug.org/texlive/trunk@35920 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
4 files changed, 217 insertions, 170 deletions
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-euenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-euenc.def index 5a2bdf38467..f99ff55a9f2 100644 --- a/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-euenc.def +++ b/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-euenc.def @@ -2,7 +2,7 @@ % =================== % Composite definitions for XeTeX and LuaTeX % ****************************************** -% +% % :Copyright: © 2013 Günter Milde % :Licence: This work may be distributed and/or modified under the % conditions of the `LaTeX Project Public License`_, either @@ -14,28 +14,28 @@ [2014/09/04 0.11.2 Composite definitions for XeTeX and LuaTeX] % Composite definitions for ``alphabeta.sty`` with XeTeX and LuaTeX. -% +% % Changelog: % .. class:: borderless -% +% % ========== ====== ======================================================== % 2013-09-12 0.1 initial version % 2013-10-01 0.1.1 remove clashing defs for legacy characters with oxia. % 2014-09-04 0.11.2 documentation update % ========== ====== ======================================================== -% +% % The alphabeta_ package re-defines the math macros for Greek letters to work % in both, text and math mode, so that Greek letters can be specified with % the established command names in text, too. -% +% % The NFSS TextComposite mechanism looks for the next token without expanding % it. In order to let compositions like ``\>"\alpha`` work as expected we % define TextComposites with the `letter name commands`. -% +% % This file expands the font encoding definitions in greek-euenc.def_ with % composite commands for use with Unicode fonts. It is sourced by alphabeta_ % under XeTeX/LuaTeX. -% +% % Greek and Coptic % ~~~~~~~~~~~~~~~~ % :: @@ -303,7 +303,7 @@ % .. References -% +% % .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt % .. _alphabeta: alphabeta.sty.html % .. _greek-euenc.def: greek-euenc.def.html diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def index 8df1b65c748..b03bb7ff4bb 100644 --- a/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def +++ b/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def @@ -2,7 +2,7 @@ % +++++++++++++++ % Greek LICR definitions for XeTeX and LuaTeX % ******************************************* -% +% % :Copyright: © 2013 Günter Milde % :Licence: This work may be distributed and/or modified under the % conditions of the `LaTeX Project Public License`_, either @@ -11,61 +11,62 @@ % :: \ProvidesFile{greek-euenc.def} -[2014/09/08 0.11.2 Greek LICRs for XeTeX and LuaTeX] +[2014/12/12 0.12 Greek LICRs for XeTeX and LuaTeX] % :abstract: % Experimental support for Greek LICR macros with XeTeX and LuaTeX. % Extends euenc_. Used by babel-greek_ and textalpha_. -% +% % History: % .. class:: borderless -% -% ========== ====== ======================================================== -% 2013-07-16 0.1 initial version -% 2013-07-18 0.1.1 bugfix: wrong breathings psilioxia -> dasiaoxia -% 2013-07-19 0.1.2 bugfix: Disable composite defs starting with char macro, -% .. fix "hiatus" handling. -% 2013-07-24 0.1.3 fix "input" path. -% 2013-10-01 0.1.4 remove clashing defs for legacy characters with oxia, -% .. fix upcasing of ``\finalsigma``. -% 2013-12-01 0.11.1 fix identification. -% 2014-09-08 0.11.2 ``\textKoppa`` macro +% +% ====== ========== ======================================================== +% 0.1 2013-07-16 initial version +% 0.1.1 2013-07-18 bugfix: wrong breathings psilioxia -> dasiaoxia +% 0.1.2 2013-07-19 bugfix: Disable composite defs starting with char macro, +% .. fix "hiatus" handling. +% 0.1.3 2013-07-24 fix "input" path. +% 0.1.4 2013-10-01 remove clashing defs for legacy characters with oxia, +% .. fix upcasing of ``\finalsigma``. +% 0.11.1 2013-12-01 fix identification. +% 0.11.2 2014-09-08 ``\textKoppa`` macro % .. (Capital Koppa is not defined in LGR but Unicode). -% ========== ====== ======================================================== -% +% 0.12 2014-12-12 Remove symbol macros for breathing accents. +% ====== ========== ======================================================== +% % Motivation % ========== -% +% % LICR macro definitions for the Greek script are missing in both, xunicode_ % and euenc_. -% +% % This file expands the font encoding definition files ``eu1enc.def`` rsp. % ``eu2enc.def`` from euenc_ defining `LaTeX Internal Character % Representaction` (LICR) macros for Greek letters and symbols. It works % independed of xunicode_ using the standard commands for `LaTeX2e font % selection`_. -% +% % Requirements % ============ -% +% % Requires XeTeX or LuaTeX, euenc_ (usually loaded via fontspec_), and a font -% with Greek characters. -% +% with Greek characters. +% % See `<greek-euenc-doc.tex>`_ and `<greek-euenc-doc.pdf>`_ for setup and % usage examples. -% -% +% +% % Greek Diacritics % ================ -% +% % Define "named macros" for simple and combined diacritics. -% +% % * Named accent macros can be used instead of the ``\@tabacckludge`` by % to-LaTeX converters to ensure working also inside the tabbing environment. -% +% % * Named macros are required for upcasing according to Greek typesetting % conventions and in the definition of composite commands. -% +% % Greek alias names for standard accents:: \DeclareTextCommand{\acctonos}{\LastDeclaredEncoding}{\@tabacckludge'} @@ -74,18 +75,18 @@ \DeclareTextCommand{\accperispomeni}{\LastDeclaredEncoding}{\@tabacckludge~} % Breathings: -% +% % (The COMBINING GREEK KORONIS is a legacy character, discarded in favour of % COMBINING COMMA ABOVE) :: \DeclareTextCommand{\accpsili}{\LastDeclaredEncoding}[1]{#1\char"0313 } % ψιλή spiritus lenis (smooth breathing) \DeclareTextCommand{\accdasia}{\LastDeclaredEncoding}[1]{#1\char"0314 } % δασεῖα spiritus asper (rough breathing) -\DeclareTextCommand{\>}{\LastDeclaredEncoding}{\accpsili} -\DeclareTextCommand{\<}{\LastDeclaredEncoding}{\accdasia} +% \DeclareTextCommand{\>}{\LastDeclaredEncoding}{\accpsili} +% \DeclareTextCommand{\<}{\LastDeclaredEncoding}{\accdasia} % Sub-iota: -% +% % ``\ypogegrammeni`` is a postfix accent (ligature in LGR) :: \DeclareTextSymbol{\ypogegrammeni}{\LastDeclaredEncoding}{0837} % COMBINING GREEK YPOGEGRAMMENI @@ -108,7 +109,7 @@ % Common Definitions % ================== -% +% % Use the `common Greek font encoding definitions`_:: \input{greek-fontenc.def} @@ -116,17 +117,17 @@ % Character Definitions % ===================== -% +% % General Punctuation % ~~~~~~~~~~~~~~~~~~~ -% +% % Ligature break up with ZERO WIDTH NON-JOINER:: \DeclareTextCommand{\textcompwordmark}{\LastDeclaredEncoding}{\char"200C} % Greek and Coptic % ~~~~~~~~~~~~~~~~ -% +% % :: % NR Unicode Name % babel name, % PU name @@ -238,11 +239,11 @@ % Greek Extended % ~~~~~~~~~~~~~~ -% +% % We skip definitions for characters "... WITH OXIA", because they would % overwrite the defintions for "... WITH TONOS" in the `Greek and Coptic` % block. -% +% % :: \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\textalpha}{ἀ} @@ -496,10 +497,10 @@ % ~~~~~~~~~~~~~~~~~~~~~ % TODO: map other chars to corresponding Greek letters. % See also the grnumalt_ package. -% +% % Definition with literal Unicode characters, because the code-point has 5 % hexadecimal digits: -% +% % :: \DeclareTextCommand{\textpentedeka}{\LastDeclaredEncoding}{𐅄} % GREEK ACROPHONIC ATTIC FIFTY @@ -510,7 +511,7 @@ % UPPERCASE % ========= -% +% % The common Greek font encoding definitions in greek-fontenc.def_ extend the % `uclclist` with Greek LICR macros. Here, we add Unicode-specific "hiatus_" % handling (copied from lgrenc.def_ and changed Latin transcription to Unicode @@ -537,7 +538,7 @@ } % .. References -% +% % .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt % .. _babel-greek: http://www.ctan.org/pkg/babel-greek % .. _euenc: http://www.ctan.org/pkg/euenc @@ -547,8 +548,8 @@ % .. _inputenc: http://www.ctan.org/pkg/inputenc % .. _textalpha: textalpha.sty.html % .. _xunicode: http://www.ctan.org/pkg/xunicode -% -% .. _LaTeX2e font selection: +% +% .. _LaTeX2e font selection: % http://mirror.ctan.org/macros/latex/doc/fntguide.pdf % .. _common Greek font encoding definitions: % .. _greek-fontenc.def: greek-fontenc.def.html diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/greek-fontenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/greek-fontenc.def index 06d591d6272..c7128dc3684 100644 --- a/Master/texmf-dist/tex/latex/greek-fontenc/greek-fontenc.def +++ b/Master/texmf-dist/tex/latex/greek-fontenc/greek-fontenc.def @@ -1,48 +1,49 @@ % greek-fontenc.def % ***************** -% +% % Common Greek font encoding definitions % ====================================== -% +% % :Copyright: © 2013 Günter Milde % :Licence: This work may be distributed and/or modified under the % conditions of the `LaTeX Project Public License`_, either % version 1.3 of this license or any later version. % :Identification: % :: - + \ProvidesFile{greek-fontenc.def} -[2013/11/28 v0.11 Common Greek font encoding definitions] +[2014/12/12 v0.12 Common Greek font encoding definitions] % :Abstract: This file provides definitions that are shared between % font encodings providing Greek characters. -% +% % Changelog: % .. class:: borderless -% +% % ===== ============ ======================================================== % 0.9 2013-07-03 code "outsourced" from lgrxenc.def % 0.9.1 2013-07-17 composite definitions starting with standard accent cmds % 0.11 2013-11-28 ``\greekscript`` TextCommand +% 0.12 2014-12-12 Remove symbol macros for breathing accents. % ===== ============ ======================================================== -% +% % Usage % ----- -% +% % This file is input by the font encoding definition files lgrenc.def_. and % greek-euenc.def_. -% +% % Implementation % -------------- -% +% % ensuregreek, greekscript % ~~~~~~~~~~~~~~~~~~~~~~~~ -% +% % Provide "empty" encoding-specific definitions for ``\ensuregreek`` and % ``\greekscript``. The definitions in this file make the font encoding fit % for use with the Greek script. (See ``textalpha.sty`` for default % definitions.) -% +% % The ``\ensuregreek`` macro can be used to ensure that its argument is set % in a font encoding with support for Greek. If the active font encoding % supports it, kerning between adjacent command calls (e.g. @@ -60,10 +61,10 @@ % Aliases % ~~~~~~~ -% +% % Aliases are defined via `DeclareTextCommand` so that up/downcasing works % without the need for additional uclclist_ entries. -% +% % Compatibility aliases for hyperref_'s puenc.def:: \DeclareTextCommand{\textstigmagreek}{\LastDeclaredEncoding}{\textstigma} @@ -82,47 +83,60 @@ \DeclareTextCommand{\accoxia}{\LastDeclaredEncoding}{\acctonos} \DeclareTextCommand{\acckoronis}{\LastDeclaredEncoding}{\accpsili} -% Symbol macros for the breathings:: - -\DeclareTextCommand{\<}{\LastDeclaredEncoding}{\accdasia} -\DeclareTextCommand{\>}{\LastDeclaredEncoding}{\accpsili} - +% Symbol macros for the breathings: +% +% Moved to ``textalpha.sty`` to avoid clashes with local definitions +% of ``\<`` and ``\>`` in documents using LGR or babel-greek. +% (Bugreport David Kastrup). If you want to use the short macros without +% loading `textalpha`, you can define them in the document preamble like +% +% .. code:: latex +% +% \DeclareTextCommand{\<}{LGR}{\accdasia} +% \DeclareTextCommand{\>}{LGR}{\accpsili} +% \DeclareTextCompositeCommand{\>}{LGR}{'}{\accpsilioxia} +% \DeclareTextCompositeCommand{\>}{LGR}{`}{\accpsilivaria} +% \DeclareTextCompositeCommand{\>}{LGR}{~}{\accpsiliperispomeni} +% \DeclareTextCompositeCommand{\<}{LGR}{'}{\accdasiaoxia} +% \DeclareTextCompositeCommand{\<}{LGR}{`}{\accdasiavaria} +% \DeclareTextCompositeCommand{\<}{LGR}{~}{\accdasiaperispomeni} +% % TODO: do we also want alternative symbols for the breathings (cf. X compose % table, LCI encoding)? -% +% % .. code:: latex -% +% % \DeclareTextCommand{\(}{\LastDeclaredEncoding}{\accdasia} % \DeclareTextCommand{\)}{\LastDeclaredEncoding}{\accpsili} -% +% % Names from babel_ and teubner_ (do we want to define them here as alias?) -% +% % .. code:: latex -% +% % \DeclareTextCommand{\anwtonos}{\LastDeclaredEncoding}{\textdexiakeraia} % ʹ % \DeclareTextCommand{\katwtonos}{\LastDeclaredEncoding}{\textaristerikeraia} % ͵ -% -% +% +% % Composite diacritics % ~~~~~~~~~~~~~~~~~~~~ -% +% % Composite accents can be input as sequence of simple diacritics (in % arbitrary order) via named macro, symbol macro and "transcription % characters", e.g. one of -% +% % .. code:: latex -% +% % \accdialytica\accvaria\textalpha, % \"\'\textalpha, % \"'\textalpha, or % \'"\textalpha. -% +% % Separate definitions for the supported variants of the second input token % are required as composition is based on the non-expanded input -% +% % The composition with simple "transcription characters" must also be defined % for the symbol macros, otherwise it fails with ``\Makeuppercase``. -% +% % For Unicode encodings (where they do not resolve to Greek named macros, % composite definitions starting with standard macros are requried:: @@ -197,47 +211,41 @@ \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\acctonos}{\accpsilioxia} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\'}{\accpsilioxia} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{'}{\accpsilioxia} -\DeclareTextCompositeCommand{\>}{\LastDeclaredEncoding}{'}{\accpsilioxia} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\accvaria}{\accpsilivaria} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\`}{\accpsilivaria} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{`}{\accpsilivaria} -\DeclareTextCompositeCommand{\>}{\LastDeclaredEncoding}{`}{\accpsilivaria} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\accperispomeni}{\accpsiliperispomeni} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{\~}{\accpsiliperispomeni} \DeclareTextCompositeCommand{\accpsili}{\LastDeclaredEncoding}{~}{\accpsiliperispomeni} -\DeclareTextCompositeCommand{\>}{\LastDeclaredEncoding}{~}{\accpsiliperispomeni} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{\acctonos}{\accdasiaoxia} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{\'}{\accdasiaoxia} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{'}{\accdasiaoxia} -\DeclareTextCompositeCommand{\<}{\LastDeclaredEncoding}{'}{\accdasiaoxia} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{\accvaria}{\accdasiavaria} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{\`}{\accdasiavaria} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{`}{\accdasiavaria} -\DeclareTextCompositeCommand{\<}{\LastDeclaredEncoding}{`}{\accdasiavaria} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{\accperispomeni}{\accdasiaperispomeni} \DeclareTextCompositeCommand{\accdasia}{\LastDeclaredEncoding}{\~}{\accdasiaperispomeni} -\DeclareTextCompositeCommand{\<}{\LastDeclaredEncoding}{~}{\accdasiaperispomeni} -% .. _uclclist: -% +% .. _uclclist: +% % UPPERCASE % ~~~~~~~~~ -% +% % If UPPERCASE (all-caps) is generated with ``\MakeUppercase``, macro % substitutions in the ``\@uclclist`` apply. This can be used to drop the % diacritics (except dialytika and sub-iota). Different conventions exist for % the `treatment of sub-iota with uppercase letters`__. In the CB Fonts, an % "index" iota is used. -% +% % __ http://www.tlg.uci.edu/~opoudjis/unicode/unicode_adscript.html -% -% +% +% % @uclclist extension % """"""""""""""""""" -% +% % Based on the `babel patch`_ and ``fontenc.sty``. -% +% % The definition of an auxiliary, self-restting macro makes this idempotent % (only the first use of this function will expand the ``@uclclist``). % The second and third lines are TeX' way of writing ``uclclist += …``:: @@ -302,7 +310,7 @@ % Substitution macros % """"""""""""""""""" -% +% % Drop diacritics (The argument passing ensures that kerning is preserved) :: \DeclareTextCommand{\LGR@accdropped}{\LastDeclaredEncoding}[1]{#1} @@ -319,7 +327,7 @@ % Mark hiatus % """"""""""" -% +% % Tonos and dasia mark a hiatus if placed on the % first vowel of a diphthong (ΑΙ, ΑΥ, ΕΙ). A dialytika must be placed on the % second vowel if they are dropped (άυλος → ΑΫΛΟΣ, μάινα → ΜΑΪΝΑ, κέικ → ΚΕΪΚ, @@ -333,14 +341,14 @@ % The font encoding file must define the ``\LGR@hiatus`` TextCommand. See % ``lgrenc.def`` for an example. -% +% % The following macro can be used to test if the next character is an Alpha or % Epsilon. As ``\@ifnextchar`` gobbles spaces the lookahead macro definition % from ``amsgen.sty`` is used: -% +% % This macro is a new version of LaTeX’s ``\@ifnextchar``, macro % that does not skip over spaces. -% +% % :: \providecommand*{\LGR@ifnextchar}[3]{% @@ -357,7 +365,7 @@ % .. References % ---------- -% +% % .. _alphabeta: alphabeta.sty.html % .. _athnum: http://www.ctan.org/pkg/athnum % .. _Babel: http://www.ctan.org/pkg/babel @@ -374,6 +382,6 @@ % http://mirror.ctan.org/macros/latex/contrib/teubner/teubner-doc.pdf % .. _textalpha: textalpha.sty.html % .. _ucs: http://www.ctan.org/pkg/unicode -% +% % .. _lgrenc.def: lgrenc.def.html % .. _greek-euenc.def: greek-euenc.def.html diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/textalpha.sty b/Master/texmf-dist/tex/latex/greek-fontenc/textalpha.sty index 7d123b8b3f3..61932d7d5fc 100644 --- a/Master/texmf-dist/tex/latex/greek-fontenc/textalpha.sty +++ b/Master/texmf-dist/tex/latex/greek-fontenc/textalpha.sty @@ -2,31 +2,31 @@ % +++++++++++++ % Greek symbols in text % ********************* -% +% % :Copyright: © 2010 Günter Milde % :Licence: This work may be distributed and/or modified under the % conditions of the `LaTeX Project Public License`_, either % version 1.3 of this license or any later version. -% +% % :Abstract: Provide a set of ``\text*`` macros for Greek characters % in text mode. -% +% % :Identification: % :: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{textalpha} -[2013/11/28 v0.11 macros for Greek letters in text] +[2014/12/12 v0.12 macros for Greek letters in text] % .. note:: -% +% % The package was renamed from `textgreek` to `textalpha` to prevent % confusion with the textgreek_ package by Leonard Michlmayr. -% -% +% +% % Changelog: % .. class:: borderless -% +% % ========== ===== ========================================================= % 2010-06-16 0.1 initial version % 2012-06-27 0.2 support for compound Unicode definitions outside LGR @@ -34,77 +34,79 @@ % 2013-05-28 0.4 use ``lgrenc.def`` from greek-fontenc. % 2013-09-11 0.5 move to greek-fontenc_, % .. support XeTeX/LuaTeX, add breve below accents. -% 2013-11-28 0.11 Compatibility with Xe/LuaTeX in 8-bit mode. +% 2013-11-28 0.11 compatibility with Xe/LuaTeX in 8-bit mode. +% 2014-12-12 0.12 fix auxiliary macro names, +% define symbol macros for breathing accents. % ========== ===== ========================================================= -% +% % Motivation % ========== -% +% % By default, TeX macros for Greek letters are only valid in mathematical % mode. This package sets up a suitable font encoding and Greek LICR % definitions (``\textalpha`` -- ``\textOmega``). -% +% % To allow documents using Greek LICR macros without worrying about the TeX % engine used to compile them, this package tests the declared font encodings % and does "the right thing" to set up Greek text font support: -% +% % * If the Unicode font encodings EU1 (XeTeX) or EU2 (LuaTeX) are declared, % before loading this package (e.g. vie ``fontspec``) the package provides % Greek LICR definitions for them. -% +% % * If the LGR font encoding is declared before loading this package, it is % set as default for Greek LICR macros (cf. fntguide_ section 5.3). -% +% % With XeTeX or LuaTex, Unicode fonts and LGR encoded 8-bit fonts can be % used in the same document (see greek-euenc-doc.tex_). -% +% % Advantages: -% +% % * Symbols from a Greek text font (e.g. the `CB fonts`_) can be accessed % without the need for an explicite font-encoding switch anywhere in the % text. -% -% * Unicode input of Greek characters is supported -% +% +% * Unicode input of Greek characters is supported +% % + via ``\usepackage[utf8]{inputenc}`` and ``lgrenc.dfu`` from % greek-inputenc_ for 8-bit TeX or XeTeX/LuaTeX in 8-bit compatibility % mode in any font encoding (see textalpha-doc.tex_). -% +% % + natively by XeTeX/LuaTeX for Unicode fonts. As inputenc_ does not work % with these engines, text input can be done via the Latin transcription % or LICR but *not via literal Unicode characters* for 8-bit font encodings % like LGR (see greek-euenc-doc.tex_). -% +% % .. Attention:: The macros work well in any font encoding for single symbols. % However, with 8-bit TeX engines, the automatic font-encoding switches % behind the doors interfere with kerning between letters and replacement % of accent+character with a pre-composed character. -% +% % Therefore, Greek text should be written with the help of babel_ or % polyglossia_ (setting the language to ``greek``) or wrapped in the % provided ``ensuregreek`` macro. Using babel_ or polyglossia_ also helps % to ensure correct hyphenation of Greek text. -% -% +% +% % Usage % ===== -% +% % .. code:: latex -% +% % \usepackage{textalpha} -% +% % For detailled examples see `<textalpha-doc.tex>`_ and `<textalpha-doc.pdf>`_ % (8-bit TeX and XeTeX/LuaTeX in 8-bit compatibility mode) as well as % `<greek-euenc-doc.tex>`_ and `<greek-euenc-doc.pdf>`_ (XeTeX/LuaTeX with % Unicode fonts). -% -% +% +% % Implementation % ============== -% +% % Requirements % ------------ -% +% % With XeTeX or LuaTeX, there is one common input and font encoding -- % Unicode. 8-bit TeX font encodings are only used in compatibility mode or for % fonts not available otherwise. For compatibility with the LaTeX font @@ -113,25 +115,25 @@ % define LICR macros. We therefore explicitely load Greek LICR definitions for % XeTeX/LuaTeX from `greek-euenc.def <greek-euenc.def.html>`_ which in turn % includes `greek-fontenc.def <greek-fontenc.def.html>`_. -% +% % With 8-bit LaTeX, the LGR font encoding is used for Greek characters. If no % Greek-supporting font encoding (EU1, EU2, or LGR) is declared, LGR is loaded % and set up as default Greek font encoding by this package. -% +% % To give ``textalpha.sty`` a chance of finding out which font encodings are % used, load it after fontspec_ and/or fontenc_. -% +% % Font encodings % """""""""""""" -% +% % Ensure a Greek-supporting font encoding exists and supports Greek LICR % macros: -% +% % Load the Greek LICR definitions for Unicode if font encoding EU1 (XeTeX) or % EU2 (LuaTeX) is detected. [#EU]_ In an ideal world, this would be done in % the ``eu1enc.def`` (or ``eu2enc.def``) file of the euenc_ package. If none % of EU1, EU2, and LGR is declared, load ``lgrenc.def``: -% +% % Re-set the ``\LastDeclaredEncoding``: Because fontenc loads font % encoding definition files only once, it may happen that another font % encoding is defined afterwards --- for example fontspec_ leaves @@ -157,8 +159,7 @@ % .. [#EU] The two different (pseudo) font encodings allow different font setups for % XeTeX vs. LuaTeX using differently named ``*.fd`` files (see euenc_ for % details). -% -% +% % The package hyperref_ defines the PU font encoding which also supports % (monotonic) Greek. It currently misses polytonic greek and the % ``\greekscript`` and ``\ensuregreek`` TextCommands:: @@ -168,27 +169,61 @@ \ProvideTextCommand{\ensuregreek}{PU}[1]{#1}} {} +% Symbol macros for breathings +% """""""""""""""""""""""""""" +% +% In the Latin transcription provided by LGR, breathing accents (Dasia and +% Psili) are input as < and >. We provide the corresponding NFSS macro accents +% (moved here from `greek-fontenc.def`_). +% +% As Xe/LuaTeX may use LGR in combination with EU1 or EU2, we define the +% macros for both, LGR and Unicode font encodings (if they are defined):: + +\@ifl@aded{def}{lgrenc}{ + \DeclareTextCommand{\<}{LGR}{\accdasia} + \DeclareTextCommand{\>}{LGR}{\accpsili} + % Composite accents starting with the new-defined shortcuts: + \DeclareTextCompositeCommand{\>}{LGR}{'}{\accpsilioxia} + \DeclareTextCompositeCommand{\>}{LGR}{`}{\accpsilivaria} + \DeclareTextCompositeCommand{\>}{LGR}{~}{\accpsiliperispomeni} + \DeclareTextCompositeCommand{\<}{LGR}{'}{\accdasiaoxia} + \DeclareTextCompositeCommand{\<}{LGR}{`}{\accdasiavaria} + \DeclareTextCompositeCommand{\<}{LGR}{~}{\accdasiaperispomeni} +}{} + +\@ifl@aded{def}{greek-euenc}{ % XeTeX (EU1) or LuaTeX (EU2) + \DeclareTextCommand{\<}{\LastDeclaredEncoding}{\accdasia} + \DeclareTextCommand{\>}{\LastDeclaredEncoding}{\accpsili} + % Composite accents starting with the new-defined shortcuts: + \DeclareTextCompositeCommand{\>}{\LastDeclaredEncoding}{'}{\accpsilioxia} + \DeclareTextCompositeCommand{\>}{\LastDeclaredEncoding}{`}{\accpsilivaria} + \DeclareTextCompositeCommand{\>}{\LastDeclaredEncoding}{~}{\accpsiliperispomeni} + \DeclareTextCompositeCommand{\<}{\LastDeclaredEncoding}{'}{\accdasiaoxia} + \DeclareTextCompositeCommand{\<}{\LastDeclaredEncoding}{`}{\accdasiavaria} + \DeclareTextCompositeCommand{\<}{\LastDeclaredEncoding}{~}{\accdasiaperispomeni} +}{} + % Default declarations % -------------------- -% +% % The following definitions ensure that the Greek LICR macros can be used % anywhere in the document also with 8-bit TeX by declaring LGR as their -% default font encoding. Abort here, if another Greek-supporting -% font encoding is used instead of LGR:: +% default font encoding. Abort here, if the LGR font encoding is not defined:: - \@ifl@aded{def}{lgrenc} - {\renewcommand{\LastDeclaredEncoding}{LGR}} - {\expandafter\endinput} % "return" +\@ifl@aded{def}{lgrenc} + {} +% else return: + {\expandafter\endinput} % greekscript, ensuregreek % """""""""""""""""""""""" -% +% % The ``\greekscript`` declaration ensures the current font encoding supports % the Greek script. ``greek-fontenc.def`` sets this to the empty declaration % for font encodings that do so. This is currently used by ``lgrenc.def`` % (LGR) and ``greek-euenc.def`` (Greek LICR macros for EU1 and EU2). -% -% +% +% % We define LGR as default encoding for Greek text. We use % ``\ProvideTextCommandDefault`` to enable the author or other packages to use % an alternative definition (see [fntguide_]):: @@ -201,26 +236,26 @@ \ProvideTextCommandDefault{\ensuregreek}[1]{\leavevmode{\greekscript #1}} % .. The [fntguide_] writes -% +% % Note that ``\DeclareTextAccentDefault`` can be used on any % one-argument encoding-specific command, not just those defined with % ``\DeclareTextAccent``. -% +% % However, the simpler alternative % ``\DeclareTextAccentDefault{\ensuregreek}{LGR}`` fails with the table of % Unicode characters in the test document `<textalpha-doc.tex>`__: -% +% % ``! You can't use a prefix with `end-group character }'.`` -% +% % Eventually, all font encodings supporting Greek script (e.g. LGI, PU, EU1, % EU2) will declare ``\ensuregreek`` as text command that passes the argument % unchanged. This way, kerning and selection of precomposed glyphs would work % also for cases like ``\ensuregreek{\'A}U``. -% -% +% +% % Greek Alphabet % """""""""""""" -% +% % Define the ``text*`` marcos as default for all font encodings:: \DeclareTextSymbolDefault{\textAlpha}{LGR} @@ -278,9 +313,9 @@ % Additional Greek symbols % '''''''''''''''''''''''' -% +% % Including alias names for compatibility with hyperref's puenc.def. -% +% % Ancient Greek Numbers (Athenian Numerals):: \DeclareTextSymbolDefault{\textpentedeka}{LGR} % GREEK ACROPHONIC ATTIC FIFTY @@ -317,7 +352,7 @@ % Diacritics % """""""""" -% +% % Greek diacritics via "named" macros:: \DeclareTextAccentDefault{\accdasia}{LGR} @@ -326,8 +361,6 @@ \DeclareTextAccentDefault{\accvaria}{LGR} \DeclareTextAccentDefault{\accperispomeni}{LGR} \DeclareTextAccentDefault{\accdialytika}{LGR} -\DeclareTextAccentDefault{\<}{LGR} -\DeclareTextAccentDefault{\>}{LGR} % \DeclareTextAccentDefault{\accdasiaoxia}{LGR} \DeclareTextAccentDefault{\accdasiavaria}{LGR} @@ -339,6 +372,11 @@ \DeclareTextAccentDefault{\accdialytikavaria}{LGR} \DeclareTextAccentDefault{\accdialytikaperispomeni}{LGR} +% Symbol macros for the breathings:: + +\DeclareTextAccentDefault{\<}{LGR} +\DeclareTextAccentDefault{\>}{LGR} + % Postfix accents:: \DeclareTextSymbolDefault{\ypogegrammeni}{LGR} % "small" sub-iota @@ -353,12 +391,12 @@ % Auxiliary macros % """""""""""""""" -% -% ``\MakeUppercase`` requires two internal commands:: +% +% ``\MakeUppercase`` requires three internal commands:: +\DeclareTextAccentDefault{\LGR@accdropped}{LGR} +\DeclareTextAccentDefault{\LGR@accDialytika}{LGR} \DeclareTextAccentDefault{\LGR@hiatus}{LGR} -\DeclareTextAccentDefault{\LGR@Dialytika}{LGR} - % .. References % ---------- |