Chemist Package v4.05

Shinsaku Fujita

Shonan Institute of Chemoinformatics and Mathematical Chemistry Ashigara-Kami-Gun, Kanagawa, Japan

2009/11/08

Contents

1 docstrip options

This dtx file provides the chemist package by docstrip processing.

argument package name
chemist  chemist.sty
driver  a documentation driver file

2 Version information

The old process for typing out version information remains active.

1 ⟨chemist⟩

2 %%%%%%%%
3 \def\j@urnalname{chemist} \def\journalID{chemist}
4 \def\versi@ndate{November 08, 2009}
5 \def\versi@nno{ver4.05}
6 \def\copyrighth@lder{SF} % Shinsaku Fujita
7 %%%%%%%%%%

8 ⟨∗chemist⟩

9 \typeout{Package `\j@urnalname' (\versi@nno) <\versi@ndate>\space
10 [\copyrighth@lder]}
11 \typeout{chemist.sty ver4.05 (for LaTeX2e) 2009/11/08[SF]}

12 ⟨/chemist⟩

3 Times Fonts

If the chemtimes package is loaded, the switch \@chemtimestrue becomes effective. Thereby, the mathversions “chem” and “boldchem” defined in the present chemist package are entirely replaced by those defined in the chemtimes package.

\if@chemtimes

13 ⟨∗chemist⟩

14 \@ifundefined{ifchemtimes}{\newif\ifchemtimes}{}%from chemtimes
15 \@ifundefined{if@chemtimes}{\newif\if@chemtimes}{}

16 \@ifundefined{if@@chemtimes}{\newif\if@@chemtimes}{}%from chemtimes
17 \DeclareOption{chemtimes}{\@chemtimestrue}
18 \@chemtimesfalse
19 \ProcessOptions
20 \if@chemtimes
21 \if@@chemtimes\else
22 \ifchemtimes\else
23 \PackageError{chemist}
24  {The option ``chemtimes'' is not permitted}
25  {You should use this option after the chemtimes package is loaded}
26 \fi\fi\fi

4 Cross-references of compounds

The compd counter is introduced for numbering chemical compounds.

\thecompd \compd \nocompd The \thecompd command prints compound numbering without advancing the the compd counter. The \compd command prints compound numbering and advances the compd counter by one, while the \nocompd advances the compd counter by one without printing.

27 % *******************
28 % * compound label  *
29 % *   1991 sept 29  *
30 % *******************
31 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
32 \@ifundefined{chapter}{\newcounter{compd}}{\newcounter{compd}[chapter]}
33 \def\thecompd{\arabic{compd}}
34 %\def\compd{\refstepcounter{compd}\unskip{\large\bf \thecompd}}
35 \def\compd{\leavevmode\refstepcounter{compd}{\large\bf \thecompd}}
36 \def\nocompd{\refstepcounter{compd}}

\compdlabel \nocompdlabel \cref The cross-reference of compound numbers are conducted by using \label and \ref commands. Alternative commands are also available as follows.

37 \def\compdlabel#1{\compd \label{#1}}
38 \def\nocompdlabel#1{\nocompd \label{#1}}
39 \@ifundefined{bf}{\def\bf{\normalfont\bfseries}}{}
40 \def\cref#1{{\bf \ref{#1}}}

\compdfbox \compdmbox \lbcompdpbox For takeing a space for compound output, we can use \compdfbox and like.

41 \def\compdfbox#1#2#3{\framebox[#1]{\rule[-0.3mm]{0pt}{#2} #3 }}
42 \def\compdmbox#1#2#3{\makebox[#1]{\rule[-0.3mm]{0pt}{#2} #3 }}
43 \def\lbcompdpbox#1#2#3{\parbox{#2}{\vskip 2em
44 \parbox{#2}{#3 \par \centering{\compdlabel{#1}}\vskip 2em }}}

The deriv counter is introduced for numbering derivatives of a compound.

\thederiv \deriv \noderiv \derivnum
45 % ********************
46 % * deriv label      *
47 % *   1991 oct  01   *
48 % ********************
49 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita

50 \newcounter{deriv}[compd]
51 \def\thederiv {\thecompd\alph{deriv}}
52 %\def\deriv{\refstepcounter{deriv}\unskip{\large\bf \thederiv}}
53 \def\deriv{\leavevmode\refstepcounter{deriv}{\large\bf \thederiv}}
54 \def\noderiv{\refstepcounter{deriv}}
55 \def\derivnum{%
56 \leavevmode\refstepcounter{deriv}{\large\bf \alph{deriv}}}

\derivlabel \noderivlabel The cross-reference of derivative numbers are conducted by using \label and \ref commands. Alternative commands are also available as follows.

57 \def\derivlabel#1{\deriv \label{#1}}
58 \def\noderivlabel#1{\noderiv \label{#1}}

\derivfbox \derivmbox \lbderivpbox For takeing a space for placing a derivative, we can use \compdfbox and like.

59 \def\derivfbox#1#2#3{\framebox[#1]{\rule[-0.3mm]{0pt}{#2} #3 }}
60 \def\derivmbox#1#2#3{\makebox[#1]{\rule[-0.3mm]{0pt}{#2} #3 }}
61 \def\lbderivpbox#1#2#3{\parbox{#2}{\vskip 2em
62 \parbox{#2}{#3 \par \centering{\derivlabel{#1}}\vskip 2em }}}

\deriva \noderiva \derivalabel \noderivalabel The deriv counter is also advanced by \deriva command and like. This command produced the net output of the deriv counter.

63 % ********************
64 % * deriva label     *
65 % *   1991 oct  05   *
66 % ********************
67 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
68 %\def\deriva{\refstepcounter{deriv}\unskip{\large\bf \alph{deriv}}}
69 \def\deriva{\leavevmode\refstepcounter{deriv}{\large\bf \alph{deriv}}}
70 \def\noderiva{\refstepcounter{deriv}}
71 \def\derivalabel#1{\deriva \label{#1}}
72 \def\noderivalabel#1{\noderiva \label{#1}}

5 Boxes for placing compounds

\cdonecell \cdtwocell These boxes with a given width are used for printing chemical compounds. A box provided by \cdonecell is used for accomodating a compound. A box provided by \cdtwocell is devied into two vertical cells where the one is to place a compound and the other to place the compound number.

73 % ********************
74 % * cdonecell label  *
75 % *   1991 oct  04   *
76 % ********************
77 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
78 \def\cdonecell#1#2#3{\raisebox{#1}{\parbox{#2}{\centering{#3}}}}
79 % #1 ue, #2 haba, #3 honbun
80 \def\cdtwocell#1#2#3#4{\raisebox{#1}{
81 \parbox{#2}{\centering{#3} \par \vskip 3pt \centering{#4}  }}}
82 % #1 ue, #2 haba, #3 ue honbun, #4 shita label

6 Arrows

6.1 Arrows with variable length

\leftrightarrowfill \Leftarrowfill \Rightarrowfill \Leftrightarrowfill LaTeX are possessed of \leftarrowfill and \rightarrowfill for drawing ar-

rows with variable length. The chemist package defines other arrows with variable length for drawing chemical equations or schemes.

83 % *******************
84 % * variable arrows * 1992 May 24 S. Fujita
85 % *******************
86 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
87 \def\leftrightarrowfill{$\m@th \mathord\leftarrow \mkern-6mu
88 \cleaders\hbox{$\mkern-2mu \mathord- \mkern-2mu$}\hfill
89 \mkern-6mu \mathord\rightarrow$}
90 \def\Leftarrowfill{$\m@th \mathord\Leftarrow \mkern-6mu
91 \cleaders\hbox{$\mkern-2mu \mathord= \mkern-2mu$}\hfill
92 \mkern-6mu \mathord=$}
93 \def\Rightarrowfill{$\m@th \mathord= \mkern-6mu
94 \cleaders\hbox{$\mkern-2mu \mathord= \mkern-2mu$}\hfill
95 \mkern-6mu \mathord\Rightarrow$}
96 \def\Leftrightarrowfill{$\m@th \mathord\Leftarrow \mkern-6mu
97 \cleaders\hbox{$\mkern-2mu \mathord= \mkern-2mu$}\hfill
98 \mkern-6mu \mathord\Rightarrow$}

6.2 Reaction arrows with variable length

\reactrarrow \reactlarrow \reactlrarrow \reacteqarrow The chemist package defines arrows with variable length for drawing chemical equations, where additional information can be written on the upper and/or downward sides of each arrow.

The vertical space between the upper text and the arrow as well as the vertical spece between the the arrow and the below text can be changed by the dimension

register \reactarrowsep.
  \reactarrowsep (dimension) for adjusting the two vertical spaces
                             (default value 0pt)
  \reactarrowseprate (string) for adjusting the lower vertical space
                              (default 1.0)

99 % ******************* 1991 Oct 4 S. Fujita
100 % * reaction arrows * Revised 1992 May 24 S.Fujita%1999/02/02 SF
101 % *******************
102 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita

103 %

104 % #1 yoko #2 ue, #3 haba, #4 ya no ue, #5 ya no shita

105 %

106 \newdimen\reactarrowsep
107 \def\reactarrowseprate{1.0}
108 \reactarrowsep=0pt
109 \def\oldreactrarrow{\@ifnextchar[{\oldreact@rarrow}{\oldreact@rarrow[0pt]}}
110 \def\oldreact@rarrow[#1]#2#3#4#5{\ensuremath{\mathbin{\hskip#1\raisebox{#2}{%
111 \parbox{#3}{\centering
112  \baselineskip=.8\normalbaselineskip \ChemStrut{#4}\par

113  \vskip-0.2\normalbaselineskip\vskip\reactarrowsep
114  \leavevmode\rightarrowfill \par
115  \vskip\reactarrowseprate\reactarrowsep
116  \vskip-0.1\normalbaselineskip\ChemStrut{#5}}}}}}
117 \def\oldreactlarrow{\@ifnextchar[{\oldreact@larrow}{\oldreact@larrow[0pt]}}
118 \def\oldreact@larrow[#1]#2#3#4#5{\ensuremath{\mathbin{\hskip#1\raisebox{#2}{%
119  \parbox{#3}{\centering
120  \baselineskip=.8\normalbaselineskip \ChemStrut{#4}\par
121  \vskip-0.2\normalbaselineskip\vskip\reactarrowsep
122  \leavevmode\leftarrowfill \par
123  \vskip\reactarrowseprate\reactarrowsep
124  \vskip-0.1\normalbaselineskip\ChemStrut{#5}}}}}}
125 \def\oldreactlrarrow{\@ifnextchar[{\oldreact@lrarrow}{\oldreact@lrarrow[0pt]}}
126 \def\oldreact@lrarrow[#1]#2#3#4#5{\ensuremath{\mathbin{\hskip#1\raisebox{#2}{%
127  \parbox{#3}{\centering
128  \baselineskip=.8\normalbaselineskip
129  \ChemStrut{#4}\par
130  \vskip-0.2\normalbaselineskip\vskip\reactarrowsep
131  \leavevmode\centering{\leftrightarrowfill} \par
132  \vskip\reactarrowseprate\reactarrowsep
133  \vskip-0.1\normalbaselineskip\ChemStrut{#5}}}}}}
134 \def\oldreacteqarrow{\@ifnextchar[{\oldreact@eqarrow}{\oldreact@eqarrow[0pt]}}
135 \def\oldreact@eqarrow[#1]#2#3#4#5{\ensuremath{\mathbin{\hskip#1\raisebox{#2}{%
136  \parbox{#3}{\centering
137  \baselineskip=.8\normalbaselineskip
138  \ChemStrut{#4}\par
139  \vskip-0.2\normalbaselineskip\vskip\reactarrowsep
140  \leavevmode\rightarrowfill \par \vskip-0.55\normalbaselineskip%
141  \leavevmode\leftarrowfill \par
142  \vskip\reactarrowseprate\reactarrowsep
143  \vskip-0.1\normalbaselineskip\ChemStrut{#5}}}}}}
144 %%%%%%2009/11/19
145 %\let\reactrarrow=\oldreactrarrow
146 %\let\reactlarrow=\oldreactlarrow
147 %\let\reactlrarrow=\oldreactlrarrow
148 %\let\reacteqarrow=\oldreacteqarrow

\reactreqarrow \reactleqarrow These commands have been added for the XyMTeX version 4.05. The chemist package additionally defines arrows with variable length for drawing chemical equilibrium, where additional information can be written on the upper and/or downward sides of each arrow. The length of either one of arrows can be reduced

 by \eqlbarrowstretch.
149 % **************************************** 2009/11/08 S. Fujita
150 % * equilibrium arrows of uneven lengths *
151 % ****************************************

152 %

153 % #1 yoko #2 ue, #3 haba, #4 ya no ue, #5 ya no shita

154 %

155 \def\eqlbarrowstretch{0.6}%reduction rate of arrow length
156 \def\oldreactreqarrow{\@ifnextchar[{\oldreact@reqarrow}{\oldreact@reqarrow[0pt]}}
157 \def\oldreact@reqarrow[#1]#2#3#4#5{\ensuremath{\mathbin{\hskip#1\raisebox{#2}{%
158  \parbox{#3}{\centering\dimen0=#3
159  \baselineskip=.8\normalbaselineskip
160  \ChemStrut{#4}\par

161  \vskip-0.2\normalbaselineskip\vskip\reactarrowsep
162  \leavevmode\rightarrowfill \par \vskip-0.55\normalbaselineskip%
163  \leavevmode\hbox to\eqlbarrowstretch\dimen0{\leftarrowfill} \par
164  \vskip\reactarrowseprate\reactarrowsep
165  \vskip-0.1\normalbaselineskip\ChemStrut{#5}}}}}}
166 \def\oldreactleqarrow{\@ifnextchar[{\oldreact@leqarrow}{\oldreact@leqarrow[0pt]}}
167 \def\oldreact@leqarrow[#1]#2#3#4#5{\ensuremath{\mathbin{\hskip#1\raisebox{#2}{%
168  \parbox{#3}{\centering\dimen0=#3
169  \baselineskip=.8\normalbaselineskip
170  \ChemStrut{#4}\par
171  \vskip-0.2\normalbaselineskip\vskip\reactarrowsep
172  \leavevmode\hbox to\eqlbarrowstretch\dimen0{\rightarrowfill} \par
173  \vskip-0.55\normalbaselineskip%
174  \leavevmode\leftarrowfill \par
175  \vskip\reactarrowseprate\reactarrowsep
176  \vskip-0.1\normalbaselineskip\ChemStrut{#5}}}}}}
177 %%%%%2009/11/19
178 %\let\reactreqarrow=\oldreactreqarrow
179 %\let\reactleqarrow=\oldreactleqarrow

\k@nz@n The \k@nz@n command is used for changing a dimension to a parameter for the L^{A}TEX picture environment.

180 \def\k@nz@n#1{\@tempdima=#1\relax
181 \@tempcnta=\@tempdima \@tempcntb=\unitlength
182 \divide\@tempcnta by \@tempcntb
183 \edef\kanzanchi{\the\@tempcnta}%
184 \divide\@tempcnta by2\relax
185 \edef\kanzanhalf{\the\@tempcnta}}
\reactdarrow \reactuarrow \reactveqarrow \reactduarrow Vertical reaction arrows has been added.
186 \def\oldreactdarrow{\@ifnextchar[{\oldreact@darrow}{\oldreact@darrow[0pt]}}
187 \def\oldreact@darrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
188 \def\arraystretch{0.8}%
189 \begin{tabular}{l}#4\end{tabular}%
190 {\tabcolsep=0pt
191 \begin{tabular}{c}\begin{sfpicture}(0,\kanzanchi)(0,0)
192 \Put@Direct(0,\kanzanchi){\vector(0,-1){\kanzanchi}}
193 \end{sfpicture}\end{tabular}}%
194 \begin{tabular}{l}#5\end{tabular}}}

195 %

196 \def\oldreactuarrow{\@ifnextchar[{\oldreact@uarrow}{\oldreact@uarrow[0pt]}}
197 \def\oldreact@uarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
198 \def\arraystretch{0.8}%
199 \begin{tabular}{l}#4\end{tabular}%
200 {\tabcolsep=0pt
201 \begin{tabular}{c}\begin{sfpicture}(0,\kanzanchi)(0,0)
202 \Put@Direct(0,0){\vector(0,1){\kanzanchi}}
203 \end{sfpicture}\end{tabular}}%
204 \begin{tabular}{l}#5\end{tabular}}}

205 %

206 \def\oldreactveqarrow{\@ifnextchar[%]
207 {\oldreact@veqarrow}{\oldreact@veqarrow[0pt]}}
208 \def\oldreact@veqarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
209 \def\arraystretch{0.8}%

210 \begin{tabular}{l}#4\end{tabular}%
211 {\tabcolsep=0pt
212 \begin{tabular}{c}\begin{sfpicture}(40,\kanzanchi)(0,0)
213 \Put@Direct(40,0){\vector(0,1){\kanzanchi}}%
214 \Put@Direct(0,\kanzanchi){\vector(0,-1){\kanzanchi}}%
215 \end{sfpicture}\end{tabular}}%
216 \begin{tabular}{l}#5\end{tabular}}}

217 %

218 \def\oldreactduarrow{\@ifnextchar[{\oldreact@duarrow}{\oldreact@duarrow[0pt]}}
219 \def\oldreact@duarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
220 \def\arraystretch{0.8}%
221 \begin{tabular}{l}#4\end{tabular}%
222 {\tabcolsep=0pt
223 \begin{tabular}{c}\begin{sfpicture}(0,\kanzanchi)(0,0)
224 \Put@Direct(0,\kanzanhalf){\vector(0,1){\kanzanhalf}}%
225 \Put@Direct(0,\kanzanhalf){\vector(0,-1){\kanzanhalf}}%
226 \end{sfpicture}\end{tabular}}%
227 \begin{tabular}{l}#5\end{tabular}}}
228 %%%%2009/11/19
229 %\let\reactdarrow=\oldreactdarrow
230 %\let\reactuarrow=\oldreactuarrow
231 %\let\reactveqarrow=\oldreactveqarrow
232 %\let\reactduarrow=\oldreactduarrow
\reactswarrow \reactsearrow \reactnwrarrow \reactnearrow Further reaction arrows have been added.
233 \def\oldreactsearrow{\@ifnextchar[{\oldreact@searrow}{\oldreact@searrow[0pt]}}
234 \def\oldreact@searrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
235 \def\arraystretch{0.8}%
236 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)
237 \Put@Direct(0,\kanzanchi){\vector(1,-1){\kanzanchi}}%
238 \Put@Direct(\kanzanhalf,\kanzanhalf){\hbox to0pt{%
239 \begin{tabular}[b]{l}#4\end{tabular}\hss}}
240 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{\hss
241 \begin{tabular}[t]{r}#5\end{tabular}}}%
242 \end{sfpicture}}}

243 %

244 \def\oldreactnwarrow{\@ifnextchar[{\oldreact@nwarrow}{\oldreact@nwarrow[0pt]}}
245 \def\oldreact@nwarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
246 \def\arraystretch{0.8}%
247 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)%
248 \Put@Direct(\kanzanchi,0){\vector(-1,1){\kanzanchi}}%
249 \Put@Direct(\kanzanhalf,\kanzanhalf){\hbox to0pt{%
250 \begin{tabular}[b]{l}#4\end{tabular}\hss}}%
251 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{\hss
252 \begin{tabular}[t]{r}#5\end{tabular}}}%
253 \end{sfpicture}}}

254 %

255 \def\oldreactnearrow{\@ifnextchar[{\oldreact@nearrow}{\oldreact@nearrow[0pt]}}
256 \def\oldreact@nearrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
257 \def\arraystretch{0.8}%
258 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)
259 \Put@Direct(0,0){\vector(1,1){\kanzanchi}}%
260 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{%
261 \begin{tabular}[t]{l}#5\end{tabular}\hss}}%

262 \Put@Direct(\kanzanhalf,\kanzanhalf){\hbox to0pt{\hss
263 \begin{tabular}[b]{r}#4\end{tabular}}}%
264 \end{sfpicture}}}

265 %

266 \def\oldreactswarrow{\@ifnextchar[{\oldreact@swarrow}{\oldreact@swarrow[0pt]}}
267 \def\oldreact@swarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
268 \def\arraystretch{0.8}%
269 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)%
270 \Put@Direct(\kanzanchi,\kanzanchi){\vector(-1,-1){\kanzanchi}}%
271 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{%
272 \begin{tabular}[t]{l}#5\end{tabular}\hss}}%
273 \Put@Direct(\kanzanhalf,\kanzanhalf){\hbox to0pt{\hss
274 \begin{tabular}[b]{r}#4\end{tabular}}}%
275 \end{sfpicture}}}
276 %%%%%2009/11/19
277 %\let\reactsearrow=\oldreactsearrow
278 %\let\reactnwarrow=\oldreactnwarrow
279 %\let\reactnearrow=\oldreactnearrow
280 %\let\reactswarrow=\oldreactswarrow
\reactdeqarrow \reactueqarrow \reactdlrarrow \reactulrarrow Further reaction arrows have been added.
281 \def\oldreactdeqarrow{\@ifnextchar[%]
282 {\oldreact@deqarrow}{\oldreact@deqarrow[0pt]}}
283 \def\oldreact@deqarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
284 \def\arraystretch{0.8}%
285 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)%
286 \Put@Direct(0,\kanzanchi){\Put@Direct(15,15){\vector(1,-1){\kanzanchi}}}%
287 \Put@Direct(\kanzanchi,0){\Put@Direct(-15,-15){\vector(-1,1){\kanzanchi}}}%
288 \Put@Direct(\kanzanhalf,\kanzanhalf){\raise1ex\hbox to0pt{%
289 \begin{tabular}[b]{l}#4\end{tabular}\hss}}%
290 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{\hss
291 \begin{tabular}[t]{r}#5\end{tabular}}}%
292 \end{sfpicture}}}
293 \def\oldreactueqarrow{\@ifnextchar[%]
294 {\oldreact@ueqarrow}{\oldreact@ueqarrow[0pt]}}
295 \def\oldreact@ueqarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
296 \def\arraystretch{0.8}%
297 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)
298 \Put@Direct(0,0){\Put@Direct(-15,15){\vector(1,1){\kanzanchi}}}
299 \Put@Direct(\kanzanchi,\kanzanchi){\Put@Direct(15,-15){\vector(-1,-1){\kanzanchi}}}%
300 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{%
301 \begin{tabular}[t]{l}#5\end{tabular}\hss}}%
302 \Put@Direct(\kanzanhalf,\kanzanhalf){\raise1ex\hbox to0pt{\hss
303 \begin{tabular}[b]{r}#4\end{tabular}}}%
304 \end{sfpicture}}}
305 \def\oldreactulrarrow{\@ifnextchar[%]
306 {\oldreact@ulrarrow}{\oldreact@ulrarrow[0pt]}}
307 \def\oldreact@ulrarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
308 \def\arraystretch{0.8}%
309 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)%
310 \Put@Direct(\kanzanhalf,\kanzanhalf){\vector(1,1){\kanzanhalf}}%
311 \Put@Direct(\kanzanhalf,\kanzanhalf){\vector(-1,-1){\kanzanhalf}}%
312 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{%
313 \begin{tabular}[t]{l}#5\end{tabular}\hss}}%

314 \Put@Direct(\kanzanhalf,\kanzanhalf){\raise1ex\hbox to0pt{\hss
315 \begin{tabular}[b]{r}#4\end{tabular}}}%
316 \end{sfpicture}}}
317 \def\oldreactdlrarrow{\@ifnextchar[%]
318 {\oldreact@dlrarrow}{\oldreact@dlrarrow[0pt]}}
319 \def\oldreact@dlrarrow[#1]#2#3#4#5{\hskip#1\raisebox{#2}{\k@nz@n{#3}%
320 \def\arraystretch{0.8}%
321 \begin{sfpicture}(\kanzanchi,\kanzanchi)(0,0)%
322 \Put@Direct(\kanzanhalf,\kanzanhalf){\vector(-1,1){\kanzanhalf}}%
323 \Put@Direct(\kanzanhalf,\kanzanhalf){\vector(1,-1){\kanzanhalf}}%
324 \Put@Direct(\kanzanhalf,\kanzanhalf){\hbox to0pt{%
325 \begin{tabular}[b]{l}#4\end{tabular}\hss}}%
326 \Put@Direct(\kanzanhalf,\kanzanhalf){\lower2ex\hbox to0pt{\hss
327 \begin{tabular}[t]{r}#5\end{tabular}}}%
328 \end{sfpicture}}}
329 %%%%%2009/11/19
330 %\let\reactdeqarrow=\oldreactdeqarrow
331 %\let\reactueqarrow=\oldreactueqarrow
332 %\let\reactulrarrow=\oldreactulrarrow
333 %\let\reactdlrarrow=\oldreactdlrarrow

\schemelarrow \schemerarrow \schemelrarrow The chemist package defines double-line arrows with variable length for drawing reaction schemes, where additional information can be written on the upper and/or downward sides of each arrow.

334 % ********************************
335 % * scheme arrows                *
336 % * 1991 OCT 4 S. Fujita         *
337 % * Revised 1992 May 24 S.Fujita * 1999/02/02 by S. Fujita
338 % ********************************
339 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
340 \def\oldschemelarrow#1#2#3#4{\raisebox{#1}{%
341  \parbox{#2}{\centering
342  \baselineskip=.8\normalbaselineskip #3 \par
343  \vskip-0.2\normalbaselineskip
344  \centering{\Leftarrowfill} \par
345  \vskip-0.1\normalbaselineskip #4}}}
346 \def\oldschemerarrow#1#2#3#4{\raisebox{#1}{%
347  \parbox{#2}{\centering
348  \baselineskip=.8\normalbaselineskip #3 \par
349  \vskip-0.2\normalbaselineskip
350  \centering{\Rightarrowfill} \par
351  \vskip-0.1\normalbaselineskip #4}}}
352 \def\oldschemelrarrow#1#2#3#4{\raisebox{#1}{%
353  \parbox{#2}{\centering
354  \baselineskip=.8\normalbaselineskip #3 \par
355  \vskip-0.2\normalbaselineskip
356  \centering{\Leftrightarrowfill} \par
357  \vskip-0.1\normalbaselineskip #4}}}
358 %%%%2009/11/19
359 %\let\schemelarrow=\oldschemelarrow
360 %\let\schemerarrow=\oldschemerarrow
361 %\let\schemelrarrow=\oldschemelrarrow

\ChemStrut The commond \ChemStrut is defined to output a strut for chemical arrows. For

 example, \reactrarrow{0pt}{1cm}{AAAA}{\ChemStrut} can adjust the horizon-

tal position of an arrow.

362 \def\ChemStrut{\mbox{\vphantom{A}}}

\changespace The \changespace command is used to change a vertical space between lines.

363 % *************************
364 % * Changing line spacing *
365 % *************************
366 % After Chapter 3 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
367 \def\changespace#1{\def\baselinestretch{#1} \@normalsize}
368 %    %%%%%%%%%%1991 November 6%%%\bslskipchange%%%%%%%%%%
369 % \newenvironment{bslskipchange}[1]%
370 % {\par\begingroup\global\baselineskip= #1\normalbaselineskip}%
371 % {\endgroup\par\global\baselineskip=\normalbaselineskip%
372 %  \global\@ignoretrue}

7 Captions

7.1 Changing caption types within a float

\tbcaption \fgcaption \smcaption These commands enable us to place two or more floats of different kinds in a single floating body.

\tbcaption[TCAP]{CAP} makes a table caption in a float other than “table” or after using

                                 \fgcaption or \smcaption com-

mand. \fgcaption[TCAP]{CAP} makes a figure caption in a float

other than “figure” or after using

                                 \tbcaption or \smcaption com-

mand. \smcaption[TCAP]{CAP} makes a scheme caption in a float

other than “scheme” or after us-

                                 ing \tbcaption or \fgcaption

command.

For exmaple, we have

    \begin{figure}
       \caption{aaa}   % 通常のキャプション。
       \tbcaption{bbb} % 表のキャプションの強制的に変更。
       \fgcaption[ccc]{ddd} %図のキャプションに戻す。
    \end{figure}

373 \def\tbcaption{\def\@captype{table}\caption}
374 \def\fgcaption{\def\@captype{figure}\caption}
375 \def\smcaption{\def\@captype{scheme}\caption}
\chapinitial
376 % *****************

377 % * miscellaneous *
378 % *****************
379 %%%%%%%%%%%1991 November 7%%%chapinitial%%%%%%%%%%%%%
380 \def\chap@initial#1%
381 {\medbreak\begingroup\clubpenalty=10000
382 \def\par{\endgraf\endgroup\medbreak}
383 \noindent\hangindent28pt\hangafter=-2
384 \hbox to0pt{\hskip-\hangindent
385 \hbox to28pt{\hss\raise-4pt\hbox{\lower3pt\hbox{\Huge\bf #1}} }
386 } \hskip-5pt plus2pt minus2pt}
387 \outer\def\chapinitial{\chap@initial}

8 Redefinition of verbatim

\yen The chemist package uses a customaized defintion of \yen for printing the top symbol of each command sequence.

388 % ************

389 % * ￥の定義 *

390 % ************
391 % % ￥ %%%%%from ascmac.sty%%%%added \leavevmode%%%%%%%%%%%%%%%%
392 %\def\yen{\leavevmode{\setbox0=\hbox{Y}Y\kern-.97\wd0\vbox{%
393 % \hrule\@height.1ex\@width.98\wd0%
394 % \kern.33ex\hrule\@height.1ex\@width.98\wd0\kern.45ex}}}

395 %

396 \def\yen{\leavevmode\hbox{\setbox0=\hbox{Y}%
397 \setbox1=\vbox{\hrule height.05\ht0 width.96\wd0%
398 \kern.18\ht0\hrule height.05\ht0 width.96\wd0}%
399 \setbox1=\hbox to\wd0{\raise.3\ht0\box1\hss}%
400 {\ooalign{\hfil\box1\hfil\crcr\box0}}}}
\ifverbswitch \verb The switch \ifverbswitch is used for changing \yen or \backslash for the top

symbol of each control sequence printed by the \verb command.

401 % **************************
402 % * ￥を含んだ verbatim 環境 *
403 % **************************
404 % %%%%%%1992 April 30 %%%verbatim%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

405 % % from  奥村晴彦 LaTeX 美文書作成入門 1991 技術評論社  %

406 % %  omitted: =, by, etc.                                        %
407 % %  added: verbswitch                                           %
408 % %          \verbswitchtrue===> yen mark                        %
409 % %          \verbswitchfalse===> backslash mark                 %
410 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
411 \newif\ifverbswitch \verbswitchtrue
412 \let\old@verbatim\@verbatim
413 \let\old@xverbatim\@xverbatim
414 \let\old@sxverbatim\@sxverbatim
415 \begingroup
416 \catcode`\|=0  \catcode`\\=13
417 |gdef|verbh@@k{|catcode`|\=13 |let\=|yen}
418 |endgroup
419 \def\verb{\begingroup \catcode``=13 \@noligs
420 \tt \let\do\@makeother \dospecials

421 \ifverbswitch \verbh@@k \fi \@ifstar{\@sverb}{\@verb}}

