| 1 |
LaTeX support for texnansi encoding (LY1) |
| 2 |
=========================================== |
| 3 |
|
| 4 |
Installing |
| 5 |
========== |
| 6 |
|
| 7 |
Ordinarily, you don't have to do anything, since this package is likely |
| 8 |
already present in your TeX distribution (TeX Live, MiKTeX). |
| 9 |
|
| 10 |
But if you're on your own, then just recursively copy the directories |
| 11 |
here to your texmf-local (or some) tree, preserving structure. Then add |
| 12 |
the map files *8y.map to your dvips setup and/or update the |
| 13 |
configuration of other DVI drivers correspondingly. You will have to |
| 14 |
adjust URW vs. Adobe names as needed. (In TeX Live, this is already |
| 15 |
done in dvips35.map, etc., in conjunction with updmap, and the *8y.map |
| 16 |
files here are not used.) |
| 17 |
|
| 18 |
Usage |
| 19 |
===== |
| 20 |
|
| 21 |
The font encoding `LY1` corresponds to the `texnansi` encoding |
| 22 |
originally used in the Y&Y TeX system. There is also an option to |
| 23 |
support the `ansinew` encoding that is the default encoding in |
| 24 |
Microsoft Windows. |
| 25 |
|
| 26 |
The main file is `ly1enc.def`. This contains the declaration of |
| 27 |
the encoding. To use `texnansi` encoded fonts within LaTeX, |
| 28 |
typically you just need to add the line |
| 29 |
|
| 30 |
|
| 31 |
\usepackage[LY1]{fontenc} |
| 32 |
|
| 33 |
to your document preamble. |
| 34 |
|
| 35 |
An alternative to the above line is to use the `texnansi` package |
| 36 |
|
| 37 |
\usepackage{texnansi} |
| 38 |
|
| 39 |
This will call the fontenc package, as above, to set up the LY1 |
| 40 |
encoding but then make further changes to the uppercase and |
| 41 |
lowercase tables. Note that LaTeX does not need these changes to |
| 42 |
correctly uppercase text as its \MakeUppercase and \MakeLowercase |
| 43 |
commands only require the uppercase and lower case codes of the |
| 44 |
letters a-z. |
| 45 |
|
| 46 |
So for most purposes it is better to use the call to fontenc |
| 47 |
rather than use the `texnansi' package. Then, if you pass the |
| 48 |
file to a site using T1 (Cork) encoded fonts the line can more |
| 49 |
easily be changed to |
| 50 |
|
| 51 |
\usepackage[T1]{fontenc} |
| 52 |
|
| 53 |
The texnansi package has a package option `ansinew` which |
| 54 |
modifies the LY1 encoding to refer to that MS Windows |
| 55 |
encoding. However you should only do this if your TeX system |
| 56 |
can not reencode fonts to support T1 or LY1. The `ansinew` |
| 57 |
treatment of the left quote ` as a grave accent makes it |
| 58 |
rather unsuitable for TeX use. It also lacks several useful |
| 59 |
glyphs. However if you need to, you can do: |
| 60 |
|
| 61 |
\usepackage[ansinew]{texnansi} |
| 62 |
|
| 63 |
The other possible reason for using the `texnansi` package |
| 64 |
relates to the use of the lowercase table in the hyphenation |
| 65 |
algorithm. This is described below, but it is unfortunately |
| 66 |
of necessity rather technical, and you may want to stop |
| 67 |
reading at that point. |
| 68 |
|
| 69 |
LY1 matches OT1 well enough that you can usually use it in that role |
| 70 |
also. You can `\input` texnansi if you want this to work exactly even |
| 71 |
in plain TeX. |
| 72 |
|
| 73 |
Having declared the LY1 encoding to LaTeX, LaTeX will need to |
| 74 |
know the fonts that are available in this encoding. This |
| 75 |
distribution includes TeX metrics, font definition files and |
| 76 |
map files for the common "Standard PostScript" fonts. |
| 77 |
|
| 78 |
For each encoding LaTeX needs to know an `error font` which is |
| 79 |
its fall back in the case that the font substitution system |
| 80 |
can find nothing better to do. ly1enc.def specifies that the |
| 81 |
Error Font for LY1 is Adobe Times-Roman. Any PostScript |
| 82 |
interpreter must be able to provide Times-Roman, so it seems a |
| 83 |
good choice as the error font. Yet you may wish to change |
| 84 |
this for any reason; just edit the lines |
| 85 |
|
| 86 |
\DeclareErrorFont{LY1}{ptm}{m}{n}{10} |
| 87 |
\DeclareFontSubstitution{LY1}{ptm}{m}{n} |
| 88 |
|
| 89 |
at the top of ly1enc.def to refer to some other font set. For example |
| 90 |
if you have Y&Y TeX's "Lucida Bright" distribution you could change the |
| 91 |
two occurrences of `{ptm}` to `{hlh}` to make LaTeX fall back on Lucida |
| 92 |
Bright if all else fails. Please follow the LPPL and do not |
| 93 |
capriciously alter ly1enc.def in other ways. |
| 94 |
|
| 95 |
For more information on LY1 encoding and see Y&Y's WWW page: |
| 96 |
|
| 97 |
<http://www.tug.org/yandy/usely1.htm> |
| 98 |
|
| 99 |
|
| 100 |
A Note on Lowercase Codes and Hyphenation Tables |
| 101 |
================================================ |
| 102 |
|
| 103 |
The lowercase table is used by TeX's hyphenation algorithm, so |
| 104 |
in principle one would need to change the lowercase table to |
| 105 |
match the encoding used. However, it should not be changed |
| 106 |
mid paragraph as all words, whatever font encoding they are |
| 107 |
set in, are lowercased using the table current at the *end* of |
| 108 |
the paragraph before being checked for hyphenation. Because |
| 109 |
of these limitations in TeX's hyphenation algorithm, LaTeX |
| 110 |
does not support changing the lowercase table mid document, so |
| 111 |
if the `texnansi` package is used then the `texnansi` |
| 112 |
lowercase table will be used for all fonts (whether or not LY1 |
| 113 |
encoded) and conversely if it is not used, the T1 table will |
| 114 |
be used, even for LY1 encoded fonts. The reason why this |
| 115 |
problem is not as serious as it may at first appear is that |
| 116 |
the majority of letters (as opposed to ligatures, and symbols) |
| 117 |
that occur in LY1 occur in the same place in T1. |
| 118 |
|
| 119 |
The only letters that might possibly appear in a hyphenation |
| 120 |
table that are in different positions in T1 and LY1 are: |
| 121 |
|
| 122 |
``` |
| 123 |
\oe (low position OT1 high new) |
| 124 |
\ss (low position OT1 high new) |
| 125 |
\v{s} |
| 126 |
\v{z} |
| 127 |
\l |
| 128 |
\i OT1 (although *composites* such as \'\i are in T1 position |
| 129 |
so this will only affect languages (Turkish?) that use |
| 130 |
an unaccented \i) |
| 131 |
\"{y} |
| 132 |
``` |
| 133 |
|
| 134 |
It should be noted that for those symbols that occur twice in |
| 135 |
LY1, the "high" copy is used if it coincides with the position |
| 136 |
used in T1 (as in the case of \ae, \o) otherwise the "low" |
| 137 |
copy will be used which will coincide with the OT1 position |
| 138 |
(\oe, \ss). (Unless the setup for ansinew is enabled in which |
| 139 |
case the high position is always used.) |
| 140 |
|
| 141 |
Fortunately most hyphenation files for Western European |
| 142 |
languages (I checked French, German and Danish) duplicate all |
| 143 |
the hyphenation patterns using these letters so that the |
| 144 |
tables work with both T1 and OT1 (and hence LY1) encoded |
| 145 |
fonts. However if you are using a language that makes use of |
| 146 |
say, \ss, but the hyphenation patterns just refer to \ss as |
| 147 |
^^ff then you will need to copy the hyphenation file and edit |
| 148 |
all occurrences of ^^ff to refer to the new position; either |
| 149 |
^^19 (for texnansi) or ^^df (for ansinew). |
| 150 |
|
| 151 |
The remaining letters that are in different positions, such as |
| 152 |
s caron, may be dealt with similarly, although they are mainly |
| 153 |
used in Eastern European languages. The LY1 encoding does not |
| 154 |
have as many glyphs for Eastern European languages as T1, so |
| 155 |
for those languages most likely this encoding is not suitable. |
| 156 |
(Of course TeX can produce all the accented letters required, |
| 157 |
but the hyphenation algorithm can not work with such |
| 158 |
constructed composites it can only work with composite letters |
| 159 |
that actually occur in the font.) |
| 160 |
|
| 161 |
It would be a good thing if hyphenation tables did not refer |
| 162 |
to any explicit character positions using the ^^ab notation, |
| 163 |
but rather always accessed characters by control sequences |
| 164 |
such as \ss. This would allow the remapping to be done via |
| 165 |
inputting a file such as ly1enc.def rather than by editing the |
| 166 |
hyphenation file. However currently most of the publicly |
| 167 |
available hyphenation tables unfortunately do "hard wire" the |
| 168 |
T1 character codes in this way. |
| 169 |
|
| 170 |
|
| 171 |
Copyright 1997 David Carlisle |
| 172 |
(Updated Feb. 2001 Walter Schmidt) |
| 173 |
(Updated Jun. 2010 Karl Berry) |
| 174 |
(Updated Oct. 2010 Karl Berry -- Times small caps faked as intended.) |
| 175 |
(Updated Jan. 2011 Karl Berry |
| 176 |
-- missing map entries for ptmrr8ye and ptmr8yn. |
| 177 |
-- irrelevant {phvl*,psyr,pzdr}.tfm removed. |
| 178 |
-- relevant ptm{b,r}c8y.vf included, and corresponding ptm{b,r}c8y.tfm. |
| 179 |
Thanks to Bruno Voisin for much research and debugging. |
| 180 |
) |
| 181 |
(Updated June 2022 David Carlisle ) |
| 182 |
|
| 183 |
All the files in this directory may be redistributed and/or modified |
| 184 |
under the terms of the LaTeX Project Public License |
| 185 |
http://www.latex-project.org/lppl/ |
| 186 |
either version 1 of the License, or (at your option) any later version. |