Times Fonts for Chemistry and Mathamatics by chemtimes.sty (v1.00)

Shinsaku Fujita

Shonan Institute of Chemoinformatics and Mathematical Chemistry

2009/10/24

1 Introduction

1.1 Options for docstrip

option  function
chemtimes chemtimes.sty
driver  driver for this dtx file

1.2 Version Information

1 ⟨∗chemtimes⟩

2 \typeout{Package `chemtimes' (v. 1.00) Shinsaku Fujita 2009/10/25}

2 Times Fonts

The option “chemist” is to load the chemist package in place of the default loading of the chmst-ps package. By the option “chemtimes” of the chemist or chmst-ps package, the switch \@chemtimestrue or \@@@chemtimestrue becomes effective. Thereby, the mathversions “chem” and “boldchem” defined in the chemist package are entirely ignored so as to be replaced by those defined in the chemtimes package.

3 \@ifundefined{chemcorr}{}{%
4 \PackageError{chemtimes}
5  {The ``chemist'' or ``chmst-ps'' package is not permitted here}
6  {The ``chemist'' or ``chmst-ps'' package will be automatically loaded \MessageBreak
7  when the ``chemtimes'' package is loaded.}
8 }
9 \newif\ifchemtimes%%
10 \newif\if@chemtimes%%for chemist package
11 \newif\if@@@chemtimes%%for chmst-ps package
12 \newif\if@@chemtimes%%for chmst-ps package
13 \DeclareOption{chemist}{\chemtimestrue}
14 \chemtimesfalse
15 \ProcessOptions
16 \ifchemtimes
17 \RequirePackage[chemtimes]{chemist}%
18 \else

19 \@@chemtimestrue
20 \RequirePackage[chemtimes]{chmst-ps}%
21 \fi

3 Definition of Macros

Times-like fonts are used by declaring “ptm” (times roman) and “phv” (Helvetica) in place of the corresponding roman and san serif families. while computer modern type-writer fonts are used without change.

22 %chemtimes package
23 %times, helvetica
24 %times from ot1ptm.fd 2007/07/31
25 \renewcommand{\rmdefault}{ptm}
26 %Helvetica from ot1phv.fd 2007/07/31
27 \def\Hv@scale{0.90}%scalable font
28 \renewcommand{\sfdefault}{phv}
29 %typewriter
30 %\renewcommand{\ttdefault}{pcr}
31 % with the default (computer modern typewriter font)
32 %% change the defalt values (\thinmuskip 3mu to 2mu etc.)
33 \thinmuskip=2mu
34 \medmuskip=2.5mu plus 1mu minus 1mu
35 \thickmuskip=4mu plus 1.5mu minus 1mu

Fonts for normal mathversion are used on the same line as mathptmx package:

36 %mathversion normal
37 \DeclareSymbolFont{letters}     {OML}{ztmcm}{m}{it}
38 \DeclareSymbolFont{operators}   {OT1}{ztmcm}{m}{n}
39 \DeclareSymbolFont{symbols}     {OMS}{ztmcm}{m}{n}
40 \DeclareSymbolFont{largesymbols}{OMX}{ztmcm}{m}{n}
41 \DeclareSymbolFont{bold}        {OT1}{ptm}{bx}{n}
42 \DeclareSymbolFont{italic}      {OT1}{ptm}{m}{it}
43 \DeclareMathAlphabet{\mathbf}{OT1}{ptm}{bx}{n}
44 \DeclareMathAlphabet{\mathit}{OT1}{ptm}{m}{it}
45 \DeclareMathAlphabet{\mathbfit}{OT1}{ptm}{b}{it}%2009/11/22
46 \DeclareMathAlphabet{\mathsf}{OT1}{phv}{m}{n}
47 %\DeclareMathAlphabet{\mathtt}{OT1}{pcr}{m}{n}
48 \DeclareMathAlphabet{\mathtt}{OT1}{cmtt}{m}{n}
49 %Uppercase Greeks
50 \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{0}
51 \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{1}
52 \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{2}
53 \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{3}
54 \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{4}
55 \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{5}
56 \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{6}
57 \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{7}
58 \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{8}
59 \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{9}
60 \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{10}

The following fonts are used for bold mathversion.

61 %mathversion bold

62 %\SetSymbolFont{letters}     {bold}{OML}{ptm}{b}{it}%
63 \SetSymbolFont{letters}     {bold}{OT1}{ptm}{b}{it}%
64 \SetSymbolFont{operators}   {bold}{OT1}{ptm}{b}{n}%
65 \SetSymbolFont{symbols}     {bold}{OMS}{ptm}{b}{n}%
66 \SetSymbolFont{largesymbols}{bold}{OMX}{ztmcm}{m}{n}%

Font sizes for math modes are defined as follows on the same line as mathptmx package:

67 \def\defaultscriptratio{.74}
68 \def\defaultscriptscriptratio{.6}
69 \DeclareMathSizes{5}{5}{5}{5}
70 \DeclareMathSizes{6}{6}{5}{5}
71 \DeclareMathSizes{7}{7}{5}{5}
72 \DeclareMathSizes{8}{8}{6}{5}
73 \DeclareMathSizes{9}{9}{7}{5}
74 \DeclareMathSizes{10}{10}{7.4}{6}
75 \DeclareMathSizes{10.95}{10.95}{8}{6}
76 \DeclareMathSizes{12}{12}{9}{7}
77 \DeclareMathSizes{14.4}{14.4}{10.95}{8}
78 \DeclareMathSizes{17.28}{17.28}{12}{10}
79 \DeclareMathSizes{20.74}{20.74}{14.4}{12}
80 \DeclareMathSizes{24.88}{24.88}{17.28}{14.4}

Letter strings for judging mathversions:

81 \newif\ifnewl@tex \newl@textrue
82 \@ifundefined{DeclareMathVersion}%
83 {\global\newl@texfalse}{\global\newl@textrue}%
84 \def\math@chem{chem}
85 \def\math@boldchem{boldchem}
86 \def\math@bold{bold}
87 \def\math@normal{normal}

The original setting of each Greek letter is stored tentatively.

88 %%added 2005/09/02
89 \let\oldalpha=\alpha
90 \let\oldbeta=\beta
91 \let\oldgamma=\gamma
92 \let\olddelta=\delta
93 \let\oldepsilon=\epsilon
94 \let\oldzeta=\zeta
95 \let\oldeta=\eta
96 \let\oldtheta=\theta
97 \let\oldiota=\iota
98 \let\oldkappa=\kappa
99 \let\oldlambda=\lambda
100 \let\oldmu=\mu
101 \let\oldnu=\nu
102 \let\oldxi=\xi
103 \let\oldpi=\pi
104 \let\oldrho=\rho
105 \let\oldsigma=\sigma
106 \let\oldtau=\tau
107 \let\oldupsilon=\upsilon
108 \let\oldphi=\phi

109 \let\oldchi=\chi
110 \let\oldpsi=\psi
111 \let\oldomega=\omega
112 \let\oldvarepsilon=\varepsilon
113 \let\oldvartheta=\vartheta
114 \let\oldvarpi=\varpi
115 \let\oldvarrho=\varrho
116 \let\oldvarsigma=\varsigma
117 \let\oldvarphi=\varphi
118 \let\oldGamma=\Gamma
119 \let\oldDelta=\Delta
120 \let\oldTheta=\Theta
121 \let\oldLamda=\Lambda
122 \let\oldXi=\Xi
123 \let\oldPi=\Pi
124 \let\oldSigma=\Sigma
125 \let\oldUpsilon=\Upsilon
126 \let\oldPhi=\Phi
127 \let\oldPsi=\Psi
128 \let\oldOmega=\Omega

\chemGreekpalette \chemGreekletter The command \chemGreekletter selects a lowercase greek letter for each mathversion.

129 \def\chemGreekpalette#1#2#3{%
130 \mathchoice%
131 {\mathord{\hbox{\usefont{OML}{#1}{#3}{it}\char"#2}}}%
132 {\mathord{\hbox{\usefont{OML}{#1}{#3}{it}\char"#2}}}%
133 {\mathord{\hbox{\scriptsize\usefont{OML}{#1}{#3}{it}\char"#2}}}%
134 {\mathord{\hbox{\tiny\usefont{OML}{#1}{#3}{it}\char"#2}}}}%
135 \def\chemGreekletter#1#2{%
136 \expandafter\def\csname #1\endcsname{%
137 \ifx\math@version\math@chem
138 %\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}
139 \chemGreekpalette{ztmcm}{#2}{m}%
140 \else
141 \ifx\math@version\math@boldchem
142 %\mathord{\hbox{\mathversion{bold}$\mathchar"#2$}}%
143 \chemGreekpalette{cmm}{#2}{b}%
144 \else
145 \ifx\math@version\math@bold
146 %\csname old#1\endcsname
147 \chemGreekpalette{cmm}{#2}{b}%
148 \else
149 \csname old#1\endcsname
150 \fi\fi\fi}}
\ChemAccent
151 %\if@chemtimes\else%for chemtimes package
152 \def\ChemAccent#1#2#3{%
153 \expandafter\def\csname #1\endcsname{%
154 \ifx\math@version\math@chem
155 #2{\hbox{\kern-0.15em\usefont{OML}{cmm}{m}{it}\char"#3}}\else
156 \ifx\math@version\math@boldchem
157 #2{\hbox{\kern-0.2em\usefont{OML}{cmm}{b}{it}\char"#3}}\else

158 \ifx\math@version\math@bold
159 \ifupgreekrm
160 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
161 \upgreekrmfalse
162 \else
163 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
164 \fi
165 \else
166 #2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
167 \fi\fi\fi}}
168 %\fi

\rm The command \rm is redefined to use \ifupgreekrm for switching slanted letters into upright letters.

169 \newif\ifupgreekrm \upgreekrmfalse
170 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm\upgreekrmtrue}
171 %\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\upgreekrmtrue\mathrm}
172 \DeclareOldFontCommand{\bfit}{\normalfont\itshape\bfseries}{\mathbfit}%2009/11/22
173 \let\oldmathrm=\mathrm
174 \def\mathrm#1{\oldmathrm{\upgreekrmtrue #1}}

\chemUpGreekletter The command \chemUpGreekletter selects an uppercase greek letter for each mathversion.

175 \newif\ifm@thnorm@l
176 \def\chemUpGreekletter#1#2{%
177 \expandafter\def\csname #1\endcsname{%
178 \ensuremath{%
179 \ifx\math@version\math@chem
180 %\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}\else
181 \ifm@thnorm@l
182 \mathord{\hbox{\usefont{OML}{cmm}{m}{it}\char"#2}}%
183 \else
184 \mathord{\hbox{\usefont{OT1}{cmr}{m}{n}\char"#2}}%
185 \fi
186 \else
187 \ifx\math@version\math@boldchem
188 %\mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}\else
189 \ifm@thnorm@l
190 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
191 \else
192 \mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}%
193 \fi
194 \else
195 \ifx\math@version\math@bold
196 \ifupgreekrm
197 \ifm@thnorm@l
198 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
199 \else
200 \mathord{\hbox{\usefont{OT1}{cmr}{b}{n}\char"#2}}%
201 \fi
202 %%%\upgreekrmfalse
203 \else
204 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}\char"#2}}%
205 %\csname old#1\endcsname

206 \fi
207 \else
208 \csname old#1\endcsname
209 \fi\fi\fi}}}
\ctSFOpalette \chemtimesSubFontOrd The command \chemtimesSubFontOrd selects a symbol for substitution (com-

puter modern font) if there is no such font of times family.

210 \def\ctSFOpalette#1#2#3{%
211 \mathchoice
212 {#2{\hbox{\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
213 {#2{\hbox{\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
214 {#2{\hbox{\scriptsize\usefont{OML}{cmm}{#1}{it}\char"#3}}}%
215 {#2{\hbox{\tiny\usefont{OML}{cmm}{#1}{it}\char"#3}}}%

216 }

217 \def\chemtimesSubFontOrd#1#2#3{%
218 \expandafter\def\csname #1\endcsname{%
219 \PackageWarning{chemtimes}
220 {The symbol \expandafter\string\csname #1\endcsname\space
221 is not available with this package.
222 This font will be substituted by an appropriate commputer modern font}%
223 \ifx\math@version\math@chem
224 %#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
225 \ctSFOpalette{m}{#2}{#3}%
226 \else\ifx\math@version\math@boldchem
227 %#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
228 \ctSFOpalette{b}{#2}{#3}%
229 \else\ifx\math@version\math@bold
230 %{#2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}}%
231 \ctSFOpalette{b}{#2}{#3}%
232 \else\ifx\math@version\math@normal
233 %#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
234 \ctSFOpalette{m}{#2}{#3}%
235 \else
236 %#2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
237 \ctSFOpalette{m}{#2}{#3}%
238 \fi\fi\fi\fi}}
\ctSFBpalette \ctSFBBpalette \chemtimesSubFontBin The command \chemtimesSubFontBin selects a symbol (binary operation) for

substitution (computer modern font) if there is no such font of times family.

239 \def\ctSFBpalette#1#2#3{%
240 \mathchoice
241 {#2{\hbox{\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
242 {#2{\hbox{\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
243 {#2{\hbox{\scriptsize\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%
244 {#2{\hbox{\tiny\usefont{OMS}{cmsy}{#1}{n}\char"#3}}}%

245 }

246 \def\ctSFBBpalette#1#2#3{%
247 \mathchoice
248 {#2{\hbox{\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
249 {#2{\hbox{\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
250 {#2{\hbox{\scriptsize\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%
251 {#2{\hbox{\tiny\usefont{OMS}{cmm}{#1}{n}\char"#3}}}%

252 }

253 \def\chemtimesSubFontBin#1#2#3{%

254 \expandafter\def\csname #1\endcsname{%
255 \PackageWarning{chemtimes}
256 {The symbol \expandafter\string\csname #1\endcsname\space
257 is not available with this package.
258 This font will be substituted by an appropriate commputer modern font}%
259 \ifx\math@version\math@chem
260 %#2{\hbox{\usefont{OMS}{cmsy}{m}{n}\char"#3}}%
261 \ctSFBpalette{m}{#2}{#3}%
262 \else\ifx\math@version\math@boldchem
263 %#2{\hbox{\usefont{OMS}{cmsy}{b}{n}\char"#3}}%
264 \ctSFBpalette{b}{#2}{#3}%
265 \else\ifx\math@version\math@bold
266 %#2{\hbox{\usefont{OMS}{cmsy}{b}{n}\char"#3}}%
267 \ctSFBpalette{b}{#2}{#3}%
268 \else\ifx\math@version\math@normal
269 %#2{\hbox{\usefont{OMS}{cmsy}{m}{n}\char"#3}}%
270 \ctSFBpalette{m}{#2}{#3}%
271 \else
272 %#2{\hbox{\usefont{OMS}{cmm}{m}{n}\char"#3}}%
273 \ctSFBBpalette{m}{#2}{#3}%
274 \fi\fi\fi\fi}}

\chemtimesSubFontLOp The command \chemtimesSubFontLOp selects a symbol (large operation) for substitution (computer modern font) if there is no such font of times family.

275 \def\chemtimesSubFontLOp#1#2#3{%
276 \expandafter\def\csname #1\endcsname{%
277 \PackageWarning{chemtimes}
278 {The symbol \expandafter\string\csname #1\endcsname\space
279 is not available with this package.
280 This font will be substituted by an appropriate commputer modern font}%
281 \ifx\math@version\math@chem
282 \mathop{\mathchoice%
283 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
284 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%

285 }%

286 \else\ifx\math@version\math@boldchem
287 \mathop{\mathchoice%
288 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#3}}%
289 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#2}}{}{}%

290 }%

291 \else\ifx\math@version\math@bold
292 \mathop{\mathchoice%
293 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#3}}%
294 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{b}{n}\char"#2}}{}{}%

295 }%

296 \else\ifx\math@version\math@normal
297 \mathop{\mathchoice%
298 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
299 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%

300 }%

301 \else
302 \mathop{\mathchoice%
303 {\raise2.2ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#3}}%
304 {\raise1.8ex\hbox{\usefont{OMX}{cmex}{m}{n}\char"#2}}{}{}%

305 }%

306 \fi\fi\fi\fi}}

Lowercase and uppercase Greek letters are redefined as follows:

307 \def\SetChemSymbol{%
308 %\chemGreekletter{alpha}{010B}%
309 %\chemGreekletter{beta}{010C}%
310 %\chemGreekletter{gamma}{010D}%
311 %\chemGreekletter{delta}{010E}%
312 %\chemGreekletter{epsilon}{010F}%
313 %\chemGreekletter{zeta}{0110}%
314 %\chemGreekletter{eta}{0111}%
315 %\chemGreekletter{theta}{0112}%
316 %\chemGreekletter{iota}{0113}%
317 %\chemGreekletter{kappa}{0114}%
318 %\chemGreekletter{lambda}{0115}%
319 %\chemGreekletter{mu}{0116}%
320 %\chemGreekletter{nu}{0117}%
321 %\chemGreekletter{xi}{0118}%
322 %\chemGreekletter{pi}{0119}%
323 %\chemGreekletter{rho}{011A}%
324 %\chemGreekletter{sigma}{011B}%
325 %\chemGreekletter{tau}{011C}%
326 %\chemGreekletter{upsilon}{011D}%
327 %\chemGreekletter{phi}{011E}%
328 %\chemGreekletter{chi}{011F}%
329 %\chemGreekletter{psi}{0120}%
330 %\chemGreekletter{omega}{0121}%
331 %\chemGreekletter{varepsilon}{0122}%
332 %\chemGreekletter{vartheta}{0123}%
333 %\chemGreekletter{varpi}{0124}%
334 %\chemGreekletter{varrho}{0125}%
335 %\chemGreekletter{varsigma}{0126}%
336 %\chemGreekletter{varphi}{0127}%

337 %

338 \chemGreekletter{alpha}{0B}%
339 \chemGreekletter{beta}{0C}%
340 \chemGreekletter{gamma}{0D}%
341 \chemGreekletter{delta}{0E}%
342 \chemGreekletter{epsilon}{0F}%
343 \chemGreekletter{zeta}{10}%
344 \chemGreekletter{eta}{11}%
345 \chemGreekletter{theta}{12}%
346 \chemGreekletter{iota}{13}%
347 \chemGreekletter{kappa}{14}%
348 \chemGreekletter{lambda}{15}%
349 \chemGreekletter{mu}{16}%
350 \chemGreekletter{nu}{17}%
351 \chemGreekletter{xi}{18}%
352 \chemGreekletter{pi}{19}%
353 \chemGreekletter{rho}{1A}%
354 \chemGreekletter{sigma}{1B}%
355 \chemGreekletter{tau}{1C}%
356 \chemGreekletter{upsilon}{1D}%

357 \chemGreekletter{phi}{1E}%
358 \chemGreekletter{chi}{1F}%
359 \chemGreekletter{psi}{20}%
360 \chemGreekletter{omega}{21}%
361 \chemGreekletter{varepsilon}{22}%
362 \chemGreekletter{vartheta}{23}%
363 \chemGreekletter{varpi}{24}%
364 \chemGreekletter{varrho}{25}%
365 \chemGreekletter{varsigma}{26}%
366 \chemGreekletter{varphi}{27}%

367 %

368 %\chemUpGreekletter{Gamma}{7000}%
369 %\chemUpGreekletter{Delta}{7001}%
370 %\chemUpGreekletter{Theta}{7002}%
371 %\chemUpGreekletter{Lambda}{7003}%
372 %\chemUpGreekletter{Xi}{7004}%
373 %\chemUpGreekletter{Pi}{7005}%
374 %\chemUpGreekletter{Sigma}{7006}%
375 %\chemUpGreekletter{Upsilon}{7007}%
376 %\chemUpGreekletter{Phi}{7008}%
377 %\chemUpGreekletter{Psi}{7009}%

378 %

379 \chemUpGreekletter{Omega}{0A}%
380 \chemUpGreekletter{Gamma}{00}%
381 \chemUpGreekletter{Delta}{01}%
382 \chemUpGreekletter{Theta}{02}%
383 \chemUpGreekletter{Lambda}{03}%
384 \chemUpGreekletter{Xi}{04}%
385 \chemUpGreekletter{Pi}{05}%
386 \chemUpGreekletter{Sigma}{06}%
387 \chemUpGreekletter{Upsilon}{07}%
388 \chemUpGreekletter{Phi}{08}%
389 \chemUpGreekletter{Psi}{09}%
390 \chemUpGreekletter{Omega}{0A}%

391 %

392 \chemtimesSubFontOrd{imath}{\mathord}{7B}%
393 \chemtimesSubFontOrd{jmath}{\mathord}{7C}%
394 \chemtimesSubFontBin{amalg}{\mathbin}{71}%
395 \chemtimesSubFontLOp{coprod}{60}{61}%
396 %2009/11/22
397 \chemtimesSubFontOrd{mathless}{\mathrel}{3C}%
398 \chemtimesSubFontOrd{mathgreater}{\mathrel}{3E}%
399 \chemtimesSubFontOrd{leftharpoonup}{\mathrel}{28}%
400 \chemtimesSubFontOrd{leftharpoondown}{\mathrel}{29}%
401 \chemtimesSubFontOrd{rightharpoonup}{\mathrel}{2A}%
402 \chemtimesSubFontOrd{rightharpoondown}{\mathrel}{2B}%
403 \chemtimesSubFontOrd{ell}{\mathord}{60}%
404 \chemtimesSubFontOrd{wp}{\mathord}{7D}%
405 \chemtimesSubFontOrd{partial}{\mathord}{40}%
406 \chemtimesSubFontOrd{flat}{\mathord}{5B}%
407 \chemtimesSubFontOrd{natural}{\mathord}{5C}%
408 \chemtimesSubFontOrd{sharp}{\mathord}{5D}%
409 \chemtimesSubFontOrd{triangleleft}{\mathbin}{2F}%
410 \chemtimesSubFontOrd{triangleright}{\mathbin}{2E}%

411 \chemtimesSubFontOrd{smile}{\mathrel}{5E}%
412 \chemtimesSubFontOrd{frown}{\mathrel}{5F}%
413 \chemtimesSubFontOrd{star}{\mathbin}{3F}%
414 \ChemAccent{vec}{\rlap}{7E}%

415 }

\mathversion The command \mathversion is redefined to typeset punctuation symbols properly.

416 \DeclareRobustCommand\mathversion[1]
417  {\@nomath\mathversion
418  \expandafter\ifx\csname mv@#1\endcsname\relax
419  \@latex@error{Math version `#1' is not defined}\@eha\else
420  \edef\math@version{#1}%
421  \gdef\glb@currsize{}%
422 %%%%%%2002/5/30 and 2004/11/17
423 \ifx\math@version\math@chem
424 \mathcode`\.="012E
425 \mathcode`\,="612C
426 \mathcode`\/="012F
427 \SetChemSymbol
428 \else\ifx\math@version\math@boldchem
429 \mathcode`\.="012E
430 \mathcode`\,="612C
431 \mathcode`\/="012F
432 \SetChemSymbol
433 \else\ifx\math@version\math@bold
434 \mathcode`\.="012E
435 \mathcode`\,="612C
436 \mathcode`\/="012F
437 \SetChemSymbol%
438 \else
439 \mathcode`\.="013A
440 \mathcode`\,="613B
441 \mathcode`\/="013D
442 \SetChemSymbol%
443 \fi\fi\fi
444 %%%%%%
445  \aftergroup\glb@settings
446  \fi}

New mathversions (chem and boldchem) are defined, where upright fonts of times family are used in math modes in place of slanted fonts.

447 \ifnewl@tex
448 \@ifundefined{mv@chem}{%
449 \DeclareMathVersion{chem}%
450 \SetSymbolFont{letters}{chem}     {OT1}{ptm}{m}{n}%
451 \SetSymbolFont{operators}{chem}   {OT1}{ztmcm} {m}{n}%
452 \SetSymbolFont{symbols}  {chem}   {OMS}{ztmcm}{m}{n}%
453 \SetSymbolFont{largesymbols}{chem}{OMX}{ztmcm}{b}{n}%
454 \DeclareMathVersion{boldchem}%2009/10/23<--2002/5/30
455 \SetSymbolFont{letters}{boldchem}     {OT1}{ptm}{b}{n}%
456 \SetSymbolFont{operators}{boldchem}   {OT1}{ptm}{b}{n}%
457 \SetSymbolFont{symbols}{boldchem}     {OMS}{ptm}{b}{n}%
458 \SetSymbolFont{largesymbols}{boldchem}{OMX}{ztmcm}{b}{n}%

459 }{%
460 \PackageWarning%
461 {chemtimes}%
462 {The mathversion "chem" or "boldchem" has been already defined. ^^J%
463 The old mathversion remains effective unless it is removed. }%

464 }

465 \else
466 \PackageWarning%
467 {chemtimes}%
468 {Mathversions cannot be defined. Use LaTeX2e or a later version.}%
469 \fi

\hbar The command \hbar is redefined to typeset the symbol properly. This command is a slight modification of the one which has been described in the mathptmx package.

470 \DeclareRobustCommand\hbar{{%from mathptmx package
471 \dimen@.06em \dimen@ii.06em%
472 \def\@tempa##1##2{%
473 \lower##1\dimen@\rlap{\kern##1\dimen@ii\the##2 0\char22}}%
474 \mathchoice{\@tempa{\@ne}{\textfont}}%
475  {\@tempa{\@ne}{\textfont}}%
476  {\@tempa{\defaultscriptratio}{\scriptfont}}%
477  {\@tempa{\defaultscriptscriptratio}{\scriptscriptfont}}%
478 h}}

\mathnormal The macro \mathnormal for outputting numbers of old style has been redefined to meet “boldchem”.

479 \let\oldmathnormal=\mathnormal
480 \def\mathnormal#1{%
481 \ifx\math@version\math@chem
482 %\mathgroup\@ne
483 \m@thnorm@ltrue
484 \ensuremath{\it \usefont{OML}{cmm}{m}{it}#1}%
485 \else\ifx\math@version\math@boldchem
486 \m@thnorm@ltrue
487 \ensuremath{\bfit \usefont{OML}{cmm}{b}{it}#1}%
488 \else\ifx\math@version\math@bold
489 \ifupgreekrm
490 \m@thnorm@ltrue
491 \ensuremath{\bfit \usefont{OML}{cmm}{b}{it}#1}%
492 \else
493 \ensuremath{\usefont{OML}{cmm}{b}{it}#1}%
494 \fi
495 \else
496 \oldmathnormal{#1}%
497 \fi\fi\fi%
498 \m@thnorm@lfalse

499 }%

\oldstyle The command \oldstyle should be used in the form of {\oldstyle ...} in a math mode.

500 \def\oldstyle{\egroup%
501 \ifx\math@version\math@chem

502 \hbox\bgroup\usefont{OML}{cmm}{m}{it}%
503 \else\ifx\math@version\math@boldchem
504 \hbox\bgroup\usefont{OML}{cmm}{b}{it}%
505 \else\ifx\math@version\math@bold
506 \ifupgreekrm
507 \oldmathnormal\bgroup%
508 \upgreekrmfalse
509 \else
510 \hbox\bgroup\usefont{OML}{cmm}{b}{it}%
511 \fi
512 \else
513 \oldmathnormal\bgroup%
514 \fi\fi\fi}%

\mathcal The macro \mathcal for outputting calligraphic letters has been redefined to meet “boldchem”.

515 \let\oldmathcal=\mathcal
516 \def\mathcal#1{%
517 \ifx\math@version\math@chem
518 \mathgroup\tw@{\usefont{OMS}{cmsy}{m}{n}#1}%
519 \else\ifx\math@version\math@boldchem
520 \mathgroup\tw@{\usefont{OMS}{cmsy}{b}{n}#1}%
521 \else\ifx\math@version\math@bold
522 \ifupgreekrm \oldmathcal{#1}%\upgreekrmfalse
523 \else \oldmathcal{#1}\fi
524 \else
525 \oldmathcal{#1}%
526 \fi\fi\fi}%

\cal The macro \cal for outputting calligraphic letters (a macro of declaration type) has been redefined to meet “boldchem”.

527 %\if@chemtimes\else%for chemtimes package
528 \let\oldcal=\cal
529 \def\cal{%
530 \ifx\math@version\math@chem
531 \mathgroup\tw@\usefont{OMS}{cmsy}{m}{n}%
532 \else\ifx\math@version\math@boldchem
533 \mathgroup\tw@\usefont{OMS}{cmsy}{b}{n}%
534 \else\ifx\math@version\math@bold
535 \ifupgreekrm \oldcal\upgreekrmfalse
536 \else\oldcal\fi
537 \else
538 \oldcal%
539 \fi\fi\fi}%
540 %\fi

ChemEquation and ChemEqnarray enviroments are defined as chemical counterparts of equation and eqnarray environments. The corresponding asterisked enviroments are also defined. The command \ChemForm is defined as a chemical counterpart of \(...\) or $...$. These enviroments and the command do not require the selection of a chem or boldchem mathversion.

ChemEquation
ChemEqnarray
ChemEquation*
ChemEqnarray*
\ChemForm

12

541 %\def\ChemEquation{\everymath{\rm}\everydisplay{\rm}\equation}
542 %\def\endChemEquation{\endequation\everymath{}\everydisplay{}}
543 %\def\ChemEqnarray{\everymath{\rm}\everydisplay{\rm}\eqnarray}
544 %\def\endChemEqnarray{\endeqnarray\everymath{}\everydisplay{}}
545 %\def\ChemForm#1{\everymath{\rm}$#1$\everymath{}}
546 %\@namedef{ChemEqnarray*}{\def\@eqncr{\nonumber\@seqncr}\ChemEqnarray}
547 %\@namedef{endChemEqnarray*}{\nonumber\endChemEqnarray}

The mathversion “normal” is declared as the initial default setting.

548 \mathversion{normal}%default setting

549 ⟨/chemtimes⟩