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
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>greek-fontenc: Greek text font encoding setup</title>
<meta name="copyright" content="© 2013 Günter Milde" />
<link rel="stylesheet" href="../../../../../Python/docutils-svn/docutils/docutils/writers/html4strict/html4css1.css" type="text/css" />
<link rel="stylesheet" href="../../../../../Python/docutils-svn/docutils/docutils/writers/html4strict/html4css2.css" type="text/css" />
</head>
<body>
<div class="document" id="greek-fontenc-greek-text-font-encoding-setup">
<h1 class="title">greek-fontenc: Greek text font encoding setup</h1>
<dl class="docinfo">
<dt class="copyright">Copyright</dt>
<dd class="copyright">© 2013 Günter Milde</dd>
<dt>Licence</dt>
<dd><p>This work may be distributed and/or modified under the
conditions of the <a class="reference external" href="http://www.latex-project.org/lppl.txt">LaTeX Project Public License</a>, either
version 1.3 of this license or any later version.</p>
</dd>
<dt>Identification</dt>
<dd><pre class="literal-block">\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{greek-fontenc}
[2013/09/10 v0.1 Greek text font encoding setup]
</pre>
</dd>
</dl>
<div class="abstract topic">
<p class="topic-title first">Abstract</p>
<p>This package sets up a suitable font encoding and Greek LICR
definitions depending on the used TeX engine.</p>
</div>
<div class="section" id="motivation">
<h1>Motivation</h1>
<p>With 8-bit TeX, you usually pass the font encoding name(s) as option to
<a class="reference external" href="http://www.ctan.org/pkg/fontenc">fontenc</a> which then loads the corresponding <tt class="literal">*.def</tt> file(s).
The last option indicates the document’s default font encoding.
(See <a class="citation-reference" href="#fntguide" id="id1">[fntguide]</a> for details and <a class="reference external" href="lgrenc-test.tex">lgrenc-test.tex</a> for an example.)</p>
<p>However, with XeTeX or LuaTeX, there is one common input and font encoding
– Unicode. 8-bit TeX font encodings should generally not be used. For
compatibility with the LaTeX font selection system, the package <a class="reference external" href="http://www.ctan.org/pkg/euenc">euenc</a>
defines the (pseudo) font encodings EU1 and EU2 for XeTeX and LuaTeX
respectively, however <a class="reference external" href="http://www.ctan.org/pkg/euenc">euenc</a> does not (yet) define LICR macros. The package
<a class="reference external" href="http://www.ctan.org/pkg/xunicode">xunicode</a> defines LICR macros for use with XeTeX but does not support Greek.</p>
<p>To allow documents using Greek LICR macros without worrying about the TeX
engine used to compile them, this package does a simple test (based on the
<tt class="literal">\ifdefined</tt> command provided by the e-TeX extension) and does “the right
thing” to set up Greek text font support for the detected engine.</p>
</div>
<div class="section" id="xetex">
<h1>XeTeX</h1>
<ul class="simple">
<li><p>Use the EU1 font encoding. This is the only font encoding used with
XeTeX, so loading it with <a class="reference external" href="http://www.ctan.org/pkg/fontenc">fontenc</a> cannot mix up the default font
encoding.</p></li>
<li><p>Ensure EU1 is the <tt class="literal">\LastDeclaredEncoding</tt>. As fontenc does not load font
encoding definition files twice, it may happen that another font encoding
is defined after EU1 – for example the xunicode package (also loaded by
fontspec) leaves <tt class="literal">\LastDeclaredEncoding</tt> at <tt class="literal">T3</tt> (tipa), because it
inputs <tt class="literal">t3enc.def</tt>.</p></li>
<li><p>load the Greek LICR definitions for XeTeX/LuaTeX. In an ideal world, this
should be done in the eu1enc.def file of the <a class="reference external" href="http://www.ctan.org/pkg/euenc">euenc</a> package.</p></li>
</ul>
<pre class="literal-block">\ifdefined\XeTeXrevision
\usepackage[EU1]{fontenc}
\renewcommand{\LastDeclaredEncoding}{EU1}
\input{greek-euenc.def}
</pre>
</div>
<div class="section" id="luatex">
<h1>LuaTeX</h1>
<p>Similar actions to XeTeX, but use the font encoding EU2. (The two different
(pseudo) encodings allow different font setups for XeTeX vs. LuaTeX using
differently named <tt class="literal">*.fd</tt> files (see <a class="reference external" href="http://www.ctan.org/pkg/euenc">euenc</a> for details).</p>
<pre class="literal-block">\else\ifdefined\luatexversion
\usepackage[EU2]{fontenc}
\renewcommand{\LastDeclaredEncoding}{EU1}
\input{greek-euenc.def}
</pre>
</div>
<div class="section" id="bit-tex">
<h1>8-bit TeX</h1>
<p>Wit 8-bit TeX (TeX, PDFTeX), we do not know the documents main font
encoding, so we cannot use <tt class="literal"><span class="pre">\usepackage[LGR]{inputenc}</span></tt>. However, the file
<tt class="literal">lgrenc.def</tt> contains code to prevent re-definition if it is already
loaded, so we can simply input:</p>
<pre class="literal-block">\else
\input{lgrenc.def}
\fi\fi
</pre>
</div>
<div class="section" id="references">
<h1>References</h1>
<dl class="citation"><dt class="label"><a class="fn-backref" href="#id1">[fntguide]</a></dt>
<dd id="fntguide">
<p class="first last">LaTeX3 Project Team, <cite>LaTeX 2ε font selection</cite>, 2005.
<a class="reference external" href="http://mirror.ctan.org/macros/latex/doc/fntguide.pdf">http://mirror.ctan.org/macros/latex/doc/fntguide.pdf</a></p>
</dd>
</dl>
</div>
</div>
</body>
</html>
|