| 1 |
%% filename: cyracc.def |
| 2 |
%% version: 2.2b |
| 3 |
%% date: 2001/10/01 |
| 4 |
%% |
| 5 |
%% American Mathematical Society |
| 6 |
%% Technical Support |
| 7 |
%% Publications Technical Group |
| 8 |
%% 201 Charles Street |
| 9 |
%% Providence, RI 02904 |
| 10 |
%% USA |
| 11 |
%% tel: (401) 455-4080 |
| 12 |
%% (800) 321-4267 (USA and Canada only) |
| 13 |
%% fax: (401) 331-3842 |
| 14 |
%% email: [email protected] |
| 15 |
%% |
| 16 |
%% Copyright 1996, 2001, 2009 American Mathematical Society. |
| 17 |
%% |
| 18 |
%% Unlimited copying and redistribution of this file are permitted as |
| 19 |
%% long as this file is not modified. Modifications, and distribution |
| 20 |
%% of modified versions, are permitted, but only if the resulting file |
| 21 |
%% is renamed. |
| 22 |
%% |
| 23 |
%% ==================================================================== |
| 24 |
%% |
| 25 |
%% This file is intended for use only with Plain TeX and AMS-TeX. |
| 26 |
%% It is not compatible with LaTeX. |
| 27 |
%% |
| 28 |
%% The \font specification(s) should be made elsewhere, and should include |
| 29 |
%% \newfam\cyrfam |
| 30 |
%% \font\...cyr=wncyr... (e.g. \font\tencyr=wncyr10 ) |
| 31 |
%% An appropriate definition for cyrillic, usable in math and text, is |
| 32 |
%% \def\cyr{\fam\cyrfam\...cyr\cyracc} |
| 33 |
%% More extensive instructions for using cyrillic fonts are included |
| 34 |
%% in the AMSFonts 2.2 User's Guide. |
| 35 |
%% |
| 36 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 37 |
|
| 38 |
\chardef\tempcat=\the\catcode`\@ |
| 39 |
\catcode`\@=11 |
| 40 |
|
| 41 |
% The first set of definitions is what will be in effect outside of cyrillic, |
| 42 |
% i.e., in transliterated text. |
| 43 |
|
| 44 |
% Definition of \cydot is not ideal; real dot should be in an accent font. |
| 45 |
\def\cydot{{\mathsurround=0pt$\cdot$}} |
| 46 |
|
| 47 |
% \ubar is the definition of \b from PLAIN; it may not work in math mode. |
| 48 |
\def\ubar#1{\oalign{#1\crcr\hidewidth |
| 49 |
\vbox to.2ex{\hbox{\char22}\vss}\hidewidth}} |
| 50 |
|
| 51 |
% Soft and hard signs are represented in transliteration by prime and |
| 52 |
% double prime respectively. |
| 53 |
\def\cprime{\/{\mathsurround=0pt$'$}} |
| 54 |
\def\Cprime{{\mathsurround=0pt$'$}} |
| 55 |
\def\cdprime{\/{\mathsurround=0pt$''$}} |
| 56 |
\def\Cdprime{{\mathsurround=0pt$\ubar{\hbox{$''$}}$}} |
| 57 |
|
| 58 |
\def\dbar{dj} % make real barred d when accent font available |
| 59 |
\def\Dbar{Dj} % "" |
| 60 |
|
| 61 |
% It would be nice to make these control sequences unnecessary; that will |
| 62 |
% probably require d to become active. |
| 63 |
\def\dz{dz} |
| 64 |
\def\Dz{Dz} |
| 65 |
\def\dzh{dzh\cydot } |
| 66 |
\def\Dzh{Dzh\cydot } |
| 67 |
|
| 68 |
|
| 69 |
% Stress marks are sometimes used in cyrillic text, mainly for pedagogic |
| 70 |
% reasons. These definitions support stress marks within {\cyr ...}; |
| 71 |
% in transliteration, they are suppressed. Stress is indicated in |
| 72 |
% input by \! preceding a letter on which a stress mark is to appear; |
| 73 |
% an acute accent will appear in the output. Since \! is also a plain |
| 74 |
% command, for negative thin space in math mode, test for math mode and |
| 75 |
% include the plain definition as appropriate. |
| 76 |
|
| 77 |
\def\@gobble#1{} |
| 78 |
\def\@testgrave{\`} |
| 79 |
\def\@stressit{\futurelet\chartest\@stresschar } |
| 80 |
|
| 81 |
\def\@stresschar#1{% |
| 82 |
\ifx #1y\def\result{\futurelet\chartest\@yligature}% |
| 83 |
\else \ifx #1Y\def\result{\futurelet\chartest\@Yligature}% |
| 84 |
\else \ifx\chartest\@testgrave \def\result{\accent"26 }% |
| 85 |
\else \def\result{\accent"26 #1}% |
| 86 |
\fi \fi \fi |
| 87 |
\result } |
| 88 |
|
| 89 |
\def\@yligature{% |
| 90 |
\ifx a\chartest \def\result{\accent"26 \char"1F \@gobble}% |
| 91 |
\else \ifx u\chartest \def\result{\accent"26 \char"18 \@gobble}% |
| 92 |
\else \def\result{\accent"26 y}% |
| 93 |
\fi \fi |
| 94 |
\result } |
| 95 |
|
| 96 |
\def\@Yligature{% |
| 97 |
\ifx a\chartest \def\result{\accent"26 \char"17 \@gobble}% |
| 98 |
\else \ifx A\chartest \def\result{\accent"26 \char"17 \@gobble}% |
| 99 |
\else \ifx u\chartest \def\result{\accent"26 \char"10 \@gobble}% |
| 100 |
\else \ifx U\chartest \def\result{\accent"26 \char"10 \@gobble}% |
| 101 |
\else \def\result{\accent"26 Y}% |
| 102 |
\fi \fi \fi \fi |
| 103 |
\result } |
| 104 |
|
| 105 |
\def\!{\ifmmode \mskip-\thinmuskip \fi} |
| 106 |
|
| 107 |
|
| 108 |
% These are the definitions that will produce cyrillic letters within |
| 109 |
% {\cyr ...} for letters represented in input by control sequences and |
| 110 |
% accented latin letters. |
| 111 |
|
| 112 |
\def\cyracc{% |
| 113 |
\def\cydot{{\kern0pt}}% |
| 114 |
\def\cprime{\char"7E }\def\Cprime{\char"5E }% |
| 115 |
\def\cdprime{\char"7F }\def\Cdprime{\char"5F }% |
| 116 |
\def\dbar{dj}\def\Dbar{Dj}% |
| 117 |
\def\dz{\char"1E }\def\Dz{\char"16 }% |
| 118 |
\def\dzh{\char"0A }\def\Dzh{\char"02 }% |
| 119 |
\def\'##1{\if c##1\char"0F % |
| 120 |
\else \if C##1\char"07 % |
| 121 |
\else \accent"26 ##1\fi \fi }% |
| 122 |
\def\`##1{\if e##1\char"0B % |
| 123 |
\else \if E##1\char"03 % |
| 124 |
\else \errmessage{accent \string\` not defined in cyrillic}% |
| 125 |
##1\fi \fi }% |
| 126 |
\def\=##1{\if e##1\char"0D % |
| 127 |
\else \if E##1\char"05 % |
| 128 |
\else \if \i##1\char"0C % |
| 129 |
\else \if I##1\char"04 % |
| 130 |
\else \errmessage{accent \string\= not defined in cyrillic}% |
| 131 |
##1\fi \fi \fi \fi }% |
| 132 |
\def\u##1{\if \i##1\accent"24 i% |
| 133 |
\else \accent"24 ##1\fi }% |
| 134 |
\def\"##1{\if \i##1\accent"20 \char"3D % |
| 135 |
\else \if I##1\accent"20 \char"04 % |
| 136 |
\else \accent"20 ##1\fi \fi }% |
| 137 |
\def\!{\ifmmode \def\result{\mskip-\thinmuskip}% |
| 138 |
\else \def\result{\@stressit}\fi \result}} |
| 139 |
|
| 140 |
|
| 141 |
% If cyrillic strings are to be included in \mark's, the accents need |
| 142 |
% to be kept in unexpanded form until the \mark's are interpreted. |
| 143 |
% See note on \mark below for details. |
| 144 |
|
| 145 |
\def\keep@cyracc{\let\cyr=\relax \let\i=\relax |
| 146 |
\let\ubar=\relax \let\cydot=\relax |
| 147 |
\let\cprime=\relax \let\Cprime=\relax |
| 148 |
\let\cdprime=\relax \let\Cdprime=\relax |
| 149 |
\let\dbar=\relax \let\Dbar=\relax |
| 150 |
\let\dz=\relax \let\Dz=\relax |
| 151 |
\let\dzh=\relax \let\Dzh=\relax |
| 152 |
\let\'=\relax \let\`=\relax \let\==\relax |
| 153 |
\let\u=\relax \let\"=\relax \let\!=\relax } |
| 154 |
|
| 155 |
|
| 156 |
\catcode`\@=\tempcat |
| 157 |
\endinput |
| 158 |
|
| 159 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 160 |
% |
| 161 |
% ***** CYRACC.DEF ***** |
| 162 |
% |
| 163 |
% Access to the cyrillic is through the MR 1980 transliteration scheme, |
| 164 |
% using TeX/Metafont ligature capability. (An alternate set of ligatures |
| 165 |
% exists, for accessing letters beyond the 26 located in the font positions |
| 166 |
% of the 26 roman letters. An authoritative list of the ligature rules is |
| 167 |
% given below, under the heading Ligatures.) Successful use of this file |
| 168 |
% requires appropriate cyrillic and accent fonts, arranged according to |
| 169 |
% the AMS/MR scheme. |
| 170 |
% |
| 171 |
% There are some weaknesses in this ligaturing and accent system. |
| 172 |
% The following are known to be less than satisfactory: |
| 173 |
% |
| 174 |
% the intermediate `ligatures' for shch access numerals; |
| 175 |
% primes (transliteration of hard/soft signs) use math mode; |
| 176 |
% underbar on `cap' double prime is too low (hard sign); |
| 177 |
% thorn d's don't yet exist; |
| 178 |
% \cydot uses math mode; |
| 179 |
% this scheme is not compatible with automatic Russian hyphenation. |
| 180 |
% |
| 181 |
% |
| 182 |
% Notes on the macros: |
| 183 |
% |
| 184 |
% The single space following each hex character code is necessary |
| 185 |
% to prevent the next input character from being gobbled. |
| 186 |
% |
| 187 |
% |
| 188 |
% Note on \mark : |
| 189 |
% |
| 190 |
% Control sequences such as these cyrillic accents should remain |
| 191 |
% unexpanded when generating \mark's; otherwise, the definition of |
| 192 |
% the expanded strings in effect when the \mark is used may be |
| 193 |
% inappropriate. By \let\...=\relax , the \... takes on the important |
| 194 |
% characteristic of a primitive that it will not be expanded further. |
| 195 |
% The following code has been shown to generate correct \mark entries |
| 196 |
% that can be used successfully in running heads: |
| 197 |
% |
| 198 |
% \newtoks\marktoks |
| 199 |
% \def\domark{\keep@cyracc \mark{\the\marktoks}} |
| 200 |
% |
| 201 |
% In running heads, the marks should be accessed using \the to expand |
| 202 |
% the tokens strings properly. |
| 203 |
% |
| 204 |
% |
| 205 |
% Ligatures |
| 206 |
% |
| 207 |
% This is a list of all the letter ligatures in the AMS cyrillic fonts, |
| 208 |
% and in other cyrillic fonts (such as those developed at the University |
| 209 |
% of Washington that use the AMS arrangement). |
| 210 |
% |
| 211 |
% LOWER CASE LIGATURES |
| 212 |
% |
| 213 |
% A. All-letter ligatures |
| 214 |
% |
| 215 |
% ch = `q |
| 216 |
% dj = '016 |
| 217 |
% kh = `h |
| 218 |
% lj = '011 |
| 219 |
% nj = '010 |
| 220 |
% sh = `x; xc = `7 (shc); 7h = `w (shch) |
| 221 |
% ts = `c |
| 222 |
% ya = '037 |
| 223 |
% yu = '030 |
| 224 |
% zh = '031 |
| 225 |
% |
| 226 |
% B. Ligatures with keyed numerals |
| 227 |
% |
| 228 |
% c1 = '017 |
| 229 |
% d1 = '016 (dj); d2 = '012 (dzh); d3 = '036 (dz) |
| 230 |
% e0 = '033; e1 = '013; e2 = '015 |
| 231 |
% i0 = '032; i1 = '014 |
| 232 |
% j1 = '037 (ya); j2 = '030 (yu) |
| 233 |
% l1 = '011 (lj) |
| 234 |
% n1 = '010 (nj) |
| 235 |
% p1 = '176; p2 = '177 |
| 236 |
% z1 = '031 (zh) |
| 237 |
% |
| 238 |
% UPPER CASE LIGATURES |
| 239 |
% A. All-letter ligatures |
| 240 |
% |
| 241 |
% CH, Ch = `Q |
| 242 |
% KH, Kh = `H |
| 243 |
% LJ, Lj = '001 |
| 244 |
% NJ, Nj = '000 |
| 245 |
% SH, Sh = `X; XH, Xh = `6 (SHC, SHc, Shc); |
| 246 |
% 6H, 6h = `W (SHCH, SHCh, SHch, Shch) |
| 247 |
% TS, Ts = `C |
| 248 |
% YA, Ya = '027 |
| 249 |
% YU, Yu = '020 |
| 250 |
% ZH, Zh = '021 |
| 251 |
% |
| 252 |
% B. Ligatures with keyed numerals |
| 253 |
% |
| 254 |
% C1 = '007 |
| 255 |
% D1 = '006 (DJ); D2 = '002 (DZH); D3 = '026 (DZ) |
| 256 |
% E0 = '023; E1 = '003; E2 = '005 |
| 257 |
% I0 = '022; I1 = '004 |
| 258 |
% J1 = '027 (YA); J2 = '020 (YU) |
| 259 |
% L1 = '001 (LJ) |
| 260 |
% N0 = '175 (Number sign); N1 = '000 (NJ) |
| 261 |
% P1 = '136; P2 = '137 |
| 262 |
% Z1 = '021 (ZH) |
| 263 |
% |
| 264 |
% DEACTIVATED LIGATURES |
| 265 |
% |
| 266 |
% The dzh and DZH ligatures were originally built in the following manner, |
| 267 |
% but the results were not compatible with desired keyboarding schemes. |
| 268 |
% |
| 269 |
% dz = '036; '036(roman s)h = '012 (dzh) |
| 270 |
% DZ = '026; '026(roman S)H = '002 (DZH) |
| 271 |
% |
| 272 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |