Debian Codegraph @

texmf-dist/source/latex/xymtex/chemist/chemtimes.dtx

raw
1 % \iffalse meta-comment
2 %% File: chemtimes.dtx
3 % Copyright 2009, 2010 by Shinsaku Fujita
4 %
5 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % \typeout{Package `chemtimes' (v. 1.00) Shinsaku Fujita 2009/10/25}
7 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 % \fi
9 %
10 % \CheckSum{1110}
11 %% \CharacterTable
12 %% {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
13 %% 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
14 %% Digits \0\1\2\3\4\5\6\7\8\9
15 %% Exclamation \! Double quote \" Hash (number) \#
16 %% Dollar \$ Percent \% Ampersand \&
17 %% Acute accent \' Left paren \( Right paren \)
18 %% Asterisk \* Plus \+ Comma \,
19 %% Minus \- Point \. Solidus \/
20 %% Colon \: Semicolon \; Less than \<
21 %% Equals \= Greater than \> Question mark \?
22 %% Commercial at \@ Left bracket \[ Backslash \\
23 %% Right bracket \] Circumflex \^ Underscore \_
24 %% Grave accent \` Left brace \{ Vertical bar \|
25 %% Right brace \} Tilde \~}
26 %
27 % \setcounter{StandardModuleDepth}{1}
28 %
29 % \StopEventually{}
30 % \MakeShortVerb{\|}
31 %
32 % \iffalse
33 %<*driver>
34 \NeedsTeXFormat{pLaTeX2e}
35 % \fi
36 \ProvidesFile{chemtimes.dtx}[2010/11/21 v5.00a chemtimes package]
37 % \iffalse
38 \documentclass{ltxdoc}
39 \GetFileInfo{chemtimes.dtx}
40 %
41 \title{Times Fonts for Chemistry and Mathamatics by {\sffamily chemtimes.sty} (\fileversion)}
42 \author{Shinsaku Fujita \\
43 Shonan Institute of Chemoinformatics and
44 Mathematical Chemistry
45 }
46 \date{\filedate}
47 %
48 \begin{document}
49 \maketitle
50 \DocInput{chemtimes.dtx}
51 \end{document}
52 %</driver>
53 % \fi
54 %
55 % \section{Introduction}
56 % \subsection{Options for {\sffamily docstrip}}
57 %
58 % \DeleteShortVerb{\|}
59 % \begin{center}
60 % \begin{tabular}{|l|l|}
61 % \hline
62 % \emph{option} & \emph{function}\\ \hline
63 % chemtimes & chemtimes.sty \\
64 % driver & driver for this dtx file \\
65 % \hline
66 % \end{tabular}
67 % \end{center}
68 % \MakeShortVerb{\|}
69 %
70 % \subsection{Version Information}
71 %
72 % \begin{macrocode}
73 %<*chemtimes>
74 \typeout{Package `chemtimes' (v. 5.00a) Shinsaku Fujita 2010/11/21}
75 % \end{macrocode}
76 %
77 % \section{Times Fonts}
78 %
79 % The option ``chemist'' is to load the \textsf{chemist} package in place of
80 % the default loading of the \textsf{chmst-ps} package. By the option ``chemtimes''
81 % of the \textsf{chemist} or \textsf{chmst-ps} package, the switch \verb/\@chemtimestrue/
82 % or \verb/\@@@chemtimestrue/ becomes effective. Thereby, the mathversions ``chem'' and
83 % ``boldchem'' defined in the \textsf{chemist} package are entirely ignored so as to be
84 % replaced by those defined in the \textsf{chemtimes} package.
85 %
86 % \begin{macrocode}
87 \@ifundefined{chemcorr}{}{%
88 \PackageError{chemtimes}
89 {The ``chemist'' or ``chmst-ps'' package is not permitted here}
90 {The ``chemist'' or ``chmst-ps'' package will be automatically loaded \MessageBreak
91 when the ``chemtimes'' package is loaded.}
92 }
93 % \end{macrocode}
94 %
95 % \begin{macrocode}
96 \newif\ifchemtimes%%
97 \newif\if@chemtimes%%for chemist package
98 \newif\if@@@chemtimes%%for chmst-ps package
99 \newif\if@@chemtimes%%for chmst-ps package
100 \DeclareOption{chemist}{\chemtimestrue}
101 \chemtimesfalse
102 \ProcessOptions
103 \ifchemtimes
104 \RequirePackage[chemtimes]{chemist}%
105 \else
106 \@@chemtimestrue
107 \RequirePackage[chemtimes]{chmst-ps}%
108 \fi
109 % \end{macrocode}
110 %
111 % \section{Definition of Macros}
112 %
113 % Times-like fonts are used by declaring ``ptm'' (times roman) and ``phv'' (Helvetica)
114 % in place of the corresponding roman and san serif families.
115 % while computer modern type-writer fonts are used without change.
116 %
117 % \begin{macrocode}
118 %chemtimes package
119 %times, helvetica
120 %times from ot1ptm.fd 2007/07/31
121 \renewcommand{\rmdefault}{ptm}
122 %Helvetica from ot1phv.fd 2007/07/31
123 \def\Hv@scale{0.90}%scalable font
124 \renewcommand{\sfdefault}{phv}
125 %typewriter
126 %\renewcommand{\ttdefault}{pcr}
127 % with the default (computer modern typewriter font)
128 %% change the defalt values (\thinmuskip 3mu to 2mu etc.)
129 \thinmuskip=2mu
130 \medmuskip=2.5mu plus 1mu minus 1mu
131 \thickmuskip=4mu plus 1.5mu minus 1mu
132 % \end{macrocode}
133 %
134 % Fonts for normal mathversion are used on the same line
135 % as \textsf{mathptmx} package:
136 %
137 % \begin{macrocode}
138 %mathversion normal
139 \DeclareSymbolFont{letters} {OML}{ztmcm}{m}{it}
140 \DeclareSymbolFont{operators} {OT1}{ztmcm}{m}{n}
141 \DeclareSymbolFont{symbols} {OMS}{ztmcm}{m}{n}
142 \DeclareSymbolFont{largesymbols}{OMX}{ztmcm}{m}{n}
143 \DeclareSymbolFont{bold} {OT1}{ptm}{bx}{n}
144 \DeclareSymbolFont{italic} {OT1}{ptm}{m}{it}
145 \DeclareMathAlphabet{\mathbf}{OT1}{ptm}{bx}{n}
146 \DeclareMathAlphabet{\mathit}{OT1}{ptm}{m}{it}
147 \DeclareMathAlphabet{\mathbfit}{OT1}{ptm}{b}{it}%2009/11/22
148 \DeclareMathAlphabet{\mathsf}{OT1}{phv}{m}{n}
149 %\DeclareMathAlphabet{\mathtt}{OT1}{pcr}{m}{n}
150 \DeclareMathAlphabet{\mathtt}{OT1}{cmtt}{m}{n}
151 %Uppercase Greeks
152 \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{0}
153 \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{1}
154 \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{2}
155 \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{3}
156 \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{4}
157 \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{5}
158 \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{6}
159 \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{7}
160 \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{8}
161 \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{9}
162 \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{10}
163 % \end{macrocode}
164 %
165 % The following fonts are used for bold mathversion.
166 %
167 % \begin{macrocode}
168 %mathversion bold
169 %\SetSymbolFont{letters} {bold}{OML}{ptm}{b}{it}%
170 \SetSymbolFont{letters} {bold}{OT1}{ptm}{b}{it}%
171 \SetSymbolFont{operators} {bold}{OT1}{ptm}{b}{n}%
172 \SetSymbolFont{symbols} {bold}{OMS}{ptm}{b}{n}%
173 \SetSymbolFont{largesymbols}{bold}{OMX}{ztmcm}{m}{n}%
174 % \end{macrocode}
175 %
176 % Font sizes for math modes are defined as follows
177 % on the same line as \textsf{mathptmx} package:
178 %
179 % \begin{macrocode}
180 \def\defaultscriptratio{.74}
181 \def\defaultscriptscriptratio{.6}
182 \DeclareMathSizes{5}{5}{5}{5}
183 \DeclareMathSizes{6}{6}{5}{5}
184 \DeclareMathSizes{7}{7}{5}{5}
185 \DeclareMathSizes{8}{8}{6}{5}
186 \DeclareMathSizes{9}{9}{7}{5}
187 \DeclareMathSizes{10}{10}{7.4}{6}
188 \DeclareMathSizes{10.95}{10.95}{8}{6}
189 \DeclareMathSizes{12}{12}{9}{7}
190 \DeclareMathSizes{14.4}{14.4}{10.95}{8}
191 \DeclareMathSizes{17.28}{17.28}{12}{10}
192 \DeclareMathSizes{20.74}{20.74}{14.4}{12}
193 \DeclareMathSizes{24.88}{24.88}{17.28}{14.4}
194 % \end{macrocode}
195 %
196 % Letter strings for judging mathversions:
197 %
198 % \begin{macrocode}
199 \newif\ifnewl@tex \newl@textrue
200 \@ifundefined{DeclareMathVersion}%
201 {\global\newl@texfalse}{\global\newl@textrue}%
202 \def\math@chem{chem}
203 \def\math@boldchem{boldchem}
204 \def\math@bold{bold}
205 \def\math@normal{normal}
206 % \end{macrocode}
207 %
208 % The original setting of each Greek letter is stored tentatively.
209 % \begin{macrocode}
210 %%added 2005/09/02
211 \let\oldalpha=\alpha
212 \let\oldbeta=\beta
213 \let\oldgamma=\gamma
214 \let\olddelta=\delta
215 \let\oldepsilon=\epsilon
216 \let\oldzeta=\zeta
217 \let\oldeta=\eta
218 \let\oldtheta=\theta
219 \let\oldiota=\iota
220 \let\oldkappa=\kappa
221 \let\oldlambda=\lambda
222 \let\oldmu=\mu
223 \let\oldnu=\nu
224 \let\oldxi=\xi
225 \let\oldpi=\pi
226 \let\oldrho=\rho
227 \let\oldsigma=\sigma
228 \let\oldtau=\tau
229 \let\oldupsilon=\upsilon
230 \let\oldphi=\phi
231 \let\oldchi=\chi
232 \let\oldpsi=\psi
233 \let\oldomega=\omega
234 \let\oldvarepsilon=\varepsilon
235 \let\oldvartheta=\vartheta
236 \let\oldvarpi=\varpi
237 \let\oldvarrho=\varrho
238 \let\oldvarsigma=\varsigma
239 \let\oldvarphi=\varphi
240 \let\oldGamma=\Gamma
241 \let\oldDelta=\Delta
242 \let\oldTheta=\Theta
243 \let\oldLamda=\Lambda
244 \let\oldXi=\Xi
245 \let\oldPi=\Pi
246 \let\oldSigma=\Sigma
247 \let\oldUpsilon=\Upsilon
248 \let\oldPhi=\Phi
249 \let\oldPsi=\Psi
250 \let\oldOmega=\Omega
251 % \end{macrocode}
252 %
253 % \begin{macro}{\chemGreekpalette}
254 % \begin{macro}{\chemGreekletter}
255 % The command \verb/\chemGreekletter/ selects a lowercase greek letter
256 % for each mathversion.
257 % \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
258 %
259 % \begin{macrocode}
260 \def\chemGreekpalette#1#2#3{%
261 \mathchoice%
262 {\mathord{\hbox{\usefont{OML}{#1}{#3}{it}\char"#2}}}%
263 {\mathord{\hbox{\usefont{OML}{#1}{#3}{it}\char"#2}}}%
264 {\mathord{\hbox{\scriptsize\usefont{OML}{#1}{#3}{it}\char"#2}}}%
265 {\mathord{\hbox{\tiny\usefont{OML}{#1}{#3}{it}\char"#2}}}}%
266 \def\chemGreekletter#1#2{%
267 \expandafter\def\csname #1\endcsname{\bgroup%added 2010/11/21 by S. Fujita
268 \ifx\math@version\math@chem
269 %\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}
270 \chemGreekpalette{ztmcm}{#2}{m}%
271 \else
272 \ifx\math@version\math@boldchem
273 %\mathord{\hbox{\mathversion{bold}$\mathchar"#2$}}%
274 \chemGreekpalette{cmm}{#2}{b}%
275 \else
276 \ifx\math@version\math@bold
277 %\csname old#1\endcsname
278 \chemGreekpalette{cmm}{#2}{b}%
279 \else
280 \csname old#1\endcsname
281 \fi\fi\fi\egroup}}%added 2010/11/21 by S. Fujita
282 % \end{macrocode}
283 % \end{macro}
284 % \end{macro}
285 %
286 % \begin{macro}{\ChemAccent}
287 %
288 % \changes{v4.05}{2009/10/25}{Defined: \cs{ChemAccent}}
289 % \begin{macrocode}
290 %\if@chemtimes\else%for chemtimes package
291 \def\ChemAccent#1#2#3{%
292 \expandafter\def\csname #1\endcsname{%
293 \ifx\math@version\math@chem
294 #2{\hbox{\kern-0.15em\usefont{OML}{cmm}{m}{it}\char"#3}}\else
295 \ifx\math@version\math@boldchem
296 #2{\hbox{\kern-0.2em\usefont{OML}{cmm}{b}{it}\char"#3}}\else
297 \ifx\math@version\math@bold
298 \ifupgreekrm
299 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
300 \upgreekrmfalse
301 \else
302 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
303 \fi
304 \else
305 #2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
306 \fi\fi\fi}}
307 %\fi
308 % \end{macrocode}
309 % \end{macro}
310 %
311 %
312 % \begin{macro}{\rm}
313 % The command \verb/\rm/ is redefined to use \verb/\ifupgreekrm/
314 % for switching slanted letters into upright letters.
315 % \begin{macrocode}
316 \newif\ifupgreekrm \upgreekrmfalse
317 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm\upgreekrmtrue}
318 %\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\upgreekrmtrue\mathrm}
319 \DeclareOldFontCommand{\bfit}{\normalfont\itshape\bfseries}{\mathbfit}%2009/11/22
320 \let\oldmathrm=\mathrm
321 \def\mathrm#1{\oldmathrm{\upgreekrmtrue #1}}
322 % \end{macrocode}
323 % \end{macro}
324 %
325 % \begin{macro}{\chemUpGreekletter}
326 % The command \verb/\chemUpGreekletter/ selects an uppercase greek letter
327 % for each mathversion.
328 % \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
329 % \begin{macrocode}
330 \newif\ifm@thnorm@l
331 \def\chemUpGreekletter#1#2{%
332 \expandafter\def\csname #1\endcsname{\bgroup%2010/11/21 by S. Fujita
333 \ensuremath{%
334 \ifx\math@version\math@chem
335 %\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}\else
336 \ifm@thnorm@l
337 \mathord{\hbox{\usefont{OML}{cmm}{m}{it}\char"#2}}%
338 \else
339 \mathord{\hbox{\usefont{OT1}{cmr}{m}{n}\char"#2}}%
340 \fi
341 \else
342 \ifx\math@version\math@boldchem
343 %\mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}\else
344 \ifm@thnorm@l
345 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
346 \else
347 \mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}%
348 \fi
349 \else
350 \ifx\math@version\math@bold
351 \ifupgreekrm
352 \ifm@thnorm@l
353 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
354 \else
355 \mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}%
356 \fi
357 %%%\upgreekrmfalse
358 \else
359 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
360 %\csname old#1\endcsname
361 \fi
362 \else
363 \csname old#1\endcsname
364 \fi\fi\fi}\egroup}}%added 2010/11/21 by S. Fujita
365 % \end{macrocode}
366 % \end{macro}
367 %
368 %
369 % \begin{macro}{\ctSFOpalette}
370 % \begin{macro}{\chemtimesSubFontOrd}
371 % The command \verb/\chemtimesSubFontOrd/ selects a symbol for substitution
372 % (computer modern font) if there is no such font of times family.
373 % \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
374 % \begin{macrocode}
375 \def\ctSFOpalette#1#2#3{%
376 \mathchoice
377 {#2{\hbox{\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
378 {#2{\hbox{\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
379 {#2{\hbox{\scriptsize\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
380 {#2{\hbox{\tiny\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
381 }
382 \def\chemtimesSubFontOrd#1#2#3{%
383 \expandafter\def\csname #1\endcsname{\bgroup%added 2010/11/21 by S. Fujita
384 \PackageWarning{chemtimes}
385 {The symbol \expandafter\string\csname #1\endcsname\space
386 is not available with this package.
387 This font will be substituted by an appropriate commputer modern font}%
388 \ifx\math@version\math@chem
389 %#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
390 \ctSFOpalette{m}{#2}{#3}%
391 \else\ifx\math@version\math@boldchem
392 %#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
393 \ctSFOpalette{b}{#2}{#3}%
394 \else\ifx\math@version\math@bold
395 %{#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}}%
396 \ctSFOpalette{b}{#2}{#3}%
397 \else\ifx\math@version\math@normal
398 %#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
399 \ctSFOpalette{m}{#2}{#3}%
400 \else
401 %#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
402 \ctSFOpalette{m}{#2}{#3}%
403 \fi\fi\fi\fi\egroup}}%added 2010/11/21 by S. Fujita
404 % \end{macrocode}
405 % \end{macro}
406 % \end{macro}
407 %
408 % \begin{macro}{\ctSFBpalette}
409 % \begin{macro}{\ctSFBBpalette}
410 % \begin{macro}{\chemtimesSubFontBin}
411 % The command \verb/\chemtimesSubFontBin/ selects a symbol (binary operation)
412 % for substitution (computer modern font) if there is no such font of times family.
413 % \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
414 % \begin{macrocode}
415 \def\ctSFBpalette#1#2#3{%
416 \mathchoice
417 {#2{\hbox{\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
418 {#2{\hbox{\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
419 {#2{\hbox{\scriptsize\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
420 {#2{\hbox{\tiny\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
421 }
422 \def\ctSFBBpalette#1#2#3{%
423 \mathchoice
424 {#2{\hbox{\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
425 {#2{\hbox{\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
426 {#2{\hbox{\scriptsize\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
427 {#2{\hbox{\tiny\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
428 }
429 \def\chemtimesSubFontBin#1#2#3{%
430 \expandafter\def\csname #1\endcsname{\bgroup%added 2010/11/21 by S. Fujita
431 \PackageWarning{chemtimes}
432 {The symbol \expandafter\string\csname #1\endcsname\space
433 is not available with this package.
434 This font will be substituted by an appropriate commputer modern font}%
435 \ifx\math@version\math@chem
436 %#2{\hbox{\usefont{OMS}{cmsy}{m}{n}\char"#3}}%
437 \ctSFBpalette{m}{#2}{#3}%
438 \else\ifx\math@version\math@boldchem
439 %#2{\hbox{\usefont{OMS}{cmsy}{b}{n}\char"#3}}%
440 \ctSFBpalette{b}{#2}{#3}%
441 \else\ifx\math@version\math@bold
442 %#2{\hbox{\usefont{OMS}{cmsy}{b}{n}\char"#3}}%
443 \ctSFBpalette{b}{#2}{#3}%
444 \else\ifx\math@version\math@normal
445 %#2{\hbox{\usefont{OMS}{cmsy}{m}{n}\char"#3}}%
446 \ctSFBpalette{m}{#2}{#3}%
447 \else
448 %#2{\hbox{\usefont{OMS}{cmm}{m}{n}\char"#3}}%
449 \ctSFBBpalette{m}{#2}{#3}%
450 \fi\fi\fi\fi\egroup}}%added 2010/11/21 by S. Fujita
451 % \end{macrocode}
452 % \end{macro}
453 % \end{macro}
454 % \end{macro}
455 %
456 % \begin{macro}{\chemtimesSubFontLOp}
457 % The command \verb/\chemtimesSubFontLOp/ selects a symbol (large operation)
458 % for substitution (computer modern font) if there is no such font of times family.
459 % \changes{v5.00a}{2010/11/21}{bug fix: \cs{bgroup}, \cs{egroup} added}
460 % \begin{macrocode}
461 \def\chemtimesSubFontLOp#1#2#3{%
462 \expandafter\def\csname #1\endcsname{\bgroup%%added 2010/11/21 by S. Fujita
463 \PackageWarning{chemtimes}
464 {The symbol \expandafter\string\csname #1\endcsname\space
465 is not available with this package.
466 This font will be substituted by an appropriate commputer modern font}%
467 \ifx\math@version\math@chem
468 \mathop{\mathchoice%
469 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
470 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%
471 }%
472 \else\ifx\math@version\math@boldchem
473 \mathop{\mathchoice%
474 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#3}}%
475 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#2}}{}{}%
476 }%
477 \else\ifx\math@version\math@bold
478 \mathop{\mathchoice%
479 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#3}}%
480 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#2}}{}{}%
481 }%
482 \else\ifx\math@version\math@normal
483 \mathop{\mathchoice%
484 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
485 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%
486 }%
487 \else
488 \mathop{\mathchoice%
489 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
490 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%
491 }%
492 \fi\fi\fi\fi\egroup}}%%added 2010/11/21 by S. Fujita
493 % \end{macrocode}
494 % \end{macro}
495 %
496 %
497 % Lowercase and uppercase Greek letters are redefined as follows:
498 % \begin{macrocode}
499 \def\SetChemSymbol{%
500 %\chemGreekletter{alpha}{010B}%
501 %\chemGreekletter{beta}{010C}%
502 %\chemGreekletter{gamma}{010D}%
503 %\chemGreekletter{delta}{010E}%
504 %\chemGreekletter{epsilon}{010F}%
505 %\chemGreekletter{zeta}{0110}%
506 %\chemGreekletter{eta}{0111}%
507 %\chemGreekletter{theta}{0112}%
508 %\chemGreekletter{iota}{0113}%
509 %\chemGreekletter{kappa}{0114}%
510 %\chemGreekletter{lambda}{0115}%
511 %\chemGreekletter{mu}{0116}%
512 %\chemGreekletter{nu}{0117}%
513 %\chemGreekletter{xi}{0118}%
514 %\chemGreekletter{pi}{0119}%
515 %\chemGreekletter{rho}{011A}%
516 %\chemGreekletter{sigma}{011B}%
517 %\chemGreekletter{tau}{011C}%
518 %\chemGreekletter{upsilon}{011D}%
519 %\chemGreekletter{phi}{011E}%
520 %\chemGreekletter{chi}{011F}%
521 %\chemGreekletter{psi}{0120}%
522 %\chemGreekletter{omega}{0121}%
523 %\chemGreekletter{varepsilon}{0122}%
524 %\chemGreekletter{vartheta}{0123}%
525 %\chemGreekletter{varpi}{0124}%
526 %\chemGreekletter{varrho}{0125}%
527 %\chemGreekletter{varsigma}{0126}%
528 %\chemGreekletter{varphi}{0127}%
529 %
530 \chemGreekletter{alpha}{0B}%
531 \chemGreekletter{beta}{0C}%
532 \chemGreekletter{gamma}{0D}%
533 \chemGreekletter{delta}{0E}%
534 \chemGreekletter{epsilon}{0F}%
535 \chemGreekletter{zeta}{10}%
536 \chemGreekletter{eta}{11}%
537 \chemGreekletter{theta}{12}%
538 \chemGreekletter{iota}{13}%
539 \chemGreekletter{kappa}{14}%
540 \chemGreekletter{lambda}{15}%
541 \chemGreekletter{mu}{16}%
542 \chemGreekletter{nu}{17}%
543 \chemGreekletter{xi}{18}%
544 \chemGreekletter{pi}{19}%
545 \chemGreekletter{rho}{1A}%
546 \chemGreekletter{sigma}{1B}%
547 \chemGreekletter{tau}{1C}%
548 \chemGreekletter{upsilon}{1D}%
549 \chemGreekletter{phi}{1E}%
550 \chemGreekletter{chi}{1F}%
551 \chemGreekletter{psi}{20}%
552 \chemGreekletter{omega}{21}%
553 \chemGreekletter{varepsilon}{22}%
554 \chemGreekletter{vartheta}{23}%
555 \chemGreekletter{varpi}{24}%
556 \chemGreekletter{varrho}{25}%
557 \chemGreekletter{varsigma}{26}%
558 \chemGreekletter{varphi}{27}%
559 %
560 %\chemUpGreekletter{Gamma}{7000}%
561 %\chemUpGreekletter{Delta}{7001}%
562 %\chemUpGreekletter{Theta}{7002}%
563 %\chemUpGreekletter{Lambda}{7003}%
564 %\chemUpGreekletter{Xi}{7004}%
565 %\chemUpGreekletter{Pi}{7005}%
566 %\chemUpGreekletter{Sigma}{7006}%
567 %\chemUpGreekletter{Upsilon}{7007}%
568 %\chemUpGreekletter{Phi}{7008}%
569 %\chemUpGreekletter{Psi}{7009}%
570 %
571 \chemUpGreekletter{Gamma}{00}%
572 \chemUpGreekletter{Delta}{01}%
573 \chemUpGreekletter{Theta}{02}%
574 \chemUpGreekletter{Lambda}{03}%
575 \chemUpGreekletter{Xi}{04}%
576 \chemUpGreekletter{Pi}{05}%
577 \chemUpGreekletter{Sigma}{06}%
578 \chemUpGreekletter{Upsilon}{07}%
579 \chemUpGreekletter{Phi}{08}%
580 \chemUpGreekletter{Psi}{09}%
581 \chemUpGreekletter{Omega}{0A}%
582 %
583 \chemtimesSubFontOrd{imath}{\mathord}{7B}%
584 \chemtimesSubFontOrd{jmath}{\mathord}{7C}%
585 \chemtimesSubFontBin{amalg}{\mathbin}{71}%
586 \chemtimesSubFontLOp{coprod}{60}{61}%
587 %2009/11/22
588 \chemtimesSubFontOrd{mathless}{\mathrel}{3C}%
589 \chemtimesSubFontOrd{mathgreater}{\mathrel}{3E}%
590 \chemtimesSubFontOrd{leftharpoonup}{\mathrel}{28}%
591 \chemtimesSubFontOrd{leftharpoondown}{\mathrel}{29}%
592 \chemtimesSubFontOrd{rightharpoonup}{\mathrel}{2A}%
593 \chemtimesSubFontOrd{rightharpoondown}{\mathrel}{2B}%
594 \chemtimesSubFontOrd{ell}{\mathord}{60}%
595 \chemtimesSubFontOrd{wp}{\mathord}{7D}%
596 \chemtimesSubFontOrd{partial}{\mathord}{40}%
597 \chemtimesSubFontOrd{flat}{\mathord}{5B}%
598 \chemtimesSubFontOrd{natural}{\mathord}{5C}%
599 \chemtimesSubFontOrd{sharp}{\mathord}{5D}%
600 \chemtimesSubFontOrd{triangleleft}{\mathbin}{2F}%
601 \chemtimesSubFontOrd{triangleright}{\mathbin}{2E}%
602 \chemtimesSubFontOrd{smile}{\mathrel}{5E}%
603 \chemtimesSubFontOrd{frown}{\mathrel}{5F}%
604 \chemtimesSubFontOrd{star}{\mathbin}{3F}%
605 \ChemAccent{vec}{\rlap}{7E}%
606 }
607 % \end{macrocode}
608 %
609 % \begin{macro}{\mathversion}
610 % The command \verb/\mathversion/ is redefined to typeset punctuation symbols
611 % properly.
612 % \begin{macrocode}
613 \DeclareRobustCommand\mathversion[1]
614 {\@nomath\mathversion
615 \expandafter\ifx\csname mv@#1\endcsname\relax
616 \@latex@error{Math version `#1' is not defined}\@eha\else
617 \edef\math@version{#1}%
618 \gdef\glb@currsize{}%
619 %%%%%%2002/5/30 and 2004/11/17
620 \ifx\math@version\math@chem
621 \mathcode`\.="012E
622 \mathcode`\,="612C
623 \mathcode`\/="012F
624 \SetChemSymbol
625 \else\ifx\math@version\math@boldchem
626 \mathcode`\.="012E
627 \mathcode`\,="612C
628 \mathcode`\/="012F
629 \SetChemSymbol
630 \else\ifx\math@version\math@bold
631 \mathcode`\.="012E
632 \mathcode`\,="612C
633 \mathcode`\/="012F
634 \SetChemSymbol%
635 \else
636 \mathcode`\.="013A
637 \mathcode`\,="613B
638 \mathcode`\/="013D
639 \SetChemSymbol%
640 \fi\fi\fi
641 %%%%%%
642 \aftergroup\glb@settings
643 \fi}
644 % \end{macrocode}
645 % \end{macro}
646 %
647 % New mathversions (chem and boldchem) are defined, where upright fonts of times family
648 % are used in math modes in place of slanted fonts.
649 %
650 % \begin{macrocode}
651 \ifnewl@tex
652 \@ifundefined{mv@chem}{%
653 \DeclareMathVersion{chem}%
654 \SetSymbolFont{letters}{chem} {OT1}{ptm}{m}{n}%
655 \SetSymbolFont{operators}{chem} {OT1}{ztmcm} {m}{n}%
656 \SetSymbolFont{symbols} {chem} {OMS}{ztmcm}{m}{n}%
657 \SetSymbolFont{largesymbols}{chem}{OMX}{ztmcm}{b}{n}%
658 \DeclareMathVersion{boldchem}%2009/10/23<--2002/5/30
659 \SetSymbolFont{letters}{boldchem} {OT1}{ptm}{b}{n}%
660 \SetSymbolFont{operators}{boldchem} {OT1}{ptm}{b}{n}%
661 \SetSymbolFont{symbols}{boldchem} {OMS}{ptm}{b}{n}%
662 \SetSymbolFont{largesymbols}{boldchem}{OMX}{ztmcm}{b}{n}%
663 }{%
664 \PackageWarning%
665 {chemtimes}%
666 {The mathversion "chem" or "boldchem" has been already defined. ^^J%
667 The old mathversion remains effective unless it is removed. }%
668 }
669 \else
670 \PackageWarning%
671 {chemtimes}%
672 {Mathversions cannot be defined. Use LaTeX2e or a later version.}%
673 \fi
674 % \end{macrocode}
675 %
676 % \begin{macro}{\hbar}
677 % The command \verb/\hbar/ is redefined to typeset the symbol
678 % properly. This command is a slight modification of the one
679 % which has been described in the \textsf{mathptmx} package.
680 % \begin{macrocode}
681 \DeclareRobustCommand\hbar{{%from mathptmx package
682 \[email protected] \[email protected]%
683 \def\@tempa##1##2{%
684 \lower##1\dimen@\rlap{\kern##1\dimen@ii\the##2 0\char22}}%
685 \mathchoice{\@tempa{\@ne}{\textfont}}%
686 {\@tempa{\@ne}{\textfont}}%
687 {\@tempa{\defaultscriptratio}{\scriptfont}}%
688 {\@tempa{\defaultscriptscriptratio}{\scriptscriptfont}}%
689 h}}
690 % \end{macrocode}
691 % \end{macro}
692 %
693 % \begin{macro}{\mathnormal}
694 %
695 % The macro \verb/\mathnormal/ for outputting numbers of old style
696 % has been redefined to meet ``boldchem''.
697 %
698 % \changes{v4.05}{2009/10/25}{Redefined for oldsytle fonts}
699 % \changes{v4.05}{2009/11/22}{Switch by \cs{bfit}}
700 %
701 % \begin{macrocode}
702 \let\oldmathnormal=\mathnormal
703 \def\mathnormal#1{%
704 \ifx\math@version\math@chem
705 %\mathgroup\@ne
706 \m@thnorm@ltrue
707 \ensuremath{\it \usefont{OML}{cmm}{m}{it}#1}%
708 \else\ifx\math@version\math@boldchem
709 \m@thnorm@ltrue
710 \ensuremath{\bfit \usefont{OML}{cmm}{b}{it}#1}%
711 \else\ifx\math@version\math@bold
712 \ifupgreekrm
713 \m@thnorm@ltrue
714 \ensuremath{\bfit \usefont{OML}{cmm}{b}{it}#1}%
715 \else
716 \ensuremath{\usefont{OML}{cmm}{b}{it}#1}%
717 \fi
718 \else
719 \oldmathnormal{#1}%
720 \fi\fi\fi%
721 \m@thnorm@lfalse
722 }%
723 % \end{macrocode}
724 % \end{macro}
725 %
726 % \begin{macro}{\oldstyle}
727 %
728 % The command \verb/\oldstyle/ should be used in the form of \verb/{\oldstyle ...}/
729 % in a math mode.
730 %
731 % \changes{v4.05}{2009/10/25}{Redefined for oldsytle fonts}
732 %
733 % \begin{macrocode}
734 \def\oldstyle{\egroup%
735 \ifx\math@version\math@chem
736 \hbox\bgroup\usefont{OML}{cmm}{m}{it}%
737 \else\ifx\math@version\math@boldchem
738 \hbox\bgroup\usefont{OML}{cmm}{b}{it}%
739 \else\ifx\math@version\math@bold
740 \ifupgreekrm
741 \oldmathnormal\bgroup%
742 \upgreekrmfalse
743 \else
744 \hbox\bgroup\usefont{OML}{cmm}{b}{it}%
745 \fi
746 \else
747 \oldmathnormal\bgroup%
748 \fi\fi\fi}%
749 % \end{macrocode}
750 % \end{macro}
751 %
752 % \begin{macro}{\mathcal}
753 %
754 % The macro \verb/\mathcal/ for outputting calligraphic letters
755 % has been redefined to meet ``boldchem''.
756 %
757 % \changes{v4.05}{2009/10/25}{Redefined for calligraphic letters}
758 % \changes{v4.05}{2009/11/20}{Switch by \cs{if@chemtimes} for chemtimes package}
759 %
760 % \begin{macrocode}
761 \let\oldmathcal=\mathcal
762 \def\mathcal#1{%
763 \ifx\math@version\math@chem
764 \mathgroup\tw@{\usefont{OMS}{cmsy}{m}{n}#1}%
765 \else\ifx\math@version\math@boldchem
766 \mathgroup\tw@{\usefont{OMS}{cmsy}{b}{n}#1}%
767 \else\ifx\math@version\math@bold
768 \ifupgreekrm \oldmathcal{#1}%\upgreekrmfalse
769 \else \oldmathcal{#1}\fi
770 \else
771 \oldmathcal{#1}%
772 \fi\fi\fi}%
773 % \end{macrocode}
774 % \end{macro}
775 %
776 % \begin{macro}{\cal}
777 %
778 % The macro \verb/\cal/ for outputting calligraphic letters
779 % (a macro of declaration type) has been redefined to meet ``boldchem''.
780 %
781 % \changes{v4.05}{2009/10/25}{Redefined for calligraphic letters}
782 % \changes{v4.05}{2009/11/20}{Switch by \cs{if@chemtimes} for chemtimes package}
783 %
784 % \begin{macrocode}
785 %\if@chemtimes\else%for chemtimes package
786 \let\oldcal=\cal
787 \def\cal{%
788 \ifx\math@version\math@chem
789 \mathgroup\tw@\usefont{OMS}{cmsy}{m}{n}%
790 \else\ifx\math@version\math@boldchem
791 \mathgroup\tw@\usefont{OMS}{cmsy}{b}{n}%
792 \else\ifx\math@version\math@bold
793 \ifupgreekrm \oldcal\upgreekrmfalse
794 \else\oldcal\fi
795 \else
796 \oldcal%
797 \fi\fi\fi}%
798 %\fi
799 % \end{macrocode}
800 % \end{macro}
801 %
802 % ChemEquation and ChemEqnarray enviroments are defined
803 % as chemical counterparts of equation and eqnarray environments.
804 % The corresponding asterisked enviroments are also defined.
805 % The command \verb/\ChemForm/ is defined as a chemical counterpart
806 % of \verb/\(...\)/ or \verb/$...$/.
807 % These enviroments and the command do not require the selection of
808 % a chem or boldchem mathversion.
809 % \changes{v1.00}{2009/11/25}{Deleted. Definitions from the chemist package}
810 %
811 % \begin{macro}{ChemEquation}
812 % \begin{macro}{ChemEqnarray}
813 % \begin{macro}{ChemEquation*}
814 % \begin{macro}{ChemEqnarray*}
815 % \begin{macro}{\ChemForm}
816 % \begin{macrocode}
817 %\def\ChemEquation{\everymath{\rm}\everydisplay{\rm}\equation}
818 %\def\endChemEquation{\endequation\everymath{}\everydisplay{}}
819 %\def\ChemEqnarray{\everymath{\rm}\everydisplay{\rm}\eqnarray}
820 %\def\endChemEqnarray{\endeqnarray\everymath{}\everydisplay{}}
821 %\def\ChemForm#1{\everymath{\rm}$#1$\everymath{}}
822 %\@namedef{ChemEqnarray*}{\def\@eqncr{\nonumber\@seqncr}\ChemEqnarray}
823 %\@namedef{endChemEqnarray*}{\nonumber\endChemEqnarray}
824 % \end{macrocode}
825 % \end{macro}
826 % \end{macro}
827 % \end{macro}
828 % \end{macro}
829 % \end{macro}
830 %
831 % The mathversion ``normal'' is declared as the initial default setting.
832 % \begin{macrocode}
833 \mathversion{normal}%default setting
834 %</chemtimes>
835 % \end{macrocode}
836 %
837 % \Finale
838 %
839 \endinput