@verbatim verbatim The switch \ifverbswitch is also effective for in a verbtim environment.

422 \begingroup
423 \catcode`|=0 \catcode`[=1 \catcode`]=2
424 \catcode`\{=12 \catcode`\}=12 \catcode`\\=13
425 |gdef|@xverbatim#1\end{verbatim}[#1|end[verbatim]]
426 |gdef|@sxverbatim#1\end{verbatim*}[#1|end[verbatim*]]
427 |endgroup
428 \newdimen\verbatimleftmargin \verbatimleftmargin\leftmargini
429 \newdimen\verbatimbaselineskip \verbatimbaselineskip11pt
430 \def\verbatimsize{\small}
431 \def\@verbatim{\trivlist \item[]%
432 \if@minipage \else \vskip\baselineskip%
433 \vskip-\verbatimbaselineskip \vskip\parskip\fi
434 \leftskip\@totalleftmargin
435 \if@minipage \else \advance\leftskip\verbatimleftmargin \fi
436 \rightskip\z@ \parindent\z@ \parfillskip\@flushglue \parskip\z@
437 \@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
438 \obeylines \verbatimsize \baselineskip\verbatimbaselineskip \tt
439 \catcode``=13 \@noligs \let\do\@makeother \dospecials}
440 \def\verbatim{\ifverbswitch \@verbatim \else \old@verbatim \fi
441 \frenchspacing \@vobeyspaces
442 \ifverbswitch \verbh@@k \@xverbatim \else \old@xverbatim \fi}
443 \@namedef{verbatim*}{%
444 \ifverbswitch \@verbatim \verbh@@k \@sxverbatim
445 \else \old@verbatim \old@sxverbatim \fi}
446 % %%%%%%%%%%%%%%pLaTeX2e%%%%%%%%%%%%%1996/04/20 by S. Fujita%%%%%%

447 % pLaTeX2e では再定義されているので，上のままだとエラーになる 448 % LaTeX2.09 の定義を補っておく

449 \def\@sverb#1{\def\@tempa ##1#1{##1\endgroup}\@tempa}
450 \def\@verb{\obeyspaces \frenchspacing \@sverb}
451 \def\@sverbtim{\obeyspaces\@verbatim}
452 \let\endverbatim=\endtrivlist
453 \@namedef{varbatim*}{\@verbatim\@sxverbatim}
454 \expandafter\let\csname endverbatim*\endcsname =\endtrivlist

9 Shadowed Boxes

\fb@xit \fboxit

455 %

456 % <<Base box for boxes>>
457 % \fb@xit{LWIDTH}{SPACE}{BWIDTH}{TEXT}
458 %     #1 LWIDTH:  line thickness
459 %     #2 SPACE:   spacing around the text
460 %     #3 BWIDTH:  box width
461 %     #4 TEXT:    text

462 %

463 \long\def\fb@xit#1#2#3#4{%
464 \setbox4=\vbox{\hsize#3\noindent#4}%
465 %\setbox4=\vbox{\hsize#3\noindent\strut#4\strut}%

466 \vbox{\hrule\@height#1\hbox{\vrule\@width#1\kern#2\vbox{%
467 \kern#2\box4\kern#2}\kern#1\vrule\@width#1}\hrule\@height#1}}
468 %\kern#2\box4\kern#2}\vrule\@width#1}\hrule\@height#1}}

469 %

470 % \fboxit{BWIDTH}{TEXT}
471 %     #1 BWIDTH:  box width
472 %     #2 TEXT:    text

473 %

474 \long\def\fboxit#1#2{\fb@xit{\fboxrule}{\fboxsep}{#1}{#2}}
\leftshfr@me
\leftshframe
\leftshfbox

475 % % ************************************************************

476 % % * 影のついた箱 *

477 % % *   January 3, 1993 by Shinsaku Fujita                     *
478 % % *   Borde ({\em \TeX{} by Example}) の記載を参考にして作った*
479 % % ************************************************************
480 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita

481 %

482 % left shadow box

483 %

484 %    \leftshfr@me{SWIDTH}{SPACE}{BOXWIDTH}{TEXT}

485 %

486 %     #1 SWIDTH:    shadow width
487 %     #2 SPACE:     spacing around the text
488 %     #3 BOXWIDTH:  box width
489 %     #4 TEXT:      text

490 %

491 %    \leftshframe{BOXWIDTH}{TEXT}

492 %

493 %     #1 BOXWIDTH:  box width
494 %     #2 TEXT:      text

495 %

496 %    \leftshfbox{TEXT}

497 %

498 %     #1 TEXT:      text

499 %

500 % %%leftshfr@me#1 shadow width, #2 space, #3 boxwidth, #4 text%
501 \long\def\leftshfr@me#1#2#3#4{\leavevmode%
502 \vbox{\hbox{\hsize #3\vbox{%
503 \hbox{\vrule\@width #1%
504 \vbox{\kern-#1\fb@xit{%
505 \fboxrule}{#2}{#3}{#4}\kern-\fboxrule}\kern-#1}%
506 \hrule\@height#1}}}\strut\hskip #1\relax}
507 % %leftshframe%%%%%%%%%%%%%%%%%%%%%%%%% #1 width, #2 text%%%%%
508 \long\def\leftshframe#1#2{%
509 \leftshfr@me{\fboxsep}{\fboxsep}{#1}{#2}}
510 % %leftshfbox%%%%%%%%%%%%%%%%%%%%%%%%% #1 text%%%%%%%%%%%%%%%%
511 \long\def\leftshfbox#1{\leavevmode\setbox0=\hbox{\fbox{#1}}%
512 \vbox{\hbox{\vbox{\hbox{\vrule\@width\fboxsep\vbox{%
513  \kern-\fboxsep\box0\kern-\fboxrule}\kern-\fboxsep}%
514 \hrule\@height\fboxsep}}}\hskip\fboxsep\relax} %%%%
\rightshfr@me
\rightshframe
\rightshfbox

516 % right shadow box

517 %

518 %    \rightshfr@me{SWIDTH}{SPACE}{BOXWIDTH}{TEXT}

519 %

520 %     #1 SWIDTH:    shadow width
521 %     #2 SPACE:     spacing around the text
522 %     #3 BOXWIDTH:  box width
523 %     #4 TEXT:      text

524 %

525 %    \rightshframe{BOXWIDTH}{TEXT}

526 %

527 %     #1 BOXWIDTH:  box width
528 %     #2 TEXT:      text

529 %

530 %    \rightshfbox{TEXT}

531 %

532 %     #1 TEXT:      text

533 %

534 % %rightshfr@me#1 shadow width, #2 space, #3 boxwidth, #4 text%
535 \long\def\rightshfr@me#1#2#3#4{\leavevmode%
536 \vbox{\hbox{\kern#1\vbox{\hsize#3\vbox{\kern-#1\hbox{%
537 \kern-#1\fb@xit{\fboxrule}{#2}{#3}{#4}}\hrule\@height#1}}%
538 \vrule\@width#1}}\strut}
539 % %rightshframe%%%%%%%%%%%%%%%%%%%%%%%%% #1 width, #2 text%%%%%
540 \long\def\rightshframe#1#2{%
541 \rightshfr@me{\fboxsep}{\fboxsep}{#1}{#2}}
542 % %rightshfbox%%%%%%%%%%%%%%%%%%%%%%%%% #1 text%%%%%%%%%%%%%%%%
543 \long\def\rightshfbox#1{\leavevmode%
544 \vbox{\hbox{\kern\fboxsep\vbox{\vbox{\kern-\fboxsep\hbox{%
545 \kern-\fboxsep\fbox{#1}}\hrule\@height\fboxsep}}%
546 \vrule\@width\fboxsep}}}
ffboxit \ffparbox
547 % *****************************************

548 % * 箱 (環境版) *

549 % *   November 2, 1991 by Shinsaku Fujita *
550 % *****************************************
551 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
552 % %%%%%%1991 November 2 %%%ffboxit%%%%%%%%%%%%%%%%%%%%%%
553 \def\ffboxit{\par\vskip1pc\hfil\vbox\bgroup
554  \hrule\hbox\bgroup\vrule\kern3pt\vbox\bgroup\kern3pt}
555 \def\endffboxit{\kern3pt\egroup\kern3pt\vrule\egroup\hrule\egroup
556  \hfil\\}
557 \def\ffparbox#1#2{\vbox{\hsize=#1 \noindent\strut #2\strut}}

10 Framed box environment with and without shadows

10.1 Framed box environment without shadows

558 % %%%%%%1991 November 2 %%%frameboxit%%%old definition%%%%%%%%%%
559 %                                   with centering function

560 %\def\frameboxit#1{\par\vskip1pc\hfil\vbox\bgroup
561 %    \hrule\hbox\bgroup\vrule\kern3pt\vbox\bgroup\kern3pt
562 %    \vbox\bgroup\hsize=#1 \noindent\strut
563 %    \@minipagetrue%
564 %    \everypar{\global\@minipagefalse\everypar{}}}
565 %\def\endframeboxit{\strut\egroup\kern3pt\egroup%
566 %\kern3pt\vrule\egroup
567 %             \hrule\egroup\hfil\\}
568 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

569 %

570 % <<Base box for box environments>>
571 % \begin{fr@meboxit}{LWIDTH}{SPACE}{BWIDTH}
572 %     LWIDTH:  line thickness
573 %     SPACE:   spacing around the text
574 %     BWIDTH:  box width
575 % \end{fr@meboxit}

576 %

577 % %%fr@meboxit%%%%%#1 line width, #2 space, #3 width%%%%%%%%%%%%%
578 %\def\fr@meboxit#1#2#3{\gdef\fr@meline{#1}\gdef\fr@mesp{#2}%
579 %    \hbox\bgroup\vbox\bgroup%
580 %    \hrule\@height#1\hbox\bgroup%
581 %    \vrule\@width#1\kern#2\vbox\bgroup%
582 %    \kern#2\vbox\bgroup\hsize=#3\strut%
583 %    \@minipagetrue%
584 %    \everypar{\global\@minipagefalse\everypar{}}}
585 %\def\endfr@meboxit{\strut\egroup%
586 %\kern\fr@mesp\egroup\kern\fr@mesp\egroup\hrule\@height\fr@meline%
587 %\egroup\vrule\@width\fr@meline\egroup}
fr@meboxit frameboxit
588 % %%%%%%%revised by S. Fujita, January 16, 1993%%%%%%%%%%%%%%%%%%%%%
589 \long\def\fr@meboxit#1#2#3{\gdef\fr@meline{#1}\gdef\fr@mesp{#2}%
590 % %    \setbox4=\vbox\bgroup\hsize=#3\@parboxrestore\ignorespaces}
591  \global\setbox4=\hbox\bgroup\minipage{#3}}
592 % %\def\endfr@meboxit{\egroup%
593 \def\endfr@meboxit{\endminipage\egroup%
594  \hbox{\vbox{\hrule\@height\fr@meline%
595  \hbox{\vrule\@width\fr@meline\kern\fr@mesp%
596  \vbox{\kern\fr@meline\kern\fr@mesp\box4\kern\fr@mesp}%
597 % %    \vbox{\kern\fr@mesp\box4\kern\fr@mesp}%
598  \kern\fr@mesp}\hrule\@height\fr@meline}%
599  \vrule\@width\fr@meline}}
600 % %%%%%%%revised by S. Fujita, January 16, 1993%%%%%%%%%%%%%%%%%%%%
601 \def\frameboxit#1{\leavevmode\fr@meboxit{\fboxrule}{\fboxsep}{#1}}
602 \let\endframeboxit=\endfr@meboxit

10.2 Framed box environment with shadows

lshfr@meboxit
lshfboxit
603 % *****************************************

604 % * 影のついた箱 (環境版) *

605 % *   January 16, 1993 by Shinsaku Fujita *
606 % *   \sh@hwidth: 水平の影の太さ  *

607 % *   \sh@vwidth: 垂直の影の太さ  *
608 % *****************************************
609 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita

610 %

611 % <<Base box for box environments>>  See above
612 % \begin{fr@meboxit}{LWIDTH}{SPACE}{BWIDTH}
613 %     LWIDTH:  line thickness
614 %     SPACE:   spacing around the text
615 %     BWIDTH:  box width
616 % \end{fr@meboxit}

617 %

618 % <<Base box environment with left shadow>>
619 % \begin{lshfr@meboxit}{HSWIDTH}{VSWIDTH}{SPACE}{BWIDTH}
620 %     HSWIDTH: the thickness of the horizontal shadow
621 %     VSWIDTH: the thickness of the vertical shadow
622 %     SPACE:   spacing around the text
623 %     BWIDTH:  box width
624 % \end{lshfr@meboxit}

625 %

626 % <<Box environment with left shadow>>
627 % \begin{lshfboxit}{BWIDTH}
628 %     BWIDTH:  box width
629 % \end{lshfboxit}

630 %

631 % %%%lshfr@meboxit#1 #2 shadow width, #3 space, #4 boxwidth%%%%
632 \def\lshfr@meboxit#1#2#3#4{\gdef\sh@hwidth{#1}\gdef\sh@vwidth{#2}%
633 \leavevmode%
634 \vbox\bgroup\hbox\bgroup\hsize #4\vbox\bgroup%
635 \hbox\bgroup\vrule\@width\sh@vwidth%
636 \vbox\bgroup\kern-\sh@hwidth\fr@meboxit{\fboxrule}{#3}{#4}}
637 \def\endlshfr@meboxit{\endfr@meboxit%%%%\kern-\fboxrule
638 \egroup\kern-\sh@vwidth\egroup%
639 \hrule\@height\sh@hwidth\egroup\egroup\egroup%
640 \strut\kern\sh@hwidth\relax}
641 % %%lshfboxit%%%%%%%%%%%%%%%%%%%%%%%%% #1 width %%%%%%%%
642 \def\lshfboxit#1{\leavevmode%
643 \lshfr@meboxit{\fboxsep}{\fboxsep}{\fboxsep}{#1}}
644 \let\endlshfboxit=\endlshfr@meboxit
rshfr@meboxit
rshfboxit
645 % <<Base box environment with right shadow>>
646 % \begin{rshfr@meboxit}{HSWIDTH}{VSWIDTH}{SPACE}{BWIDTH}
647 %     HSWIDTH: the thickness of the horizontal shadow
648 %     VSWIDTH: the thickness of the vertical shadow
649 %     SPACE:   spacing around the text
650 %     BWIDTH:  box width
651 % \end{rshfr@meboxit}

652 %

653 % <<Box environment with right shadow>>
654 % \begin{rshfboxit}{BWIDTH}
655 %     BWIDTH:  box width
656 % \end{rshfboxit}

657 %

658 % %%rshfr@meboxit#1 #2 shadow width, #3 space, #4 boxwidth%%%

659 \def\rshfr@meboxit#1#2#3#4{%
660 \gdef\sh@hwidth{#1}\gdef\sh@vwidth{#2}%
661 \leavevmode%
662 \vbox\bgroup\hbox\bgroup\kern\sh@vwidth%
663 \vbox\bgroup\hsize#4\vbox\bgroup%
664 \kern-\sh@hwidth\hbox\bgroup\kern-\sh@vwidth%
665 \fr@meboxit{\fboxrule}{#3}{#4}}
666 \def\endrshfr@meboxit{\endfr@meboxit\egroup%
667 \hrule\@height\sh@hwidth%
668 \egroup\egroup\vrule\@width\sh@vwidth\egroup\egroup\strut}
669 % %%rshfboxit%%%%%%%%%%%%%%%%%%%%%%%%% #1 width%%%%%%%%
670 \def\rshfboxit#1{\leavevmode%
671 \rshfr@meboxit{\fboxsep}{\fboxsep}{\fboxsep}{#1}}
672 \let\endrshfboxit=\endrshfr@meboxit

10.3 Framed box environment with gradient shadows

\hsgr@d
\vsgr@d
\vwgr@d
\hwgr@d
\vsepgr@d
\hsepgr@d
\nrep
\nrepmax

673 % %%parameters%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
674 \newdimen\hsgr@d \newdimen\vsgr@d
675 \newdimen\vwgr@d \newdimen\hwgr@d
676 \newdimen\vsepgr@d \newdimen\hsepgr@d
677 \newcount\nrep \newcount\nrepmax
678 %\nrepmax=20
679 \nrepmax=25
grshfr@meboxit
grshfboxit
680 % *****************************************

681 % * 斜の影のついた箱 (環境版) *

682 % * Box environments with gradient shadow *
683 % *   January 16, 1993 by Shinsaku Fujita *
684 % *****************************************
685 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita

686 %

687 % <<Base box environment with gradient right shadow>>
688 % \begin{grshfr@meboxit}{HSWIDTH}{VSWIDTH}{SPACE}{BWIDTH}
689 %     HSWIDTH: the thickness of the horizontal shadow
690 %     VSWIDTH: the thickness of the vertical shadow
691 %     SPACE:   spacing around the text
692 %     BWIDTH:  box width
693 % \end{grshfr@meboxit}

694 %

695 % <<Box environment with gradient right shadow>>
696 % \begin{grshfboxit}{BWIDTH}
697 %     BWIDTH:  box width
698 % \end{grshfboxit}
699 % %%%%%%%%grshfr@meboxit#1 #2 shadow width, #3 space, #4 boxwidth%%%
700 \def\grshfr@meboxit#1#2#3#4{%
701 \hsgr@d=0pt \advance\hsgr@d by#1 \divide\hsgr@d by\nrepmax%
702 \vsgr@d=0pt \advance\vsgr@d by#2 \divide\vsgr@d by\nrepmax%
703 \leavevmode%
704 \setbox0=\vbox\bgroup\fr@meboxit{\fboxrule}{#3}{#4}}
705 \def\brb@xit#1{\vbox{\setbox1=\hbox{#1}%

706  \offinterlineskip%
707 \hbox{\copy1\vsepgr@d=\nrep\vsgr@d%
708  \vwgr@d=\ht1\advance\vwgr@d by-\vsepgr@d%
709  \vrule\@height\vwgr@d\@width\vsgr@d}%
710 \hbox{\hsepgr@d=\nrep\hsgr@d\kern\hsepgr@d%
711  \vbox{\hwgr@d=\wd1\advance\hwgr@d by-\hsepgr@d%
712  \hrule\@height\hsgr@d\@width\hwgr@d}}}}
713 \def\lprb@xit{\expandafter\setbox0=\expandafter\brb@xit{\box0}}
714 \def\endgrshfr@meboxit{\endfr@meboxit\egroup%
715 \nrep=\@ne\@whilenum\nrep<\nrepmax\do%
716 {\lprb@xit\advance\nrep\@ne}\box0\relax}
717 % %%%%% in TeX grammer
718 %\def\endgrshfr@meboxit{\endfr@meboxit\egroup%
719 % \nrep=\@ne \loop \lprb@xit \advance\nrep\@ne%
720 % \ifnum \nrep<\nrepmax \repeat \box0\relax}
721 % %%%%%%%grshfboxit%%%%%%%%%%%%%%%%%%%%%%%%% #1 width, #2 text%%%%%%%%
722 \def\grshfboxit#1{\leavevmode%
723 \grshfr@meboxit{\fboxsep}{\fboxsep}{\fboxsep}{#1}}
724 \let\endgrshfboxit=\endgrshfr@meboxit
glshfr@meboxit
glshfboxit
725 % <<Base box environment with gradient left shadow>>
726 % \begin{glshfr@meboxit}{HSWIDTH}{VSWIDTH}{SPACE}{BWIDTH}
727 %     HSWIDTH: the thickness of the horizontal shadow
728 %     VSWIDTH: the thickness of the vertical shadow
729 %     SPACE:   spacing around the text
730 %     BWIDTH:  box width
731 % \end{glshfr@meboxit}

732 %

733 % <<Box environment with gradient left shadow>>
734 % \begin{glshfboxit}{BWIDTH}
735 %     BWIDTH:  box width
736 % \end{glshfboxit}
737 % %%%%%%%%glshfr@meboxit#1 #2 shadow width, #3 space, #4 boxwidth%%
738 \def\glshfr@meboxit#1#2#3#4{%
739 \hsgr@d=0pt \advance\hsgr@d by#1 \divide\hsgr@d by\nrepmax%
740 \vsgr@d=0pt \advance\vsgr@d by#2 \divide\vsgr@d by\nrepmax%
741 \leavevmode%
742 \setbox0=\vbox\bgroup\fr@meboxit{\fboxrule}{#3}{#4}}
743 \def\blb@xit#1{%
744 \vbox{\setbox1=\hbox{#1}%
745  \offinterlineskip%
746  \vsepgr@d=\nrep\vsgr@d%
747  \vwgr@d=\ht1\advance\vwgr@d by-\vsepgr@d%
748  \hsepgr@d=\nrep\hsgr@d%
749  \hwgr@d=\wd1\advance\hwgr@d by-\hsepgr@d%
750 \hbox{\vrule\@height\vwgr@d\@width\vsgr@d\copy1}%
751 \hbox{\kern-\vsgr@d%
752  \vrule\@height\hsgr@d\@width\hwgr@d}}}
753 % %%       \hbox{\vbox{\hrule\@height\hsgr@d\@width\hwgr@d}}}}
754 \def\lplb@xit{\expandafter\setbox0=\expandafter\blb@xit{\box0}}
755 \def\endglshfr@meboxit{\endfr@meboxit\egroup%
756 \nrep=\@ne\@whilenum\nrep<\nrepmax\do%
757 {\lplb@xit\advance\nrep\@ne}\box0\relax}

758 % %%%%% in TeX grammer
759 %\def\endglshfr@meboxit{\endfr@meboxit\egroup%
760 % \nrep=\@ne \loop \lplb@xit \advance\nrep\@ne%
761 % \ifnum\nrep<\nrepmax\repeat\box0\relax}
762 % %%%%%%%%glshfboxit%%%%%%%%%%%%%%%%%%%%%%%%% #1 width, #2 text%%%
763 \def\glshfboxit#1{\leavevmode%
764 \glshfr@meboxit{\fboxsep}{\fboxsep}{\fboxsep}{#1}}
765 \let\endglshfboxit=\endglshfr@meboxit

11 (Mini)screen environment

11.1 (Mini)screen environment without a title

\@oval \h@b@x \@vrf@
766 \@ifundefined{ybaselineshift}{%
767 \newdimen\ybaselineshift \ybaselineshift=\z@}{}
768 \@ifundefined{tbaselineshift}{%
769 \newdimen\tbaselineshift \tbaselineshift=\z@}{}
770 \newdimen\@savetbaselineshift \@savetbaselineshift=\z@
771 \def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen
772 \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
773 \@tfor\@tempa :=#3\do{\csname @ov\@tempa false\endcsname}\@ovxx
774 #1\unitlength \@ovyy #2\unitlength
775 \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
776 \advance\@tempdimb -2pt\relax
777 \@getcirc \@tempdimb
778 \@ovro \ht\@tempboxa \@ovri \dp\@tempboxa
779 \@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@
780 \@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@
781 \@circlefnt \setbox\@tempboxa
782 \hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi
783 \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi
784 \if@ovt \@ovhorz \kern -\@ovxx \fi
785 \if@ovb \raise \@ovyy \@ovhorz \fi}\advance\@ovdx\@ovro
786 \advance\@ovdy\@ovro \ht\@tempboxa\z@ \dp\@tempboxa\z@
787 \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}%
788 \endgroup}
789 \def\h@b@x#1#2#3{\hbox to\dimen1%
790 {\@oval(#3,#3)[#1]\hfil\@oval(#3,#3)[#2]}}
791 \def\@vrf@#1#2{\vskip#1\leaders\vrule\@width#2\vfil\vskip#1}
miniscreen screen
792 % ******************
793 % * miniscreen 環境 *
794 % ******************

795 % 796 % ASCII 版 Micro\TeX の screen 環境を枠の幅を指定できるように改変 797 %

798 %   ifcase 文 ==> 直接計算
799 %   dimen 類 ==> dimen0 to dimen5
800 %   box 類  ==> box0 and box1

801 %

802 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
803 % miniscreen environment

804 %

805 \let\miniscreentoprule=\hrule
806 \def\miniscreen{\@ifnextchar[{\@miniscreen}{\@miniscreen[0]}}
807 \def\miniscreen{\@ifnextchar[{\@miniscreen}{\@miniscreen[0]}}
808 \def\@miniscreen[#1]#2{\dimen1=#2\relax%
809 \@savetbaselineshift\tbaselineshift \tbaselineshift\z@
810 \@tempcnta=-2 \multiply\@tempcnta by#1\relax%
811 \advance\@tempcnta by 20\relax \dimen5=1pt
812 \multiply\dimen5\@tempcnta
813 \dimen4=-1pt \multiply\dimen4 by#1\relax
814 \advance\dimen4 by 10pt
815 \dimen3=\dimen4 \advance\dimen3 by -.2pt
816 \par\vspace{.3\baselineskip}%
817 \dimen6=\dimen1 \advance\dimen6 by .1pt
818 \advance\dimen1 -\dimen5\relax%
819 \setbox0=\hbox\bgroup\minipage{\dimen1
820 \tbaselineshift\@savetbaselineshift}}%
821 \def\endminiscreen{\endminipage\egroup%
822 \setbox1=\hbox to\dimen6{\hfil\vbox{\offinterlineskip%
823 \thinlines\unitlength=1pt
824 \miniscreentoprule%\hrule
825 \kern\dimen3%
826 \h@b@x{tl}{tr}{\@tempcnta}%
827 \kern-\dimen4\box0\h@b@x{bl}{br}{\@tempcnta}%
828 \kern-.4pt\hrule}\hfil}\dimen0=\ht1\noindent%
829 \hbox to\dimen6{\hbox to.4pt{%
830 \vbox to\dimen0{\@vrf@{\dimen4}{.4pt}}\hss}%
831 \box1\hbox to.2pt{%
832 \hss\vbox to\dimen0{\@vrf@{\dimen4}{.4pt}}}\hss}}%
833 % %%%%%%alternative
834 %\def\miniscreen{\@ifnextchar[{\@miniscreen}{\@miniscreen[0]}}
835 %\def\@miniscreen[#1]#2{\noindent\minipage{#2}\@screen[#1]}
836 %\def\endminiscreen{\endscreen\endminipage}
837 \def\screen{\@ifnextchar[{\@screen}{\@miniscreen[0]{\linewidth}}}
838 \def\@screen[#1]{\miniscreen[#1]{\linewidth}}
839 \let\endscreen=\endminiscreen

11.2 (Mini)screen environment with a title

\tboxscreentoprule
\tboxtitle
840 \def\tboxscreentoprule{%
841 \hbox to\wd0{\smash{\lower.4ex\hbox{%
842 \fboxsep=2pt \fbox{\small \tboxtitle}}}\hrulefill}}
843 \def\tboxtitle{\bf Memorandum}
\tboxminiscreen
\tboxscreen
844 % ******************
845 % * tboxscreen 環境 *
846 % ******************
847 % 1996/06/04 by Shinsaku Fujita

849 \def\tboxminiscreen{\@ifnextchar[{\vskip8pt
850 \let\miniscreentoprule=\tboxscreentoprule%
851 \@miniscreen}{\vskip8pt
852 \let\miniscreentoprule=\tboxscreentoprule%
853 \@miniscreen[0]}}
854 \let\endtboxminiscreen=\endminiscreen
855 \def\tboxscreen{\@ifnextchar[{\@tboxscreen}%
856 {\@tboxscreen[0]}}
857 \def\@tboxscreen[#1]{\tboxminiscreen[#1]{\linewidth}}
858 \let\endtboxscreen=\endtboxminiscreen

12 Further boxes

\sboxit
859 % ******************************

860 % * \sboxit 左右の余裕のない箱 *

861 % ******************************
862 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
863 \def\sboxit#1#2{\vbox{\hrule\hbox%
864 {\vrule\vbox{\kern3pt\vbox{\hsize #1 \noindent #2}%
865 \kern3pt}\vrule}\hrule}}

13 Boxes with no height or no width

\bury \pushtowall
866 % ***********************
867 % * bury and pushtowall *
868 % ***********************
869 % After Chapter 7 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita

870 %

871 %  \bury[下げ幅]{内容}
872 %  下げ幅のデフォルト値は， \normalbaselineksip の半分

873 %

874 %  (旧) \def\bury#1{\smash{\lower.5\normalbaselineskip\hbox{#1}}}

875 % これは，「化学と生化学のための LaTeX」に載せた定義です． 876 % 以下の定義は，下げ幅をオプション引数として取るように 877 % 拡張したものです． 878 %

879 \def\bury{\@ifnextchar [{\@bury}{\@bury[.5\normalbaselineskip]}}
880 \def\@bury[#1]#2{\smash{\lower#1\hbox{#2}}}

881 %

882 %  \pushtowall{内容}

883 % 水平方向の押し付ける命令 (\smash の水平方向版) 884 %

885 \def\finpushw@ll{\wd0=0pt \box0}
886 \def\makepushw@ll#1{\setbox0=\hbox{#1}\finpushw@ll}
887 \def\mathpushw@ll#1#2{\setbox0=\hbox{$\m@th#1{#2}$}\finpushw@ll}
888 \def\pushtowall{\relax \leavevmode
889 \ifmmode\def\next{\mathpalette\mathpushw@ll}
890 \else\let\next\makepushw@ll \fi \next}

\penetrate
891 %   \penetrate{DIM}{OBJ}

892 % 幅無し<OBJ>を、印字位置はそのままにして、 <DIM>だけ移動させる。この時 893 % 引き続く文字の印字位置は<OBJ>がなかったとした時の位置になる。 894 % (\bury 命令の水平方向版) 895 % 896 % (比較)

897 %     aaa  bbb  \penetrate{-50pt}{ccc} ddd eee fff \\
898 %     aaa  bbb  \hspace{-50pt} ccc ddd eee fff \\

899 %

900 \def\penetrate#1#2{\pushtowall{\hbox{\hskip#1\hbox{#2}}}}

14 Symbols for instant photography

\cyan
\magenta
\yellow
\cyandv
\magentadv
\yellowdv
\agxlatent
\agxdv
\agx

901 % ***********************
902 % * instant photography *
903 % ***********************
904 % After Chapter 7 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
905 \def\cyan{\mbox{$\bigcirc$\kern-.06em{--}\kern-.06em
906 \ooalign{\hfil
907 \raise.05ex\hbox{\scriptsize C}\hfil\cr\cr$\bigcirc$}\,}}
908 \def\magenta{\mbox{$\bigcirc$\kern-.06em{--}\kern-.06em
909 \ooalign{\hfil
910 \raise.05ex\hbox{\scriptsize M}\hfil\cr\cr$\bigcirc$}\,}}
911 \def\yellow{\mbox{$\bigcirc$\kern-.06em{--}\kern-.06em
912 \ooalign{\hfil
913 \raise.05ex\hbox{\scriptsize Y}\hfil\cr\cr$\bigcirc$}\,}}
914 \def\cyandv{\mbox{$\bigotimes$\kern-.06em{--}\kern-.06em
915 \ooalign{\hfil
916 \raise.05ex\hbox{\scriptsize C}\hfil\cr\cr$\bigcirc$}\,}}
917 \def\magentadv{\mbox{$\bigotimes$\kern-.06em{--}\kern-.06em
918 \ooalign{\hfil
919 \raise.05ex\hbox{\scriptsize M}\hfil\cr\cr$\bigcirc$}\,}}
920 \def\yellowdv{\mbox{$\bigotimes$\kern-.06em{--}\kern-.06em
921 \ooalign{\hfil
922 \raise.05ex\hbox{\scriptsize Y}\hfil\cr\cr$\bigcirc$}\,}}
923 \def\agxlatent{%
924 \mbox{\ooalign{%
925 \hfil\raise.07ex\hbox{\footnotesize $\bullet$}\hfil\cr\cr
926 $\triangle$}\,}}
927 \def\agxdv{%
928 \mbox{\ooalign{\hfil\raise.07ex\hbox{%
929 \small $\spadesuit$}\hfil\cr\cr
930 $\triangle$}\,}}
931 \def\agx{\mbox{$\triangle$}}

15 Various arrows with fixed length

\llongrightarrow
\llongleftarrow
\llongleftrightarrow
\Equilibarrow
\Llongrightarrow
\Llongleftarrow
\Llongleftrightarrow

932 % ***********************

22

933 % * various long arrows *
934 % ***********************
935 % After Chapter 18 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
936 \def\oldllongrightarrow{%%%--->
937 \relbar\joinrel\relbar\joinrel\relbar\joinrel\rightarrow}
938 \def\oldllongleftarrow{%%%<---
939 \leftarrow\joinrel\relbar\joinrel\relbar\joinrel\relbar}
940 \def\oldllongleftrightarrow{%%%<--->
941 \leftarrow\joinrel\relbar\joinrel\relbar\joinrel\rightarrow}
942 %\def\oldEquilibarrow{%%%<--- and --->
943 % \mathrel{\ooalign{\raise.35ex\hbox{$\llongrightarrow$}\crcr
944 % \lower.35ex\hbox{$\llongleftarrow$}}}}
945 \def\oldEquilibarrow{%%%<--- and --->
946 \mathrel{\ooalign{\raise.35ex\hbox{$\oldllongrightarrow$}\crcr
947 \lower.35ex\hbox{$\oldllongleftarrow$}}}}
948 \def\oldLlongrightarrow{%%%===>
949 \Relbar\joinrel\Relbar\joinrel\Relbar\joinrel\Rightarrow}
950 \def\oldLlongleftarrow{%%%<===
951 \Leftarrow\joinrel\Relbar\joinrel\Relbar\joinrel\Relbar}
952 \def\oldLlongleftrightarrow{%%<===>
953 \Leftarrow\joinrel\Relbar\joinrel\Relbar\joinrel\Rightarrow}
954 %%%%%2009/11/19 old...
955 %\let\llongrightarrow=\oldllongrightarrow%%%--->
956 %\let\llongleftarrow=\oldllongleftarrow%%%<---
957 %\let\llongleftrightarrow=\oldllongleftrightarrow%%%<--->
958 %\let\Equilibarrow=\oldEquilibarrow%%%<--- and --->
959 %\let\Llongrightarrow=\oldLlongrightarrow%%%===>
960 %\let\Llongleftarrow=\oldLlongleftarrow%%%<===
961 %\let\Llongleftrightarrow=\oldLlongleftrightarrow%%<===>
\llongleftharpoondown
\llongrightharpoondown
\equilibarrow

962 \def\oldllongleftharpoondown{%%% /---
963 \leftharpoondown\joinrel\relbar\joinrel\relbar\joinrel\relbar}
964 \def\oldllongrightharpoonup{%%%---/
965 \relbar\joinrel\relbar\joinrel\relbar\joinrel\rightharpoonup}
966 \def\oldequilibarrow{%%% /--- and ---/
967 \mathrel{\ooalign{%
968 \raise.3ex\hbox{$\oldllongrightharpoonup$}\crcr
969 \lower.3ex\hbox{$\oldllongleftharpoondown$}}}}
970 %%%%%2009/11/19
971 %\let\llongleftharpoondown=\oldllongleftharpoondown%%% /---
972 %\let\llongrightharpoonup=\oldllongrightharpoonup%%%---/
973 %\let\equilibarrow=\oldequilibarrow%%% /--- and ---/
\eqproton
974 % *******************************

975 % * 平衡の両側矢印の上に H+を書く*

976 % *******************************
977 \def\eqproton{\stackrel{{\rm \displaystyle H}^{+}}{\Equilibarrow}}
\lllongrightarrow
\lllongleftarrow
\lllongleftrightarrow
\Equiliblongarrow
\Lllongrightarrow
\Lllongleftarrow
\Lllongleftrightarrow

978 % ****************

979 % * 長い長い矢印 *

980 % ****************

23

 981 \def\oldlllongrightarrow{\relbar\joinrel\relbar%
 982 \joinrel\relbar\joinrel\relbar\joinrel\rightarrow}
 983 \def\oldlllongleftarrow{%%%<-------
 984 \leftarrow\joinrel\relbar\joinrel\relbar%
 985 \joinrel\relbar\joinrel\relbar}
 986 \def\oldlllongleftrightarrow{%%%<------->
 987 \leftarrow\joinrel\relbar\joinrel\relbar%
 988 \joinrel\relbar\joinrel\rightarrow}
 989 \def\oldEquiliblongarrow{%%%<------- and ------->
 990 \mathrel{\ooalign{\raise.35ex\hbox{$\oldlllongrightarrow$}\crcr
 991 \lower.35ex\hbox{$\oldlllongleftarrow$}}}}
 992 \def\oldLllongrightarrow{%%%=======>
 993 \Relbar\joinrel\Relbar\joinrel\Relbar\joinrel%
 994 \Relbar\joinrel\Rightarrow}
 995 \def\oldLllongleftarrow{%%%<=======
 996 \Leftarrow\joinrel\Relbar\joinrel\Relbar\joinrel%
 997 \Relbar\joinrel\Relbar}
 998 \def\oldLllongleftrightarrow{%%<=======>
 999 \Leftarrow\joinrel\Relbar\joinrel\Relbar\joinrel%
1000 \Relbar\joinrel\Rightarrow}
1001 %%%%2009/11/19
1002 %\let\lllongrightarrow=\oldlllongrightarrow%%%%------>
1003 %\let\lllongleftarrow=\oldlllongleftarrow%%%<-------
1004 %\let\lllongleftrightarrow=\oldlllongleftrightarrow%%%<------->
1005 %\let\Equiliblongarrow=\oldEquiliblongarrow%%%<------- and ------->
1006 %\let\Lllongrightarrow=\oldLllongrightarrow%%%=======>
1007 %\let\Lllongleftarrow=\oldLllongleftarrow%%%<=======
1008 %\let\Lllongleftrightarrow=\oldLllongleftrightarrow%%<=======>
\lllongleftharpoondown
\lllongrightharpoondown
\equiliblongarrow
\deHBr

1009 \def\oldlllongleftharpoondown{%%% /-------
1010 \leftharpoondown\joinrel\relbar\joinrel\relbar%
1011 \joinrel\relbar\joinrel\relbar}
1012 \def\oldlllongrightharpoonup{%%%-------/
1013 \relbar\joinrel\relbar\joinrel\relbar\joinrel%
1014 \relbar\joinrel\rightharpoonup}
1015 \def\oldequiliblongarrow{%%% /------ and ------/
1016 \mathrel{\ooalign{%
1017 \raise.3ex\hbox{$\oldlllongrightharpoonup$}\crcr
1018 \lower.3ex\hbox{$\oldlllongleftharpoondown$}}}}
1019 %%%%%%%%2009/11/19
1020 %\let\lllongleftharpoondown=\oldlllongleftharpoondown%%% /-------
1021 %\let\lllongrightharpoonup=\oldlllongrightharpoonup%%%-------/
1022 %\let\equiliblongarrow=\oldequiliblongarrow%%% /------ and ------/
1023 % %%%%%
1024 \def\deHBr{\stackrel{\displaystyle \rm -HBr}%
1025 {\stackrel{\displaystyle \lllongrightarrow}{\rm E2}}}

16 Chemical Corrections

16.1 Correction commands

\chemcorr
\leavechemcorr

1026 % ********************
1027 % * chemform command *
1028 % ********************
1029 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1030 \def\chemcorr{%
1031 \fontdimen16\textfont2=3.05pt
1032 \fontdimen17\textfont2=3.05pt
1033 %\fontdimen14\textfont2=3.8pt

1034 }

1035 \def\leavechemcorr{%
1036 \fontdimen16\textfont2=1.49998pt
1037 \fontdimen17\textfont2=2.47217pt
1038 %\fontdimen14\textfont2=3.62892pt

1039 }

16.2 Chem Version

The ‘chem’ for mathversion is introduced to describe chemical equations. The ‘boldchem’ for mathversion is introduced to describe boldfaced chemical equations.

\ifnewl@tex
1040 \newif\ifnewl@tex \newl@textrue
1041 \@ifundefined{DeclareMathVersion}%
1042 {\global\newl@texfalse}{\global\newl@textrue}%

Old commands are stored temporarily.

1043 \if@chemtimes\else%for chemtimes package
1044 \def\math@chem{chem}
1045 \def\math@boldchem{boldchem}
1046 \def\math@bold{bold}
1047 \def\math@normal{normal}
1048 %%added 2005/09/02
1049 \let\oldalpha=\alpha
1050 \let\oldbeta=\beta
1051 \let\oldgamma=\gamma
1052 \let\olddelta=\delta
1053 \let\oldepsilon=\epsilon
1054 \let\oldzeta=\zeta
1055 \let\oldeta=\eta
1056 \let\oldtheta=\theta
1057 \let\oldiota=\iota
1058 \let\oldkappa=\kappa
1059 \let\oldlambda=\lambda
1060 \let\oldmu=\mu
1061 \let\oldnu=\nu
1062 \let\oldxi=\xi
1063 \let\oldpi=\pi
1064 \let\oldrho=\rho
1065 \let\oldsigma=\sigma
1066 \let\oldtau=\tau
1067 \let\oldupsilon=\upsilon
1068 \let\oldphi=\phi
1069 \let\oldchi=\chi
1070 \let\oldpsi=\psi

1071 \let\oldomega=\omega
1072 \let\oldvarepsilon=\varepsilon
1073 \let\oldvartheta=\vartheta
1074 \let\oldvarpi=\varpi
1075 \let\oldvarrho=\varrho
1076 \let\oldvarsigma=\varsigma
1077 \let\oldvarphi=\varphi
1078 \let\oldGamma=\Gamma
1079 \let\oldDelta=\Delta
1080 \let\oldTheta=\Theta
1081 \let\oldLamda=\Lambda
1082 \let\oldXi=\Xi
1083 \let\oldPi=\Pi
1084 \let\oldSigma=\Sigma
1085 \let\oldUpsilon=\Upsilon
1086 \let\oldPhi=\Phi
1087 \let\oldPsi=\Psi
1088 \let\oldOmega=\Omega

1089 \fi

\chemGreekletter
1090 \if@chemtimes\else%for chemtimes package
1091 \def\chemGreekletter#1#2{%
1092 \expandafter\def\csname #1\endcsname{%
1093 \ifx\math@version\math@chem
1094 \mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}\else
1095 \ifx\math@version\math@boldchem
1096 \mathord{\hbox{\mathversion{bold}$\mathchar"#2$}}\else
1097 \ifx\math@version\math@bold
1098 \csname old#1\endcsname
1099 %\mathord{\hbox{\mathversion{bold}$\mathchar"#2$}}%changed 2005/09/02
1100 \else
1101 \csname old#1\endcsname
1102 %\mathord{\hbox{\mathversion{normal}$\mathchar"#2$}}%changed 2005/09/02
1103 \fi\fi\fi}}%

1104 \fi

\chemUpGreekletter
1105 %%%\if@chemtimes\else%for chemtimes package
1106 \newif\ifupgreekrm \upgreekrmfalse
1107 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\upgreekrmtrue\mathrm}
1108 %%%\fi
1109 \if@chemtimes\else\relax%for chemtimes package
1110 \def\chemUpGreekletter#1#2#3{%
1111 \expandafter\def\csname #1\endcsname{%
1112 \ensuremath{%
1113 \ifx\math@version\math@chem
1114 #2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}\else
1115 \ifx\math@version\math@boldchem
1116 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}\else
1117 \ifx\math@version\math@bold
1118 \ifupgreekrm
1119 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
1120 \upgreekrmfalse

1121 \else
1122 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%

1123 \fi

1124 \else
1125 #2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
1126 \fi\fi\fi}}}%

1127 \fi

\ChemAccent
1128 \if@chemtimes\else%for chemtimes package
1129 \def\ChemAccent#1#2#3{%
1130 \expandafter\def\csname #1\endcsname{%
1131 \ifx\math@version\math@chem
1132 #2{\hbox{\kern-0.15em\usefont{OML}{cmm}{m}{it}\char"#3}}\else
1133 \ifx\math@version\math@boldchem
1134 #2{\hbox{\kern-0.2em\usefont{OML}{cmm}{b}{it}\char"#3}}\else
1135 \ifx\math@version\math@bold
1136 \ifupgreekrm
1137 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%
1138 \upgreekrmfalse
1139 \else
1140 #2{\hbox{\usefont{OML}{cmm}{b}{it}\char"#3}}%

1141 \fi

1142 \else
1143 #2{\hbox{\usefont{OML}{cmm}{m}{it}\char"#3}}%
1144 \fi\fi\fi}}

1145 \fi

\SetChemSymbol
1146 \if@chemtimes\else%for chemtimes package
1147 \def\SetChemSymbol{%
1148 \chemGreekletter{alpha}{010B}%
1149 \chemGreekletter{beta}{010C}%
1150 \chemGreekletter{gamma}{010D}%
1151 \chemGreekletter{delta}{010E}%
1152 \chemGreekletter{epsilon}{010F}%
1153 \chemGreekletter{zeta}{0110}%
1154 \chemGreekletter{eta}{0111}%
1155 \chemGreekletter{theta}{0112}%
1156 \chemGreekletter{iota}{0113}%
1157 \chemGreekletter{kappa}{0114}%
1158 \chemGreekletter{lambda}{0115}%
1159 \chemGreekletter{mu}{0116}%
1160 \chemGreekletter{nu}{0117}%
1161 \chemGreekletter{xi}{0118}%
1162 \chemGreekletter{pi}{0119}%
1163 \chemGreekletter{rho}{011A}%
1164 \chemGreekletter{sigma}{011B}%
1165 \chemGreekletter{tau}{011C}%
1166 \chemGreekletter{upsilon}{011D}%
1167 \chemGreekletter{phi}{011E}%
1168 \chemGreekletter{chi}{011F}%
1169 \chemGreekletter{psi}{0120}%
1170 \chemGreekletter{omega}{0121}%

1171 \chemGreekletter{varepsilon}{0122}%
1172 \chemGreekletter{vartheta}{0123}%
1173 \chemGreekletter{varpi}{0124}%
1174 \chemGreekletter{varrho}{0125}%
1175 \chemGreekletter{varsigma}{0126}%
1176 \chemGreekletter{varphi}{0127}%

1177 %

1178 %\chemGreekletter{Gamma}{7000}%
1179 %\chemGreekletter{Delta}{7001}%
1180 %\chemGreekletter{Theta}{7002}%
1181 %\chemGreekletter{Lambda}{7003}%
1182 %\chemGreekletter{Xi}{7004}%
1183 %\chemGreekletter{Pi}{7005}%
1184 %\chemGreekletter{Sigma}{7006}%
1185 %\chemGreekletter{Upsilon}{7007}%
1186 %\chemGreekletter{Phi}{7008}%
1187 %\chemGreekletter{Psi}{7009}%
1188 %\chemGreekletter{Omega}{700A}%

1189 %

1190 % for uppercase Greek letters and some fonts
1191 % (cmmi medium or bold) 2009/10/25
1192 \chemUpGreekletter{Gamma}{\mathord}{00}%
1193 \chemUpGreekletter{Delta}{\mathord}{01}%
1194 \chemUpGreekletter{Theta}{\mathord}{02}%
1195 \chemUpGreekletter{Lambda}{\mathord}{03}%
1196 \chemUpGreekletter{Xi}{\mathord}{04}%
1197 \chemUpGreekletter{Pi}{\mathord}{05}%
1198 \chemUpGreekletter{Sigma}{\mathord}{06}%
1199 \chemUpGreekletter{Upsilon}{\mathord}{07}%
1200 \chemUpGreekletter{Phi}{\mathord}{08}%
1201 \chemUpGreekletter{Psi}{\mathord}{09}%
1202 \chemUpGreekletter{Omega}{\mathord}{0A}%
1203 \chemUpGreekletter{imath}{\mathord}{7B}%
1204 \chemUpGreekletter{jmath}{\mathord}{7C}%
1205 \chemUpGreekletter{mathless}{\mathrel}{3C}%in place of <
1206 \chemUpGreekletter{mathgreater}{\mathrel}{3E}% in place of >
1207 \chemUpGreekletter{leftharpoonup}{\mathrel}{28}%
1208 \chemUpGreekletter{leftharpoondown}{\mathrel}{29}%
1209 \chemUpGreekletter{rightharpoonup}{\mathrel}{2A}%
1210 \chemUpGreekletter{rightharpoondown}{\mathrel}{2B}%
1211 \chemUpGreekletter{ell}{\mathord}{60}%
1212 \chemUpGreekletter{wp}{\mathord}{7D}%
1213 \chemUpGreekletter{partial}{\mathord}{40}%
1214 \chemUpGreekletter{flat}{\mathord}{5B}%
1215 \chemUpGreekletter{natural}{\mathord}{5C}%
1216 \chemUpGreekletter{sharp}{\mathord}{5D}%
1217 \chemUpGreekletter{triangleleft}{\mathbin}{2F}%
1218 \chemUpGreekletter{triangleright}{\mathbin}{2E}%
1219 \chemUpGreekletter{smile}{\mathrel}{5E}%
1220 \chemUpGreekletter{frown}{\mathrel}{5F}%
1221 \chemUpGreekletter{star}{\mathbin}{3F}%
1222 \ChemAccent{vec}{\rlap}{7E}%

1223 } 1224 \fi

\mathversion
1225 \if@chemtimes\else%for chemtimes package
1226 \DeclareRobustCommand\mathversion[1]
1227  {\@nomath\mathversion
1228  \expandafter\ifx\csname mv@#1\endcsname\relax
1229  \@latex@error{Math version `#1' is not defined}\@eha\else
1230  \edef\math@version{#1}%
1231  \gdef\glb@currsize{}%
1232 %%%%%%2002/5/30, 2004/11/17, and 2009/10/25
1233 \ifx\math@version\math@chem
1234 \mathcode`\.="012E
1235 \mathcode`\,="612C
1236 \mathcode`\/="012F
1237 \mathcode`\=="313D
1238 \mathcode`\?="513F
1239 \mathcode`\[="415B
1240 \mathcode`\]="515D
1241 \mathcode`\(="4128
1242 \mathcode`\)="5129
1243 % \mathcode`\+="212B
1244 \SetChemSymbol
1245 \else\ifx\math@version\math@boldchem
1246 \mathcode`\.="012E
1247 \mathcode`\,="612C
1248 \mathcode`\/="012F
1249 \mathcode`\=="313D
1250 \mathcode`\?="513F
1251 \mathcode`\[="415B
1252 \mathcode`\]="515D
1253 \mathcode`\(="4128
1254 \mathcode`\)="5129
1255 % \mathcode`\+="212B
1256 \def\check{\mathaccent"7114 }
1257 \def\dot{\mathaccent"715F }
1258 \def\acute{\mathaccent"7113 }
1259 \def\grave{\mathaccent"7112 }
1260 \def\ddot{\mathaccent"717F }
1261 \def\bar{\mathaccent"7116 }
1262 \def\breve{\mathaccent"7115 }
1263 \SetChemSymbol
1264 \else\ifx\math@version\math@bold
1265 \mathcode`\.="013A
1266 \mathcode`\,="613B
1267 \mathcode`\/="013D
1268 \mathcode`\=="303D
1269 \mathcode`\?="503F
1270 \mathcode`\[="405B
1271 \mathcode`\]="505D
1272 \mathcode`\(="4028
1273 \mathcode`\)="5029
1274 % \mathcode`\+="202B
1275 \SetChemSymbol%
1276 \else
1277 \mathcode`\.="013A

1278 \mathcode`\,="613B
1279 \mathcode`\/="013D
1280 \mathcode`\=="303D
1281 \mathcode`\?="503F
1282 \mathcode`\[="405B
1283 \mathcode`\]="505D
1284 \mathcode`\(="4028
1285 \mathcode`\)="5029
1286 % \mathcode`\+="202B
1287 \SetChemSymbol%
1288 \fi\fi\fi
1289 %%%%%%
1290  \aftergroup\glb@settings
1291  \fi}

1292 \fi

\SetSymbolFont
1293 \if@chemtimes\else%for chemtimes package
1294 \ifnewl@tex
1295 \@ifundefined{mv@chem}{\DeclareMathVersion{chem}%
1296 \SetSymbolFont{letters}{chem}{OT1}{cmr}{m}{n}%OT1-->T1-->OT1
1297 \SetSymbolFont{operators}{chem}{OT1}{cmr} {m}{n}%
1298 \SetSymbolFont{symbols}  {chem}{OMS}{cmsy}{m}{n}%
1299 \DeclareMathVersion{boldchem}%2002/5/30
1300 \SetSymbolFont{operators}{boldchem}{OT1}{cmr} {bx}{n}%
1301 \SetSymbolFont{letters}  {boldchem}{OT1}{cmr} {b}{n}%
1302 \SetSymbolFont{symbols}  {boldchem}{OMS}{cmsy}{b}{n}%

1303 }{} 1304 \fi 1305 \fi

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

1306 \if@chemtimes\else%for chemtimes package
1307 \let\oldmathnormal=\mathnormal
1308 \def\mathnormal#1{%
1309 \ifx\math@version\math@chem
1310 %\mathgroup\@ne
1311 \mathord{\hbox{\usefont{OML}{cmm}{m}{it}#1}}%
1312 \else\ifx\math@version\math@boldchem
1313 %\mathgroup\@ne
1314 \mathord{\hbox{\usefont{OML}{cmm}{b}{it}#1}}%
1315 \else\ifx\math@version\math@bold
1316 \ifupgreekrm
1317 \oldmathnormal{#1}%
1318 \upgreekrmfalse
1319 \else
1320 \oldmathnormal{#1}%

1321 \fi

1322 \else
1323 \oldmathnormal{#1}%
1324 %\mathgroup\@ne\usefont{OML}{cmm}{m}{it}%
1325 \fi\fi\fi}%

1326 \fi

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

1327 \if@chemtimes\else%for chemtimes package
1328 \def\oldstyle{\egroup%
1329 \ifx\math@version\math@chem
1330 \hbox\bgroup\usefont{OML}{cmm}{m}{it}%
1331 \else\ifx\math@version\math@boldchem
1332 \hbox\bgroup\usefont{OML}{cmm}{b}{it}%
1333 \else\ifx\math@version\math@bold
1334 \ifupgreekrm
1335 \oldmathnormal\bgroup%
1336 \upgreekrmfalse
1337 \else
1338 \oldmathnormal\bgroup%

1339 \fi

1340 \else
1341 \oldmathnormal\bgroup%
1342 \fi\fi\fi}%

1343 \fi

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

1344 \if@chemtimes\else%for chemtimes package
1345 \let\oldmathcal=\mathcal
1346 \def\mathcal#1{%
1347 \ifx\math@version\math@chem
1348 \mathgroup\tw@{\usefont{OMS}{cmsy}{m}{n}#1}%
1349 \else\ifx\math@version\math@boldchem
1350 \mathgroup\tw@{\usefont{OMS}{cmsy}{b}{n}#1}%
1351 \else\ifx\math@version\math@bold
1352 \ifupgreekrm \oldmathcal{#1}\upgreekrmfalse
1353 \else \oldmathcal{#1}\fi
1354 \else
1355 \oldmathcal{#1}%
1356 \fi\fi\fi}%

1357 \fi

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

1358 \if@chemtimes\else%for chemtimes package
1359 \let\oldcal=\cal
1360 \def\cal{%
1361 \ifx\math@version\math@chem
1362 \mathgroup\tw@\usefont{OMS}{cmsy}{m}{n}%
1363 \else\ifx\math@version\math@boldchem
1364 \mathgroup\tw@\usefont{OMS}{cmsy}{b}{n}%
1365 \else\ifx\math@version\math@bold
1366 \ifupgreekrm \oldcal\upgreekrmfalse
1367 \else\oldcal\fi
1368 \else
1369 \oldcal%
1370 \fi\fi\fi}%

1371 \fi

\chemform
1372 \ifnewl@tex
1373 \def\chemform#1{{\mathversion{chem}%
1374 $\chemcorr #1$\leavechemcorr}}
1375 \else
1376 \def\chemform#1{\chemcorr
1377 $\rm #1$\leavechemcorr}

1378 \fi

chemmath
1379 % ************************
1380 % * chemmath environment *
1381 % ************************
1382 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1383 \ifnewl@tex
1384 \def\chemmath{\begingroup\mathversion{chem}\[\chemcorr}
1385 \def\endchemmath{\]\endgroup\leavechemcorr}
1386 \else
1387 \def\chemmath{\chemcorr\[\rm}
1388 \def\endchemmath{\] \leavechemcorr}

1389 \fi

chemeqn
1390 % ***********************
1391 % * chemeqn environment *
1392 % ***********************
1393 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1394 \ifnewl@tex
1395 \def\chemeqn{\begingroup\mathversion{chem}\equation\chemcorr}
1396 \def\endchemeqn{\endequation\endgroup\leavechemcorr}
1397 \else
1398 \def\chemeqn{\chemcorr\equation\rm}
1399 \def\endchemeqn{\endequation\leavechemcorr}

1400 \fi

chemeqnarray
1401 % ****************************
1402 % * chemeqnarray environment *
1403 % ****************************
1404 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1405 \ifnewl@tex
1406 \def\chemeqnarray{\stepcounter{equation}
1407 \let\@currentlabel=\theequation
1408 \global\@eqnswtrue
1409 \global\@eqcnt\z@\tabskip\@centering
1410 \let\\=\@eqncr
1411 \begingroup\mathversion{chem}
1412 $$\chemcorr\halign to \displaywidth\bgroup
1413 \@eqnsel\hskip\@centering
1414 $\rm \displaystyle\tabskip\z@{##}$ &
1415 \global\@eqcnt\@ne
1416 \hskip \arraycolsep \hfil$\rm{##}$\hfil &
1417 \global\@eqcnt\tw@ \hskip \arraycolsep
1418 $\rm \displaystyle\tabskip\z@{##}$\hfil

1419 \tabskip\@centering &
1420 \llap{##}\tabskip\z@\cr}
1421 \def\endchemeqnarray{\endeqnarray\endgroup
1422 \leavechemcorr}
1423 \else
1424 \def\chemeqnarray{\stepcounter{equation}
1425 \let\@currentlabel=\theequation
1426 \global\@eqnswtrue
1427 \global\@eqcnt\z@\tabskip\@centering
1428 \let\\=\@eqncr \chemcorr
1429 $$\halign to \displaywidth\bgroup
1430 \@eqnsel\hskip\@centering
1431 $\rm \displaystyle\tabskip\z@{##}$ &
1432 \global\@eqcnt\@ne
1433 \hskip \arraycolsep \hfil$\rm{##}$\hfil &
1434 \global\@eqcnt\tw@ \hskip \arraycolsep
1435 $\rm \displaystyle\tabskip\z@{##}$\hfil
1436 \tabskip\@centering &
1437 \llap{##}\tabskip\z@\cr}
1438 \def\endchemeqnarray{\endeqnarray
1439 \leavechemcorr}

1440 \fi

chemeqnarray*
1441 % *****************************
1442 % * chemeqnarray* environment *
1443 % *****************************
1444 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1445 % bug fix (1996/06/15) the end command is replaced.
1446 \let\@seqncr=\@eqncr
1447 \ifnewl@tex
1448 \@namedef{chemeqnarray*}{%
1449 \def\@eqncr{\nonumber\@seqncr}\chemeqnarray}
1450 \@namedef{endchemeqnarray*}{\nonumber\endchemeqnarray}
1451 \else
1452 \@namedef{chemeqnarray*}{%
1453 \def\@eqncr{\nonumber\@seqncr\rm}\chemeqnarray}
1454 \@namedef{endchemeqnarray*}{\nonumber\endchemeqnarray}

1455 \fi

chemeqnarraya
1456 % *****************
1457 % * chemeqnarraya *
1458 % *****************
1459 % After Chapter 9 of ``LaTeX for (Bio)Chemists'' by S. Fujita
1460 % revised may 21 1992 by S. Fujita
1461 \def\chemeqnarraya{\chemeqn@rraya \chemeqnarray}
1462 \def\chemeqn@rraya{%
1463 \c@enumi=\c@equation
1464 \advance\c@enumi\@ne
1465 \c@equation=\z@
1466 \@ifundefined{chapter}%
1467 {\def\theequation{\theenumi\alph{equation}}}%
1468 {\def\theequation{%

1469 \thechapter.\theenumi\alph{equation}}}}
1470 \def\endchemeqnarraya{\endchemeqnarray
1471 \global\c@equation=\c@enumi}

\if@display This switch is to meat the amsmath package.

1472 \@ifundefined{if@display}{\newif\if@display}{}
ChemEquation
1473 \newif\ifupgreekrm \upgreekrmfalse
1474 \let\ChemEqFont=\rm
1475 \def\ChemEquation{\everymath{\ChemEqFont\chemcorr\upgreekrmtrue}%
1476 \everydisplay{\ChemEqFont\chemcorr\@displaytrue\upgreekrmtrue}\equation}
1477 \def\endChemEquation{\endequation\everymath{}\everydisplay{}%
1478 \@displayfalse\leavechemcorr\upgreekrmfalse}
ChemEqnarray
1479 \def\ChemEqnarray{\everymath{\ChemEqFont\chemcorr\upgreekrmtrue}%
1480 %\everydisplay{\ChemEqFont\chemcorr\@displaytrue}
1481 \eqnarray}
1482 \def\endChemEqnarray{\endeqnarray\everymath{}%
1483 %\everydisplay{}\@displayfalse
1484 \leavechemcorr\upgreekrmfalse}
\ChemForm
1485 \def\ChemForm#1{\everymath{\ChemEqFont\chemcorr\upgreekrmtrue}$#1$\everymath{}%
1486 \leavechemcorr\upgreekrmfalse}
ChemEqnarray*
1487 \@namedef{ChemEqnarray*}{\def\@eqncr{\nonumber\@seqncr}\ChemEqnarray}
1488 \@namedef{endChemEqnarray*}{\nonumber\endChemEqnarray}

\newchemenvironment This command is used to creat a new environment for chemistry based on an appropriate environment for mathematics.

   \newchemenviroment{New Name}{Old Environment}

1489 \def\newchemenvironment#1#2{%
1490 \expandafter\def\csname  #1\endcsname{%
1491 \everymath{\ChemEqFont\chemcorr\upgreekrmtrue}%
1492 %\everydisplay{\ChemEqFont\chemcorr\@displaytrue}%
1493 \csname #2\endcsname}%
1494 \expandafter\def\csname  end#1\endcsname{%
1495 \csname end#2\endcsname\everymath{}%
1496 %\everydisplay{}\@displayfalse%
1497 \leavechemcorr\upgreekrmfalse}}

17 XyMcompd and XyMtab Environments

These environments are designed for XyM Markup Language to treat a XyM tag and a XyMtab tag.

XyMcompd
1498 \def\XyMcompd(#1,#2)(#3,#4)#5#6{%
1499 \begingroup
1500 \edef\xymrefa{#5}\edef\xymrefb{#6}%
1501 \edef\kkk{#1}%
1502 \begin{tabular}{c}
1503 \ifx\kkk\empty\else
1504 \begin{sfpicture}(#1,#2)(#3,#4)\fi\ignorespaces}
1505 \def\endXyMcompd{%
1506 \ifx\kkk\empty\else\end{sfpicture}\fi
1507 \\[-\baselineskip]
1508 \ifx\xymrefa\empty\else{\bf \compd\xymrefb
1509 \expandafter\label{\xymrefa}}\fi
1510 \end{tabular}\endgroup}
XyMtab
1511 \def\XyMtab#1{\center\tabular{#1c}}
1512 \def\endXyMtab{\endtabular\endcenter}

\derivlist For example, derivatives are specified as follows:

    \derivlist{X = Cl;X = F;X = Me}

1513 \def\derivlist#1{%
1514 \mbox{}\\
1515 \begingroup\def\arraystretch{0.7}%
1516 \begin{tabular}{l}
1517 \@forsemicol\member:=#1\do{%
1518 \ifx\member\empty\else%
1519 \hbox to2em{\hss\derivnum}:\space\member \\
1520 \fi}\end{tabular}\endgroup}

This command is used in the XyMderiv environment.

XyMderiv
1521 \def\XyMderiv{\tabular{c}}
1522 \def\endXyMderiv{\endtabular}

18 Useful commands

\endash \Cent \degC \degF
1523 % ***************
1524 % * temperature *
1525 % ***************
1526 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1527 \def\endash{\mbox{--{}}}
1528 \def\Cent{\mbox{\raise.9ex\hbox{%
1529 \scriptsize$\circ$}\kern-.12em\hbox{C}}}
1530 \def\degC{\mbox{\kern-.2em\char'27\kern-.3em C}}
1531 \def\degF{\mbox{\kern-.2em\char'27\kern-.3em F}}

\yubin \Yubin
1532 % *******************
1533 % * yubin and Yubin *
1534 % *******************
1535 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1536 \def\yubin{$\overline{\top}$}
1537 \def\Yubin#1{\leavevmode\hbox{\vbox{\hrule\@height.12ex\@width.7em
1538 \kern.28ex\hrule\@height.12ex\@width.7em
1539 \hbox{\kern.35em\kern-.06ex
1540 \vbox{\hrule\@height1ex\@width.12ex}}}\kern.1em{#1}}}
\xlethead
1541 % ***********
1542 % * lethead *
1543 % ***********
1544 % After Chapter 18 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1545 \def\xlethead#1{%
1546 \kern-.6667\baselineskip \line{\hrulefill\phantom{ #1 }\hrulefill}
1547 \kern-.6667\baselineskip \line{\hrulefill\phantom{ #1 }\hrulefill}
1548 \kern-.6667\baselineskip \line{\hrulefill\hbox{ #1 }\hrulefill}}
1549 \def\lethead#1#2#3{\def\line{\hbox to\textwidth}
1550 \vbox{\line{\hrulefill}
1551 \xlethead{#1} \xlethead{#2} \xlethead{#3}
1552 \kern-.6667\baselineskip \line{\hrulefill}}}
\horizon
1553 % ************
1554 % * baseline *
1555 % ************
1556 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1557 \def\horizon{\rule{12pt}{0.1pt}}

19 Logos

\resetfontsize
\Bib
\BibTeX
\jBibTeX

1558 % ********************************
1559 % * Redefinition of Logos        *
1560 % * January 3, 1993 by S. Fujita *
1561 % ********************************
1562 % After Chapter 12 of ``LaTeX for (Bio)Chemists'' by Shinsaku Fujita
1563 \newcount\TestCount \def\tmpkern{\kern0pt}
1564 \ifnewl@tex \else
1565 \def\resetfontsize{%
1566 \ifx\@currsize\normalsize%
1567 \def\tmpf@ntsize{%
1568 \load{\footnotesize}{\sf}%
1569 \load{\footnotesize}{\sl}%
1570 \load{\footnotesize}{\bf}%
1571 \def\tmpkern{\kern0.05em}%
1572 \footnotesize}\fi
1573 \ifx\@currsize\scriptsize \let\tmpf@ntsize=\tiny\fi
1574 \ifx\@currsize\footnotesize \let\tmpf@ntsize=\tiny\fi

1575 \ifx\@currsize\small \let\tmpf@ntsize=\scriptsize\fi
1576 \ifx\@currsize\large \let\tmpf@ntsize=\small\fi
1577 \ifx\@currsize\Large \let\tmpf@ntsize=\@normalsize\fi
1578 \ifx\@currsize\LARGE \let\tmpf@ntsize=\large\fi
1579 \ifx\@currsize\huge \let\tmpf@ntsize=\Large\fi
1580 \ifx\@currsize\Huge \let\tmpf@ntsize=\LARGE\fi}

1581 \fi

1582 \ifnewl@tex \else
1583 \def\Bib{\ifnum \fam=\m@ne \fam=\z@ \fi\TestCount=\fam\leavevmode%
1584  \edef\aaa{\fontname\scriptfont\fam}%
1585  \edef\bbb{\fontname\textfont\fam}%
1586 \resetfontsize%
1587 \hbox{$\fam=\TestCount\textstyle B$}%
1588 \ifx\aaa\bbb%
1589 \hbox{\tmpf@ntsize\bf
1590 $\fam=\TestCount\kern-.025em I\kern-.045em B$}%
1591 \else%
1592 \hbox{$\fam\TestCount\scriptstyle\kern-.025em I\kern-.045em B$}%

1593 \fi 1594 } 1595 \fi

1596 %\def\BibTeX{\Bib\kern-.08em\TeX}
1597 %\def\jBibTeX{\leavevmode\lower.46ex\hbox{J}
1598 %\kern-.08em\Bib\kern-.08em\TeX}
1599 % %%\def\BibTeX{%
1600 % {\rm B\kern-.05em{\sc i\kern-.025emb}\kern-.08em\TeX}}
1601 % %%%%%1996/04/20 by Shinsaku Fujita%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1602 \ifnewl@tex
1603 \DeclareRobustCommand{\BibTeX}{%
1604  B\hbox{$\m@th$\csname S@\f@size\endcsname
1605  \fontsize\sf@size\z@ \math@fontsfalse\selectfont
1606  \kern-.025em I\kern-.045em B}\kern-.08em\TeX}
1607 \else \def\BibTeX{\Bib\kern-.08em\TeX} \fi
1608 \ifnewl@tex
1609 \DeclareRobustCommand{\jBibTeX}{\mbox{%
1610 \if b\expandafter\@car\f@series\@nil\boldmath\fi
1611 \leavevmode\lower.46ex\hbox{J}\kern-.08em\BibTeX}}
1612 \else
1613 \def\jBibTeX{\leavevmode\lower.46ex\hbox{J}%
1614 \kern-.08em\Bib\kern-.08em\TeX}

1615 \fi

\jTeX \pTeX
1616 \def\jTeX{\leavevmode\lower.46ex\hbox{J}\kern-.15em\TeX}
1617 \def\pTeX{p\kern-.15em\TeX}
\Sub \Subbib
1618 \ifnewl@tex \else
1619 \def\Sub{\leavevmode\ifnum \fam=\m@ne \fam=\z@ \fi%
1620  \TestCount=\fam{S}%
1621  \edef\aaa{\fontname\scriptfont\fam}%
1622  \edef\bbb{\fontname\textfont\fam}%
1623  \ifx\aaa\bbb\resetfontsize%

1624  \hbox{\tmpf@ntsize\bf%
1625  $\fam=\TestCount\kern-.045em{U}\kern-.12em{B}$}%
1626  \else%
1627  \hbox{$\fam\TestCount%
1628  \scriptstyle\kern-.045em{U}\kern-.12em{B}$}%
1629  \fi}

1630 \fi

1631 %\def\SubBib{\Sub\kern-.08em\Bib}
1632 % %%%%%1996/04/20 by Shinsaku Fujita%%%%%%%%%%%%%%%%%%%%%%%%%%%
1633 \ifnewl@tex
1634 \DeclareRobustCommand{\SubBib}{S\hbox{$\m@th$%
1635 \csname S@\f@size\endcsname\fontsize\sf@size\z@
1636 \math@fontsfalse\selectfont%
1637 \kern-.045em{U}\kern-.12em{B}}B\hbox{$\m@th$%
1638 \csname S@\f@size\endcsname\fontsize\sf@size\z@
1639 \math@fontsfalse\selectfont \kern-.025em I\kern-.045em B}}
1640 \else \def\SubBib{\Sub\kern-.08em\Bib} \fi

{\La \atop \LaTeX}

1641 %\def\La{\TestCount=\fam \leavevmode L\raise.42ex
1642 %        \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}}
1643 \ifnewl@tex \else
1644 \def\La{\ifnum \fam=\m@ne \fam=\z@ \fi\TestCount=\fam%
1645 \edef\aaa{\fontname\scriptfont\fam}%
1646 \edef\bbb{\fontname\textfont\fam}\leavevmode{L}%
1647 \ifx\aaa\bbb \resetfontsize%
1648 \raise.46ex\hbox{{\tmpf@ntsize\bf%
1649 $\fam\TestCount\kern-.4em\tmpkern{A}$}}%
1650 \else%
1651 \raise.42ex\hbox{$\fam\TestCount\scriptstyle\kern-.3em{A}$}%
1652 \fi}

1653 \fi

1654 % %%%%%1996/04/20 by Shinsaku Fujita%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1655 %\def\LaTeX{\La\kern-.15em\TeX}
1656 \ifnewl@tex \else \def\LaTeX{\La\kern-.15em\TeX}\fi
1657 %\def\jLaTeX{\leavevmode\lower.46ex\hbox{J}\kern-.08em\LaTeX}
1658 \ifnewl@tex
1659 \DeclareRobustCommand{\jLaTeX}%
1660 {\leavevmode\lower.46ex\hbox{J}\kern-.08em\LaTeX}
1661 \else
1662 \def\jLaTeX{\leavevmode\lower.46ex\hbox{J}\kern-.08em\LaTeX}

1663 \fi

\PiC \PiCTeX
1664 \def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC}
1665 %\def\PiCTeX{\PiC\kern-.11em\TeX}
1666 \ifnewl@tex
1667 \DeclareRobustCommand{\PiCTeX}{\PiC\kern-.11em\TeX}
1668 \else
1669 \def\PiCTeX{\PiC\kern-.11em\TeX}

1670 \fi

\tpic \PiCTeX
1671 %\def\tpic{\TestCount=\fam \leavevmode T%
1672 % \hbox{$\fam\TestCount\scriptstyle
1673 %\kern-.025em P\kern-.025em I\kern-.025emC$}}
1674 \ifnewl@tex
1675 \DeclareRobustCommand{\tpic}{T\hbox{$\m@th$%
1676 \csname S@\f@size\endcsname\fontsize\sf@size\z@
1677 \math@fontsfalse\selectfont
1678 \kern-.025em P\kern-.025em I\kern-.025emC}}
1679 \else
1680 \def\tpic{\ifnum \fam=\m@ne \fam=\z@ \fi%
1681  \TestCount=\fam \leavevmode%
1682  \edef\aaa{\fontname\scriptfont\fam}%
1683  \edef\bbb{\fontname\textfont\fam}%
1684 \resetfontsize\hbox{$\fam=\TestCount\textstyle T$}%
1685 \ifx\aaa\bbb\hbox{\tmpf@ntsize\bf$\fam=\TestCount%
1686  \kern-.025em P\kern-.025em I\kern-.025emC$}\else%
1687 \hbox{$\fam\TestCount\scriptstyle%
1688  \kern-.025em P\kern-.025em I\kern-.025emC$}\fi}

1689 \fi

\Post \Script \PostScript
1690 \ifnewl@tex \else
1691 \def\Post{\ifnum \fam=\m@ne \fam=\z@ \fi%
1692  \TestCount=\fam\leavevmode%
1693  \edef\aaa{\fontname\scriptfont\fam}%
1694  \edef\bbb{\fontname\textfont\fam}%
1695 \resetfontsize%
1696 \hbox{$\fam=\TestCount\textstyle P$}%
1697 \ifx\aaa\bbb%
1698 \hbox{\tmpf@ntsize\bf%
1699 $\fam=\TestCount\kern-.045em O\kern-.015em ST$}%
1700 \else%
1701 \hbox{$\fam\TestCount%
1702 \scriptstyle\kern-.045em O\kern-.015em ST$}%
1703 \fi}
1704 \def\Script{\ifnum \fam=\m@ne \fam=\z@ \fi%
1705  \TestCount=\fam\leavevmode%
1706  \edef\aaa{\fontname\scriptfont\fam}%
1707  \edef\bbb{\fontname\textfont\fam}%
1708 \resetfontsize%
1709 \hbox{$\fam=\TestCount\textstyle S$}%
1710 \ifx\aaa\bbb%
1711 \hbox{\tmpf@ntsize\bf$\fam=\TestCount\kern-.035em %
1712  C\kern-.015em R\kern-.015em IP\kern-.035em T$}%
1713 \else%
1714 \hbox{$\fam\TestCount\scriptstyle\kern-.035em %
1715 C\kern-.015em R\kern-.015em IP\kern-.035em T$}%
1716 \fi}

1717 \fi

1718 %\def\PostScript{\Post\Script}
1719 % %%%%%1996/04/20 by Shinsaku Fujita%%%%%%%%%%%%%%%%%%%%%%%%%%%
1720 \ifnewl@tex

1721 \DeclareRobustCommand{\PostScript}{P\hbox{$\m@th$%
1722  \csname S@\f@size\endcsname\fontsize\sf@size\z@
1723  \math@fontsfalse\selectfont
1724  \kern-.045em O\kern-.015em ST}S\hbox{$\m@th$%
1725  \csname S@\f@size\endcsname\fontsize\sf@size\z@
1726  \math@fontsfalse\selectfont
1727  \kern-.035em C\kern-.015em R\kern-.015em IP\kern-.035em T}}
1728 \else
1729 \def\PostScript{\Post\Script}

1730 \fi

20 Double and triple bonds

\triplebond \doublebond \tbond \dbond
1731 % *****************

1732 % * 二重三重結合 *

1733 % *****************
1734 \def\triplebond{\leavevmode\kern.2pt\raisebox{.2ex}{%
1735 \hbox{\vbox{\hrule height.03ex width1em\kern.4ex
1736 \hrule height.03ex width1em\kern.4ex
1737 \hrule height.03ex width1em}}}\hskip.4pt}
1738 \def\doublebond{\leavevmode\kern.2pt\raisebox{.3ex}{%
1739 \hbox{\vbox{\hrule height.03ex width1em\kern.6ex
1740 \hrule height.03ex width1em}}}\hskip.4pt}
1741 \let\tbond=\triplebond
1742 \let\dbond=\doublebond

The following macros are supported only by the chmst-ps pacakage.

1743 %\let\reactDEqarrow=\reactdeqarrow
1744 %\let\reactUEqarrow=\reactueqarrow
1745 %\let\reactVEqarrow=\reactveqarrow
1746 %\let\reactREqarrow=\reactreqarrow
1747 %\let\reactLEqarrow=\reactleqarrow
1748 %\let\reactEqarrow=\reacteqarrow
1749 %\let\lllongleftharpoonup=\lllongleftarrow
1750 %\let\lllongrightharpoondown=\lllongrightarrow
1751 %\let\llongleftharpoonup=\llongleftarrow
1752 %\let\llongrightharpoondown=\llongrightarrow

21 Initial Setting and Switch to Arrows of Original Styles

\chemistsw
1753 \def\chemistsw{%setting of the chemist package
1754 \let\reactrarrow=\oldreactrarrow%
1755 \let\reactlarrow=\oldreactlarrow
1756 \let\reactlrarrow=\oldreactlrarrow
1757 \let\reacteqarrow=\oldreacteqarrow
1758 %%%%
1759 \let\reactreqarrow=\oldreactreqarrow%
1760 \let\reactleqarrow=\oldreactleqarrow

1761 %%%%
1762 \let\reactdarrow=\oldreactdarrow%
1763 \let\reactuarrow=\oldreactuarrow
1764 \let\reactveqarrow=\oldreactveqarrow
1765 \let\reactduarrow=\oldreactduarrow
1766 %%%%
1767 \let\reactsearrow=\oldreactsearrow%
1768 \let\reactnwarrow=\oldreactnwarrow
1769 \let\reactnearrow=\oldreactnearrow
1770 \let\reactswarrow=\oldreactswarrow
1771 %%%%
1772 \let\reactdeqarrow=\oldreactdeqarrow%
1773 \let\reactueqarrow=\oldreactueqarrow
1774 \let\reactulrarrow=\oldreactulrarrow
1775 \let\reactdlrarrow=\oldreactdlrarrow
1776 %%%%
1777 \let\schemelarrow=\oldschemelarrow%
1778 \let\schemerarrow=\oldschemerarrow
1779 \let\schemelrarrow=\oldschemelrarrow
1780 %%%%
1781 \let\llongrightarrow=\oldllongrightarrow%%%--->%
1782 \let\llongleftarrow=\oldllongleftarrow%%%<---
1783 \let\llongleftrightarrow=\oldllongleftrightarrow%%%<--->
1784 \let\Equilibarrow=\oldEquilibarrow%%%<--- and --->
1785 \let\Llongrightarrow=\oldLlongrightarrow%%%===>
1786 \let\Llongleftarrow=\oldLlongleftarrow%%%<===
1787 \let\Llongleftrightarrow=\oldLlongleftrightarrow%%<===>
1788 %%%%%
1789 \let\llongleftharpoondown=\oldllongleftharpoondown%%% /---%
1790 \let\llongrightharpoonup=\oldllongrightharpoonup%%%---/
1791 \let\equilibarrow=\oldequilibarrow%%% /--- and ---/
1792 %%%%%
1793 \let\lllongrightarrow=\oldlllongrightarrow%%%%------>%
1794 \let\lllongleftarrow=\oldlllongleftarrow%%%<-------
1795 \let\lllongleftrightarrow=\oldlllongleftrightarrow%%%<------->
1796 \let\Equiliblongarrow=\oldEquiliblongarrow%%%<------- and ------->
1797 \let\Lllongrightarrow=\oldLllongrightarrow%%%=======>
1798 \let\Lllongleftarrow=\oldLllongleftarrow%%%<=======
1799 \let\Lllongleftrightarrow=\oldLllongleftrightarrow%%<=======>
1800 %%%%%
1801 \let\lllongleftharpoondown=\oldlllongleftharpoondown%%% /-------%
1802 \let\lllongrightharpoonup=\oldlllongrightharpoonup%%%-------/
1803 \let\equiliblongarrow=\oldequiliblongarrow%%% /------ and ------/
1804 %%%%tentative setting
1805 \let\reactDEqarrow=\oldreactdeqarrow
1806 \let\reactUEqarrow=\oldreactueqarrow
1807 \let\reactVEqarrow=\oldreactveqarrow
1808 \let\reactREqarrow=\oldreactreqarrow
1809 \let\reactLEqarrow=\oldreactleqarrow
1810 \let\reactEqarrow=\oldreacteqarrow
1811 \let\lllongleftharpoonup=\oldlllongleftarrow
1812 \let\lllongrightharpoondown=\oldlllongrightarrow
1813 \let\llongleftharpoonup=\oldllongleftarrow
1814 \let\llongrightharpoondown=\oldllongrightarrow

1815 %%%%

1816 }

Initial setting:

1817 \chemistsw%setting of the chemist package
1818 \mathversion{normal}

1819 ⟨/chemist⟩