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