Chemistry Conventions by xymtx-ps.sty (v4.05) of XΥMTEX

Shinsaku Fujita Shonan Institute of Chemoinformatics Mathematical Chemistry,

Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun, Kanagawa-Ken, 258-0019 Japan

2009/11/05

1 Introduction

1.1 Options for docstrip

option  function
xymtxps xymtx-ps.sty
driver  driver for this dtx file

1.2 Version Information

1 ⟨∗xymtxps⟩

2 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 \def\j@urnalname{xymtx-ps}
4 \def\versi@ndate{November 05, 2009}
5 \def\versi@nno{ver4.05}
6 \def\copyrighth@lder{SF} % Shinsaku Fujita
7 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 \typeout{XyMTeX Macro File `\j@urnalname' (\versi@nno) <\versi@ndate>%
9 \space[\copyrighth@lder]}

2 Input of basic macros

To assure the compatibility to L^{A}TEX2.09 (the native mode), the commands added by L^{A}TEX 2ε have not been used in the resulting sty files (ccycle.sty for the present case). Hence, the combination of \input and \@ifundefined is used to crossload sty files (chemstr.sty for the present case) in place of the \RequirePackage command of L^{A}TEX 2ε. The global setting of unit by \psset has caused imcompatibility with the prosper package and so has been changed into a local setting.

10 % *************************
11 % * input of basic macros *
12 % *************************
13 \@ifundefined{setsixringv}{\input chemstr.sty\relax}{}
14 \RequirePackage{pstricks}
15 \RequirePackage{pst-coil}
16 \unitlength=0.1pt
17 %%\psset{xunit=\the\unitlength,yunit=\the\unitlength}%delete August 2, 2005

18 \newif\if@thicklinesw \@thicklineswfalse
19 \def\Thick@Lines{\@thicklineswtrue}%redefinition
20 \def\Thin@Lines{\@thicklineswfalse}%redefinition
21 \def\thickLineWidth{1.6pt}
22 \def\thinLineWidth{0.4pt}

The macro \Put@@@Line can draw dashed bonds or wedged bonds for supporting stereochemistry. Two switches are available as follows:

changedashtowedge
changewedgetodash
23 \newif\if@wedgesw \@wedgeswtrue
24 \newif\if@hasheddashsw \@hasheddashswtrue
25 \def\wedgehasheddash{\@wedgeswtrue\@hasheddashswtrue}
26 \def\wedgehashedwedge{\@wedgeswtrue\@hasheddashswfalse}
27 \def\dashhasheddash{\@wedgeswfalse\@hasheddashswtrue}
28 \@ifundefined{ifmolfront}{\newif\ifmolfront \molfrontfalse}{}
29 \@ifundefined{if@skbondlist}{\newif\if@skbondlist \@skbondlistfalse}{}
Put@@@Line
30 \newcount\@tempcntXa \newcount\@tempcntYa \newcount\@tempcntz
31 \newcount\@tempcntXb \newcount\@tempcntYb \newcount\@tempcntzz
32 \newcount\@tempcntXc \newcount\@tempcntYc \newcount\@tempcntzzz
33 \long\gdef\Put@@@Line(#1,#2)(#3,#4)#5{%
34 \begingroup
35 %%x-coordinate
36 \@tempcntXa=0\relax
37 \ifnum#3>0\relax \@tempcntXa=#5\relax
38 \else\ifnum#3<0\relax\@tempcntXa=-#5\relax\fi\fi
39 \advance\@tempcntXa by#1\relax
40 %%y-coordinate
41 \@tempcntYa=#5\relax
42 \ifnum#3=0\relax\else
43 \multiply\@tempcntYa by#4\relax\multiply\@tempcntYa by10\relax
44 \divide\@tempcntYa by#3\relax\divide\@tempcntYa by10\relax\fi
45 \ifnum\@tempcntYa<0\relax
46 \ifnum#4>0\relax\@tempcntYa=-\@tempcntYa\fi
47 \else
48 \ifnum\@tempcntYa>0\relax
49 \ifnum#4<0\relax\@tempcntYa=-\@tempcntYa\fi\fi
50 \fi
51 \advance\@tempcntYa by#2\relax

52 %

53 \if@thicklinesw
54 \if@wedgesw
55 \ifmolfront%bold dash bond for skeletal bond for pyranose etc.
56 \psline[unit=\unitlength,linewidth=\thickLineWidth](#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
57 \else
58 \if@skbondlist%bold dash bond skeletal bond for general cases
59 \psline[unit=\unitlength,linewidth=\thickLineWidth](#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
60 \else%wedged bond
61 \stereo@wedgedimension(#3,#4){10}%
62 \pspolygon*[unit=\unitlength](#1,#2)%
63 (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)
64 \fi\fi

65 \else
66 \psline[unit=\unitlength,linewidth=\thickLineWidth](#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
67 \fi
68 \else
69 \ifwavebond
70 \pszigzag[unit=\unitlength,coilheight=1,coilwidth=.13cm,linewidth=\thinLineWidth,linearc=5,%
71 coilarm=0]{-}(\the\@tempcntXa,\the\@tempcntYa)(#1,#2)%
72 \else
73 \psline[unit=\unitlength,linewidth=\thinLineWidth](#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
74 \fi
75 \fi
76 \@tempcntXa=0\relax \@tempcntYa=0\relax
77 \endgroup}%end of Put@@@Line

The macro \stereo@wedgedimension calculates the coordinates of three positions for drawing a wedged bond, which is drawn by the \pspolygon command of the PSTricks package.

stereo@wedgedimension
78 \newif\if@wedgeadjust
79 \def\stereo@wedgedimension(#1,#2)#3{%
80 \@tempcntXb=0\relax
81 \@tempcntYb=0\relax
82 \@tempcntXc=0\relax
83 \@tempcntYc=0\relax
84 %%
85 \@wedgeadjustfalse
86 \ifnum#1<0 \@tempcntzz=-#1\else\@tempcntzz=#1\fi
87 \ifnum#2<0 \@tempcntzzz=-#2\else\@tempcntzzz=#2\fi
88 \ifnum#1=0\else
89 \multiply\@tempcntzzz by10\relax \divide\@tempcntzzz by\@tempcntzz\fi%% (3/5)x10=6
90 \ifnum\@tempcntzzz>7\relax\else\@wedgeadjusttrue\fi
91 %%one point of wedge
92 \ifnum#1=0\relax
93 \@tempcntXb=#3 \advance\@tempcntXb by8\relax
94 \@tempcntYb=0\relax
95 \else
96 \ifnum#2=0\relax
97 \@tempcntXb=0\relax
98 \@tempcntYb=#3 \advance\@tempcntYb by8\relax
99 \else
100 \@tempcntXb=#3\relax
101 \@tempcntYb=-#3\relax
102 \if@wedgeadjust
103 \advance\@tempcntXb by8\relax
104 \advance\@tempcntYb by-8\relax
105 \fi
106 \multiply\@tempcntXb by#2\relax\multiply\@tempcntXb by10\relax
107 \divide\@tempcntXb by#1\relax\divide\@tempcntXb by10\relax\fi\fi
108 \advance\@tempcntXb by\@tempcntXa\relax
109 \advance\@tempcntYb by\@tempcntYa\relax
110 %%other point of wedge
111 \ifnum#1=0\relax
112 \@tempcntXc=-#3 \advance\@tempcntXc by-8\relax

113 \@tempcntYc=0\relax
114 \else
115 \ifnum#2=0\relax
116 \@tempcntXc=0\relax
117 \@tempcntYc=-#3 \advance\@tempcntYc by-8\relax
118 \else
119 \@tempcntXc=-#3\relax
120 \@tempcntYc=#3\relax
121 \if@wedgeadjust
122 \advance\@tempcntXc by-6\relax
123 \advance\@tempcntYc by6\relax
124 \fi
125 \multiply\@tempcntXc by#2\relax\multiply\@tempcntXc by10\relax
126 \divide\@tempcntXc by#1\relax\divide\@tempcntXc by10\relax\fi\fi
127 \advance\@tempcntXc by\@tempcntXa\relax
128 \advance\@tempcntYc by\@tempcntYa\relax
129 }%%end of \stereo@wedgedimension

The optional argument [Bl] of \Put@@@Direct is corrected to be [bl]. This effect appears in the use of tbook.cls etc.

Put@@@Direct
130 % \def\Put@@@Direct(#1,#2)#3{\begingroup\psset{unit=\unitlength}%
131 % \rput[Bl]{0}(#1,#2){#3}\endgroup}%2009/06/15 2009/11/05bugfix as follows
132 \@ifundefined{iftdir}{\newif\iftdir \tdirfalse}{}%pLaTeXe vs. LaTeXe
133 \def\Put@@@Direct(#1,#2)#3{\begingroup\psset{unit=\unitlength}%
134 \iftdir
135 \rput[bl]{0}(#1,#2){#3}\else\rput[Bl]{0}(#1,#2){#3}\fi
136 \endgroup}
137 \def\Put@@@oCircle(#1,#2)#3{%
138 \begingroup \@tempcntz=#3 \divide\@tempcntz by2\relax
139 \pscircle[linewidth=.4pt,unit=\unitlength](#1,#2){\@tempcntz}\endgroup}
140 \def\Put@@@sCircle(#1,#2)#3{%
141 \begingroup \@tempcntz=#3 \divide\@tempcntz by2\relax
142 \pscircle[linewidth=2pt,unit=\unitlength](#1,#2){\@tempcntz}\endgroup}

Dotted lines by the old macro \d@@t@rline are changed into hashed dash

 bonds in the new macro \d@@t@rline (\@wedgeswfalse). If \@wedgeswtrue is

declared (default), the new macro draws a hashed wedged bonds.

d@@t@rline
143 \def\d@@t@rline(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
144 \if@hasheddashsw
145 \@ifundefined{psline}{%
146 \XyMTeXWarning{A dottedline is replaced by a solid line.}%
147  \Put@Line(#1,#2)(#3,#4){#5}%
148  }{{\thicklines%
149  \hasheddashbond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)}}%
150 \else
151 \if@skbondlist%hashed dash bond skeletal bond for general cases
152 \@ifundefined{psline}{%
153 \XyMTeXWarning{A dottedline is replaced by a solid line.}%
154  \Put@Line(#1,#2)(#3,#4){#5}%
155  }{{\thicklines%

156  \hasheddashbond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)}}%
157 \else
158 \hashedwedgebond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)%
159 \fi\fi
160 }%end of \d@@t@rline

The inner macro \hasheddashbond works in the macro \d@@t@rline for drawing a hased dash bond.

hasheddashbond
161 \def\hasheddashbond(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
162 \begingroup
163 \@tempcntzz=12\relax
164 \@tempcntzzz=-30\relax%almost no shortening
165 \bond@shorten(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)%
166 \ifdim\unitlength>0.08pt
167 \psline[unit=\unitlength,linewidth=\thickLineWidth,linestyle=dashed,dash=1pt 1.2pt]%
168 (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
169 \else
170 \psline[unit=\unitlength,linewidth=\thickLineWidth,linestyle=dashed,dash=1pt 1.2pt]%
171 (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
172 \fi
173 \endgroup}

The inner macro \hashedwedgebond works in the macro \d@@t@rline for drawing a hashed wedged bond.

hashedwedgebond
174 \def\hashedwedgebond(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
175 \begingroup
176 \@tempcntXa=#8\relax
177 \@tempcntYa=#9\relax
178 \stereo@wedgedimension(#3,#4){10}%
179 \pspolygon*[unit=\unitlength](#1,#2)(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
180 \@tempcntzz=5\relax
181 \@tempcntzzz=-12\relax
182 \bond@shorten(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)%
183 \ifdim\unitlength>0.08pt
184 \psline[unit=\unitlength,linewidth=3.8pt,linestyle=dashed,dash=0.8pt 1pt,linecolor=white]%
185 (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
186 \else
187 \psline[unit=\unitlength,linewidth=3pt,linestyle=dashed,dash=0.6pt 0.8pt,linecolor=white]%
188 (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
189 \fi
190 \endgroup
191 }%%end of \hashedwedgebond

The inner macro \bond@shorten works in the macros \hasheddashbond and \hashedwedgebond for shortening the resulting hashed bonds. This macro calculates the coordinates of the staring point and the end point.

bond@shorten
192 \def\bond@shorten(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
193 \@tempcntXb=#8\relax

194 \@tempcntYb=#9\relax
195 \advance\@tempcntXb by-#6\relax \divide\@tempcntXb by\@tempcntzz\relax
196 \advance\@tempcntYb by-#7\relax \divide\@tempcntYb by\@tempcntzz\relax
197 \advance\@tempcntXb by#6\relax
198 \advance\@tempcntYb by#7\relax
199 \@tempcntXc=#8\relax
200 \@tempcntYc=#9\relax
201 \advance\@tempcntXc by-#6\relax \divide\@tempcntXc by\@tempcntzzz\relax
202 \advance\@tempcntYc by-#7\relax \divide\@tempcntYc by\@tempcntzzz\relax
203 \advance\@tempcntXc by#8\relax
204 \advance\@tempcntYc by#9\relax
205 }%%end of \bondshorten

Skeletal bold bonds can be changed into wedges, where \WedgeAsSubst is described in an ATOMLIST as a kind of spiro substituent.

WedgeAsSubst
206 \def\WedgeAsSubst(#1,#2)(#3,#4)#5{%
207 \begingroup
208 \@thicklineswtrue \@wedgeswtrue
209 \molfrontfalse \@skbondlistfalse
210 \Put@@@Line(#1,#2)(#3,#4){#5}%
211 \endgroup}

Skeletal hashed dash bonds can be changed into hashed wedges, where \HashWedgeAsSubst is described in an ATOMLIST as a kind of spiro substituent.

HashWedgeAsSubst
212 \def\HashWedgeAsSubst(#1,#2)(#3,#4)#5{%
213 \begingroup
214 \@thicklineswtrue \@wedgeswtrue
215 \molfrontfalse \@skbondlistfalse
216 \Put@@@Line(#1,#2)(#3,#4){#5}%
217 %%x-coordinate
218 \@tempcntXa=0\relax
219 \ifnum#3>0\relax \@tempcntXa=#5\relax
220 \advance\@tempcntXa by-10\relax
221 \else\ifnum#3<0\relax\@tempcntXa=-#5\relax\fi\fi
222 \advance\@tempcntXa by#1\relax
223 %%y-coordinate
224 \@tempcntYa=#5\relax
225 \advance\@tempcntYa by-10\relax
226 \ifnum#3=0\relax\else
227 \multiply\@tempcntYa by#4\relax\multiply\@tempcntYa by10\relax
228 \divide\@tempcntYa by#3\relax\divide\@tempcntYa by10\relax\fi
229 \ifnum\@tempcntYa<0\relax
230 \ifnum#4>0\relax\@tempcntYa=-\@tempcntYa\fi
231 \else
232 \ifnum\@tempcntYa>0\relax
233 \ifnum#4<0\relax\@tempcntYa=-\@tempcntYa\fi\fi
234 \fi
235 \advance\@tempcntYa by#2\relax
236 \ifdim\unitlength>0.08pt
237 \psline[unit=\unitlength,linewidth=5pt,linestyle=dashed,dash=0.8pt 1pt,linecolor=white]%

238 %%(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
239 (#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
240 \else
241 \psline[unit=\unitlength,linewidth=3pt,linestyle=dashed,dash=0.6pt 0.8pt,linecolor=white]%
242 %%(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
243 (#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
244 \fi
245 \endgroup
246 }%%end of \HashWedgeAsSubst

The command \downnobond is redefined for pstricks.

\upnobond \downnobond
247 %\def\upnobond#1#2{%nochange
248 %\hbox{\hbox to0.72em{\hss#1\hss}\kern-0.72em\raise2.2ex\hbox{#2}}}
249 \def\downnobond#1#2{%
250 \hbox{\smash{\hbox to0.72em{\hss#1\hss}\kern-0.72em\lower2.2ex\hbox{#2}}}}

The command \changeunitlength is redefined for using pstricks.

\changeunitlength
251 \newif\ifsizereduction\sizereductionfalse
252 \def\@@changeunitlength#1{\unitlength=#1\relax
253 %%\psset{unit=\unitlength}%delete August 02, 2005
254 \ifdim\unitlength<0.1pt \sizereductiontrue
255 \ifdim\unitlength<0.062pt \let\substfontsize=\tiny \else
256 \ifdim\unitlength<0.072pt \let\substfontsize=\scriptsize \else
257 \ifdim\unitlength<0.082pt \let\substfontsize=\footnotesize
258 \fi\fi\fi
259 \else \let\substfontsize=\normalsize\fi}
setxymtxps
260 \def\setxymtxps{%
261 \@ifnextchar[{\@setxymtxps}{\@setxymtxps[0.1pt]}}
262 \def\@setxymtxps[#1]{%
263 \let\sfpicture=\picture
264 \let\endsfpicture=\endpicture
265 \let\thicklines=\Thick@Lines
266 \let\thinlines=\Thin@Lines
267 \let\Put@Line=\Put@@@Line
268 \let\Put@Direct=\Put@@@Direct
269 \let\Put@oCircle=\Put@@@oCircle
270 \let\Put@sCircle=\Put@@@sCircle
271 \let\dotorline=\d@@t@rline
272 \let\changeunitlength=\@@changeunitlength
273 \changeunitlength{#1}%
274 \wedgehasheddash%

275 }

276 \setxymtxps

277 ⟨/xymtxps⟩