summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def')
-rw-r--r--Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def261
1 files changed, 150 insertions, 111 deletions
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
index 06cc8ad798d..c6f0f54134a 100644
--- a/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
+++ b/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
@@ -1,31 +1,31 @@
% lgrenc.def
% ***********
-%
+%
% LGR Greek font encoding definitions
% ===================================
-%
+%
% :Copyright: © 2010, 2014 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: The LGR font encoding is the de-facto standard for Greek
% typesetting with LaTeX. This file provides a comprehensive set
% of macros to typeset Greek with LGR encoded fonts. It works for
% both, monotonic and polytonic Greek, independent of the `babel`
% package.
-%
+%
% .. contents::
-%
-%
+%
+%
% Changelog
% ---------
-%
+%
% Development of this file started under the name "lgrxenc.def" as part of the
% lgrx_ bundle. With version 0.8, it moved to ``greek-fontenc/lgrx.def``.
-%
+%
% .. class:: borderless
-%
+%
% ====== ============ ========================================================
% 0.1 2010-03-31 initial attempt
% 0.2 2010-04-20 diacritics dropped in UPPERCASE.
@@ -51,24 +51,25 @@
% .. add composite command for Ῥ (Rho with Dasia).
% 0.9 2013-07-16 move common definitions to ``greek-fontenc.def``,
% .. add composite commands for single quotation marks.
-% 0.11.2 unpublished remove duplicate code.
+% 0.11.2 2014-09-04 remove duplicate code.
+% 0.13 2015-08-04 Support for symbol variants.
% ====== ============ ========================================================
-%
+%
% Usage
% -----
-%
+%
% Load this file by calling fontenc_ with the ``LGR`` option
% or indirectly via the babel_, textalpha_ or alphabeta_ packages.
-%
+%
% Example:
% Select font encodings `T1` (as default) and `LGR` (for Greek):
-%
+%
% ``\usepackage[LGR,T1]{fontenc}``
-%
-%
+%
+%
% Implementation
% --------------
-%
+%
% Read this file only once
% ~~~~~~~~~~~~~~~~~~~~~~~~
% .. note:: The use of ``\@ifundefined`` has the side-effect that the tested
@@ -76,7 +77,7 @@
% interfering with tests via eTeX's ``\ifdefined``). However, in this case
% no harm is done as the macro is defined by the identification_ below
% anyway.
-%
+%
% ::
% read this file only once
@@ -92,7 +93,7 @@
% ::
\ProvidesFile{lgrenc.def}
-[2013/12/02 v0.11.2 LGR Greek font encoding definitions]
+[2015/08/08 v0.13 LGR Greek font encoding definitions]
% Copyright © 2010 Günter Milde
% This file is part of the "greek-fontenc" package.
% It may be distributed and/or modified under the
@@ -100,17 +101,17 @@
% version 1.3 of this license or any later version.
% You can test the version date using
-%
+%
% .. code:: latex
-%
+%
% \@ifl@ter {extension}{filename}{date}{YES}{NO}
-%
+%
% or using ltxcmds_' ``\@iffilelater``.
-%
-%
+%
+%
% Base setup
% ~~~~~~~~~~
-%
+%
% Declare the LGR font encoding and base substitutions::
\DeclareFontEncoding{LGR}{}{}
@@ -119,13 +120,13 @@
% Text symbols
% ~~~~~~~~~~~~
-%
+%
% Greek Alphabet
% """"""""""""""
-%
+%
% Greek letters are accessible by the Latin transcription, but the mapping is
% specific to the LGR font encoding.
-%
+%
% The LICR macros provide a way to access the symbols independent of the
% specific font encoding, in any font encoding supporting Greek. An
% alternative Greek font encodings is LGI (ibycus_). Greek script is also
@@ -191,10 +192,10 @@
% Additional Greek symbols
% """"""""""""""""""""""""
-%
+%
% Ancient Greek Numbers (Athenian Numerals)
% '''''''''''''''''''''''''''''''''''''''''
-%
+%
% Names from ucs_ (``ucsencs.def``)
% (In ucs, five hundred is (wrongly?) named \textpentehkaton.) ::
@@ -225,22 +226,61 @@
% Numeral signs
% '''''''''''''
% See also http://en.wikipedia.org/wiki/Greek_numerals
-%
+%
% Names from ucs_::
\DeclareTextSymbol{\textdexiakeraia}{LGR}{254} % ʹ (Dexia keraia)
\DeclareTextSymbol{\textaristerikeraia}{LGR}{255} % ͵ (Aristeri keraia)
+% variant symbols
+% '''''''''''''''
+%
+% Mathematical notation distinguishes variant shapes for pi, phi, rho, theta
+% (small and capital), beta, and kappa (characters for the latter three
+% symbols are not included in TeX’s math fonts). These variations have no
+% syntactic meaning in Greek text and are not given code-points in the LGR
+% encoding. Greek text fonts use the shape variants interchangeabely.
+%
+% However, as Unicode defines separate code points for the symbol variants, we
+% provide fallback LICR macros with detailed error reporting::
+
+\providecommand*{\LGR@TextSymbolUnavailable}[1]{%
+ \PackageError{greek-fontenc}{character \string#1 not available \MessageBreak
+ in 8-bit TeX}
+ {Use XeTeX/LuaTeX if you need to distinguish the symbol from the letter.\MessageBreak
+ The package `textalpha' with `normalize-symbols' maps the GREEK SYMBOL\MessageBreak
+ character to the corresponding GREEK LETTER.\MessageBreak
+ Press <return> to proceed (dropping the symbol from the document).}
+}
+
+\providecommand*{\LGR@TextSymbolOnlyMath}[2]{%
+ \PackageError{greek-fontenc}{character \string#1 not available in text mode}
+ {Use #2 or XeTeX/LuaTeX if you need to distinguish\MessageBreak
+ the symbol from the letter.\MessageBreak
+ The package `textalpha' with `normalize-symbols' maps the GREEK SYMBOL\MessageBreak
+ character to the corresponding GREEK LETTER.\MessageBreak
+ Press <return> to proceed (dropping the symbol from the document).}
+}
+
+\ProvideTextCommand{\textbetasymbol} {LGR}{\LGR@TextSymbolUnavailable{ϐ beta symbol}}
+\ProvideTextCommand{\textkappasymbol}{LGR}{\LGR@TextSymbolUnavailable{ϰ kappa symbol}}
+\ProvideTextCommand{\textThetasymbol}{LGR}{\LGR@TextSymbolUnavailable{ϴ Theta symbol}}
+
+\ProvideTextCommand{\textthetasymbol} {LGR}{\LGR@TextSymbolOnlyMath{ϑ theta symbol}{$\vartheta$}}
+\ProvideTextCommand{\textphisymbol} {LGR}{\LGR@TextSymbolOnlyMath{ϕ phi symbol}{$\phi$}}
+\ProvideTextCommand{\textpisymbol} {LGR}{\LGR@TextSymbolOnlyMath{ϖ pi symbol}{$\varpi$}}
+\ProvideTextCommand{\textrhosymbol} {LGR}{\LGR@TextSymbolOnlyMath{ϱ rho symbol}{$\varrho$}}
+\ProvideTextCommand{\textepsilonsymbol}{LGR}{\LGR@TextSymbolOnlyMath{ϵ lunate epsilon symbol}{$\epsilon$}}
% Other
% """""
-%
+%
% Characters that also exist in other font encodings:
-%
+%
% * define them for LGR if there is a matching glyph,
% * use established macro names that match with other ``*enc.def`` files and
% ``textcomp.sty``.
-%
+%
% All encodings: See usrguide.pdf, chapter 3.14 ff::
\DeclareTextSymbol{\textendash}{LGR}{0} % EN DASH
@@ -274,103 +314,102 @@
% T3 also defines some greek letters as well as Latin characters with Greek
% names:
-%
+%
% According to the Unicode standard, the following IPA characters are identic
% to the Greek letters:
-%
-% - 03B2 greek small letter beta
-% - 03B8 greek small letter theta
-% - 03BB greek small letter lamda
-% - 03C7 greek small letter chi
-%
-% The following characters in the IPA block are not Greek letters:
-%
-% - 0251 LATIN SMALL LETTER ALPHA ≠ greek small letter alpha - 03B1
-% - 025B LATIN SMALL LETTER OPEN E = epsilon ≠ greek small letter epsilon - 03B5
-% - 0263 LATIN SMALL LETTER GAMMA ≠ greek small letter gamma - 03B3
-% - 0269 LATIN SMALL LETTER IOTA ≠ greek small letter iota - 03B9
-% - 0278 LATIN SMALL LETTER PHI ≠ greek small letter phi - 03C6
-% - 028A LATIN SMALL LETTER UPSILON ≠ greek small letter upsilon - 03C5
-%
-% Unfortunately, `tipa` uses the macro names ``\textepsilon``, ``\textgamma``,
-% ``\textiota``, ``\textphi``, and ``\textupsilon`` for the Latin characters.
-% This is no problem with 8-bit fonts (set the font encoding to T3 vs. LGR to
-% disambiguate), but leads to name clashes with Unicode fonts. xunicode_ uses
-% the ``gr`` infix and alias names to disambiguate:
-%
+%
+% - 03B2 greek small letter beta
+% - 03B8 greek small letter theta
+% - 03BB greek small letter lamda
+% - 03C7 greek small letter chi
+%
+% The following characters in the IPA block refer to Greek letters:
+%
+% - 0251 LATIN SMALL LETTER ALPHA → greek small letter alpha - 03B1
+% - 025B LATIN SMALL LETTER OPEN E = epsilon → greek small letter epsilon - 03B5
+% - 0263 LATIN SMALL LETTER GAMMA → greek small letter gamma - 03B3
+% - 0269 LATIN SMALL LETTER IOTA → greek small letter iota - 03B9
+% - 0278 LATIN SMALL LETTER PHI → greek small letter phi - 03C6
+% - 028A LATIN SMALL LETTER UPSILON → greek small letter upsilon - 03C5
+%
+% `tipa` uses the macro names ``\textepsilon``, ``\textgamma``, ``\textiota``,
+% ``\textphi``, and ``\textupsilon`` for the Latin characters. This is no
+% problem with 8-bit fonts (set the font encoding to T3 vs. LGR to
+% disambiguate), but leads to ambiguity with Unicode fonts. xunicode_ uses the
+% ``gr`` infix and alias names to disambiguate:
+%
% - 03B3 ``\textgrgamma``
% - 03B9 ``\textgriota``
% - 03C6 ``\textgrphi`` (see x0278 )
-%
+%
% but not for epsilon and upsilon (03C2 ``\textgrsigma`` is the final sigma).
-%
+%
% It also assigns alias names to the Latin counterparts, however not on a
% systematical basis:
-%
+%
% - 0194 ``\textGammaafrican``
% - 0196 ``\textIotaafrican``
% - 0251 ``\textscripta``
% - 025B ``\texteopen``
% - 0263 ``\textbabygamma``, ``\textgammalatinsmall``
-% - 0269 ``\textiotalatin``
+% - 0269 ``\textiotalatin``
% - 028A ``\textscupsilon`` % TIPA-U
-%
-%
-%
+%
+%
+%
% Not implemented
% """""""""""""""
-%
+%
% The characters at position 16 and 17 are used in the ``\nexus`` macro
% of the teubner_ package to form an extensible, hat-like bracket. In
% ``CB.enc``, they are mapped to
-%
+%
% 16--MODIFIER LETTER LOW ACUTE ACCENT
% 17--MODIFIER LETTER LOW GRAVE ACCENT
-%
+%
% but according to the documentation of Werner Lemberg's `babel patch`_,
% they rather represent the left and right part of U+23E0 TOP TORTOISE
% SHELL BRACKET.
-%
+%
% Babel's ``lgrenc.def`` has some definitions to prevent surprises with
% macros that expect a Latin script. These definitions are problematic in a
% font-encoding definition file as they require ``\textlatin`` which is
% defined in ``babel.def``. They were moved to ``greek.ldf``.
-%
-%
+%
% Diacritics
% ~~~~~~~~~~
-%
+%
% This section defines `named macros`_ for Greek diacritics and standard
% `symbol macros`_ as alias for simple diacritics. Convenient input
% conventions for `composite diacritics`_ are defined as `composite
% definitions`_.
-%
+%
% Advantages:
-%
+%
% * input convention similar to LGR input encodings (just prepend a ``\``).
-%
+%
% * Access pre-composed characters without resorting to the
% ligature mechanism (allows proper kerning, cf. teubner-doc_).
-%
+%
% * Named macros can be used to ensure a font encoding supporting Greek is
% used. However, substitution with pre-composed characters works only for
% the active font encoding (cf. textalpha_). Named accent macros can also 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 (cf. `UPPERCASE`_ below) and for composite diacritics.
-%
-%
+%
+%
% Named macros
% """"""""""""
-%
+%
% Definitions are based on the teubner_ package by Claudio Beccari, the ucs_
% package, and the `babel patch`_ by Werner Lemberg. Names are derived from
% the Unicode name with the prefix "acc" (cf. `How to name accent macros?`
% in the README_) reducing the probability of incompatibilities compared to the
% two-letter teubner_ diacritic macros or the "text" prefix used by ucs_.
-%
+%
% Simple Greek diacritics::
\DeclareTextAccent{\accdialytika}{LGR}{34} % διαλυτικά (diaeresis/trema)
@@ -388,7 +427,7 @@
\DeclareTextSymbol{\ypogegrammeni}{LGR}{124} % ͺ "small" sub-iota
% __ http://en.wikipedia.org/wiki/Hypogegrammeni
-%
+%
% Composite diacritics::
% Teubner name
@@ -410,12 +449,12 @@
\DeclareTextAccent{\accinvertedbrevebelow}{LGR}{1} % INVERTED BREVE BELOW
\DeclareTextAccent{\textsubarch}{LGR}{1} % (tipa)
\DeclareTextAccent{\accbrevebelow}{LGR}{20} % BREVE BELOW
-\DeclareTextAccent{\u}{LGR}{30} % BREVE
+\DeclareTextAccent{\u}{LGR}{30} % BREVE (Greek vrachy)
\DeclareTextAccent{\=}{LGR}{31} % MACRON
% Aliases
% """""""
-%
+%
% The standard _`symbol macros` are exclusively used for Greek diacritics
% in LGR::
@@ -426,7 +465,7 @@
% Common Greek font encoding definitions
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-%
+%
% The file greek-fontenc.def contains font encoding definitions that are
% shared by font encodings providing Greek characters::
@@ -435,24 +474,24 @@
% Composite definitions
% ~~~~~~~~~~~~~~~~~~~~~
-%
+%
% 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. ``\accdialytica\accvaria\textalpha``, ``\"\'\textalpha``,
% ``\"'\textalpha``, or ``\'"\textalpha``.
-%
+%
% The actual declarations are part of the `common Greek font encoding
% definitions`_.
-%
-%
+%
+%
% Pre-composed letters
% """"""""""""""""""""
% Small letters with diacritics
% '''''''''''''''''''''''''''''
-%
+%
% (from teubner_ with changed names of the composite accents)::
\DeclareTextComposite{\accvaria}{LGR}{a}{128}
@@ -624,15 +663,15 @@
% Capital letters with diacritics
% '''''''''''''''''''''''''''''''
-%
+%
% In Greek, diacritics are omitted in all-uppercase words, but kept as part
% of an uppercase initial (written before rather than above the letter).
-%
+%
% The diaytika should also always be used in all-uppercase words (even
% in cases where they are not needed when writing in lowercase)
-%
+%
% -- http://en.wikipedia.org/wiki/Capitalization
-%
+%
% In Title Case, place diacritics before instead of above the base character::
\DeclareTextCompositeCommand{\accdasia}{LGR}{A}{<A}
@@ -792,24 +831,24 @@
% UPPERCASE
% ~~~~~~~~~
-%
+%
% The `common Greek font encoding definitions`_ in ``greek-fontenc.def`` extend
% the `uclclist` with Greek LICR macros. Here, we add LGR specific "hiatus"
% handling.
-%
+%
% Composite commands for Latin transliteration::
-
+
\DeclareTextCompositeCommand{\LGR@hiatus}{LGR}{A}{\LGR@A@hiatus}
\DeclareTextCompositeCommand{\LGR@hiatus}{LGR}{E}{\LGR@E@hiatus}
% TODO: What does the \LGR@hiatus command "see" if a Unicode literal follows?
-%
+%
% .. code:: latex
-%
+%
% % \DeclareTextCompositeCommand{\LGR@hiatus}{LGR}{\symbol{"ce}}{bluff}
% % \DeclareTextCompositeCommand{\LGR@hiatus}{LGR}{"cf}{blaff}
% % \DeclareTextCompositeCommand{\LGR@hiatus}{LGR}{ι}{blaff}
-%
+%
% Look ahead and place a diaeresis on Ι or Υ::
\DeclareTextCommand{\LGR@A@hiatus}{LGR}{%
@@ -832,36 +871,36 @@
}
% Unfortunately, the lookahead breaks kerning.
-%
+%
% Alternatives tried:
-%
+%
% * CompositeCommands fail at the end of a macro, e.g. ``\emph{\'a}``
-%
+%
% .. code:: latex
-%
+%
% \DeclareTextCommand{\LGR@A@hiatus}{LGR}{A}
% \DeclareTextCommand{\LGR@E@hiatus}{LGR}{E}
-%
+%
% \DeclareTextCompositeCommand{\LGR@A@hiatus}{LGR}{}{A}
% \DeclareTextCompositeCommand{\LGR@A@hiatus}{LGR}{I}{A\"I}
% \DeclareTextCompositeCommand{\LGR@A@hiatus}{LGR}{U}{A\"U}
-%
-%
+%
+%
% * The glyph No 12 is a special "Upcase Alpha" that in ligature with Y
% and I adds a diaresis to them. However, it seems that it has only
% kerning definitions for I and Y (as it is not intended for direct
% use)
-%
+%
% .. code:: latex
-%
+%
% \DeclareTextComposite{\LGR@hiatus}{LGR}{A}{12}
-%
+%
% No such glyph exists for E but this is no problem as E does
% not require kerning anyway.
-%
+%
% .. References
% ----------
-%
+%
% .. _README: README.html
% .. _alphabeta: alphabeta.sty.html
% .. _athnum: http://www.ctan.org/pkg/athnum