Debian Codegraph @

texmf-dist/doc/latex/mdputu/mdputu.dtx

raw
1 % \iffalse
2 % $Id: mdputu.dtx,v 1.6 2010-11-03 01:58:00 boris Exp $
3 %
4 % Copyright (c) 2010, Boris Veytsman
5 %
6 % All rights reserved.
7 %
8 % Redistribution and use in source and binary forms, with or without
9 % modification, are permitted provided that the following conditions
10 % are met:
11 %
12 % * Redistributions of source code must retain the above copyright
13 % notice, this list of conditions and the following disclaimer.
14 % * Redistributions in binary form must reproduce the above
15 % copyright notice, this list of conditions and the following
16 % disclaimer in the documentation and/or other materials provided
17 % with the distribution.
18 % * Neither the name of the original author nor the names of the
19 % contributors may be used to endorse or promote products derived
20 % from this software without specific prior written permission.
21 %
22 % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 % CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 % INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
27 % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 % EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 % TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 % DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31 % ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 % OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 % OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 % POSSIBILITY OF SUCH DAMAGE.
35 %
36 % \fi
37 % \CheckSum{86}
38 %
39 %
40 %% \CharacterTable
41 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
42 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
43 %% Digits \0\1\2\3\4\5\6\7\8\9
44 %% Exclamation \! Double quote \" Hash (number) \#
45 %% Dollar \$ Percent \% Ampersand \&
46 %% Acute accent \' Left paren \( Right paren \)
47 %% Asterisk \* Plus \+ Comma \,
48 %% Minus \- Point \. Solidus \/
49 %% Colon \: Semicolon \; Less than \<
50 %% Equals \= Greater than \> Question mark \?
51 %% Commercial at \@ Left bracket \[ Backslash \\
52 %% Right bracket \] Circumflex \^ Underscore \_
53 %% Grave accent \` Left brace \{ Vertical bar \|
54 %% Right brace \} Tilde \~}
55 %
56 %\iffalse
57 % Taken from xkeyval.dtx
58 %\fi
59 %\makeatletter
60 %\def\DescribeOption#1{\leavevmode\@bsphack
61 % \marginpar{\raggedleft\PrintDescribeOption{#1}}%
62 % \SpecialOptionIndex{#1}\@esphack\ignorespaces}
63 %\def\PrintDescribeOption#1{\strut\emph{option}\\\MacroFont #1\ }
64 %\def\SpecialOptionIndex#1{\@bsphack
65 % \index{#1\actualchar{\protect\ttfamily#1}
66 % (option)\encapchar usage}%
67 % \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
68 % usage}\@esphack}
69 %\def\DescribeOptions#1{\leavevmode\@bsphack
70 % \marginpar{\raggedleft\strut\emph{options}%
71 % \@for\@tempa:=#1\do{%
72 % \\\strut\MacroFont\@tempa\SpecialOptionIndex\@tempa
73 % }}\@esphack\ignorespaces}
74 %\makeatother
75 %
76 %
77 % \MakeShortVerb{|}
78 % \GetFileInfo{mdputu.dtx}
79 % \title{Unslanted Digits in Adobe Utopia Italics\thanks{The font was
80 % commissioned by the \emph{Annals of Mathematics}}}
81 % \author{Boris Veytsman\thanks{%
82 % \href{mailto:[email protected]}{\texttt{[email protected]}},
83 % \href{mailto:[email protected]}{\texttt{[email protected]}}}}
84 % \date{\filedate, \fileversion}
85 % \maketitle
86 % \begin{abstract}
87 % The \emph{Annals of Mathematics} uses italics for theorems.
88 % However, slanted digits and parentheses look disturbing when
89 % surrounded by (upright) math. This package provides virtual fonts
90 % with italics and upright digits and punctuation.
91 % \end{abstract}
92 % \tableofcontents
93 % \clearpage
94 %
95 % \changes{v1.0}{2010/08/25}{First fully functional version}
96 % \changes{v1.1}{2010/09/15}{Changed the location of TFM and VF files
97 % per request by Karl Berry}
98 % \changes{v1.2}{2010/11/02}{Corrected the bug in fd files: the fonts are
99 % scaled by 0.92 now (thanks to AoM staff for noticing!)}
100 %
101 %\section{Introduction}
102 %\label{sec:intro}
103 %
104 % This package provides fonts for the \emph{Annals of Mathematics.}
105 % The journal uses italics for theorems, but the house style requires
106 % upright digits and punctuation. Since the journal switched to Adobe
107 % Utopia fonts, it needed matching fonts for theorems typesetting.
108 %
109 %
110 % To install the package you need the file
111 % \url{http://mirrors.ctan.org/install/fonts/mdputu.tds.zip}/ Unzip
112 % this file in \path{$TEXMF}. Run |texhash| to update the
113 % configuration files and file names database.
114 %
115 %
116 %
117 % To use the package, you need to call it after
118 % |\usepackage[utopia]{mathdesign}|:
119 % \begin{verbatim}
120 % \usepackage[utopia]{mathdesign}
121 % \usepackage{mdputu}
122 % \end{verbatim}
123 %\DescribeMacro{\sitshape}
124 %\DescribeMacro{\textsit}
125 %\DescribeMacro{\specialdigits}
126 % This will define new font shape `special italics', which can be
127 % switched on by the declaration |\sitshape| or command |\textsit|,
128 % for example
129 % \begin{verbatim}
130 % {\sitshape This is example~1,} and this is \textsit{example~2.}
131 % \end{verbatim}
132 % The command |\specialdigits| changes italics to special italics:
133 % \begin{verbatim}
134 % Here the numbers \textit{123 are slanted}. {\specialdigits Here
135 % the numbers \textit{123 are uprigt.}}
136 % \end{verbatim}
137 %
138 %
139 %
140 % \StopEventually{}
141 %
142 %\section{Implementation}
143 %\label{sec:impl}
144 %
145 %\subsection{Identification}
146 %\label{sec:ident}
147 %
148 %
149 % We start with the declaration who we are. Most |.dtx| files put
150 % driver code in a separate driver file |.drv|. We roll this code into the
151 % main file, and use the pseudo-guard |<gobble>| for it.
152 %
153 % \begin{macrocode}
154 %<style>\NeedsTeXFormat{LaTeX2e}
155 %<*gobble>
156 \ProvidesFile{mdputu.dtx}
157 %</gobble>
158 %<style>\ProvidesClass{mdputu}
159 %<drv>\ProvidesFile{drv.tex}
160 %<*!mtx>
161 [2010/11/02 v1.2 Adobe Utopia Font with Unslanted Digits]
162 %</!mtx>
163 % \end{macrocode}
164 % And the driver code:
165 % \begin{macrocode}
166 %<*gobble>
167 \documentclass{ltxdoc}
168 \usepackage{booktabs,amsmath}
169 \usepackage{url}
170 \usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
171 pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
172 \PageIndex
173 \CodelineIndex
174 \RecordChanges
175 \EnableCrossrefs
176 \begin{document}
177 \DocInput{mdputu.dtx}
178 \end{document}
179 %</gobble>
180 % \end{macrocode}
181 %
182 %
183 %\subsection{Fontinst Driver}
184 %\label{sec:drv}
185 %
186 %
187 % First, we read the \textsf{Fontinst} program |fontinst.sty|:
188 % \begin{macrocode}
189 %<*drv>
190 \input fontinst.sty
191 % \end{macrocode}
192 %
193 % Standard substitutions.
194 % \begin{macrocode}
195 \substitutesilent{bx}{b}
196 % \end{macrocode}
197 %
198 %
199 % First, we create |.pl| files
200 % \begin{macrocode}
201 \generalpltomtx{mdputri7t}{mdputri7t}{vpl}{}
202 \generalpltomtx{mdputr7t}{mdputr7t}{vpl}{}
203 \generalpltomtx{mdputbi7t}{mdputbi7t}{vpl}{}
204 \generalpltomtx{mdputb7t}{mdputb7t}{vpl}{}
205 \generalpltomtx{mdputri8t}{mdputri8t}{vpl}{}
206 \generalpltomtx{mdputr8t}{mdputr8t}{vpl}{}
207 \generalpltomtx{mdputbi8t}{mdputbi8t}{vpl}{}
208 \generalpltomtx{mdputb8t}{mdputb8t}{vpl}{}
209 % \end{macrocode}
210 %
211 % Now font installation
212 % the first one:
213 % \begin{macrocode}
214 \installfonts
215 \installfamily{OT1}{mdputu}{}
216 \installfont{mdputuri7t}{%
217 mdputri7t,deldigits,mdputr7t}{ot1}{OT1}{mdputu}{m}{si}{}
218 \installfont{mdputubi7t}{%
219 mdputbi7t,deldigits,mdputb7t}{ot1}{OT1}{mdputu}{bx}{si}{}
220 \installfamily{T1}{mdputu}{}
221 \installfont{mdputuri8t}{%
222 mdputri8t,deldigits,mdputr8t}{t1}{T1}{mdputu}{m}{si}{}
223 \installfont{%
224 mdputubi8t}{mdputbi8t,deldigits,mdputb8t}{t1}{T1}{mdputu}{bx}{si}{}
225 \endinstallfonts
226 \bye
227 %</drv>
228 % \end{macrocode}
229 %
230 %
231 %
232 %
233 %\subsection{Deleting Digits}
234 %\label{sec:deldigits}
235 %
236 %
237 %
238 % Everything between |\relax| and |\metrix| is just a comment:
239 % \begin{macrocode}
240 %<*mtx>
241 \relax
242 Unset all digits and punctuation
243 \metrics
244 % \end{macrocode}
245 %
246 % The file itself uses the command |\unsetglyph|. We unset the
247 % digits, parenthesizes, etc.
248 % \begin{macrocode}
249 \unsetglyph{exclam}
250 \unsetglyph{parenleft}
251 \unsetglyph{parenright}
252 \unsetglyph{comma}
253 \unsetglyph{period}
254 \unsetglyph{slash}
255 \unsetglyph{zero}
256 \unsetglyph{one}
257 \unsetglyph{two}
258 \unsetglyph{three}
259 \unsetglyph{four}
260 \unsetglyph{five}
261 \unsetglyph{six}
262 \unsetglyph{seven}
263 \unsetglyph{eight}
264 \unsetglyph{nine}
265 \unsetglyph{colon}
266 \unsetglyph{semicolon}
267 \unsetglyph{exclamdown}
268 \unsetglyph{questiondown}
269 \unsetglyph{question}
270 \unsetglyph{bracketleft}
271 \unsetglyph{bracketright}
272 \unsetglyph{braceleft}
273 \unsetglyph{braceright}
274 \endmetrics
275 %</mtx>
276 % \end{macrocode}
277 %
278 %
279 %
280 %\subsection{Style File}
281 %\label{sec:style}
282 %
283 % Now we are ready to work on the style file. First, some |fd|
284 % commands. They belong here rather than in a proper |fd| file
285 % because we want to add to the |mdput| files, not to overwrite them:
286 % \begin{macrocode}
287 %<*style>
288 \InputIfFileExists{ot1mdput.fd}{}{\ClassError{mdputu}{You do not have
289 mathdesign package installed!}}
290 \InputIfFileExists{t1mdput.fd}{}{\ClassError{mdputu}{You do not have
291 mathdesign package installed!}}
292 \DeclareFontShape{OT1}{mdput}{m}{si}{
293 <-> s * [0.92] mdputuri7t
294 }{}
295 \DeclareFontShape{OT1}{mdput}{bx}{si}{
296 <-> s * [0.92] mdputubi7t
297 }{}
298 \DeclareFontShape{OT1}{mdput}{b}{si}{<-> ssub * mdputu/bx/si}{}
299 \DeclareFontShape{T1}{mdput}{m}{si}{
300 <-> s * [0.92] mdputuri8t
301 }{}
302 \DeclareFontShape{T1}{mdput}{bx}{si}{
303 <-> s * [0.92] mdputubi8t
304 }{}
305 \DeclareFontShape{T1}{mdput}{b}{si}{<->ssub * mdputu/bx/si}{}
306 % \end{macrocode}
307 %
308 %
309 % Now we are ready for font changing commands.
310 %
311 % \begin{macro}{\sishape}
312 % First, the declaration:
313 % \begin{macrocode}
314 \DeclareRobustCommand\sishape{%
315 \not@math@alphabet\itshape\mathit
316 \fontshape{si}\selectfont}
317 % \end{macrocode}
318 % \end{macro}
319 % \begin{macro}{\textsi}
320 % And the command:
321 % \begin{macrocode}
322 \DeclareTextFontCommand{\textsi}{\sishape}
323 % \end{macrocode}
324 % \end{macro}
325 % \begin{macro}{\specialdigits}
326 % This macro checks whether the current shape is italics; if yes, it
327 % switches to special italics
328 % \begin{macrocode}
329 \def\specialdigits{\def\itdefault{si}}
330 % \end{macrocode}
331 % \end{macro}
332 %
333 %
334 %
335 % \begin{macrocode}
336 %</style>
337 % \end{macrocode}
338 %
339 %
340 %\Finale
341 %\clearpage
342 %
343 %\PrintChanges
344 %\clearpage
345 %\PrintIndex
346 %
347 \endinput