summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/algolrevived/algolrevived.sty
blob: aa5043cec2fb5a10d2dfed415db8fe41876fd281 (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
\NeedsTeXFormat{LaTeX2e}
\def\fileversion{1.05}
\def\filedate{2020/09/28}
\ProvidesPackage{algolrevived}
    [\filedate\space v\fileversion]
\message{'algolrevived' v\fileversion, \filedate\space  Style file for AlgolRevived fonts (msharpe).}

\RequirePackage[LY1,T1]{fontenc}
\RequirePackage{textcomp}
\RequirePackage{xstring,ifthen,scalefnt}
\RequirePackage{ifthen}
\DeclareEncodingSubset{TS1}{AlgolRevived-*}{0}
\IfFileExists{mweights.sty}{\RequirePackage{mweights}}{}
\IfFileExists{fontaxes.sty}{
    \RequirePackage{fontaxes}
    \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
    \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
    \def\sufigures{\@nomath\sufigures
        \fontfigurestyle{superior}\selectfont}
    \DeclareTextFontCommand{\textsu}{\sufigures}
    \let\textsuperior\textsu

    \fa@naming@exception{figures}{{inferior}{proportional}}{Inf}
    \fa@naming@exception{figures}{{inferior}{tabular}}{Inf}
    \def\infigures{\@nomath\infigures
        \fontfigurestyle{inferior}\selectfont}
    \DeclareTextFontCommand{\textinf}{\infigures}
    \let\textinferior\textinf
}{}
\def\zal@foresolidus{0em}
\def\zal@aftsolidus{0em}
%\def\zal@zslash{1} % slashed zero is default in tt mode
\IfFileExists{xkeyval.sty}{
    \newcommand*{\AlgolRevived@scale}{1}
    \RequirePackage{xkeyval}
    \DeclareOptionX{scale}{\renewcommand*{\AlgolRevived@scale}{##1}}
    \DeclareOptionX{scaled}{\renewcommand*{\AlgolRevived@scale}{##1}}
}{
    \let\DeclareOptionX\DeclareOption
    \let\ExecuteOptionsX\ExecuteOptions
    \let\ProcessOptionsX\ProcessOptions
}
\edef\mdseries@rm{sb}
\edef\mdseries@rm{m}

\edef\zal@figurestyle{TLF}
\def\useosf{\edef\zal@figurestyle{OsF}}
\@onlypreamble\useosf

\newif\ifzal@tt
\newif\ifzal@hyphens
\newif\ifzal@xhyphens
\newif\ifzal@xnohyphens
\newif\ifzal@zslash
\DeclareOptionX{tt}{\zal@tttrue}
\DeclareOptionX{hyphens}{\zal@xhyphenstrue}
\DeclareOptionX{nohyphens}{\zal@xnohyphenstrue}
\DeclareOptionX{zeroslash}{\zal@zslashtrue}%\edef\zal@zslash{1}
\DeclareOptionX{nozeroslash}{\zal@zslashfalse}%\edef\zal@zslash{0}
\DeclareOptionX{lining}{\edef\zal@figurestyle{TLF}}
\DeclareOptionX{lf}{\edef\zal@figurestyle{TLF}}
\DeclareOptionX{oldstyle}{\useosf}
\DeclareOptionX{osf}{\useosf}
\DeclareOptionX{foresolidus}{\gdef\zal@foresolidus{#1}}
\DeclareOptionX{aftsolidus}{\gdef\zal@aftsolidus{#1}}
\ExecuteOptionsX{zeroslash}
\ProcessOptionsX\relax

\ifzal@tt%
  \ifzal@xhyphens\zal@hyphenstrue\fi
  \edef\zal@zslash{1}
  \ifzal@zslash\else\edef\zal@zslash{0}\fi
  \edef\zal@figurestyle{TLF} % no osf in tt mode
\else % text mode
% \edef\zal@zslash{0}
%\ifzal@zslash\else\edef\zal@zslash{1}\fi
 \zal@hyphenstrue % default is hyphens in text mode
 \ifzal@xnohyphens\zal@hyphensfalse\fi % unless turned off in options
 \newcommand{\textfrac}[3][]{% like \textfrac[1]{7}{8}
  \mbox{%
    \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1]
      {\textlf{#1}\kern.05em}{}%         
    \raise -.1em\hbox{\textsu{#2}}% numerator
    \StrRight{#2}{1}[\@digit@]%
    % look for  1, 2, 6, 7
    \ifcase\@digit@\kern-.02em% 0
    \or\kern.03em% 1
    \or\kern.03em% 2
    \or%\kern-.01em% 3
    \or\kern.05em% 4
    \or\kern-.01em% 5
    \or\kern-.02em% 6
    \or\kern-.14em% 7
    \or%\kern-.01em% 8
    \or\kern-.02em% 9
   \fi%
    \kern\zal@foresolidus{\fontencoding{TS1}\selectfont\char"2F}%
    \kern\zal@aftsolidus%
    \StrLeft{#3}{1}[\@digit@]%
    % look for 1, 4, 7
    \ifcase\@digit@% 0
    \or\kern -.03em% 1
    \or\kern-.02em% 2
    \or\kern-.03em% 3
    \or\kern -.06em% 4
    \or% 5
    \or% 6
    \or\kern .02em% 7
    \fi%
    \raise .15em\hbox{\textinf{#3}}%       denominator [#3]
  }%
}
\fi 

\DeclareRobustCommand{\lfstyle}{%
  \not@math@alphabet\lfstyle\relax
  \fontfamily{AlgolRevived-TLF}\selectfont %
}
\DeclareRobustCommand{\tlfstyle}{%
  \not@math@alphabet\tlfstyle\relax
  \fontfamily{AlgolRevived-TLF}\selectfont %
}% to get tlf
\DeclareRobustCommand{\osfstyle}{%
  \not@math@alphabet\osfstyle\relax
  \fontfamily{AlgolRevived-OsF}\selectfont %
}% to get osf
\DeclareRobustCommand{\tosfstyle}{%
  \not@math@alphabet\tosfstyle\relax
  \fontfamily{AlgolRevived-OsF}\selectfont %
}% to get tosf
\DeclareRobustCommand{\textlf}[1]{%
  {\lfstyle #1}%
}% to get lf
\DeclareRobustCommand{\texttlf}[1]{%
  {\tlfstyle #1}%
}% to get tlf
\DeclareRobustCommand{\textosf}[1]{%
  {\osfstyle #1}%
}% to get osf
\DeclareRobustCommand{\texttosf}[1]{%
  {\tosfstyle #1}%
}% to get tosf
\DeclareTextCommand{\textcircled}{TS1}[1]{\hmode@bgroup
   \ooalign{%
      \hfil \raise .307ex\hbox {\fontencoding{T1}\fontfamily{AlgolRevived-TLF}\fontseries{m}\fontshape{n}\selectfont\scalefont{.6}%
\uppercase{#1}}\hfil \crcr
     \char 79 %\textbigcircle 
   }%
 \egroup}

\def\zal@typewriter{} % do not prevent hyphenation
\ifzal@hyphens\else\def\zal@typewriter{\hyphenchar\font=-1}\fi
%\show\zal@typewriter


%Added textcomp symbols
\DeclareTextSymbolDefault{\textprime}{TS1}          
\DeclareTextSymbolDefault{\textdprime}{TS1}
\DeclareTextSymbolDefault{\textleftrightarrow}{TS1}
\DeclareTextSymbolDefault{\textupdownarrow}{TS1}
\DeclareTextSymbolDefault{\textLeftarrow}{TS1}
\DeclareTextSymbolDefault{\textUparrow}{TS1}
\DeclareTextSymbolDefault{\textRightarrow}{TS1}
\DeclareTextSymbolDefault{\textDownarrow}{TS1}
\DeclareTextSymbolDefault{\textLeftrightarrow}{TS1}
\DeclareTextSymbolDefault{\textUpdownarrow}{TS1}
\DeclareTextSymbolDefault{\textforall}{TS1}
\DeclareTextSymbolDefault{\textcomplement}{TS1}
\DeclareTextSymbolDefault{\textpartial}{TS1}
\DeclareTextSymbolDefault{\textexists}{TS1}
\DeclareTextSymbolDefault{\textnexists}{TS1}
\DeclareTextSymbolDefault{\textvarnothing}{TS1}
\DeclareTextSymbolDefault{\textincrement}{TS1}
\DeclareTextSymbolDefault{\textnabla}{TS1}
\DeclareTextSymbolDefault{\textin}{TS1}
\DeclareTextSymbolDefault{\textnotin}{TS1}
\DeclareTextSymbolDefault{\textsmallin}{TS1}
\DeclareTextSymbolDefault{\textni}{TS1}
\DeclareTextSymbolDefault{\textnni}{TS1}
\DeclareTextSymbolDefault{\textsmallni}{TS1}
\DeclareTextSymbolDefault{\textsmallsetminus}{TS1}
\DeclareTextSymbolDefault{\textlargebullet}{TS1}
\DeclareTextSymbolDefault{\textland}{TS1}
\DeclareTextSymbolDefault{\textlor}{TS1}
\DeclareTextSymbolDefault{\textcap}{TS1}
\DeclareTextSymbolDefault{\textcup}{TS1}
\DeclareTextSymbolDefault{\textcoloneq}{TS1}
\DeclareTextSymbolDefault{\texteqcolon}{TS1}
\DeclareTextSymbolDefault{\textneq}{TS1}
\DeclareTextSymbolDefault{\textequiv}{TS1}
\DeclareTextSymbolDefault{\textneqiv}{TS1}
\DeclareTextSymbolDefault{\textleq}{TS1}
\DeclareTextSymbolDefault{\textgeq}{TS1}
\DeclareTextSymbolDefault{\textsubset}{TS1}
\DeclareTextSymbolDefault{\textsupset}{TS1}
\DeclareTextSymbolDefault{\textnsubset}{TS1}
\DeclareTextSymbolDefault{\textnsupset}{TS1}
\DeclareTextSymbolDefault{\textsubseteq}{TS1}
\DeclareTextSymbolDefault{\textsupseteq}{TS1}
\DeclareTextSymbolDefault{\textnsubseteq}{TS1}
\DeclareTextSymbolDefault{\textnsupseteq}{TS1}
\DeclareTextSymbolDefault{\textsqsubset}{TS1}
\DeclareTextSymbolDefault{\textsqsubset}{TS1}
\DeclareTextSymbolDefault{\textsqsupset}{TS1}
\DeclareTextSymbolDefault{\textsqsubseteq}{TS1}
\DeclareTextSymbolDefault{\textsqcap}{TS1}
\DeclareTextSymbolDefault{\textsqcup}{TS1}
%
\DeclareTextSymbol{\textprime}{TS1}{192}           
\DeclareTextSymbol{\textdprime}{TS1}{193}
\DeclareTextSymbol{\textleftrightarrow}{TS1}{196}
\DeclareTextSymbol{\textupdownarrow}{TS1}{197}
\DeclareTextSymbol{\textLeftarrow}{TS1}{198}
\DeclareTextSymbol{\textUparrow}{TS1}{199}
\DeclareTextSymbol{\textRightarrow}{TS1}{200}
\DeclareTextSymbol{\textDownarrow}{TS1}{201}
\DeclareTextSymbol{\textLeftrightarrow}{TS1}{202}
\DeclareTextSymbol{\textUpdownarrow}{TS1}{203}
\DeclareTextSymbol{\textforall}{TS1}{204}
\DeclareTextSymbol{\textcomplement}{TS1}{205}
\DeclareTextSymbol{\textpartial}{TS1}{206}
\DeclareTextSymbol{\textexists}{TS1}{207}
\DeclareTextSymbol{\textnexists}{TS1}{208}
\DeclareTextSymbol{\textvarnothing}{TS1}{209}
\DeclareTextSymbol{\textincrement}{TS1}{210}
\DeclareTextSymbol{\textnabla}{TS1}{211}
\DeclareTextSymbol{\textin}{TS1}{212}
\DeclareTextSymbol{\textnotin}{TS1}{213}
\DeclareTextSymbol{\textsmallin}{TS1}{215}
\DeclareTextSymbol{\textni}{TS1}{216}
\DeclareTextSymbol{\textnni}{TS1}{217}
\DeclareTextSymbol{\textsmallni}{TS1}{218}
\DeclareTextSymbol{\textsmallsetminus}{TS1}{219}
\DeclareTextSymbol{\textlargebullet}{TS1}{220}
\DeclareTextSymbol{\textland}{TS1}{221}
\DeclareTextSymbol{\textlor}{TS1}{222}
\DeclareTextSymbol{\textcap}{TS1}{224}
\DeclareTextSymbol{\textcup}{TS1}{225}
\DeclareTextSymbol{\textcoloneq}{TS1}{226}
\DeclareTextSymbol{\texteqcolon}{TS1}{227}
\DeclareTextSymbol{\textneq}{TS1}{228}
\DeclareTextSymbol{\textequiv}{TS1}{229}
\DeclareTextSymbol{\textneqiv}{TS1}{230}
\DeclareTextSymbol{\textleq}{TS1}{231}
\DeclareTextSymbol{\textgeq}{TS1}{232}
\DeclareTextSymbol{\textsubset}{TS1}{233}
\DeclareTextSymbol{\textsupset}{TS1}{234}
\DeclareTextSymbol{\textnsubset}{TS1}{235}
\DeclareTextSymbol{\textnsupset}{TS1}{236}
\DeclareTextSymbol{\textsubseteq}{TS1}{237}
\DeclareTextSymbol{\textsupseteq}{TS1}{238}
\DeclareTextSymbol{\textnsubseteq}{TS1}{239}
\DeclareTextSymbol{\textnsupseteq}{TS1}{240}
\DeclareTextSymbol{\textsqsubset}{TS1}{241}
\DeclareTextSymbol{\textsqsubset}{TS1}{242}
\DeclareTextSymbol{\textsqsupset}{TS1}{243}
\DeclareTextSymbol{\textsqsubseteq}{TS1}{244}
\DeclareTextSymbol{\textsqcap}{TS1}{245}
\DeclareTextSymbol{\textsqcup}{TS1}{247}

\ifzal@tt
  \renewcommand*{\ttdefault}{AlgolRevived-\zal@figurestyle-TT}
\else
  \renewcommand*{\rmdefault}{AlgolRevived-\zal@figurestyle}
  \renewcommand*{\familydefault}{\rmdefault}
\fi
\normalfont
\endinput