summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/greek-fontenc/README
blob: 498b30c0e168906dfb67bd021cd43c64d197ffbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
greek-fontenc
#############
Greek font encoding definition files
************************************

:Author:    Günter Milde
:Date:      2013-09-10
:Copyright: © 2013 Günter Milde <milde@users.sf.net>
: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 fontenc_ standard package supports TeX font encodings via
            `encoding definition files`. The mechanism is explained in
            [fntguide_], section 5. This package provides encoding definition
            files for `Greek text font encodings`_ for use with fontenc_ and
            8-bit TeX engines. Currently, only LGR_ is supported.

.. note::   The LICR macro names for Greek symbols are chosen pending
            endorsement by the TeX community and related packages.

            Names for archaic characters, accents/diacritics, and
            punctuation may change in future versions.

News
====

.. class:: borderless

==========  ===== ==========================================================
2013-07-03  0.9   greek-fontenc.def "outsourced" from lgrxenc.def
..                experimental files xunicode-greek.sty and
                  greek-euenc.def: LICRs for XeTeX/LuaTeX.
2013-07-18  0.9.1 bugfix: wrong breathings psilioxia -> dasiaoxia.
2013-07-19  0.9.2 bugfix: Disable composite defs starting with char macro,
..                fix "hiatus" handling.
2013-07-24  0.9.3 fix "input" path in xunicode-greek and greek-euenc.def.
2013-09-10  0.9.4 greek-fontenc.sty: Greek text font encoding setup package,
..                remove xunicode-greek.sty.
==========  ===== ==========================================================


Files
=====

`<greek-fontenc.def>`_
  `Common Greek font encoding definitions <greek-fontenc.def.html>`_.

`<lgrenc.def>`_
  `LGR Greek font encoding definitions <lgrenc.def.html>`_.

  This file is the successor of the basic LGR encoding definition file which
  comes with babel_'s Greek support and ``lgrxenc.def`` from the lgrx_
  bundle.

`<lgrenc-test.tex>`_, `<lgrenc-test.pdf>`_
  Test and usage example.

`<greekhyperref.tex>`_, `<greekhyperref.pdf>`_
  `Greek script in PDF metadata`.

  The package hyperref_ defines the PU font encoding which also supports
  (monotonic) Greek.

Experimental files that are still in development and will eventually be
moved to/merged with other packages or removed in future versions:

`<greek-fontenc.sty>`_
  `Greek text font encoding setup <greek-fontenc.sty.html>`_

`<greek-euenc.def>`_
  `Greek LICR definitions for XeTeX and LuaTeX <greek-euenc.def.html>`_

`<test-euenc.tex>`_
  Example for use of the experimental Greek LICR definitions with XeTeX or
  LuaTeX.

`<lgr2licr.lua>`_
  `LGR Transcription to Greek LICR transformation <lgr2licr.lua.html>`_

Literate source files were converted with PyLit_ to reStructuredText and
with Docutils_ to the HTML documentation.


Installation
============

If possible, get this package from your distribution using its installation
manager.

Otherwise, make sure LaTeX can find the package and definition files:

* Download and unpack ``greek-fontenc.zip``.

* Copy/Move/Link files ending in ``.def`` or ``.sty`` to a suitable place in
  the TDS_ and run ``texhash``, or place them in the current working
  directory (e.g. for testing).

Usage
=====

For 8-bit TeX, pass the encoding name as option to fontenc_.  For example,
specify T1 (Latin) as default font encoding and LGR for Greek with ::

     \usepackage[LGR,T1]{fontenc}

See [fntguide]_ for details and `<lgrenc-test.tex>`_ for an example.

For XeTeX/LuaTeX, you can specify the EU1/EU2 encoding and
load the experimental ``greek-euenc.def``::

     \usepackage[EU1]{fontenc} % XeTeX
     % \usepackage[EU2]{fontenc} % LuaTeX
     \makeatletter
     \input{greek-euenc.def}
     \makeatother

XeTeX/LuaTeX usage details are likely to change in the future!!!

To ensure Greek support independent of the TeX engine, you may write ::

     \usepackage{fontenc-greek}


Greek text font encodings
=========================

Greek TeX font encodings are the envisaged T7_, LGR_, and LGI_.
Greek letters and symbols are also defined in the Unicode-based font
encodings EU1 (XeTeX), EU2 (LuaTeX) and PU (hyperref_).

T7
--

The [encguide]_ reserves the name T7 for a Greek `standard font encoding`.
However, up to now, there is no agreement on an implementation because the
restrictions for general text encodings are too severe for typesetting
polytonic Greek.


LGR
---

The LGR font encoding is the de-facto standard for typesetting Greek with
(8-bit) LaTeX. Fonts in this encoding include the `CB fonts`_ (matching CM),
grtimes_ (Greek Times), Kerkis_ (matching URW Bookman), and the `GFS font
collection`_. Setup of these fonts as Greek variant to matching Latin fonts
is facilitated by the substitutefont_ package.

