| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% |
| 3 |
% Module: Redefinitions for Common Encoding |
| 4 |
% |
| 5 |
% Copyright 1989--2020 by Paul C. Anagnostopoulos |
| 6 |
% under The MIT License (opensource.org/licenses/MIT) |
| 7 |
% |
| 8 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9 |
|
| 10 |
|
| 11 |
% Redefine accents. |
| 12 |
|
| 13 |
\def \"#1{{\accent 8 #1}} %~ Umlaut accent. %^accent |
| 14 |
|
| 15 |
\def \.#1{{\accent 11 #1}} %~ Dot accent. %^accent |
| 16 |
|
| 17 |
\def \H #1{{\accent 12 #1}} %~ Long Hungarian umlaut accent. %^accent |
| 18 |
|
| 19 |
\def \^#1{{\accent 7 #1}} %~ Circumflex accent. %^accent |
| 20 |
|
| 21 |
\def \g #1{% %~ Ogonek accent. %^accent |
| 22 |
\setbox \zboxa = \hbox{#1}% |
| 23 |
\if \dimeqlp{\ht\zboxa}{1ex}% |
| 24 |
\accent 14 #1% |
| 25 |
\else |
| 26 |
{\ooalign{\hidewidth \char 14 \hidewidth \cr |
| 27 |
\unhbox \zboxa}}% |
| 28 |
\fi} |
| 29 |
|
| 30 |
\def \~#1{{\accent 15 #1}} %~ Tilde accent. %^accent |
| 31 |
|
| 32 |
|
| 33 |
% Redefine standard ASCII characters. |
| 34 |
|
| 35 |
\def \udquote {% %~ Undirected double quote. %^named_char |
| 36 |
\ensurepar |
| 37 |
\char "22\relax} |
| 38 |
|
| 39 |
\def \dollar {% %~ Dollar sign. %^named_char |
| 40 |
\zprehyph{\dollarhyph}% |
| 41 |
\char "24\relax |
| 42 |
\zposthyph{\dollarhyph}} |
| 43 |
|
| 44 |
\let \$ = \dollar |
| 45 |
|
| 46 |
\def \less {% %~ Less-than sign. %^named_char |
| 47 |
\ensurepar |
| 48 |
\char "3C\relax} |
| 49 |
|
| 50 |
\let \< = \relax |
| 51 |
|
| 52 |
\def \greater {% %~ Greater-than sign. %^named_char |
| 53 |
\ensurepar |
| 54 |
\char "3E\relax} |
| 55 |
|
| 56 |
\let \> = \relax |
| 57 |
|
| 58 |
\def \backslash {% %~ Backslash. %^named_char |
| 59 |
\ensurepar |
| 60 |
\if \mathmodep |
| 61 |
\zmbackslash |
| 62 |
\else |
| 63 |
\char "5C\relax |
| 64 |
\fi} |
| 65 |
|
| 66 |
\let \\ = \backslash |
| 67 |
|
| 68 |
\def \underscore {% %~ Underscore. %^named_char |
| 69 |
\ensurepar |
| 70 |
\zprehyph{\underscorehyph}% |
| 71 |
\char "5F\relax |
| 72 |
\zposthyph{\underscorehyph}} |
| 73 |
|
| 74 |
\let \_ = \underscore |
| 75 |
|
| 76 |
\def \lbrace {% %~ Left brace. %^named_char |
| 77 |
\relax |
| 78 |
\if \mathmodep |
| 79 |
\zmlbrace |
| 80 |
\else |
| 81 |
\char "7B\relax |
| 82 |
\fi} |
| 83 |
|
| 84 |
\let \{ = \lbrace |
| 85 |
|
| 86 |
\def \verticalbar {% %~ Vertical bar. %^named_char |
| 87 |
\ensurepar |
| 88 |
\char "7C\relax} |
| 89 |
|
| 90 |
\def \rbrace {% %~ Right brace. %^named_char |
| 91 |
\relax |
| 92 |
\if \mathmodep |
| 93 |
\zmrbrace |
| 94 |
\else |
| 95 |
\char "7D\relax |
| 96 |
\fi} |
| 97 |
|
| 98 |
\let \} = \rbrace |
| 99 |
|
| 100 |
|
| 101 |
% Define additional special characters. |
| 102 |
|
| 103 |
\def \specialchar #1#2{% {text-char}{math-char} |
| 104 |
\ensurepar |
| 105 |
\if \mathmodep |
| 106 |
\if \emptyargp{#2}% |
| 107 |
\error{scinmath}{Cannot use that special character in math mode}% |
| 108 |
\else |
| 109 |
#2\relax |
| 110 |
\fi |
| 111 |
\else |
| 112 |
#1\relax |
| 113 |
\fi} |
| 114 |
|
| 115 |
% Decided not to make these two characters pseudo-ligatures. |
| 116 |
|
| 117 |
\def \exclamdown {\specialchar{\char 142}{}} %~ Upside-down exclamation. |
| 118 |
\def \questiondown {\specialchar{\char 143}{}} %~ Upside-down question mark. |
| 119 |
|
| 120 |
\def \bullet {\specialchar{\char 150}{\zmbullet}} %~ Bullet. |
| 121 |
\def \cent {\specialchar{\char 151}{}} %~ Cent sign. |
| 122 |
\let \cents = \cent |
| 123 |
\def \copyright {\specialchar{\char 152}{}} %~ Copyright symbol. |
| 124 |
\def \currency {\specialchar{\char 153}{}} %~ Currency symbol. |
| 125 |
\def \dagger {\specialchar{\char 154}{\zmdagger}} %~ Dagger. |
| 126 |
\def \ddagger {\specialchar{\char 155}{\zmddagger}}%~ Double dagger. |
| 127 |
\def \degree {\specialchar{\char 156}{^\circ}} %~ Degree sign. |
| 128 |
\let \degrees = \degree |
| 129 |
\def \Edh {\specialchar{\char 157}{}} %~ Uppercase Edh. |
| 130 |
\def \edh {\specialchar{\char 158}{}} %~ Lowercase edh. |
| 131 |
\def \euro {\specialchar{\char 159}{}} %~ Euro symbol. |
| 132 |
\def \florin {\specialchar{\char 160}{}} %~ Florin. |
| 133 |
\def \lguill {\specialchar{\char 161}{}} %~ Left guillemot. |
| 134 |
\def \rguill {\specialchar{\char 162}{}} %~ Right guillemot. |
| 135 |
\def \L {\specialchar{\char 163}{}} %~ Uppercase Polish L. |
| 136 |
\def \l {\specialchar{\char 164}{}} %~ Lowercase Polish l. |
| 137 |
\def \minus {\specialchar{\char 165}{}} %~ Minus sign. |
| 138 |
\def \P {\specialchar{\char 166}{}} %~ Paragraph symbol (pilcrow). |
| 139 |
\def \perthousand {\specialchar{\char 167}{}} %~ Per thousand symbol. |
| 140 |
\def \usquote {\specialchar{\char 168}{}} %~ Undirected single quote. |
| 141 |
\def \registered {\specialchar{$^\roman{\char 169}$}{}} %~ Registered symbol. |
| 142 |
\def \S {\specialchar{\char 170}{}} %~ Section sign. |
| 143 |
\def \SS {\specialchar{\char 170\kern -.1em\char 170}{}} %~ Double section sign. |
| 144 |
\def \sterling {\specialchar{\char 171}{}} %~ Pound sterling symbol. |
| 145 |
\def \Thorn {\specialchar{\char 172}{}} %~ Uppercase Thorn. |
| 146 |
\def \thorn {\specialchar{\char 173}{}} %~ Lowercase thorn. |
| 147 |
\def \trademark {\specialchar{$^\roman{\char 174}$}{}} %~ Trademark symbol. |
| 148 |
\def \yen {\specialchar{\char 175}{}} %~ Yen symbol. |
| 149 |
|
| 150 |
% Redefine a few math things. |
| 151 |
|
| 152 |
\definemathchar{\zmdagger}{\classbinop}{\rmfam}{9A} |
| 153 |
\definemathchar{\zmddagger}{\classbinop}{\rmfam}{9B} |