| 1 |
% \iffalse meta-comment |
| 2 |
%% File: xymtx-pdf.dtx |
| 3 |
% |
| 4 |
% Copyright 2002,2004,2005,2009,2010,2013 by Shinsaku Fujita |
| 5 |
% |
| 6 |
% This file is part of XyMTeX system. |
| 7 |
% ------------------------------------- |
| 8 |
% |
| 9 |
% This file is a part of the macro package ``XyMTeX'' which has been |
| 10 |
% designed for typesetting chemical structural formulas. |
| 11 |
% |
| 12 |
% This file is to be contained in the ``xymtex'' directory which is |
| 13 |
% an input directory for TeX. It is a LaTeX optional style file and |
| 14 |
% should be used only within LaTeX, because several macros of the file |
| 15 |
% are based on LaTeX commands. |
| 16 |
% |
| 17 |
% The following book deals with an application of TeX/LaTeX to |
| 18 |
% preparation of manuscripts of chemical fields: |
| 19 |
% (1) Shinsaku Fujita, ``LaTeX for Chemists and Biochemists'' |
| 20 |
% Tokyo Kagaku Dozin, Tokyo (1993) [in Japanese]. |
| 21 |
% (2) Shinsaku Fujita, ``XyMTeX. Typesetting Chemical Structural |
| 22 |
% Formulas'' Addison-Wesley, New York (1997). |
| 23 |
% |
| 24 |
% This work may be distributed and/or modified under the |
| 25 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 26 |
% of this license or (at your option) any later version. |
| 27 |
% The latest version of this license is in |
| 28 |
% http://www.latex-project.org/lppl.txt |
| 29 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 30 |
% version 2005/12/01 or later. |
| 31 |
% |
| 32 |
% This work has the LPPL maintenance status `maintained'. |
| 33 |
% The Current Maintainer of this work is Shinsaku Fujita. |
| 34 |
% |
| 35 |
% This work consists of the files xymtx-pdf.dtx and xymtx-pdf.ins |
| 36 |
% and the derived file xymtx-pdf.sty. |
| 37 |
% |
| 38 |
% Please report any bugs, comments, suggestions, etc. to: |
| 39 |
% Shinsaku Fujita, |
| 40 |
% Shonan Institute of Chemoinformatics and |
| 41 |
% Mathematical Chemistry |
| 42 |
% [email protected] |
| 43 |
% |
| 44 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 45 |
% \def\j@urnalname{xymtx-ps} |
| 46 |
% \def\versi@ndate{May 30, 2002} |
| 47 |
% \def\versi@nno{ver1.00} |
| 48 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 49 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 50 |
% \def\j@urnalname{xymtx-ps} |
| 51 |
% \def\versi@ndate{May 30, 2002} |
| 52 |
% \def\versi@nno{ver1.00} |
| 53 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 54 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 55 |
% \def\j@urnalname{xymtx-ps} |
| 56 |
% \def\versi@ndate{August 30, 2004} |
| 57 |
% \def\versi@nno{ver4.01} |
| 58 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 59 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 60 |
% \def\j@urnalname{xymtx-ps} |
| 61 |
% \def\versi@ndate{December 20, 2004} |
| 62 |
% \def\versi@nno{ver4.02} |
| 63 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 64 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 65 |
% \def\j@urnalname{xymtx-ps} |
| 66 |
% \def\versi@ndate{June 20, 2005} |
| 67 |
% \def\versi@nno{ver4.03} |
| 68 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 69 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 70 |
% \def\j@urnalname{xymtx-ps} |
| 71 |
% \def\versi@ndate{August 02, 2005} |
| 72 |
% \def\versi@nno{ver4.03a} |
| 73 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 74 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 75 |
% \def\j@urnalname{xymtx-ps} |
| 76 |
% \def\versi@ndate{June 15, 2009} |
| 77 |
% \def\versi@nno{ver4.04a} |
| 78 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 79 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 80 |
% \def\j@urnalname{xymtx-ps} |
| 81 |
% \def\versi@ndate{November 05, 2009} |
| 82 |
% \def\versi@nno{ver4.05} |
| 83 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 84 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 85 |
% \def\j@urnalname{xymtx-pdf} |
| 86 |
% \def\versi@ndate{October 01, 2010} |
| 87 |
% \def\versi@nno{ver5.00} |
| 88 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 89 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 90 |
% \def\j@urnalname{xymtx-pdf} |
| 91 |
% \def\versi@ndate{November 23, 2010} |
| 92 |
% \def\versi@nno{ver5.00b} |
| 93 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 94 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 95 |
% \def\j@urnalname{xymtx-pdf} |
| 96 |
% \def\versi@ndate{March 10, 2013} |
| 97 |
% \def\versi@nno{ver5.01b} |
| 98 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 99 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 100 |
% \def\j@urnalname{xymtx-pdf} |
| 101 |
% \def\versi@ndate{May 27, 2013} |
| 102 |
% \def\versi@nno{ver5.01bb} |
| 103 |
% \def\copyrighth@lder{SF} % Shinsaku Fujita |
| 104 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 105 |
% |
| 106 |
% \fi |
| 107 |
% |
| 108 |
% \CheckSum{1761} |
| 109 |
%% \CharacterTable |
| 110 |
%% {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 |
| 111 |
%% 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 |
| 112 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 113 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 114 |
%% Dollar \$ Percent \% Ampersand \& |
| 115 |
%% Acute accent \' Left paren \( Right paren \) |
| 116 |
%% Asterisk \* Plus \+ Comma \, |
| 117 |
%% Minus \- Point \. Solidus \/ |
| 118 |
%% Colon \: Semicolon \; Less than \< |
| 119 |
%% Equals \= Greater than \> Question mark \? |
| 120 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 121 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 122 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 123 |
%% Right brace \} Tilde \~} |
| 124 |
% |
| 125 |
% \setcounter{StandardModuleDepth}{1} |
| 126 |
% |
| 127 |
% \StopEventually{} |
| 128 |
% \MakeShortVerb{\|} |
| 129 |
% |
| 130 |
% \iffalse |
| 131 |
% \changes{v1.00}{2002/05/30}{first edition for LaTeX2e} |
| 132 |
% \changes{v4.01}{2004/08/30}{Adjust for XyMTeX version 4.01} |
| 133 |
% \changes{v4.02}{2004/12/20}{Wedged bonds for stereochemistry} |
| 134 |
% \changes{v4.03}{2005/06/20}{Wave bonds for stereochemistry} |
| 135 |
% \changes{v4.03a}{2005/08/02}{Bug fix for the compatibility with |
| 136 |
% \changes{v4.04a}{2009/06/15}{Bug fix for \cs{\Put@@@@Direct}} |
| 137 |
% \changes{v4.05}{2009/11/05}{Bug fix for \cs{\Put@@@@Direct}; pLaTeXe vs. LaTeXe} |
| 138 |
% \changes{v5.00}{2010/10/01}{Change the PostScript mode into the PDF mode} |
| 139 |
% \changes{v5.00b}{2010/11/23}{added the pgfcore package for pdflatex} |
| 140 |
% \changes{v5.01b}{2013/03/10}{Bug fix for \cs{zahyozobun}} |
| 141 |
% \changes{v5.01bb}{2013/05/27}{\cs{WedgeAsSubstX} etc.} |
| 142 |
% \changes{v5.01}{2013/06/21}{\cs{WavyAsSubst} etc.} |
| 143 |
% \fi |
| 144 |
% |
| 145 |
% \iffalse |
| 146 |
%<*driver> |
| 147 |
\NeedsTeXFormat{pLaTeX2e} |
| 148 |
% \fi |
| 149 |
\ProvidesFile{xymtx-pdf.dtx}[2013/06/21 v5.01 xymtx-pdf package file] |
| 150 |
% \iffalse |
| 151 |
\documentclass{ltxdoc} |
| 152 |
\GetFileInfo{xymtx-pdf.dtx} |
| 153 |
% |
| 154 |
% %%XyMTeX Logo: Definition 2%%% |
| 155 |
\def\UPSILON{\char'7} |
| 156 |
\def\XyM{X\kern-.30em\smash{% |
| 157 |
\raise.50ex\hbox{\UPSILON}}\kern-.30em{M}} |
| 158 |
\def\XyMTeX{\XyM\kern-.1em\TeX} |
| 159 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 160 |
\title{Chemistry Conventions by {\sffamily xymtx-pdf.sty} |
| 161 |
(\fileversion) of \XyMTeX{}} |
| 162 |
\author{Shinsaku Fujita \\ |
| 163 |
Shonan Institute of Chemoinformatics Mathematical Chemistry, \\ |
| 164 |
Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun, |
| 165 |
Kanagawa-Ken, 258-0019 Japan |
| 166 |
} |
| 167 |
\date{\filedate} |
| 168 |
% |
| 169 |
\begin{document} |
| 170 |
\maketitle |
| 171 |
\DocInput{xymtx-pdf.dtx} |
| 172 |
\end{document} |
| 173 |
%</driver> |
| 174 |
% \fi |
| 175 |
% |
| 176 |
% \section{Introduction}\label{xymtx-pdf:intro} |
| 177 |
% |
| 178 |
% This package aims at converting XyMTeX documents into PDF by |
| 179 |
% using the dvipdfm(x) converter or its equivalent. The codes |
| 180 |
% contained in xymtx-ps.dtx for the PostScript mode of XyMTeX |
| 181 |
% have been changed and extended to match direct conversion |
| 182 |
% into PDF files. |
| 183 |
% |
| 184 |
% \subsection{Options for {\sffamily docstrip}} |
| 185 |
% |
| 186 |
% \DeleteShortVerb{\|} |
| 187 |
% \begin{center} |
| 188 |
% \begin{tabular}{|l|l|} |
| 189 |
% \hline |
| 190 |
% \emph{option} & \emph{function}\\ \hline |
| 191 |
% xymtxpdf & xymtx-pdf.sty \\ |
| 192 |
% driver & driver for this dtx file \\ |
| 193 |
% \hline |
| 194 |
% \end{tabular} |
| 195 |
% \end{center} |
| 196 |
% \MakeShortVerb{\|} |
| 197 |
% |
| 198 |
% \subsection{Version Information} |
| 199 |
% |
| 200 |
% \begin{macrocode} |
| 201 |
%<*xymtxpdf> |
| 202 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 203 |
\def\j@urnalname{xymtx-pdf} |
| 204 |
\def\versi@ndate{June 21, 2013} |
| 205 |
\def\versi@nno{ver5.01} |
| 206 |
\def\copyrighth@lder{SF} % Shinsaku Fujita |
| 207 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 208 |
\typeout{XyMTeX Macro File `\j@urnalname' (\versi@nno) <\versi@ndate>% |
| 209 |
\space[\copyrighth@lder]} |
| 210 |
% \end{macrocode} |
| 211 |
% |
| 212 |
% \section{Input of basic macros} |
| 213 |
% |
| 214 |
% To assure the compatibility to \LaTeX{}2.09 (the native mode), |
| 215 |
% the commands added by \LaTeXe{} have not been used in the resulting sty |
| 216 |
% files ({\sf ccycle.sty} for the present case). Hence, the combination |
| 217 |
% of |\input| and |\@ifundefined| is used to crossload sty |
| 218 |
% files ({\sf chemstr.sty} for the present case) in place of the |
| 219 |
% |\RequirePackage| command of \LaTeXe{}. |
| 220 |
% The global setting of unit by |\psset| has caused imcompatibility |
| 221 |
% with the prosper package and so has been changed into a local setting. |
| 222 |
% \changes{v4.03a}{2005/08/02}{Bug fix for the compatibility with |
| 223 |
% the prosper package} |
| 224 |
% \changes{v5.00b}{2010/11/23}{added the pgfcore package for pdflatex} |
| 225 |
% |
| 226 |
% \begin{macrocode} |
| 227 |
% ************************* |
| 228 |
% * input of basic macros * |
| 229 |
% ************************* |
| 230 |
\@ifundefined{setsixringv}{\input chemstr.sty\relax}{} |
| 231 |
\RequirePackage{tikz} |
| 232 |
\RequirePackage{pgfcore}%%%added 2010/11/23 by S. Fujita |
| 233 |
\RequirePackage{xcolor} |
| 234 |
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,calc} |
| 235 |
\unitlength=0.1pt |
| 236 |
\def\white{\color{white}} |
| 237 |
% \end{macrocode} |
| 238 |
% |
| 239 |
% \begin{macrocode} |
| 240 |
\newif\if@thicklinesw \@thicklineswfalse |
| 241 |
\def\Thick@Lines{\@thicklineswtrue}%redefinition |
| 242 |
\def\Thin@Lines{\@thicklineswfalse}%redefinition |
| 243 |
\def\thickLineWidth{1.6pt} |
| 244 |
\def\thinLineWidth{0.4pt} |
| 245 |
% \end{macrocode} |
| 246 |
% |
| 247 |
% Temporary count registers: |
| 248 |
% \begin{macrocode} |
| 249 |
\newcount\XyMTeXnuma |
| 250 |
\newcount\XyMTeXnumb |
| 251 |
\newcount\XyMTeXnumc |
| 252 |
\newcount\XyMTeXnumd |
| 253 |
\newcount\XyMTeXnume |
| 254 |
\newcount\XyMTeXnumf |
| 255 |
\newcount\XyMTeXnumg |
| 256 |
\newcount\XyMTeXnumh |
| 257 |
\newcount\XyMTeXnumi |
| 258 |
\newcount\XyMTeXcnta |
| 259 |
\newcount\XyMTeXcntb |
| 260 |
% \end{macrocode} |
| 261 |
% |
| 262 |
% Temporary dimension registers: |
| 263 |
% \begin{macrocode} |
| 264 |
\newdimen\XyMTeXdima |
| 265 |
\newdimen\XyMTeXdimb |
| 266 |
\newdimen\XyMTeXdimc |
| 267 |
\newdimen\XyMTeXdimd |
| 268 |
\newdimen\XyMTeXdime |
| 269 |
% \end{macrocode} |
| 270 |
% |
| 271 |
% Temporary box registers: |
| 272 |
% \begin{macrocode} |
| 273 |
\newbox\BondBox |
| 274 |
% \end{macrocode} |
| 275 |
% |
| 276 |
% |
| 277 |
% The macro |\Put@@@@Line| can draw dashed bonds or wedged bonds for supporting |
| 278 |
% stereochemistry. Two switches are available as follows: |
| 279 |
% |
| 280 |
% \begin{macro}{changedashtowedge} |
| 281 |
% \begin{macro}{changewedgetodash} |
| 282 |
% \changes{v4.02}{2004/12/20}{For PS mode: Switch for wedged bonds} |
| 283 |
% \begin{macrocode} |
| 284 |
\newif\if@wedgesw \@wedgeswtrue |
| 285 |
\newif\if@hasheddashsw \@hasheddashswtrue |
| 286 |
\def\wedgehasheddash{\@wedgeswtrue\@hasheddashswtrue} |
| 287 |
\def\wedgehashedwedge{\@wedgeswtrue\@hasheddashswfalse} |
| 288 |
\def\dashhasheddash{\@wedgeswfalse\@hasheddashswtrue} |
| 289 |
\@ifundefined{ifmolfront}{\newif\ifmolfront \molfrontfalse}{} |
| 290 |
\@ifundefined{if@skbondlist}{\newif\if@skbondlist \@skbondlistfalse}{} |
| 291 |
% \end{macrocode} |
| 292 |
% \end{macro} |
| 293 |
% \end{macro} |
| 294 |
% |
| 295 |
% \begin{macro}{\setUnitHalfScale} |
| 296 |
% |
| 297 |
% The macro |\setUnitHalfScale| calculates the half of a line width |
| 298 |
% (such as |\thinLineWidth| and |\thickLineWidth|), which is used |
| 299 |
% to adjust the staring point of a bond line. This macro is used |
| 300 |
% in |\PUT@@@@bondLINE|. |
| 301 |
% |
| 302 |
% \begin{macro}{\NumRound} |
| 303 |
% \begin{macro}{\UHalfScaleGain} |
| 304 |
% These macros result in, e.g., |
| 305 |
% 0.4pt $\rightarrow$ 0.4/0.1 (/2) $\rightarrow$ 1.999 $\rightarrow$ 2. |
| 306 |
% (Not used) |
| 307 |
% |
| 308 |
% \begin{macrocode} |
| 309 |
\def\NumRound#1.#2#3\@nil{%shishagonyu |
| 310 |
\begingroup |
| 311 |
\XyMTeXcnta=0 \XyMTeXcntb=0 |
| 312 |
\XyMTeXcnta=#1 %%\typeout{A:\the\XyMTeXcnta;} |
| 313 |
\XyMTeXcntb=#2 %%\typeout{B:\the\XyMTeXcntb;} |
| 314 |
\ifnum\XyMTeXcntb<5 \else |
| 315 |
\advance\XyMTeXcnta by1 %%\typeout{C:\the\XyMTeXcnta;} |
| 316 |
\fi\xdef\@UHalfScale{\the\XyMTeXcnta}\endgroup} |
| 317 |
{\catcode`\p=12 \catcode`\t=12 |
| 318 |
\gdef\UHalfScaleGain#1pt{\gdef\@@UHalfScale{#1}}} |
| 319 |
\def\setUnitHalfScale#1{% |
| 320 |
\@tempdima=#1 \dimen0=0.1pt |
| 321 |
\@tempcnta=\@tempdima |
| 322 |
\@tempcntb=\dimen0 |
| 323 |
\multiply\@tempcntb by10 |
| 324 |
\divide\@tempcntb by65536% |
| 325 |
\divide\@tempdima by \@tempcntb |
| 326 |
\multiply\@tempdima by5 %%\typeout{D:\the\@tempdima} |
| 327 |
\expandafter\UHalfScaleGain\the\@tempdima% |
| 328 |
\expandafter\NumRound\@@UHalfScale\@nil |
| 329 |
} |
| 330 |
% \end{macrocode} |
| 331 |
% \end{macro} |
| 332 |
% \end{macro} |
| 333 |
% \end{macro} |
| 334 |
% |
| 335 |
% \begin{macro}{\PutSimpleBondBox} |
| 336 |
% \changes{v5.00}{2010/10/01}{For PDF mode: macro for adjusting the position of |
| 337 |
% a simple bond (straight line, dashed line, etc.)} |
| 338 |
% The macro |\PutSimpleBondBox| is used to adjust the coordinates of joint positions |
| 339 |
% by using the macros |\PUT@@@@bondLINE| and |h@shedd@shbond|, which draw simple bonds |
| 340 |
% such as straight lines and dashed lines. |
| 341 |
% |
| 342 |
% \begin{macrocode} |
| 343 |
%\newbox\BondBox |
| 344 |
\def\PutSimpleBondBox(#1,#2)(#3,#4)#5{%for simple bonds |
| 345 |
\setbox\BondBox=\hbox{#5}% |
| 346 |
\XyMTeXdima=#1\unitlength |
| 347 |
\XyMTeXdimb=#3\unitlength |
| 348 |
\XyMTeXdimc=\thickLineWidth |
| 349 |
\divide\XyMTeXdimc by2%adjustment by the half of a line width |
| 350 |
\ifdim \XyMTeXdima>\XyMTeXdimb\relax |
| 351 |
\XyMTeXdimd=\XyMTeXdima |
| 352 |
\XyMTeXdime=\XyMTeXdimb |
| 353 |
\advance\XyMTeXdime by -\XyMTeXdimd |
| 354 |
\advance\XyMTeXdime by -\XyMTeXdimc |
| 355 |
\put(#1,#2){\kern\XyMTeXdime\box\BondBox}% |
| 356 |
\else |
| 357 |
\ifdim \XyMTeXdima=\XyMTeXdimb\relax |
| 358 |
\XyMTeXdimd=-\XyMTeXdimc |
| 359 |
%%%\put(#1,#2){\kern\XyMTeXdimd\raise\XyMTeXdimd\hbox{\box\BondBox}}% |
| 360 |
\put(#1,#2){\kern\XyMTeXdimd\box\BondBox}% |
| 361 |
\else |
| 362 |
\XyMTeXdimd=-\XyMTeXdimc |
| 363 |
\put(#1,#2){\kern\XyMTeXdimd\box\BondBox}% |
| 364 |
\fi\fi% |
| 365 |
} |
| 366 |
% \end{macrocode} |
| 367 |
% \end{macro} |
| 368 |
% |
| 369 |
% \begin{macro}{\tikznodimension} |
| 370 |
% \changes{v5.00}{2010/10/01}{For PDF mode: macro for typesetting an object |
| 371 |
% as having no dimensions. } |
| 372 |
% The macro |\tikznodimension| is used in place of the macro |\PutSimpleBondBox|, which |
| 373 |
% is originally used to adjust the coordinates of joint positions. |
| 374 |
% Thereby, the macros |\PUT@@@@bondLINE| and |h@shedd@shbond| have a more rigorous basis |
| 375 |
% in putting such simple bonds as straight lines and dashed lines. |
| 376 |
% |
| 377 |
% \begin{macrocode} |
| 378 |
\def\tikznodimension#1{\tikz{% |
| 379 |
\pgfpathrectangle{\pgfpointorigin}{\pgfpointorigin} |
| 380 |
\pgfusepath{use as bounding box} % draws nothing |
| 381 |
#1}} |
| 382 |
% \end{macrocode} |
| 383 |
% \end{macro} |
| 384 |
% |
| 385 |
% The macro |\PUT@@@@bondLINE| is used in the macro |\Put@@@@Line|, |
| 386 |
% which draws a bond line. This macro relies on the |\tikz| graphic |
| 387 |
% enviroment. |
| 388 |
% |
| 389 |
% \begin{macro}{\PUT@@@@bondLINE} |
| 390 |
% \begin{macro}{\PutPDFLine} |
| 391 |
% \changes{v5.00}{2010/10/01}{For PDF mode: macro for |
| 392 |
% drawing a straight-line bond after adjusting its joint position} |
| 393 |
% \begin{macrocode} |
| 394 |
\def\PUT@@@@bondLINE(#1,#2)(#3,#4)#5{% |
| 395 |
\begingroup |
| 396 |
%\setbox0=\hbox{% |
| 397 |
%\tikz[baseline=(X.base)]{% |
| 398 |
%\draw[line width=#5,line cap=round]% |
| 399 |
%(#1\unitlength,#2\unitlength) coordinate (X) -- (#3\unitlength,#4\unitlength);}}% |
| 400 |
%\PutSimpleBondBox(#1,#2)(#3,#4){\box0}% |
| 401 |
\tikznodimension{% |
| 402 |
\draw[line width=#5]% |
| 403 |
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}% |
| 404 |
\endgroup |
| 405 |
} |
| 406 |
\let\PutPDFLine=\PUT@@@@bondLINE%for user's use |
| 407 |
\let\PutBondLine=\PUT@@@@bondLINE%for user's use |
| 408 |
% \end{macrocode} |
| 409 |
% \end{macro} |
| 410 |
% \end{macro} |
| 411 |
% |
| 412 |
% \begin{macro}{\PutBondBox} |
| 413 |
% \changes{v5.00}{2010/10/01}{For PDF mode: a macro for putting a bond box |
| 414 |
% after adjusting coordinates. } |
| 415 |
% The macro |\PutBondBox| put a bond box at an adjusted point, |
| 416 |
% where the bond box contain a wadge or wavy bond drawn by using |
| 417 |
% the pgf package (\verb/\tikz/). The macro is used in the |
| 418 |
% macros |\PUT@@@@wedgeLINE| and |\PUT@@@@wavyLINE|. |
| 419 |
% \begin{macrocode} |
| 420 |
%\newbox\BondBox |
| 421 |
\def\PutBondBox(#1,#2)(#3,#4)#5{%for wedge and wavy bonds |
| 422 |
\setbox\BondBox=\hbox{#5}% |
| 423 |
\XyMTeXdima=#1\unitlength |
| 424 |
\XyMTeXdimb=#3\unitlength |
| 425 |
\XyMTeXdimc=4pt% |
| 426 |
\divide\XyMTeXdimc by2%adjustment by the half of a line width |
| 427 |
\if@vertbond |
| 428 |
\XyMTeXdimd=\wd\BondBox |
| 429 |
\divide\XyMTeXdimd by2\relax |
| 430 |
\put(#1,#2){\kern-1.2\XyMTeXdimd\box\BondBox}%%tentative factor 1.2 |
| 431 |
\else |
| 432 |
\if@horizbond |
| 433 |
\ifdim \XyMTeXdima>\XyMTeXdimb\relax |
| 434 |
\XyMTeXdimd=\XyMTeXdima |
| 435 |
\XyMTeXdime=\XyMTeXdimb |
| 436 |
\advance\XyMTeXdime by -\XyMTeXdimd |
| 437 |
\put(#1,#2){\kern-5\unitlength\kern\XyMTeXdime\box\BondBox}%tentative factor 5 %%% |
| 438 |
\else |
| 439 |
\put(#1,#2){\kern-1.2\unitlength\box\BondBox}%tentative factor 1.2 |
| 440 |
\fi |
| 441 |
\else |
| 442 |
%% |
| 443 |
\ifdim \XyMTeXdima>\XyMTeXdimb\relax |
| 444 |
\XyMTeXdime=-\wd\BondBox |
| 445 |
\put(#1,#2){\kern0.2\unitlength\kern\XyMTeXdime\box\BondBox}%tentative shift factor |
| 446 |
\else |
| 447 |
\ifdim \wd\BondBox<4.3pt\relax |
| 448 |
\XyMTeXdimd=\wd\BondBox |
| 449 |
\divide\XyMTeXdimd by2\relax |
| 450 |
\put(#1,#2){\kern-1.3\XyMTeXdimd\box\BondBox}%tentative shift factor 1.3 |
| 451 |
% |
| 452 |
\else |
| 453 |
\put(#1,#2){\kern-3\unitlength\box\BondBox}%tentative shift factor 3 |
| 454 |
\fi\fi |
| 455 |
\fi\fi} |
| 456 |
% \end{macrocode} |
| 457 |
% \end{macro} |
| 458 |
% |
| 459 |
% The macro |\PUT@@@@wedgeLINE| is used in the macro |\Put@@@@Line|, |
| 460 |
% which draws a bond wedge. This macro relies on the |\tikz| graphic |
| 461 |
% enviroment. |
| 462 |
% |
| 463 |
% \begin{macro}{\PUT@@@@wedgeLINE} |
| 464 |
% \changes{v5.00}{2010/10/01}{For PDF mode: a macro for putting a wedge bond. } |
| 465 |
% \begin{macrocode} |
| 466 |
\newif\if@vertbond \@vertbondfalse |
| 467 |
\newif\if@horizbond \@horizbondfalse |
| 468 |
\def\PUT@@@@wedgeLINE(#1,#2)(#3,#4)(#5,#6){% |
| 469 |
\begingroup |
| 470 |
%\setbox0=\hbox{% |
| 471 |
%\tikz[baseline=(X.base)]{% |
| 472 |
%\filldraw[black,line cap=round]% |
| 473 |
%(#1\unitlength,#2\unitlength) coordinate (X) -- (#3\unitlength,#4\unitlength)% |
| 474 |
%-- (#5\unitlength,#6\unitlength) -- (#1\unitlength,#2\unitlength);}}% |
| 475 |
%\PutBondBox(#1,#2)(#3,#4){\box0}%adjustment |
| 476 |
\tikznodimension{% |
| 477 |
\filldraw% |
| 478 |
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength)% |
| 479 |
-- (#5\unitlength,#6\unitlength) -- (#1\unitlength,#2\unitlength);}% |
| 480 |
\endgroup |
| 481 |
} |
| 482 |
% \end{macrocode} |
| 483 |
% \end{macro} |
| 484 |
% |
| 485 |
% The macro |\PUT@@@@wavyLINE| is used in the macro |\Put@@@@Line|, |
| 486 |
% which draws a wavy bond. This macro relies on the |\tikz| graphic |
| 487 |
% enviroment. |
| 488 |
% |
| 489 |
% \begin{macro}{\PUT@@@@wavyLINE} |
| 490 |
% \changes{v5.00}{2010/10/01}{For PDF mode: a macro for putting a wavy bond. } |
| 491 |
% \begin{macrocode} |
| 492 |
\def\PUT@@@@wavyLINE(#1,#2)(#3,#4){% |
| 493 |
\begingroup |
| 494 |
%\setbox0=\hbox{% |
| 495 |
%\tikz[baseline=(X.base)]{% |
| 496 |
%\draw[line cap=round,decorate, |
| 497 |
%decoration={coil,aspect=0,segment length=2pt,amplitude=1pt}]% |
| 498 |
%(#1\unitlength,#2\unitlength) coordinate (X) -- (#3\unitlength,#4\unitlength);}}% |
| 499 |
%\PutBondBox(#1,#2)(#3,#4){\box0}%adjustment |
| 500 |
\tikznodimension{% |
| 501 |
\draw[decorate, |
| 502 |
decoration={coil,aspect=0,segment length=2pt,amplitude=1pt}]% |
| 503 |
(#1\unitlength,#2\unitlength) coordinate (X) -- (#3\unitlength,#4\unitlength);}% |
| 504 |
\endgroup |
| 505 |
} |
| 506 |
% \end{macrocode} |
| 507 |
% \end{macro} |
| 508 |
% |
| 509 |
% \begin{macro}{\Put@@@@Line} |
| 510 |
% \changes{v4.02}{2004/12/20}{For PS modes: Wedged bonds for stereochemistry} |
| 511 |
% \changes{v4.03}{2005/07/20}{For PS modes: Switch for wave bonds} |
| 512 |
% \changes{v5.00}{2010/10/01}{For PDF mode: a macro for putting a bond line. } |
| 513 |
% |
| 514 |
% Temporary count registers: |
| 515 |
% \begin{macrocode} |
| 516 |
\newcount\@tempcntXa \newcount\@tempcntYa \newcount\@tempcntz |
| 517 |
\newcount\@tempcntXb \newcount\@tempcntYb \newcount\@tempcntzz |
| 518 |
\newcount\@tempcntXc \newcount\@tempcntYc \newcount\@tempcntzzz |
| 519 |
% \end{macrocode} |
| 520 |
% |
| 521 |
% \begin{macrocode} |
| 522 |
\long\gdef\Put@@@@Line(#1,#2)(#3,#4)#5{% |
| 523 |
\begingroup |
| 524 |
%%x-coordinate |
| 525 |
\@tempcntXa=0\relax |
| 526 |
\ifnum#3>0\relax \@tempcntXa=#5\relax |
| 527 |
\else\ifnum#3<0\relax\@tempcntXa=-#5\relax\fi\fi |
| 528 |
\advance\@tempcntXa by#1\relax |
| 529 |
%%y-coordinate |
| 530 |
\@tempcntYa=#5\relax |
| 531 |
\ifnum#3=0\relax\else |
| 532 |
\multiply\@tempcntYa by#4\relax\multiply\@tempcntYa by10\relax |
| 533 |
\divide\@tempcntYa by#3\relax\divide\@tempcntYa by10\relax\fi |
| 534 |
\ifnum\@tempcntYa<0\relax |
| 535 |
\ifnum#4>0\relax\@tempcntYa=-\@tempcntYa\fi |
| 536 |
\else |
| 537 |
\ifnum\@tempcntYa>0\relax |
| 538 |
\ifnum#4<0\relax\@tempcntYa=-\@tempcntYa\fi\fi |
| 539 |
\fi |
| 540 |
\advance\@tempcntYa by#2\relax |
| 541 |
% |
| 542 |
\if@thicklinesw |
| 543 |
\if@wedgesw |
| 544 |
\ifmolfront%bold dash bond for skeletal bond for pyranose etc. |
| 545 |
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thickLineWidth}% |
| 546 |
\else |
| 547 |
\if@skbondlist%bold dash bond skeletal bond for general cases |
| 548 |
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thickLineWidth}% |
| 549 |
\else%wedged bond |
| 550 |
\ifnum#1=#3 |
| 551 |
\@vertbondtrue\@horizbondfalse |
| 552 |
\else |
| 553 |
\ifnum#2=#4 |
| 554 |
\@vertbondfalse\@horizbondtrue |
| 555 |
\else |
| 556 |
\@vertbondfalse\@horizbondfalse |
| 557 |
\fi\fi |
| 558 |
\stereo@wedgedimension(#3,#4){10}% |
| 559 |
\PUT@@@@wedgeLINE(#1,#2)(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)% |
| 560 |
\fi\fi |
| 561 |
\else |
| 562 |
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thickLineWidth}% |
| 563 |
\fi |
| 564 |
\else |
| 565 |
\ifwavebond |
| 566 |
\ifnum#1=#3 |
| 567 |
\@vertbondtrue\@horizbondfalse |
| 568 |
\else |
| 569 |
\ifnum#2=#4 |
| 570 |
\@vertbondfalse\@horizbondtrue |
| 571 |
\else |
| 572 |
\@vertbondfalse\@horizbondfalse |
| 573 |
\fi\fi |
| 574 |
\PUT@@@@wavyLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa)% |
| 575 |
\else |
| 576 |
\PUT@@@@bondLINE(#1,#2)(\the\@tempcntXa,\the\@tempcntYa){\thinLineWidth}% |
| 577 |
\fi |
| 578 |
\fi |
| 579 |
\@tempcntXa=0\relax \@tempcntYa=0\relax |
| 580 |
\endgroup}%end of Put@@@@Line |
| 581 |
% \end{macrocode} |
| 582 |
% \end{macro} |
| 583 |
% |
| 584 |
% The macro |\stereo@wedgedimension| calculates the coordinates of three positions |
| 585 |
% for drawing a wedged bond, which is drawn by the |\pspolygon| command of the PSTricks package. |
| 586 |
% |
| 587 |
% \begin{macro}{stereo@wedgedimension} |
| 588 |
% \changes{v4.02}{2004/12/20}{For PS mode: Wedged bonds for stereochemistry} |
| 589 |
% \begin{macrocode} |
| 590 |
\newif\if@wedgeadjust |
| 591 |
\def\stereo@wedgedimension(#1,#2)#3{% |
| 592 |
\@tempcntXb=0\relax |
| 593 |
\@tempcntYb=0\relax |
| 594 |
\@tempcntXc=0\relax |
| 595 |
\@tempcntYc=0\relax |
| 596 |
%% |
| 597 |
\@wedgeadjustfalse |
| 598 |
\ifnum#1<0 \@tempcntzz=-#1\else\@tempcntzz=#1\fi |
| 599 |
\ifnum#2<0 \@tempcntzzz=-#2\else\@tempcntzzz=#2\fi |
| 600 |
\ifnum#1=0\else |
| 601 |
\multiply\@tempcntzzz by10\relax \divide\@tempcntzzz by\@tempcntzz\fi%% (3/5)x10=6 |
| 602 |
\ifnum\@tempcntzzz>7\relax\else\@wedgeadjusttrue\fi |
| 603 |
%%one point of wedge |
| 604 |
\ifnum#1=0\relax |
| 605 |
\@tempcntXb=#3 \advance\@tempcntXb by8\relax |
| 606 |
\@tempcntYb=0\relax |
| 607 |
\else |
| 608 |
\ifnum#2=0\relax |
| 609 |
\@tempcntXb=0\relax |
| 610 |
\@tempcntYb=#3 \advance\@tempcntYb by8\relax |
| 611 |
\else |
| 612 |
\@tempcntXb=#3\relax |
| 613 |
\@tempcntYb=-#3\relax |
| 614 |
\if@wedgeadjust |
| 615 |
\advance\@tempcntXb by8\relax |
| 616 |
\advance\@tempcntYb by-8\relax |
| 617 |
\fi |
| 618 |
\multiply\@tempcntXb by#2\relax\multiply\@tempcntXb by10\relax |
| 619 |
\divide\@tempcntXb by#1\relax\divide\@tempcntXb by10\relax\fi\fi |
| 620 |
\advance\@tempcntXb by\@tempcntXa\relax |
| 621 |
\advance\@tempcntYb by\@tempcntYa\relax |
| 622 |
%%other point of wedge |
| 623 |
\ifnum#1=0\relax |
| 624 |
\@tempcntXc=-#3 \advance\@tempcntXc by-8\relax |
| 625 |
\@tempcntYc=0\relax |
| 626 |
\else |
| 627 |
\ifnum#2=0\relax |
| 628 |
\@tempcntXc=0\relax |
| 629 |
\@tempcntYc=-#3 \advance\@tempcntYc by-8\relax |
| 630 |
\else |
| 631 |
\@tempcntXc=-#3\relax |
| 632 |
\@tempcntYc=#3\relax |
| 633 |
\if@wedgeadjust |
| 634 |
\advance\@tempcntXc by-6\relax |
| 635 |
\advance\@tempcntYc by6\relax |
| 636 |
\fi |
| 637 |
\multiply\@tempcntXc by#2\relax\multiply\@tempcntXc by10\relax |
| 638 |
\divide\@tempcntXc by#1\relax\divide\@tempcntXc by10\relax\fi\fi |
| 639 |
\advance\@tempcntXc by\@tempcntXa\relax |
| 640 |
\advance\@tempcntYc by\@tempcntYa\relax |
| 641 |
}%%end of \stereo@wedgedimension |
| 642 |
% \end{macrocode} |
| 643 |
% \end{macro} |
| 644 |
% |
| 645 |
% The |Put@@@@Direct| macro is the same as the original command |
| 646 |
% |\put| for the LaTeX picture environment. |
| 647 |
% |
| 648 |
% \begin{macro}{Put@@@@Direct} |
| 649 |
% \changes{v5.00}{2010/10/01}{For PDF mode: a macro for putting an object. } |
| 650 |
% \begin{macrocode} |
| 651 |
\let\Put@@@@Direct=\put |
| 652 |
% \end{macrocode} |
| 653 |
% \end{macro} |
| 654 |
% |
| 655 |
% The macros |\Put@@@@oCircle| and |\Put@@@@sCircle| draw |
| 656 |
% small circles for designating original points. |
| 657 |
% |
| 658 |
% \begin{macro}{\Put@@@@oCircle} |
| 659 |
% \begin{macrocode} |
| 660 |
\def\Put@@@@oCircle(#1,#2)#3{\begingroup% |
| 661 |
\@tempcntz=#3 \divide\@tempcntz by2\relax |
| 662 |
%dimension \pgf@xx or \pgf@yy overflow |
| 663 |
%\setbox0=\hbox{% |
| 664 |
%{\tikz[baseline=(X.base)]{% |
| 665 |
%\draw[scale=\@UScale,line width=0.4pt]% |
| 666 |
%(#1,#2) coordinate (X) circle (\@tempcntz);}}}% |
| 667 |
\setbox0=\hbox{% |
| 668 |
{\tikz[baseline=(X.base)]{% |
| 669 |
\draw[line width=0.4pt]% |
| 670 |
(#1\unitlength,#2\unitlength) coordinate (X) circle (\@tempcntz\unitlength);}}}% |
| 671 |
\put(#1,#2){\kern-0.5\wd0\hbox{\box0}}% |
| 672 |
\endgroup} |
| 673 |
% \end{macrocode} |
| 674 |
% \end{macro} |
| 675 |
% |
| 676 |
% \begin{macro}{\Put@@@@sCircle} |
| 677 |
% \begin{macrocode} |
| 678 |
\def\Put@@@@sCircle(#1,#2)#3{\begingroup% |
| 679 |
\@tempcntz=#3 \divide\@tempcntz by2\relax |
| 680 |
%dimension pgf@xx or pgf@yy overflow |
| 681 |
%\setbox0=\hbox{% |
| 682 |
%{\tikz[baseline=(X.base)]{% |
| 683 |
%\draw[scale=\@UScale,line width=2pt]% |
| 684 |
%(#1,#2) coordinate (X) circle (\@tempcntz);}}}% |
| 685 |
\setbox0=\hbox{% |
| 686 |
{\tikz[baseline=(X.base)]{% |
| 687 |
\draw[line width=2pt]% |
| 688 |
(#1\unitlength,#2\unitlength) coordinate (X) circle (\@tempcntz\unitlength);}}}% |
| 689 |
\put(#1,#2){\kern-0.5\wd0\hbox{\box0}}% |
| 690 |
\endgroup} |
| 691 |
% \end{macrocode} |
| 692 |
% \end{macro} |
| 693 |
% |
| 694 |
% Dotted lines by the old macro |\d@@t@rline| are changed into hashed dash bonds |
| 695 |
% in the new macro |\d@@t@@rline| (|\@wedgeswfalse|). If |\@wedgeswtrue| is |
| 696 |
% declared (default), the new macro draws a hashed wedged bonds. |
| 697 |
% |
| 698 |
% \begin{macro}{d@@t@@rline} |
| 699 |
% \changes{v4.02}{2004/12/20}{Hashed wedged bonds for stereochemistry} |
| 700 |
% \changes{v5.00}{2010/10/01}{Renamed for PDF mode} |
| 701 |
% \begin{macrocode} |
| 702 |
\def\d@@t@@rline(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){% |
| 703 |
\if@hasheddashsw |
| 704 |
\@ifundefined{tikz}{% |
| 705 |
\XyMTeXWarning{A dottedline is replaced by a solid line.}% |
| 706 |
\Put@Line(#1,#2)(#3,#4){#5}% |
| 707 |
}{{\thicklines% |
| 708 |
\h@shedd@shbond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)}}% |
| 709 |
\else |
| 710 |
\if@skbondlist%hashed dash bond skeletal bond for general cases |
| 711 |
\@ifundefined{tikz}{% |
| 712 |
\XyMTeXWarning{A dottedline is replaced by a solid line.}% |
| 713 |
\Put@Line(#1,#2)(#3,#4){#5}% |
| 714 |
}{{\thicklines% |
| 715 |
\h@shedd@shbond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)}}% |
| 716 |
\else |
| 717 |
\h@shedw@dgebond(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)% |
| 718 |
\fi\fi |
| 719 |
}%end of \d@@t@@rline |
| 720 |
% \end{macrocode} |
| 721 |
% \end{macro} |
| 722 |
% |
| 723 |
% The inner macro |\h@shedd@shbond| works in the macro |\d@@t@@rline| for |
| 724 |
% drawing a hased dash bond. |
| 725 |
% |
| 726 |
% \begin{macro}{h@shedd@shbond} |
| 727 |
% \changes{v4.02}{2004/12/20}{For PS mode: Hashed dash bonds for stereochemistry} |
| 728 |
% \changes{v5.00}{2010/10/01}{Renamed for PDF mode: macro for |
| 729 |
% drawing a hashed dash bond after adjusting its joint position} |
| 730 |
% \begin{macrocode} |
| 731 |
\def\h@shedd@shbond(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){% |
| 732 |
\begingroup |
| 733 |
\@tempcntzz=12\relax |
| 734 |
\@tempcntzzz=-30\relax%almost no shortening |
| 735 |
\bond@shorten(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)% |
| 736 |
%\ifdim\unitlength>0.08pt |
| 737 |
%\setbox0=\hbox{% |
| 738 |
%\tikz[baseline=(X.base)]{% |
| 739 |
%\draw[dashed,line width=\thickLineWidth,dash pattern=on 1pt off 1.2pt]% |
| 740 |
%(\@tempcntXb\unitlength,\@tempcntYb\unitlength) coordinate (X) --% |
| 741 |
%(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}}% |
| 742 |
%\else |
| 743 |
%\setbox0=\hbox{% |
| 744 |
%\tikz[baseline=(X.base)]{% |
| 745 |
%\draw[dashed,line width=\thickLineWidth,dash pattern=on 0.8pt off 1pt]% |
| 746 |
%(\@tempcntXb\unitlength,\@tempcntYb\unitlength) coordinate (X) --% |
| 747 |
%(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}}% |
| 748 |
%\fi |
| 749 |
%\PutSimpleBondBox(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc){\box0}% |
| 750 |
\ifdim\unitlength>0.08pt |
| 751 |
\tikznodimension{% |
| 752 |
\draw[dashed,line width=\thickLineWidth,dash pattern=on 1pt off 1.2pt]% |
| 753 |
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) coordinate (X) --% |
| 754 |
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}% |
| 755 |
\else |
| 756 |
\tikznodimension{% |
| 757 |
\draw[dashed,line width=\thickLineWidth,dash pattern=on 0.8pt off 1pt]% |
| 758 |
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) coordinate (X) --% |
| 759 |
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}% |
| 760 |
\fi |
| 761 |
\endgroup} |
| 762 |
% \end{macrocode} |
| 763 |
% \end{macro} |
| 764 |
% |
| 765 |
% The inner macro |\h@shedw@dgebond| works in the macro |\d@@t@@rline| for |
| 766 |
% drawing a hashed wedged bond. |
| 767 |
% |
| 768 |
% |
| 769 |
% \begin{macro}{h@shedw@dgebond} |
| 770 |
% \changes{v4.02}{2004/12/20}{For PS mode: Hashed wedged bonds for stereochemistry} |
| 771 |
% \changes{v5.00}{2010/10/01}{For PDF mode: Hashed wedged bonds for stereochemistry} |
| 772 |
% \begin{macrocode} |
| 773 |
\def\h@shedw@dgebond(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){% |
| 774 |
\begingroup |
| 775 |
\@tempcntXa=#8\relax |
| 776 |
\@tempcntYa=#9\relax |
| 777 |
\stereo@wedgedimension(#3,#4){10}% |
| 778 |
\XyMTeXnumf=\@tempcntXb |
| 779 |
\XyMTeXnumg=\@tempcntYb |
| 780 |
\XyMTeXnumh=\@tempcntXc |
| 781 |
\XyMTeXnumi=\@tempcntYc |
| 782 |
\@tempcntzz=5\relax |
| 783 |
\@tempcntzzz=-12\relax |
| 784 |
\bond@shorten(#1,#2)(#3,#4){#5}/(#6,#7)(#8,#9)% |
| 785 |
%\setbox0=\hbox{% |
| 786 |
%\tikz[baseline=(X.base)]{% |
| 787 |
%\filldraw[black,line cap=round]% |
| 788 |
%(#1\unitlength,#2\unitlength) coordinate (X) --% |
| 789 |
%(\XyMTeXnumf\unitlength,\XyMTeXnumg\unitlength) --% |
| 790 |
%(\XyMTeXnumh\unitlength,\XyMTeXnumi\unitlength) -- (#1\unitlength,#2\unitlength);% |
| 791 |
%\draw[dashed,line width=4pt,dash pattern=on 1pt off 1.2pt,color=white]% |
| 792 |
%(\@tempcntXb\unitlength,\@tempcntYb\unitlength) --% |
| 793 |
%(\@tempcntXc\unitlength,\@tempcntYc\unitlength);% |
| 794 |
%}}% |
| 795 |
%\PutBondBox(#1,#2)(\the\@tempcntXc,\the\@tempcntYc){\box0}% |
| 796 |
\tikznodimension{% |
| 797 |
\filldraw% |
| 798 |
(#1\unitlength,#2\unitlength) --% |
| 799 |
(\XyMTeXnumf\unitlength,\XyMTeXnumg\unitlength) --% |
| 800 |
(\XyMTeXnumh\unitlength,\XyMTeXnumi\unitlength) -- (#1\unitlength,#2\unitlength);% |
| 801 |
\draw[dashed,line width=4pt,dash pattern=on 1pt off 1.2pt,color=white]% |
| 802 |
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) --% |
| 803 |
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}% |
| 804 |
\endgroup |
| 805 |
}%%end of \h@shedw@dgebond |
| 806 |
% \end{macrocode} |
| 807 |
% \end{macro} |
| 808 |
% |
| 809 |
% The inner macro |\bond@shorten| works in the macros |\h@shedd@shbond| and |\h@shedw@dgebond| for |
| 810 |
% shortening the resulting hashed bonds. This macro calculates the coordinates of the staring |
| 811 |
% point and the end point. |
| 812 |
% |
| 813 |
% \begin{macro}{bond@shorten} |
| 814 |
% \changes{v4.02}{2004/12/20}{Hashed forms for dash and wedged bonds} |
| 815 |
% \begin{macrocode} |
| 816 |
\def\bond@shorten(#1,#2)(#3,#4)#5/(#6,#7)(#8,#9){% |
| 817 |
\@tempcntXb=#8\relax |
| 818 |
\@tempcntYb=#9\relax |
| 819 |
\advance\@tempcntXb by-#6\relax \divide\@tempcntXb by\@tempcntzz\relax |
| 820 |
\advance\@tempcntYb by-#7\relax \divide\@tempcntYb by\@tempcntzz\relax |
| 821 |
\advance\@tempcntXb by#6\relax |
| 822 |
\advance\@tempcntYb by#7\relax |
| 823 |
\@tempcntXc=#8\relax |
| 824 |
\@tempcntYc=#9\relax |
| 825 |
\advance\@tempcntXc by-#6\relax \divide\@tempcntXc by\@tempcntzzz\relax |
| 826 |
\advance\@tempcntYc by-#7\relax \divide\@tempcntYc by\@tempcntzzz\relax |
| 827 |
\advance\@tempcntXc by#8\relax |
| 828 |
\advance\@tempcntYc by#9\relax |
| 829 |
}%%end of \bondshorten |
| 830 |
% \end{macrocode} |
| 831 |
% \end{macro} |
| 832 |
% |
| 833 |
% Skeletal bold bonds can be changed into wedges, where |
| 834 |
% |\WedgeAsSubst| is described in an ATOMLIST as a kind of |
| 835 |
% spiro substituent. |
| 836 |
% |
| 837 |
% \begin{macro}{WedgeAsSubst} |
| 838 |
% \changes{v4.02}{2004/12/20}{For PS mode: Wedged skeletal bonds} |
| 839 |
% \changes{v5.00}{2010/10/01}{For PDF mode: Checked OK} |
| 840 |
% \begin{macrocode} |
| 841 |
\def\WedgeAsSubstPDF(#1,#2)(#3,#4)#5{% |
| 842 |
\begingroup |
| 843 |
\@thicklineswtrue \@wedgeswtrue |
| 844 |
\molfrontfalse \@skbondlistfalse |
| 845 |
\Put@@@@Line(#1,#2)(#3,#4){#5}% |
| 846 |
\endgroup} |
| 847 |
\let\WedgeAsSubst=\WedgeAsSubstPDF%for compatibility to PS mode |
| 848 |
% \end{macrocode} |
| 849 |
% \end{macro} |
| 850 |
% |
| 851 |
% The macro |\stereo@wedgedimensionX| has a starting point, |
| 852 |
% an endpoint, and the width of a wedge as its arguments. |
| 853 |
% Compare this command with |\stereo@wedgedimension|, which has |
| 854 |
% a starting point, a slope, and the width of a wedge |
| 855 |
% as its arguments. |
| 856 |
% |
| 857 |
% \begin{macro}{stereo@wedgedimensionX} |
| 858 |
% \changes{v5.01}{2013/05/27}{dimension of wedge} |
| 859 |
% \begin{macrocode} |
| 860 |
\def\stereo@wedgedimensionX(#1,#2)(#3,#4){% |
| 861 |
\@ifnextchar[{\stereo@@wedgedimensionX(#1,#2)(#3,#4)}% |
| 862 |
{\stereo@@wedgedimensionX(#1,#2)(#3,#4)[10]}} |
| 863 |
\def\stereo@@wedgedimensionX(#1,#2)(#3,#4)[#5]{% |
| 864 |
\@tempcnta=-#1\relax |
| 865 |
\advance\@tempcnta by#3\relax |
| 866 |
%%\typeout{KKK:\the\@tempcnta}% |
| 867 |
\@tempcntb=-#2\relax |
| 868 |
\advance\@tempcntb by#4\relax |
| 869 |
%%%\typeout{LLL:\the\@tempcntb}% |
| 870 |
\stereo@wedgedimension(\the\@tempcnta,\the\@tempcntb){#5}% |
| 871 |
%%%\typeout{MMM; (\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)} |
| 872 |
\advance\@tempcntXb by#3\relax |
| 873 |
\advance\@tempcntYb by#4\relax |
| 874 |
\advance\@tempcntXc by#3\relax |
| 875 |
\advance\@tempcntYc by#4\relax} |
| 876 |
% \end{macrocode} |
| 877 |
% \end{macro} |
| 878 |
% |
| 879 |
% The macro |\WedgeAsSubstX| has a starting point, |
| 880 |
% an endpoint, and the width of a wedge as its arguments. |
| 881 |
% Compare this command with |\WedgeAsSubst|, which has |
| 882 |
% a starting point, a slope, and the width of a wedge |
| 883 |
% as its arguments. |
| 884 |
% |
| 885 |
% \begin{macro}{WedgeAsSubstX} |
| 886 |
% \changes{v5.01}{2013/05/27}{For PDF mode: Checked OK} |
| 887 |
% \begin{macrocode} |
| 888 |
\def\WedgeAsSubstXPDF(#1,#2)(#3,#4){% |
| 889 |
\@ifnextchar[{\Wedge@AsSubstXPDF(#1,#2)(#3,#4)}% |
| 890 |
{\Wedge@AsSubstXPDF(#1,#2)(#3,#4)[10]}} |
| 891 |
\def\Wedge@AsSubstXPDF(#1,#2)(#3,#4)[#5]{% |
| 892 |
\begingroup |
| 893 |
\stereo@wedgedimensionX(#1,#2)(#3,#4)[#5]% |
| 894 |
\PUT@@@@wedgeLINE(#1,#2)(\the\@tempcntXb,\the\@tempcntYb)(\the\@tempcntXc,\the\@tempcntYc)% |
| 895 |
\endgroup} |
| 896 |
\let\WedgeAsSubstX=\WedgeAsSubstXPDF%for compatibility to PDF mode |
| 897 |
% \end{macrocode} |
| 898 |
% \end{macro} |
| 899 |
% |
| 900 |
% The macro |\NumR@und| gives a round integer. |
| 901 |
% For example 1.99996 is transformed into 2. A negative |
| 902 |
% value is permitted. |
| 903 |
% |
| 904 |
% \begin{macro}{\NumR@und} |
| 905 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 906 |
% \begin{macrocode} |
| 907 |
\def\NumR@und#1.#2#3\@nil{%shishagonyu |
| 908 |
\begingroup |
| 909 |
\XyMTeXcnta=0 \XyMTeXcntb=0\relax |
| 910 |
\XyMTeXcnta=#1 %%\typeout{A:\the\XyMTeXcnta;} |
| 911 |
\XyMTeXcntb=#2 %%\typeout{B:\the\XyMTeXcntb;} |
| 912 |
\ifnum\XyMTeXcnta>0\relax |
| 913 |
\ifnum\XyMTeXcntb<5 \else |
| 914 |
\advance\XyMTeXcnta by1 %%\typeout{C:\the\XyMTeXcnta;} |
| 915 |
\fi |
| 916 |
\else |
| 917 |
\ifnum\XyMTeXcntb<5 \else |
| 918 |
\advance\XyMTeXcnta by-1 %%\typeout{C:\the\XyMTeXcnta;} |
| 919 |
\fi\fi\xdef\@yzobun{\the\XyMTeXcnta}\endgroup} |
| 920 |
% \end{macrocode} |
| 921 |
% \end{macro} |
| 922 |
% |
| 923 |
% The macro |\zahyozobun| calculates the increments of x- and y-coordinates |
| 924 |
% by starting from a slope of the LaTeX picture environment. |
| 925 |
% For example, the slope (5,3) (for the argument \verb/(#3,#4)/ and the x-increment \verb/#5/=171) |
| 926 |
% is transformed to give an x-increment (\verb/\@xzobun/ = 171) and |
| 927 |
% an y-increment (\verb/\@yzobun/ = 103). When the slope is (0,1) etc., we put the |
| 928 |
% x-increment (\verb/\@xzobun/ = 0) and y-increment (\verb/\@yzobun/ = \verb/#5/). |
| 929 |
% |
| 930 |
% \begin{macro}{\zahyozobun} |
| 931 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 932 |
% \changes{v5.01}{2013/03/10}{Bug fix for the slope (0,1) etc.} |
| 933 |
% \begin{macrocode} |
| 934 |
{\catcode`\p=12 \catcode`\t=12 |
| 935 |
\gdef\zobunGain#1pt{\gdef\@zobun{#1}}} |
| 936 |
|
| 937 |
\def\zahyozobun(#1,#2)(#3,#4)#5{% |
| 938 |
\@tempdima=#5\unitlength |
| 939 |
\@tempdimb=#3\unitlength |
| 940 |
\@tempcnta=\@tempdima |
| 941 |
\ifdim\@tempdimb<0pt |
| 942 |
\@tempcntb=-\@tempdimb |
| 943 |
\else |
| 944 |
\@tempcntb=\@tempdimb |
| 945 |
\fi |
| 946 |
%% |
| 947 |
\ifdim\@tempdimb=0pt%bugfix 2013/02/06 |
| 948 |
\else |
| 949 |
%% |
| 950 |
\multiply\@tempcntb by10\relax |
| 951 |
\divide\@tempcntb by65536% |
| 952 |
\divide\@tempdima by \@tempcntb |
| 953 |
\multiply\@tempdima by#4\relax |
| 954 |
\multiply\@tempdima by10 %%\typeout{D:\the\@tempdima} |
| 955 |
\expandafter\zobunGain\the\@tempdima% |
| 956 |
\expandafter\NumR@und\@zobun\@nil |
| 957 |
\fi%%% |
| 958 |
\ifnum#3<0 |
| 959 |
\xdef\@xzobun{-#5}% |
| 960 |
\else |
| 961 |
\ifnum#3=0%bugfix 2013/02/06 |
| 962 |
\xdef\@xzobun{#3}% |
| 963 |
\ifnum#4<0 |
| 964 |
\xdef\@yzobun{-#5}% |
| 965 |
\else |
| 966 |
\xdef\@yzobun{#5}% |
| 967 |
\fi%bugfix 2013/02/06 |
| 968 |
\else |
| 969 |
\xdef\@xzobun{#5}% |
| 970 |
\fi |
| 971 |
\fi |
| 972 |
} |
| 973 |
% \end{macrocode} |
| 974 |
% \end{macro} |
| 975 |
% |
| 976 |
% The inner macro |\bond@sh@rten| works in a similar way to |\bond@shorten| for |
| 977 |
% shortening the resulting hashed bonds. This macro calculates the coordinates of the starting |
| 978 |
% point and the end point. |
| 979 |
% |
| 980 |
% \begin{macro}{\bond@sh@rten} |
| 981 |
% \changes{v5.00}{2010/10/01}{For PDF mode: Hashed forms for dash and wedged bonds} |
| 982 |
% \begin{macrocode} |
| 983 |
\def\bond@sh@rten(#1,#2)(#3,#4)#5{%%%%%%%/(#6,#7)(#8,#9){% |
| 984 |
\zahyozobun(#1,#2)(#3,#4){#5}% |
| 985 |
\@tempcntXb=\@xzobun\relax%%\typeout{SSS:\@xzobun} |
| 986 |
\@tempcntYb=\@yzobun\relax%%\typeout{TTT:\@yzobun} |
| 987 |
\divide\@tempcntXb by\@tempcntzz\relax |
| 988 |
\divide\@tempcntYb by\@tempcntzz\relax |
| 989 |
\advance\@tempcntXb by#1\relax |
| 990 |
\advance\@tempcntYb by#2\relax |
| 991 |
\@tempcntXc=\@xzobun\relax%%\typeout{KKKK:\@xzobun} |
| 992 |
\@tempcntYc=\@yzobun\relax%%\typeout{LLLL:\@yzobun} |
| 993 |
\divide\@tempcntXc by\@tempcntzzz\relax |
| 994 |
\divide\@tempcntYc by\@tempcntzzz\relax |
| 995 |
\advance\@tempcntXc by#1\relax |
| 996 |
\advance\@tempcntXc by\@xzobun\relax%%\typeout{AAAA:\the\@tempcntXc} |
| 997 |
\advance\@tempcntYc by#2\relax |
| 998 |
\advance\@tempcntYc by\@yzobun\relax%%\typeout{BBBB:\the\@tempcntYc} |
| 999 |
}%%end of \bondshorten |
| 1000 |
% \end{macrocode} |
| 1001 |
% \end{macro} |
| 1002 |
|
| 1003 |
% Skeletal hashed dash bonds can be changed into hashed wedges, where |
| 1004 |
% |\HashWedgeAsSubst| is described in an ATOMLIST as a kind of |
| 1005 |
% spiro substituent. This macro is essentially equivalent to |
| 1006 |
% the macro |h@shedw@dgebond|, whose last four arguments are omitted. |
| 1007 |
% |
| 1008 |
% \begin{macro}{HashWedgeAsSubst} |
| 1009 |
% \changes{v4.02}{2004/12/20}{For PS mode: Hashed wedged bonds for stereochemistry} |
| 1010 |
% \changes{v5.00}{2010/10/01}{For PDF mode: Hashed wedged bonds for stereochemistry} |
| 1011 |
% \begin{macrocode} |
| 1012 |
\def\HashWedgeAsSubstPDF(#1,#2)(#3,#4)#5{% |
| 1013 |
\begingroup |
| 1014 |
\zahyozobun(#1,#2)(#3,#4){#5}% |
| 1015 |
\@tempcntXa=\@xzobun\relax |
| 1016 |
\advance\@tempcntXa by#1\relax |
| 1017 |
\@tempcntYa=\@yzobun\relax |
| 1018 |
\advance\@tempcntYa by#2\relax |
| 1019 |
\stereo@wedgedimension(#3,#4){10}% |
| 1020 |
\XyMTeXnumf=\@tempcntXb%%\typeout{CCCCF:\the\XyMTeXnumf} |
| 1021 |
\XyMTeXnumg=\@tempcntYb%%\typeout{CCCCG:\the\XyMTeXnumg} |
| 1022 |
\XyMTeXnumh=\@tempcntXc%%\typeout{CCCCH:\the\XyMTeXnumh} |
| 1023 |
\XyMTeXnumi=\@tempcntYc%%\typeout{CCCCI:\the\XyMTeXnumi} |
| 1024 |
\@tempcntzz=5\relax |
| 1025 |
\@tempcntzzz=-12\relax |
| 1026 |
\bond@sh@rten(#1,#2)(#3,#4){#5}% |
| 1027 |
%\setbox0=\hbox{% |
| 1028 |
%\tikz[baseline=(X.base)]{% |
| 1029 |
%\filldraw[black,line cap=round]% |
| 1030 |
%(#1\unitlength,#2\unitlength) coordinate (X) --% |
| 1031 |
%(\XyMTeXnumf\unitlength,\XyMTeXnumg\unitlength) --% |
| 1032 |
%(\XyMTeXnumh\unitlength,\XyMTeXnumi\unitlength) -- (#1\unitlength,#2\unitlength);% |
| 1033 |
%\draw[dashed,line width=4pt,dash pattern=on 1pt off 1.2pt,color=white]% |
| 1034 |
%(\@tempcntXb\unitlength,\@tempcntYb\unitlength) --% |
| 1035 |
%(\@tempcntXc\unitlength,\@tempcntYc\unitlength);% |
| 1036 |
%}}% |
| 1037 |
%\PutBondBox(#1,#2)(\the\@tempcntXc,\the\@tempcntYc){\box0}% |
| 1038 |
\tikznodimension{% |
| 1039 |
\filldraw% |
| 1040 |
(#1\unitlength,#2\unitlength) coordinate (X) --% |
| 1041 |
(\XyMTeXnumf\unitlength,\XyMTeXnumg\unitlength) --% |
| 1042 |
(\XyMTeXnumh\unitlength,\XyMTeXnumi\unitlength) -- (#1\unitlength,#2\unitlength);% |
| 1043 |
\draw[dashed,line width=4pt,dash pattern=on 1pt off 1.2pt,color=white]% |
| 1044 |
(\@tempcntXb\unitlength,\@tempcntYb\unitlength) --% |
| 1045 |
(\@tempcntXc\unitlength,\@tempcntYc\unitlength);}% |
| 1046 |
\endgroup |
| 1047 |
}%%end of \HashWedgeAsSubstPDF |
| 1048 |
\let\HashWedgeAsSubst=\HashWedgeAsSubstPDF%For compatibility to PS mode |
| 1049 |
% \end{macrocode} |
| 1050 |
% \end{macro} |
| 1051 |
% |
| 1052 |
% The macro |\HashWedgeAsSubstX| has a starting point, |
| 1053 |
% an endpoint, and the width of a wedge as its arguments. |
| 1054 |
% Compare this command with |\HashWedgeAsSubst|, which has |
| 1055 |
% a starting point, a slope, and the width of a wedge |
| 1056 |
% as its arguments. |
| 1057 |
% |
| 1058 |
% \begin{macro}{HashWedgeAsSubstX} |
| 1059 |
% \changes{v5.01}{2013/05/27}{For PDF mode: Hashed wedged bonds for stereochemistry} |
| 1060 |
% \begin{macrocode} |
| 1061 |
\def\HashWedgeAsSubstXPDF(#1,#2)(#3,#4){% |
| 1062 |
\@ifnextchar[{\HashWedge@AsSubstXPDF(#1,#2)(#3,#4)}% |
| 1063 |
{\HashWedge@AsSubstXPDF(#1,#2)(#3,#4)[10]}} |
| 1064 |
\def\HashWedge@AsSubstXPDF(#1,#2)(#3,#4)[#5]{% |
| 1065 |
\begingroup |
| 1066 |
\WedgeAsSubstXPDF(#1,#2)(#3,#4)[#5]% |
| 1067 |
\@tempdima=#5\unitlength \multiply\@tempdima by3\relax |
| 1068 |
\advance\@tempdima by1pt%adjustment |
| 1069 |
\tikznodimension{% |
| 1070 |
\draw[dashed,line width=\@tempdima, |
| 1071 |
dash pattern=on 1pt off 1.2pt,color=white]% |
| 1072 |
(#1\unitlength,#2\unitlength) --% |
| 1073 |
(#3\unitlength,#4\unitlength);}% |
| 1074 |
\endgroup |
| 1075 |
}%%end of \HashWedgeAsSubstXPDF |
| 1076 |
\let\HashWedgeAsSubstX=\HashWedgeAsSubstXPDF%For compatibility to PDF mode |
| 1077 |
% \end{macrocode} |
| 1078 |
% \end{macro} |
| 1079 |
% |
| 1080 |
% Skeletal bold bonds can be changed into wavy bonds, where |
| 1081 |
% |\WavyAsSubst| is described in an ATOMLIST as a kind of |
| 1082 |
% spiro substituent. |
| 1083 |
% |
| 1084 |
% \begin{macro}{\WavyAsSubst} |
| 1085 |
% \changes{v5.01}{2004/06/21}{For PDF mode: Wavy skeletal bonds} |
| 1086 |
% \begin{macrocode} |
| 1087 |
\def\WavyAsSubstPDF(#1,#2)(#3,#4)#5{% |
| 1088 |
\begingroup |
| 1089 |
\wavebondtrue |
| 1090 |
\Put@@@@Line(#1,#2)(#3,#4){#5}% |
| 1091 |
\endgroup} |
| 1092 |
\let\WavyAsSubst=\WavyAsSubstPDF%for compatibility to PS mode |
| 1093 |
% \end{macrocode} |
| 1094 |
% \end{macro} |
| 1095 |
% |
| 1096 |
% The macro |\WavyAsSubstX| has a starting point, |
| 1097 |
% an endpoint, and the width of a wedge as its arguments. |
| 1098 |
% Compare this command with |\WavyAsSubst|, which has |
| 1099 |
% a starting point, a slope, and the width of a wedge |
| 1100 |
% as its arguments. |
| 1101 |
% |
| 1102 |
% \begin{macro}{WedgeAsSubstX} |
| 1103 |
% \changes{v5.01}{2013/06/21}{For PDF mode: Checked OK} |
| 1104 |
% \begin{macrocode} |
| 1105 |
\let\WavyAsSubstXPDF=\PUT@@@@wavyLINE |
| 1106 |
\let\WavyAsSubstX=\WavyAsSubstXPDF%for compatibility to PS mode |
| 1107 |
% \end{macrocode} |
| 1108 |
% \end{macro} |
| 1109 |
% |
| 1110 |
% The command \cs{downnobond} is redefined for pstricks. |
| 1111 |
% \begin{macro}{\upnobond} |
| 1112 |
% \begin{macro}{\downnobond} |
| 1113 |
% \begin{macrocode} |
| 1114 |
%\def\upnobond#1#2{%nochange |
| 1115 |
%\hbox{\hbox to0.72em{\hss#1\hss}\kern-0.72em\raise2.2ex\hbox{#2}}} |
| 1116 |
\def\downnobond#1#2{% |
| 1117 |
\hbox{\smash{\hbox to0.72em{\hss#1\hss}\kern-0.72em\lower2.2ex\hbox{#2}}}} |
| 1118 |
% \end{macrocode} |
| 1119 |
% \end{macro} |
| 1120 |
% \end{macro} |
| 1121 |
% |
| 1122 |
% The macro |\PUT@@@@dashedLINE| is used to draw a dashed bond line, |
| 1123 |
% which usually links two non-adjacent atoms of a cyclic compound. |
| 1124 |
% This macro relies on the |\tikz| graphic enviroment. |
| 1125 |
% |
| 1126 |
% \begin{macro}{\PUT@@@@dashedLINE} |
| 1127 |
% \begin{macro}{\PutPDFdashed} |
| 1128 |
% \begin{macro}{\PutDashedBond} |
| 1129 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 1130 |
% \begin{macrocode} |
| 1131 |
\def\PUT@@@@dashedLINE(#1,#2)(#3,#4)#5{% |
| 1132 |
\begingroup |
| 1133 |
%\ifdim\unitlength>0.08pt |
| 1134 |
%\setbox0=\hbox{% |
| 1135 |
%\tikz[baseline=(X.base)]{% |
| 1136 |
%\draw[dashed,line width=#5,dash pattern=on 1pt off 1.2pt]% |
| 1137 |
%(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}}% |
| 1138 |
%\else |
| 1139 |
%\setbox0=\hbox{% |
| 1140 |
%\tikz[baseline=(X.base)]{% |
| 1141 |
%\draw[dashed,line width=#5,dash pattern=on 0.8pt off 1pt]% |
| 1142 |
%(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}}% |
| 1143 |
%\fi |
| 1144 |
%\PutSimpleBondBox(#1,#2)(#3,#4){\box0}% |
| 1145 |
\ifdim\unitlength>0.08pt |
| 1146 |
\tikznodimension{% |
| 1147 |
\draw[dashed,line width=#5,dash pattern=on 1pt off 1.2pt]% |
| 1148 |
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}% |
| 1149 |
\else |
| 1150 |
\tikznodimension{% |
| 1151 |
\draw[dashed,line width=#5,dash pattern=on 0.8pt off 1pt]% |
| 1152 |
(#1\unitlength,#2\unitlength) -- (#3\unitlength,#4\unitlength);}% |
| 1153 |
\fi |
| 1154 |
\endgroup |
| 1155 |
} |
| 1156 |
\let\PutPDFdashed=\PUT@@@@dashedLINE%for user's use |
| 1157 |
\let\PutDashedBond=\PUT@@@@dashedLINE%for compatibility to PS mode |
| 1158 |
% \end{macrocode} |
| 1159 |
% \end{macro} |
| 1160 |
% \end{macro} |
| 1161 |
% \end{macro} |
| 1162 |
% |
| 1163 |
% The macro |\set@xy@PDFcoords| is used in the macro |\putRoundArrowPDF| |
| 1164 |
% for drawing round arrows. This command supports a format-changing |
| 1165 |
% mechanism to assure the compatibility to the PostScript mode. |
| 1166 |
% |
| 1167 |
% \begin{macro}{\Temp@ArCords} |
| 1168 |
% \begin{macro}{\set@xy@PDFcoords} |
| 1169 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 1170 |
% \begin{macrocode} |
| 1171 |
\newtoks\Temp@ArCords \Temp@ArCords={} |
| 1172 |
\def\set@xy@PDFcoords(#1,#2){% |
| 1173 |
\ifnum\@tempcnta=1\relax |
| 1174 |
\Temp@ArCords={(#1\unitlength,#2\unitlength) }\else |
| 1175 |
\expandafter\Temp@ArCords\expandafter{\the\Temp@ArCords -- % |
| 1176 |
(#1\unitlength,#2\unitlength)}\fi} |
| 1177 |
% \end{macrocode} |
| 1178 |
% \end{macro} |
| 1179 |
% \end{macro} |
| 1180 |
% |
| 1181 |
% The macro |\setRoundArrPDF| is used in the macro |\putRoundArrowPDF| |
| 1182 |
% for drawing round arrows. This command is based on |\tikznodimension| |
| 1183 |
% to draw round arrows. The letter string |\RoundedCornersWidth| stores |
| 1184 |
% the standard roundness st a corner point. |
| 1185 |
% |
| 1186 |
% \begin{macro}{\RoundedCornersWidth} |
| 1187 |
% \begin{macro}{\setRoundArrPDF} |
| 1188 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 1189 |
% \begin{macrocode} |
| 1190 |
\def\RoundedCornersWidth{4pt} |
| 1191 |
\def\setRoundArrPDF#1{% |
| 1192 |
\ifnum\@tempcnta>5\relax |
| 1193 |
\def\RoundedCornersWidth{4pt}% |
| 1194 |
\else |
| 1195 |
\def\RoundedCornersWidth{8pt}\fi |
| 1196 |
\tikznodimension{% |
| 1197 |
\draw[\RoundArrowHead,line width=0.4pt,% |
| 1198 |
rounded corners=\RoundedCornersWidth]#1;}}% |
| 1199 |
% \end{macrocode} |
| 1200 |
% \end{macro} |
| 1201 |
% \end{macro} |
| 1202 |
% |
| 1203 |
% The macro |\putRoundArrowPDF| throws its main task to its inner |
| 1204 |
% macro |\putRound@rrowPDF|, which treats an optional argument |
| 1205 |
% for specifying the direction of an arrow head and reads coordinates |
| 1206 |
% repeatedly by using |\@forendparenthesis|. The |\@forendparenthesis| |
| 1207 |
% command is defined in the \textsf{chemstr} package. |
| 1208 |
% The macro |\putRoundArrow| is defined as a user command to |
| 1209 |
% assure the compatibility to the PostScriot mode. |
| 1210 |
% |
| 1211 |
% \begin{macro}{\putRoundArrowPDF} |
| 1212 |
% \begin{macro}{\putRound@rrowPDF} |
| 1213 |
% \begin{macro}{\putRoundArrow} |
| 1214 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 1215 |
% \begin{macrocode} |
| 1216 |
\def\putRoundArrowPDF{% |
| 1217 |
\@ifnextchar[{\putRound@rrowPDF}{\putRound@rrowPDF[->]}} |
| 1218 |
\def\putRound@rrowPDF[#1]#2{% |
| 1219 |
\edef\RoundArrowHead{#1}% |
| 1220 |
\Temp@ArCords={}\@tempcnta=\@ne\relax |
| 1221 |
\@forendparenthesis\member:=#2\do{% |
| 1222 |
\ifx\member\empty\else |
| 1223 |
\expandafter\set@xy@PDFcoords\member)\fi |
| 1224 |
\advance\@tempcnta\@ne}% |
| 1225 |
\expandafter\setRoundArrPDF\expandafter{\the\Temp@ArCords}% |
| 1226 |
} |
| 1227 |
\let\putRoundArrow=\putRoundArrowPDF |
| 1228 |
% \end{macrocode} |
| 1229 |
% \end{macro} |
| 1230 |
% \end{macro} |
| 1231 |
% \end{macro} |
| 1232 |
% |
| 1233 |
% The command |\changeunitlength| is redefined for using the pgf (tikz) package. |
| 1234 |
% The pgf package uses ``scale'' in optional designations in place of |
| 1235 |
% the setting by \verb/\unitlength/. The setting of \verb/\unitlength=0.1pt/ is |
| 1236 |
% regarded as corresponding to \verb/scale=0.00357/, which is stored in |
| 1237 |
% \verb/\@UScale/ after it is obtained by the \verb/\setUnitScale/ command. |
| 1238 |
% \begin{macro}{\changeunitlength} |
| 1239 |
% \begin{macro}{\UScaleGain} |
| 1240 |
% \begin{macro}{\setUnitScale} |
| 1241 |
% \begin{macrocode} |
| 1242 |
%%added 2010/08/17 |
| 1243 |
{\catcode`\p=12 \catcode`\t=12 |
| 1244 |
\gdef\UScaleGain#1pt{\gdef\@UScale{#1}}} |
| 1245 |
\def\setUnitScale#1{% |
| 1246 |
\@tempdima=#1 \dimen0=1cm |
| 1247 |
\@tempcnta=\@tempdima |
| 1248 |
\@tempcntb=\dimen0 |
| 1249 |
\divide\@tempcntb by65536% |
| 1250 |
\divide\@tempdima by \@tempcntb |
| 1251 |
\expandafter\UScaleGain\the\@tempdima} |
| 1252 |
\setUnitScale{0.1pt}%standard setting |
| 1253 |
%%% |
| 1254 |
\newif\ifsizereduction\sizereductionfalse |
| 1255 |
\def\@@@changeunitlength#1{\unitlength=#1\relax |
| 1256 |
\setUnitScale{#1}%%% scale=\@UScale |
| 1257 |
\ifdim\unitlength<0.1pt \sizereductiontrue |
| 1258 |
\ifdim\unitlength<0.062pt \let\substfontsize=\tiny \else |
| 1259 |
\ifdim\unitlength<0.072pt \let\substfontsize=\scriptsize \else |
| 1260 |
\ifdim\unitlength<0.082pt \let\substfontsize=\footnotesize |
| 1261 |
\fi\fi\fi |
| 1262 |
\else \let\substfontsize=\normalsize\fi} |
| 1263 |
% \end{macrocode} |
| 1264 |
% \end{macro} |
| 1265 |
% \end{macro} |
| 1266 |
% \end{macro} |
| 1267 |
% |
| 1268 |
% \begin{macro}{\red etc.} |
| 1269 |
% \changes{v5.00}{2010/10/01}{bond coloring for PDF mode} |
| 1270 |
% \begin{macrocode} |
| 1271 |
\def\red{\color{red}} |
| 1272 |
\def\green{\color{green}} |
| 1273 |
\def\blue{\color{blue}} |
| 1274 |
\def\cyan{\color{cyan}} |
| 1275 |
\def\magenta{\color{magenta}} |
| 1276 |
\def\yellow{\color{yellow}} |
| 1277 |
\def\black{\color{black}} |
| 1278 |
\def\white{\color{white}} |
| 1279 |
% \end{macrocode} |
| 1280 |
% \end{macro} |
| 1281 |
% |
| 1282 |
% \begin{macro}{\xymcolor} |
| 1283 |
% \begin{macro}{\redx etc.} |
| 1284 |
% These macros are defined to avoid \texttt{**Warning** color stack underflow} |
| 1285 |
% during processing by the dvipdfmx converter. |
| 1286 |
% \changes{v5.00}{2010/10/01}{Added: Colors for TeX/LaTeX mode} |
| 1287 |
% \begin{macrocode} |
| 1288 |
\def\xymcolor#1#2{\mbox{\color{#1}#2}} |
| 1289 |
%defined in the bondcolor packag |
| 1290 |
%\def\redx#1{\xymcolor{red}{#1}} |
| 1291 |
%\def\bluex#1{\xymcolor{blue}{#1}} |
| 1292 |
%\def\greenx#1{\xymcolor{green}{#1}} |
| 1293 |
%\def\blackx#1{\xymcolor{black}{#1}} |
| 1294 |
%\def\cyanx#1{\xymcolor{cyan}{#1}} |
| 1295 |
%\def\yellowx#1{\xymcolor{yellow}{#1}} |
| 1296 |
%\def\magentax#1{\xymcolor{magenta}{#1}} |
| 1297 |
%\def\whitex#1{\xymcolor{white}{#1}} |
| 1298 |
% \end{macrocode} |
| 1299 |
% \end{macro} |
| 1300 |
% \end{macro} |
| 1301 |
% |
| 1302 |
% \begin{macro}{\Color@@@@Line} |
| 1303 |
% \changes{v5.00}{2010/10/01}{For coloring skeletal bond in PDF mode} |
| 1304 |
% The last argument (\#7) specifies a line color. |
| 1305 |
% This command is used in the definition of |\replaceSKbond| |
| 1306 |
% of the \textsf{bondcolor} package by putting \verb/#7=white/. |
| 1307 |
% \begin{macro}{\Color@Line} |
| 1308 |
% \begin{macrocode} |
| 1309 |
\def\Color@@@@Line{% |
| 1310 |
\@ifnextchar[{\C@lor@@@@Line}{\C@lor@@@@Line[0.4pt]}} |
| 1311 |
\def\C@lor@@@@Line[#1](#2,#3)(#4,#5)#6#7{% |
| 1312 |
\begingroup |
| 1313 |
\SlopetoXY(#2,#3)(#4,#5){#6}%% |
| 1314 |
\@tempdime=\unitlength \multiply\@tempdime by#2\relax |
| 1315 |
\@tempdimb=\unitlength \multiply\@tempdimb by#3\relax |
| 1316 |
\@tempdimc=\unitlength \multiply\@tempdimc by\@tempcntXa\relax |
| 1317 |
\@tempdimd=\unitlength \multiply\@tempdimd by\@tempcntYa\relax |
| 1318 |
\tikznodimension{% |
| 1319 |
\draw[line width=#1,color=#7]% |
| 1320 |
(\@tempdime,\@tempdimb) --(\@tempdimc,\@tempdimd);}% |
| 1321 |
\endgroup}%end of \Color@@@@Line |
| 1322 |
\let\Color@Line=\Color@@@@Line%for PDF mode |
| 1323 |
% \end{macrocode} |
| 1324 |
% \end{macro} |
| 1325 |
% \end{macro} |
| 1326 |
% |
| 1327 |
% \begin{macro}{setxymtxpdf} |
| 1328 |
% \changes{v5.00}{2010/10/01}{For PDF mode} |
| 1329 |
% \begin{macrocode} |
| 1330 |
\def\setxymtxpdf{% |
| 1331 |
\@ifnextchar[{\@setxymtxpdf}{\@setxymtxpdf[0.1pt]}} |
| 1332 |
\def\@setxymtxpdf[#1]{% |
| 1333 |
\PDFmodetrue |
| 1334 |
\let\sfpicture=\picture |
| 1335 |
\let\endsfpicture=\endpicture |
| 1336 |
\let\thicklines=\Thick@Lines |
| 1337 |
\let\thinlines=\Thin@Lines |
| 1338 |
\let\Put@Line=\Put@@@@Line |
| 1339 |
\let\Color@Line=\Color@@@@Line%for PDF mode |
| 1340 |
\let\Put@Direct=\Put@@@@Direct |
| 1341 |
\let\Put@oCircle=\Put@@@@oCircle |
| 1342 |
\let\Put@sCircle=\Put@@@@sCircle |
| 1343 |
\let\dotorline=\d@@t@@rline |
| 1344 |
\let\WedgeAsSubst=\WedgeAsSubstPDF%for compatibility to PS mode |
| 1345 |
\let\HashWedgeAsSubst=\HashWedgeAsSubstPDF%For compatibility to PS mode |
| 1346 |
\let\WedgeAsSubstX=\WedgeAsSubstXPDF%for compatibility to PDF mode |
| 1347 |
\let\HashWedgeAsSubstX=\HashWedgeAsSubstXPDF%For compatibility to PDF mode |
| 1348 |
\let\PutBondLine=\PUT@@@@bondLINE%for user's use |
| 1349 |
\let\PutDashedBond=\PUT@@@@dashedLINE%for compatibility to PS mode |
| 1350 |
\let\putRoundArrow=\putRoundArrowPDF%for compatibility to PS mode |
| 1351 |
\let\changeunitlength=\@@@changeunitlength |
| 1352 |
\changeunitlength{#1}% |
| 1353 |
\wedgehasheddash% |
| 1354 |
} |
| 1355 |
\setxymtxpdf |
| 1356 |
%</xymtxpdf> |
| 1357 |
% \end{macrocode} |
| 1358 |
% \end{macro} |
| 1359 |
% |
| 1360 |
% \Finale |
| 1361 |
% |
| 1362 |
\endinput |