The LGR font encoding allows to access Greek characters via an ASCII
transliteration. This enables simple input with a Latin keyboard.
Characters with diacritics can be selected by ligature definitions in the
font (see [greek-usage]_, [teubner-doc]_, [cbfonts]_).

A major drawback of the transliteration is, that you cannot access Latin
letters if LGR is the active font encoding (e.g. in documents or parts of
documents given the `Babel` language ``greek`` or ``polutionikogreek``).
This means that for every Latin-written word or acronym an explicit
language-switch is required. This problem can only be solved via a
font-encoding comprising Latin and Greek like the envisaged T7_ or
Unicode (with XeTeX or LuaTeX).

LGI
---

The ‘Ibycus’ fonts from the package ibygrk_ implement an alternative
transliteration scheme (also explained in [babel-patch]_).
It is currently not supported by `greek-fontenc`.

The font encoding file ``lgienc.def`` from ibycus-babel_ provides a basic
setup (without any LICR macros or composite definitions).


Greek LICR macro names
======================

This package provides LaTeX internal character representations (LICR macros)
for Greek letters and diacritics. Macro names were selected based on the
following considerations:

The fntguide_ (section 6.4 Naming conventions) recommends:

  Where possible, text symbols should be named as ``\text`` followed
  by the Adobe glyph name: for example ``\textonequarter`` or
  ``\textsterling``. Similarly, math symbols should be named as
  ``\math`` followed by the glyph name, for example
  ``\mathonequarter`` or ``\mathsterling``.

The `Adobe Glyph List For New Fonts`_ has names for many glyphs in the
`Greek and Coptic` Unicode block, but not for `Greek extended`. The `Adobe
Glyph List`_ (for existing fonts) lists additional glyph names used in older
fonts. As these are not intened for further active use, the latter are not
considered in the name choice.

Proposals
---------

* If there exists a math-mode macro for a symbol, form the corresponding text
  macro by prepending ``text``?

  Example:
    The glyph name for the GREEK SMALL LETTER FINAL SIGMA is ``sigma1``,
    the corresponding math-macro is ``\varsigma``. The text symbol could be
    made available as ``\textvarsigma``.

  Problems:
    ``\varepsilon`` and ``\varphi`` math macros map to characters named
    "GREEK SMALL **LETTER** ...", while ``\\vartheta``, ``\\varkappa``,
    ``\\varrho``, and ``\\varpi`` math macros map to "GREEK ... **SYMBOL**"
    Unicode characters.

    In Greek text, these variants are interchangeable. The LGR font encoding
    does not contain slots for "symbol" glyph variants. In some Greek fonts,
    GREEK SMALL LETTERS use glyph variants resembling the corresponding
    GREEK SYMBOL Unicode character's reference glyph.

* Derive macro names from Unicode names?

  The `Unicode names list`_ provides standardized descriptive names for all
  Unicode characters that use only capital letters of the Latin alphabet.
  While not suited for direct use in a LICR macros, they can be either

  a) used as inspiration for new LICR macro names or

  b) converted to LICR macro names via a defined set of transformation rules.

  Example:
    ``\textfinalsigma`` or just ``\finalsigma`` as a more descriptive name
    for GREEK SMALL LETTER FINAL SIGMA derived via the rules:

    * drop "LETTER" if the name remains unique,
    * drop "GREEK" if the name remains unique,
    * use capitalized name for capital letters, lowercase for "SMALL" letters
      and drop "SMALL",
    * concatenate

* Omit the "text" prefix for macros that do not have a math counterpart?

  Pro:
    + Simpler,

    + ease of use (less typing, better readability of source text),

    + many established text macro names without "text",

    + there are examples of encoding-specific macros
      without the ``text``-prefix, especially for letters,

      :T1:  ``\AE \DH \DJ \L \NG \OE \O \SS \TH \ae \dh \dj \guillemotleft``
            ``\guillemotright \guilsinglleft \guilsinglright \i \j \l \ng``
            ``\oe \o \quotedblbase \quotesinglbase \ss \th`` (also in OT1)
      :T2*: ``\CYR*`` and ``\cyr*``
      :HE8: ``\heb*`` or no prefix
      :PU:  short descriptive names in the arabic part (``puarenc.def``)

    + ``text`` prefix does **not** mark a macro as encoding-specific or
      "inserting a glyph". There are e.g. font-changing macros (``\textbf``,
      ``\textit``) and encoding-changing macros (``\textgreek``,
      ``\textcyr``).

  Contra:
    - Less consistent.

    - ``text`` prefix marks a macro as confined to text mode.

  Conclusion:
      To avoid name clashes, this package uses the ``text`` prefix
      for symbols. Aliases (short forms, compatibility defs, etc.) can be
      defined in packages.


