1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
|
%%
%% This is file `xymtx-pdf.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xymtx-pdf.dtx (with options: `xymtxpdf')
%%
%% This is a generated file.
%%
%% Copyright (C) 2002,2004,2005,2009,2010,2013 by Shinsaku Fujita
%% all rights reserved.
%%
%% This file is part of the XyMTeX system.
%% =======================================
%% This style file is created for drawing chemical structural formulas.
%% This style file is to be contained in the ``xymtex'' directory which
%% is an input directory for TeX.
%%
%% Old versions (as xymtx-ps.dtx etc.):
%% Version 1.00 Released on April 30, 2002
%% Version 4.01 Released on August 30, 2004 (adjust for XyMTeX version 4.01)
%% Version 4.02 Released on December 20, 2004 (wedged bonds for stereochemistry)
%% Version 4.03 Released on July 20, 2005 (wave line for stereochemistry)
%% Version 4.03a Released on August 02, 2005 (Bug fix)
%% Version 4.04a Released on June 15, 2009 (Bug fix)
%% Version 4.05 Released on November 05, 2009 (Bug fix)
%% Version 5.00 Released on October 01, 2010
%% Version 5.00b Released on November 23, 2010
%% Version 5.01b Released on March 10, 2013
%% Version 5.01bb Released on May 27, 2013
%%
%% Present version (as xymtx-pdf.dtx etc.):
%% Version 5.01 Released on June 21, 2013
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%% The Current Maintainer of this work is Shinsaku Fujita.
%%
%% This work consists of the files xymtx-pdf.dtx and xymtx-pdf.ins
%% and the derived file xymtx-pdf.sty.
%%
%% =======================================
%%
%% File: xymtx-pdf.dtx
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\def\j@urnalname{xymtx-pdf}
\def\versi@ndate{June 21, 2013}
\def\versi@nno{ver5.01}
\def\copyrighth@lder{SF} % Shinsaku Fujita
\typeout{XyMTeX Macro File `\j@urnalname' (\versi@nno) <\versi@ndate>%
\space[\copyrighth@lder]}
\@ifundefined{setsixringv}{\input chemstr.sty\relax}{}
\RequirePackage{tikz}
\RequirePackage{pgfcore}%%%added 2010/11/23 by S. Fujita
\RequirePackage{xcolor}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,calc}
\unitlength=0.1pt
\def\white{\color{white}}
\newif\if@thicklinesw \@thicklineswfalse
\def\Thick@Lines{\@thicklineswtrue}%redefinition
\def\Thin@Lines{\@thicklineswfalse}%redefinition
\def\thickLineWidth{1.6pt}
\def\thinLineWidth{0.4pt}
\newcount\XyMTeXnuma
\newcount\XyMTeXnumb
\newcount\XyMTeXnumc
\newcount\XyMTeXnumd
\newcount\XyMTeXnume
\newcount\XyMTeXnumf
\newcount\XyMTeXnumg
\newcount\XyMTeXnumh
\newcount\XyMTeXnumi
\newcount\XyMTeXcnta
\newcount\XyMTeXcntb
\newdimen\XyMTeXdima
\newdimen\XyMTeXdimb
\newdimen\XyMTeXdimc
\newdimen\XyMTeXdimd
\newdimen\XyMTeXdime
\newbox\BondBox
\newif\if@wedgesw \@wedgeswtrue
\newif\if@hasheddashsw \@hasheddashswtrue
\def\wedgehasheddash{\@wedgeswtrue\@hasheddashswtrue}
\def\wedgehashedwedge{\@wedgeswtrue\@hasheddashswfalse}
\def\dashhasheddash{\@wedgeswfalse\@hasheddashswtrue}
\@ifundefined{ifmolfront}{\newif\ifmolfront \molfrontfalse}{}
\@ifundefined{if@skbondlist}{\newif\if@skbondlist \@skbondlistfalse}{}
\def\NumRound#1.#2#3\@nil{%shishagonyu
\begingroup
\XyMTeXcnta=0 \XyMTeXcntb=0
\XyMTeXcnta=#1 %%\typeout{A:\the\XyMTeXcnta;}
\XyMTeXcntb=#2 %%\typeout{B:\the\XyMTeXcntb;}
\ifnum\XyMTeXcntb<5 \else
\advance\XyMTeXcnta by1 %%\typeout{C:\the\XyMTeXcnta;}
\fi\xdef\@UHalfScale{\the\XyMTeXcnta}\endgroup}
{\catcode`\p=12 \catcode`\t=12
\gdef\UHalfScaleGain#1pt{\gdef\@@UHalfScale{#1}}}
\def\setUnitHalfScale#1{%
\@tempdima=#1 \dimen0=0.1pt
\@tempcnta=\@tempdima
\@tempcntb=\dimen0
\multiply\@tempcntb by10
\divide\@tempcntb by65536%
\divide\@tempdima by \@tempcntb
\multiply\@tempdima by5 %%\typeout{D:\the\@tempdima}
\expandafter\UHalfScaleGain\the\@tempdima%
\expandafter\NumRound\@@UHalfScale\@nil
}
\def\PutSimpleBondBox(#1,#2)(#3,#4)#5{%for simple bonds
\setbox\BondBox=\hbox{#5}%
\XyMTeXdima=#1\unitlength
\XyMTeXdimb=#3\unitlength
\XyMTeXdimc=\thickLineWidth
\divide\XyMTeXdimc by2%adjustment by the half of a line width
\ifdim \XyMTeXdima>\XyMTeXdimb\relax
\XyMTeXdimd=\XyMTeXdima
\XyMTeXdime=\XyMTeXdimb
\advance\XyMTeXdime by -\XyMTeXdimd
\advance\XyMTeXdime by -\XyMTeXdimc
\put(#1,#2){\kern\XyMTeXdime\box\BondBox}%
\else
\ifdim \XyMTeXdima=\XyMTeXdimb\relax
\XyMTeXdimd=-\XyMTeXdimc
%%%\put(#1,#2){\kern\XyMTeXdimd\raise\XyMTeXdimd\hbox{\box\BondBox}}%
\put(#1,#2){\kern\XyMTeXdimd\box\BondBox}%
\else
\XyMTeXdimd=-\XyMTeXdimc
\put(#1,#2){\kern\XyMTeXdimd\box\BondBox}%
\fi\fi%
}
\def\tikznodimension#1{\tikz{%
\pgfpathrectangle{\pgfpointorigin}{\pgfpointorigin}
\pgfusepath{use as bounding box} % draws nothing
#1}}
\def\PUT@@@@bondLINE(#1,#2)(#3,#4)#5{%
\begingroup
\tikznodimension{%
\draw[line width=#5]%
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}%
\endgroup
}
\let\PutPDFLine=\PUT@@@@bondLINE%for user's use
\let\PutBondLine=\PUT@@@@bondLINE%for user's use
\def\PutBondBox(#1,#2)(#3,#4)#5{%for wedge and wavy bonds
\setbox\BondBox=\hbox{#5}%
\XyMTeXdima=#1\unitlength
\XyMTeXdimb=#3\unitlength
\XyMTeXdimc=4pt%
\divide\XyMTeXdimc by2%adjustment by the half of a line width
\if@vertbond
\XyMTeXdimd=\wd\BondBox
\divide\XyMTeXdimd by2\relax
\put(#1,#2){\kern-1.2\XyMTeXdimd\box\BondBox}%%tentative factor 1.2
\else
\if@horizbond
\ifdim \XyMTeXdima>\XyMTeXdimb\relax
\XyMTeXdimd=\XyMTeXdima
\XyMTeXdime=\XyMTeXdimb
\advance\XyMTeXdime by -\XyMTeXdimd
\put(#1,#2){\kern-5\unitlength\kern\XyMTeXdime\box\BondBox}%tentative factor 5 %%%
\else
\put(#1,#2){\kern-1.2\unitlength\box\BondBox}%tentative factor 1.2
\fi
\else
%%
\ifdim \XyMTeXdima>\XyMTeXdimb\relax
\XyMTeXdime=-\wd\BondBox
\put(#1,#2){\kern0.2\unitlength\kern\XyMTeXdime\box\BondBox}%tentative shift factor
\else
\ifdim \wd\BondBox<4.3pt\relax
\XyMTeXdimd=\wd\BondBox
\divide\XyMTeXdimd by2\relax
\put(#1,#2){\kern-1.3\XyMTeXdimd\box\BondBox}%tentative shift factor 1.3
\else
\put(#1,#2){\kern-3\unitlength\box\BondBox}%tentative shift factor 3
\fi\fi
\fi\fi}
\newif\if@vertbond \@vertbondfalse
\newif\if@horizbond \@horizbondfalse
\def\PUT@@@@wedgeLINE(#1,#2)(#3,#4)(#5,#6){%
\begingroup
\tikznodimension{%
\filldraw%
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength)%
-- (#5\unitlength,#6\unitlength) -- (#1\unitlength,#2\unitlength);}%
\endgroup
}
\def\PUT@@@@wavyLINE(#1,#2)(#3,#4){%
\begingroup
\tikznodimension{%
\draw[decorate,
decoration={coil,aspect=0,segment length=2pt,amplitude=1pt}]%
(#1\unitlength,#2\unitlength) coordinate (X) -- (#3\unitlength,#4\unitlength);}%
\endgroup
}
\newcount\@tempcntXa \newcount\@tempcntYa \newcount\@tempcntz
\newcount\@tempcntXb \newcount\@tempcntYb \newcount\@tempcntzz
\newcount\@tempcntXc \newcount\@tempcntYc \newcount\@tempcntzzz
\long\gdef\Put@@@@Line(#1,#2)(#3,#4)#5{%
\begingroup
%%x-coordinate
\@tempcntXa=0\relax
\ifnum#3>0\relax \@tempcntXa=#5\relax
\else\ifnum#3<0\relax\@tempcntXa=-#5\relax\fi\fi
\advance\@tempcntXa by#1\relax
%%y-coordinate
\@tempcntYa=#5\relax
\ifnum#3=0\relax\else
\multiply\@tempcntYa by#4\relax\multiply\@tempcntYa by10\relax
\divide\@tempcntYa by#3\relax\divide\@tempcntYa by10\relax\fi
\ifnum\@tempcntYa<0\relax
\ifnum#4>0\relax\@tempcntYa=-\@tempcntYa\fi
\else
\ifnum\@tempcntYa>0\relax
\ifnum#4<0\relax\@tempcntYa=-\@tempcntYa\fi\fi
\fi
\advance\@tempcntYa by#2\relax
\if@thicklinesw
\if@wedgesw
\ifmolfront%bold dash bond for skeletal bond for pyranose etc.
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thickLineWidth}%
\else
\if@skbondlist%bold dash bond skeletal bond for general cases
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thickLineWidth}%
\else%wedged bond
\ifnum#1=#3
\@vertbondtrue\@horizbondfalse
\else
\ifnum#2=#4
\@vertbondfalse\@horizbondtrue
\else
\@vertbondfalse\@horizbondfalse
\fi\fi
\stereo@wedgedimension(#3,#4){10}%
\PUT@@@@wedgeLINE(#1,#2)(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
\fi\fi
\else
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thickLineWidth}%
\fi
\else
\ifwavebond
\ifnum#1=#3
\@vertbondtrue\@horizbondfalse
\else
\ifnum#2=#4
\@vertbondfalse\@horizbondtrue
\else
\@vertbondfalse\@horizbondfalse
\fi\fi
\PUT@@@@wavyLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
\else
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thinLineWidth}%
\fi
\fi
\@tempcntXa=0\relax \@tempcntYa=0\relax
\endgroup}%end of Put@@@@Line
\newif\if@wedgeadjust
\def\stereo@wedgedimension(#1,#2)#3{%
\@tempcntXb=0\relax
\@tempcntYb=0\relax
\@tempcntXc=0\relax
\@tempcntYc=0\relax
%%
\@wedgeadjustfalse
\ifnum#1<0 \@tempcntzz=-#1\else\@tempcntzz=#1\fi
\ifnum#2<0 \@tempcntzzz=-#2\else\@tempcntzzz=#2\fi
\ifnum#1=0\else
\multiply\@tempcntzzz by10\relax \divide\@tempcntzzz by\@tempcntzz\fi%% (3/5)x10=6
\ifnum\@tempcntzzz>7\relax\else\@wedgeadjusttrue\fi
%%one point of wedge
\ifnum#1=0\relax
\@tempcntXb=#3 \advance\@tempcntXb by8\relax
\@tempcntYb=0\relax
\else
\ifnum#2=0\relax
\@tempcntXb=0\relax
\@tempcntYb=#3 \advance\@tempcntYb by8\relax
\else
\@tempcntXb=#3\relax
\@tempcntYb=-#3\relax
\if@wedgeadjust
\advance\@tempcntXb by8\relax
\advance\@tempcntYb by-8\relax
\fi
\multiply\@tempcntXb by#2\relax\multiply\@tempcntXb by10\relax
\divide\@tempcntXb by#1\relax\divide\@tempcntXb by10\relax\fi\fi
\advance\@tempcntXb by\@tempcntXa\relax
\advance\@tempcntYb by\@tempcntYa\relax
%%other point of wedge
\ifnum#1=0\relax
\@tempcntXc=-#3 \advance\@tempcntXc by-8\relax
\@tempcntYc=0\relax
\else
\ifnum#2=0\relax
\@tempcntXc=0\relax
\@tempcntYc=-#3 \advance\@tempcntYc by-8\relax
\else
\@tempcntXc=-#3\relax
\@tempcntYc=#3\relax
\if@wedgeadjust
\advance\@tempcntXc by-6\relax
\advance\@tempcntYc by6\relax
\fi
\multiply\@tempcntXc by#2\relax\multiply\@tempcntXc by10\relax
\divide\@tempcntXc by#1\relax\divide\@tempcntXc by10\relax\fi\fi
\advance\@tempcntXc by\@tempcntXa\relax
\advance\@tempcntYc by\@tempcntYa\relax
}%%end of \stereo@wedgedimension
\let\Put@@@@Direct=\put
\def\Put@@@@oCircle(#1,#2)#3{\begingroup%
\@tempcntz=#3 \divide\@tempcntz by2\relax
\setbox0=\hbox{%
{\tikz[baseline=(X.base)]{%
\draw[line width=0.4pt]%
(#1\unitlength,#2\unitlength) coordinate (X) circle (\@tempcntz\unitlength);}}}%
\put(#1,#2){\kern-0.5\wd0\hbox{\box0}}%
\endgroup}
\def\Put@@@@sCircle(#1,#2)#3{\begingroup%
\@tempcntz=#3 \divide\@tempcntz by2\relax
\setbox0=\hbox{%
{\tikz[baseline=(X.base)]{%
\draw[line width=2pt]%
(#1\unitlength,#2\unitlength) coordinate (X) circle (\@tempcntz\unitlength);}}}%
\put(#1,#2){\kern-0.5\wd0\hbox{\box0}}%
\endgroup}
\def\d@@t@@rline(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
\if@hasheddashsw
\@ifundefined{tikz}{%
\XyMTeXWarning{A dottedline is replaced by a solid line.}%
\Put@Line(#1,#2)(#3,#4){#5}%
}{{\thicklines%
\h@shedd@shbond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)}}%
\else
\if@skbondlist%hashed dash bond skeletal bond for general cases
\@ifundefined{tikz}{%
\XyMTeXWarning{A dottedline is replaced by a solid line.}%
\Put@Line(#1,#2)(#3,#4){#5}%
}{{\thicklines%
\h@shedd@shbond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)}}%
\else
\h@shedw@dgebond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)%
\fi\fi
}%end of \d@@t@@rline
\def\h@shedd@shbond(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
\begingroup
\@tempcntzz=12\relax
\@tempcntzzz=-30\relax%almost no shortening
\bond@shorten(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)%
\ifdim\unitlength>0.08pt
\tikznodimension{%
\draw[dashed,line width=\thickLineWidth,dash pattern=on 1pt off 1.2pt]%
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) coordinate (X) --%
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}%
\else
\tikznodimension{%
\draw[dashed,line width=\thickLineWidth,dash pattern=on 0.8pt off 1pt]%
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) coordinate (X) --%
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}%
\fi
\endgroup}
\def\h@shedw@dgebond(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
\begingroup
\@tempcntXa=#8\relax
\@tempcntYa=#9\relax
\stereo@wedgedimension(#3,#4){10}%
\XyMTeXnumf=\@tempcntXb
\XyMTeXnumg=\@tempcntYb
\XyMTeXnumh=\@tempcntXc
\XyMTeXnumi=\@tempcntYc
\@tempcntzz=5\relax
\@tempcntzzz=-12\relax
\bond@shorten(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)%
\tikznodimension{%
\filldraw%
(#1\unitlength,#2\unitlength) --%
(\XyMTeXnumf\unitlength,\XyMTeXnumg\unitlength) --%
(\XyMTeXnumh\unitlength,\XyMTeXnumi\unitlength) -- (#1\unitlength,#2\unitlength);%
\draw[dashed,line width=4pt,dash pattern=on 1pt off 1.2pt,color=white]%
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) --%
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}%
\endgroup
}%%end of \h@shedw@dgebond
\def\bond@shorten(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){%
\@tempcntXb=#8\relax
\@tempcntYb=#9\relax
\advance\@tempcntXb by-#6\relax \divide\@tempcntXb by\@tempcntzz\relax
\advance\@tempcntYb by-#7\relax \divide\@tempcntYb by\@tempcntzz\relax
\advance\@tempcntXb by#6\relax
\advance\@tempcntYb by#7\relax
\@tempcntXc=#8\relax
\@tempcntYc=#9\relax
\advance\@tempcntXc by-#6\relax \divide\@tempcntXc by\@tempcntzzz\relax
\advance\@tempcntYc by-#7\relax \divide\@tempcntYc by\@tempcntzzz\relax
\advance\@tempcntXc by#8\relax
\advance\@tempcntYc by#9\relax
}%%end of \bondshorten
\def\WedgeAsSubstPDF(#1,#2)(#3,#4)#5{%
\begingroup
\@thicklineswtrue \@wedgeswtrue
\molfrontfalse \@skbondlistfalse
\Put@@@@Line(#1,#2)(#3,#4){#5}%
\endgroup}
\let\WedgeAsSubst=\WedgeAsSubstPDF%for compatibility to PS mode
\def\stereo@wedgedimensionX(#1,#2)(#3,#4){%
\@ifnextchar[{\stereo@@wedgedimensionX(#1,#2)(#3,#4)}%
{\stereo@@wedgedimensionX(#1,#2)(#3,#4)[10]}}
\def\stereo@@wedgedimensionX(#1,#2)(#3,#4)[#5]{%
\@tempcnta=-#1\relax
\advance\@tempcnta by#3\relax
%%\typeout{KKK:\the\@tempcnta}%
\@tempcntb=-#2\relax
\advance\@tempcntb by#4\relax
%%%\typeout{LLL:\the\@tempcntb}%
\stereo@wedgedimension(\the\@tempcnta,\the\@tempcntb){#5}%
%%%\typeout{MMM; (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)}
\advance\@tempcntXb by#3\relax
\advance\@tempcntYb by#4\relax
\advance\@tempcntXc by#3\relax
\advance\@tempcntYc by#4\relax}
\def\WedgeAsSubstXPDF(#1,#2)(#3,#4){%
\@ifnextchar[{\Wedge@AsSubstXPDF(#1,#2)(#3,#4)}%
{\Wedge@AsSubstXPDF(#1,#2)(#3,#4)[10]}}
\def\Wedge@AsSubstXPDF(#1,#2)(#3,#4)[#5]{%
\begingroup
\stereo@wedgedimensionX(#1,#2)(#3,#4)[#5]%
\PUT@@@@wedgeLINE(#1,#2)(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)%
\endgroup}
\let\WedgeAsSubstX=\WedgeAsSubstXPDF%for compatibility to PDF mode
\def\NumR@und#1.#2#3\@nil{%shishagonyu
\begingroup
\XyMTeXcnta=0 \XyMTeXcntb=0\relax
\XyMTeXcnta=#1 %%\typeout{A:\the\XyMTeXcnta;}
\XyMTeXcntb=#2 %%\typeout{B:\the\XyMTeXcntb;}
\ifnum\XyMTeXcnta>0\relax
\ifnum\XyMTeXcntb<5 \else
\advance\XyMTeXcnta by1 %%\typeout{C:\the\XyMTeXcnta;}
\fi
\else
\ifnum\XyMTeXcntb<5 \else
\advance\XyMTeXcnta by-1 %%\typeout{C:\the\XyMTeXcnta;}
\fi\fi\xdef\@yzobun{\the\XyMTeXcnta}\endgroup}
{\catcode`\p=12 \catcode`\t=12
\gdef\zobunGain#1pt{\gdef\@zobun{#1}}}
\def\zahyozobun(#1,#2)(#3,#4)#5{%
\@tempdima=#5\unitlength
\@tempdimb=#3\unitlength
\@tempcnta=\@tempdima
\ifdim\@tempdimb<0pt
\@tempcntb=-\@tempdimb
\else
\@tempcntb=\@tempdimb
\fi
%%
\ifdim\@tempdimb=0pt%bugfix 2013/02/06
\else
%%
\multiply\@tempcntb by10\relax
\divide\@tempcntb by65536%
\divide\@tempdima by \@tempcntb
\multiply\@tempdima by#4\relax
\multiply\@tempdima by10 %%\typeout{D:\the\@tempdima}
\expandafter\zobunGain\the\@tempdima%
\expandafter\NumR@und\@zobun\@nil
\fi%%%
\ifnum#3<0
\xdef\@xzobun{-#5}%
\else
\ifnum#3=0%bugfix 2013/02/06
\xdef\@xzobun{#3}%
\ifnum#4<0
\xdef\@yzobun{-#5}%
\else
\xdef\@yzobun{#5}%
\fi%bugfix 2013/02/06
\else
\xdef\@xzobun{#5}%
\fi
\fi
}
\def\bond@sh@rten(#1,#2)(#3,#4)#5{%%%%%%%/(#6,#7)(#8,#9){%
\zahyozobun(#1,#2)(#3,#4){#5}%
\@tempcntXb=\@xzobun\relax%%\typeout{SSS:\@xzobun}
\@tempcntYb=\@yzobun\relax%%\typeout{TTT:\@yzobun}
\divide\@tempcntXb by\@tempcntzz\relax
\divide\@tempcntYb by\@tempcntzz\relax
\advance\@tempcntXb by#1\relax
\advance\@tempcntYb by#2\relax
\@tempcntXc=\@xzobun\relax%%\typeout{KKKK:\@xzobun}
\@tempcntYc=\@yzobun\relax%%\typeout{LLLL:\@yzobun}
\divide\@tempcntXc by\@tempcntzzz\relax
\divide\@tempcntYc by\@tempcntzzz\relax
\advance\@tempcntXc by#1\relax
\advance\@tempcntXc by\@xzobun\relax%%\typeout{AAAA:\the\@tempcntXc}
\advance\@tempcntYc by#2\relax
\advance\@tempcntYc by\@yzobun\relax%%\typeout{BBBB:\the\@tempcntYc}
}%%end of \bondshorten
\def\HashWedgeAsSubstPDF(#1,#2)(#3,#4)#5{%
\begingroup
\zahyozobun(#1,#2)(#3,#4){#5}%
\@tempcntXa=\@xzobun\relax
\advance\@tempcntXa by#1\relax
\@tempcntYa=\@yzobun\relax
\advance\@tempcntYa by#2\relax
\stereo@wedgedimension(#3,#4){10}%
\XyMTeXnumf=\@tempcntXb%%\typeout{CCCCF:\the\XyMTeXnumf}
\XyMTeXnumg=\@tempcntYb%%\typeout{CCCCG:\the\XyMTeXnumg}
\XyMTeXnumh=\@tempcntXc%%\typeout{CCCCH:\the\XyMTeXnumh}
\XyMTeXnumi=\@tempcntYc%%\typeout{CCCCI:\the\XyMTeXnumi}
\@tempcntzz=5\relax
\@tempcntzzz=-12\relax
\bond@sh@rten(#1,#2)(#3,#4){#5}%
\tikznodimension{%
\filldraw%
(#1\unitlength,#2\unitlength) coordinate (X) --%
(\XyMTeXnumf\unitlength,\XyMTeXnumg\unitlength) --%
(\XyMTeXnumh\unitlength,\XyMTeXnumi\unitlength) -- (#1\unitlength,#2\unitlength);%
\draw[dashed,line width=4pt,dash pattern=on 1pt off 1.2pt,color=white]%
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) --%
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}%
\endgroup
}%%end of \HashWedgeAsSubstPDF
\let\HashWedgeAsSubst=\HashWedgeAsSubstPDF%For compatibility to PS mode
\def\HashWedgeAsSubstXPDF(#1,#2)(#3,#4){%
\@ifnextchar[{\HashWedge@AsSubstXPDF(#1,#2)(#3,#4)}%
{\HashWedge@AsSubstXPDF(#1,#2)(#3,#4)[10]}}
\def\HashWedge@AsSubstXPDF(#1,#2)(#3,#4)[#5]{%
\begingroup
\WedgeAsSubstXPDF(#1,#2)(#3,#4)[#5]%
\@tempdima=#5\unitlength \multiply\@tempdima by3\relax
\advance\@tempdima by1pt%adjustment
\tikznodimension{%
\draw[dashed,line width=\@tempdima,
dash pattern=on 1pt off 1.2pt,color=white]%
(#1\unitlength,#2\unitlength) --%
(#3\unitlength,#4\unitlength);}%
\endgroup
}%%end of \HashWedgeAsSubstXPDF
\let\HashWedgeAsSubstX=\HashWedgeAsSubstXPDF%For compatibility to PDF mode
\def\WavyAsSubstPDF(#1,#2)(#3,#4)#5{%
\begingroup
\wavebondtrue
\Put@@@@Line(#1,#2)(#3,#4){#5}%
\endgroup}
\let\WavyAsSubst=\WavyAsSubstPDF%for compatibility to PS mode
\let\WavyAsSubstXPDF=\PUT@@@@wavyLINE
\let\WavyAsSubstX=\WavyAsSubstXPDF%for compatibility to PS mode
\def\downnobond#1#2{%
\hbox{\smash{\hbox to0.72em{\hss#1\hss}\kern-0.72em\lower2.2ex\hbox{#2}}}}
\def\PUT@@@@dashedLINE(#1,#2)(#3,#4)#5{%
\begingroup
\ifdim\unitlength>0.08pt
\tikznodimension{%
\draw[dashed,line width=#5,dash pattern=on 1pt off 1.2pt]%
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}%
\else
\tikznodimension{%
\draw[dashed,line width=#5,dash pattern=on 0.8pt off 1pt]%
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}%
\fi
\endgroup
}
\let\PutPDFdashed=\PUT@@@@dashedLINE%for user's use
\let\PutDashedBond=\PUT@@@@dashedLINE%for compatibility to PS mode
\newtoks\Temp@ArCords \Temp@ArCords={}
\def\set@xy@PDFcoords(#1,#2){%
\ifnum\@tempcnta=1\relax
\Temp@ArCords={(#1\unitlength,#2\unitlength) }\else
\expandafter\Temp@ArCords\expandafter{\the\Temp@ArCords -- %
(#1\unitlength,#2\unitlength)}\fi}
\def\RoundedCornersWidth{4pt}
\def\setRoundArrPDF#1{%
\ifnum\@tempcnta>5\relax
\def\RoundedCornersWidth{4pt}%
\else
\def\RoundedCornersWidth{8pt}\fi
\tikznodimension{%
\draw[\RoundArrowHead,line width=0.4pt,%
rounded corners=\RoundedCornersWidth]#1;}}%
\def\putRoundArrowPDF{%
\@ifnextchar[{\putRound@rrowPDF}{\putRound@rrowPDF[->]}}
\def\putRound@rrowPDF[#1]#2{%
\edef\RoundArrowHead{#1}%
\Temp@ArCords={}\@tempcnta=\@ne\relax
\@forendparenthesis\member:=#2\do{%
\ifx\member\empty\else
\expandafter\set@xy@PDFcoords\member)\fi
\advance\@tempcnta\@ne}%
\expandafter\setRoundArrPDF\expandafter{\the\Temp@ArCords}%
}
\let\putRoundArrow=\putRoundArrowPDF
%%added 2010/08/17
{\catcode`\p=12 \catcode`\t=12
\gdef\UScaleGain#1pt{\gdef\@UScale{#1}}}
\def\setUnitScale#1{%
\@tempdima=#1 \dimen0=1cm
\@tempcnta=\@tempdima
\@tempcntb=\dimen0
\divide\@tempcntb by65536%
\divide\@tempdima by \@tempcntb
\expandafter\UScaleGain\the\@tempdima}
\setUnitScale{0.1pt}%standard setting
%%%
\newif\ifsizereduction\sizereductionfalse
\def\@@@changeunitlength#1{\unitlength=#1\relax
\setUnitScale{#1}%%% scale=\@UScale
\ifdim\unitlength<0.1pt \sizereductiontrue
\ifdim\unitlength<0.062pt \let\substfontsize=\tiny \else
\ifdim\unitlength<0.072pt \let\substfontsize=\scriptsize \else
\ifdim\unitlength<0.082pt \let\substfontsize=\footnotesize
\fi\fi\fi
\else \let\substfontsize=\normalsize\fi}
\def\red{\color{red}}
\def\green{\color{green}}
\def\blue{\color{blue}}
\def\cyan{\color{cyan}}
\def\magenta{\color{magenta}}
\def\yellow{\color{yellow}}
\def\black{\color{black}}
\def\white{\color{white}}
\def\xymcolor#1#2{\mbox{\color{#1}#2}}
\def\Color@@@@Line{%
\@ifnextchar[{\C@lor@@@@Line}{\C@lor@@@@Line[0.4pt]}}
\def\C@lor@@@@Line[#1](#2,#3)(#4,#5)#6#7{%
\begingroup
\SlopetoXY(#2,#3)(#4,#5){#6}%%
\@tempdime=\unitlength \multiply\@tempdime by#2\relax
\@tempdimb=\unitlength \multiply\@tempdimb by#3\relax
\@tempdimc=\unitlength \multiply\@tempdimc by\@tempcntXa\relax
\@tempdimd=\unitlength \multiply\@tempdimd by\@tempcntYa\relax
\tikznodimension{%
\draw[line width=#1,color=#7]%
(\@tempdime,\@tempdimb) --(\@tempdimc,\@tempdimd);}%
\endgroup}%end of \Color@@@@Line
\let\Color@Line=\Color@@@@Line%for PDF mode
\def\setxymtxpdf{%
\@ifnextchar[{\@setxymtxpdf}{\@setxymtxpdf[0.1pt]}}
\def\@setxymtxpdf[#1]{%
\PDFmodetrue
\let\sfpicture=\picture
\let\endsfpicture=\endpicture
\let\thicklines=\Thick@Lines
\let\thinlines=\Thin@Lines
\let\Put@Line=\Put@@@@Line
\let\Color@Line=\Color@@@@Line%for PDF mode
\let\Put@Direct=\Put@@@@Direct
\let\Put@oCircle=\Put@@@@oCircle
\let\Put@sCircle=\Put@@@@sCircle
\let\dotorline=\d@@t@@rline
\let\WedgeAsSubst=\WedgeAsSubstPDF%for compatibility to PS mode
\let\HashWedgeAsSubst=\HashWedgeAsSubstPDF%For compatibility to PS mode
\let\WedgeAsSubstX=\WedgeAsSubstXPDF%for compatibility to PDF mode
\let\HashWedgeAsSubstX=\HashWedgeAsSubstXPDF%For compatibility to PDF mode
\let\PutBondLine=\PUT@@@@bondLINE%for user's use
\let\PutDashedBond=\PUT@@@@dashedLINE%for compatibility to PS mode
\let\putRoundArrow=\putRoundArrowPDF%for compatibility to PS mode
\let\changeunitlength=\@@@changeunitlength
\changeunitlength{#1}%
\wedgehasheddash%
}
\setxymtxpdf
\endinput
%%
%% End of file `xymtx-pdf.sty'.
|