How to name *accent macros*?
----------------------------

* standard accent macros (``\DeclareTextAccent`` definitions in
  ``latex/base/...``) are one-symbol macros (``\' \" ... \u \v ...``) .

* ``tipa.sty``, xunicode_, and ucs_ use the "text" prefix also for accents.

  However, the `Adobe Glyph List For New Fonts`_ maps, e.g., "tonos" and
  "dieresistonos" to 0384 GREEK TONOS and 0385 GREEK DIALYTIKA TONOS, hence
  `\texttonos` and `\textdiaresistonos` should be spacing characters.

* textcomp (ts1enc.def) defines ``\capital...`` accents (i.e. without
  ``text`` prefix).

* Use a common prefix ``\textaccent...``, ``\accent...``,
  or just ``\acc...`` (cf ``\@tabacckludge``)?

Currently, `greek-fontenc` uses for diacritics:

- Greek names like in Unicode, and ucsencs.def

- The prefix "acc" to distinguish the macros as `TextAaccent` and reduce the
  risc of name clashes.

- For the end-user "symbol macros" (``\~ \' \` \" \< \>``) are provided.


References
----------

An alternative, more complete set of short mnemonic character names is
the `XML Entity Definitions for Characters`_ W3C Recommendation from
01 April 2010.

For glyph names of the LGR encoding see e.g. ``CB.enc`` by Apostolos
Syropoulos and ``xl-lgr.enc`` from the libertine_ (legacy) package.
``lgr.cmap`` provides a mapping to Unicode characters.

A full set of ``\text*`` symbol macros is defined in ``ucsencs.def``
from the ucs_ package.

Aliases from ``puenc.def`` ensure that the hyperref_ package can convert
Greek text in "LICR encoding" to a PDF-string (utf-8 encoded input is used
as-is).


.. [fntguide] LaTeX3 Project Team, `LaTeX2ε font selection`, 2005.
   http://mirror.ctan.org/macros/latex/doc/fntguide.pdf
.. [encguide] Frank Mittelbach, Robin Fairbairns, Werner Lemberg,
   LaTeX3 Project Team, `LaTeX font encodings`, 2006.
   http://mirror.ctan.org/macros/latex/doc/encguide.pdf
.. [greek-usage] Apostolos Syropoulos, `Writing Greek with the greek option
   of the babel package`, 1997.
   http://www.tug.org/texlive/Contents/live/texmf-dist/doc/generic/babel/greek-usage.pdf
.. [cbfonts] Claudio Beccari, `The CB Greek fonts`, Εὔτυπον, τεῦχος № 21, 2008.
   http://www.eutypon.gr/eutypon/pdf/e2008-21/e21-a01.pdf
.. [teubner-doc] Claudio Beccari, ``teubner.sty``
   `An extension to the greek option of the babel package`, 2011.
   http://mirror.ctan.org/macros/latex/contrib/teubner/teubner-doc.pdf

.. [babel-patch] Werner Lemberg, `Unicode support for the Greek LGR
   encoding` Εὔτυπον, τεῦχος  № 20, 2008.
   http://www.eutypon.gr/eutypon/pdf/e2008-20/e20-a03.pdf

.. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
.. _PyLit: http://pylit.berlios.de
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Docutils: http://docutils.sourceforge.net/rst.html
.. _TDS: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=tds

.. _Adobe Glyph List For New Fonts:
    http://www.adobe.com/devnet-archive/opentype/archives/aglfn.txt
.. _Adobe Glyph List:
    http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
.. _Unicode names list: http://www.unicode.org/Public/UNIDATA/NamesList.txt
.. _XML Entity Definitions for Characters:
    http://www.w3.org/TR/xml-entity-names/

.. _CB Fonts: http://www.ctan.org/pkg/cbgreek-complete
.. _GFS font collection: http://www.ctan.org/pkg/gfs
.. _Kerkis: http://www.ctan.org/pkg/kerkis
.. _babel: http://www.ctan.org/pkg/babel
.. _fontenc:  http://www.ctan.org/pkg/fontenc
.. _grtimes: http://www.ctan.org/pkg/grtimes
.. _hyperref: http://www.ctan.org/pkg/hyperref
.. _ibycus-babel: http://www.ctan.org/pkg/ibycus-babel
.. _ibygrk: http://www.ctan.org/pkg/ibygrk
.. _lgrx: http://www.ctan.org/pkg/lgrx
.. _libertine: http://www.ctan.org/pkg/libertine-legacy
.. _substitutefont: http://www.ctan.org/pkg/substitutefont
.. _ucs: http://www.ctan.org/pkg/unicode
.. _xunicode: http://www.ctan.org/pkg/xunicode