Debian Codegraph @

texmf-dist/source/latex/xymtex/base/assurelatexmode.dtx

raw
1 % \iffalse meta-comment
2 %% File: assurelatexmode.dtx
3 %
4 % Copyright 2010,2013 by Shinsaku Fujita
5 %
6 % This file is part of XyMTeX system.
7 % -------------------------------------
8 %
9 % This file (assurelatexmode.sty) is a successor to:
10 %
11 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 % \typeout{XyMTeX for Drawing Chemical Structural Formulas. Version 1.00}
13 % \typeout{ -- Released December 1, 1993 by Shinsaku Fujita}
14 % Copyright (C) 1993 by Shinsaku Fujita, all rights reserved.
15 %
16 % This file is a part of the macro package ``XyMTeX'' which has been
17 % designed for typesetting chemical structural formulas.
18 %
19 % This file is to be contained in the ``xymtex'' directory which is
20 % an input directory for TeX. It is a LaTeX optional style file and
21 % should be used only within LaTeX, because several macros of the file
22 % are based on LaTeX commands.
23 %
24 % For the review of XyMTeX, see
25 % (1) Shinsaku Fujita, ``Typesetting structural formulas with the text
26 % formatter TeX/LaTeX'', Computers and Chemistry, in press.
27 % The following book deals with an application of TeX/LaTeX to
28 % preparation of manuscripts of chemical fields:
29 % (2) Shinsaku Fujita, ``LaTeX for Chemists and Biochemists''
30 % Tokyo Kagaku Dozin, Tokyo (1993) [in Japanese].
31 %
32 % This work may be distributed and/or modified under the
33 % conditions of the LaTeX Project Public License, either version 1.3
34 % of this license or (at your option) any later version.
35 % The latest version of this license is in
36 % http://www.latex-project.org/lppl.txt
37 % and version 1.3 or later is part of all distributions of LaTeX
38 % version 2005/12/01 or later.
39 %
40 % This work has the LPPL maintenance status `maintained'.
41 % The Current Maintainer of this work is Shinsaku Fujita.
42 %
43 % This work consists of the files assurelatexmode.dtx and assurelatexmode.ins
44 % and the derived file lewisstruc.sty.
45 %
46 % Please report any bugs, comments, suggestions, etc. to:
47 % Shinsaku Fujita,
48 % Shonan Institute of Chemoinformatics and Mathematical Chemistry
49 % Kaneko 479-7 Ooimachi, Ashigara-Kami-Gun, Kanagawa 250-0019 Japan
50 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 % \def\j@urnalname{assurelatexmode}
52 % \def\versi@ndate{October 01, 2010}
53 % \def\versi@nno{ver5.00}
54 % \def\copyrighth@lder{SF}% Shinsaku Fujita
55 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 %
57 % \fi
58 %
59 % \CheckSum{189}
60 %% \CharacterTable
61 %% {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
62 %% 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
63 %% Digits \0\1\2\3\4\5\6\7\8\9
64 %% Exclamation \! Double quote \" Hash (number) \#
65 %% Dollar \$ Percent \% Ampersand \&
66 %% Acute accent \' Left paren \( Right paren \)
67 %% Asterisk \* Plus \+ Comma \,
68 %% Minus \- Point \. Solidus \/
69 %% Colon \: Semicolon \; Less than \<
70 %% Equals \= Greater than \> Question mark \?
71 %% Commercial at \@ Left bracket \[ Backslash \\
72 %% Right bracket \] Circumflex \^ Underscore \_
73 %% Grave accent \` Left brace \{ Vertical bar \|
74 %% Right brace \} Tilde \~}
75 %
76 % \setcounter{StandardModuleDepth}{1}
77 %
78 % \StopEventually{}
79 % \MakeShortVerb{\|}
80 %
81 % \iffalse
82 % \changes{v5.00}{2010/10/01}{First release for XyMTeX5.00}
83 % \fi
84 %
85 % \iffalse
86 %<*driver>
87 \NeedsTeXFormat{pLaTeX2e}
88 % \fi
89 \ProvidesFile{assurelatexmode.dtx}[2010/10/01 v5.00 assurelatexmode package file]
90 % \iffalse
91 \documentclass{ltxdoc}
92 \GetFileInfo{lewisstruc.dtx}
93 %
94 % %%XyMTeX Logo: Definition 2%%%
95 \def\UPSILON{\char'7}
96 \def\XyM{X\kern-.30em\smash{%
97 \raise.50ex\hbox{\UPSILON}}\kern-.30em{M}}
98 \def\XyMTeX{\XyM\kern-.1em\TeX}
99 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100 \title{Dummy Declarations for assuring the \protect\TeX/\protect\LaTeX{} mode
101 by {\sffamily assurelatexmode.sty}
102 (\fileversion) of \XyMTeX{}}
103 \author{Shinsaku Fujita \\
104 Shonan Institute of Chemoinformatics and
105 Mathematical Chemistry \\
106 Kanagawa, 258-0019 Japan
107 }
108 \date{\filedate}
109 %
110 \begin{document}
111 \maketitle
112 \DocInput{assurelatexmode.dtx}
113 \end{document}
114 %</driver>
115 % \fi
116 %
117 % \section{Introduction}\label{assurelatexmode:intro}
118 %
119 % \subsection{Options for {\sffamily docstrip}}
120 %
121 % \DeleteShortVerb{\|}
122 % \begin{center}
123 % \begin{tabular}{|l|l|}
124 % \hline
125 % \emph{option} & \emph{function}\\ \hline
126 % assurelatexmode & assurelatexmode.sty \\
127 % driver & driver for this dtx file \\
128 % \hline
129 % \end{tabular}
130 % \end{center}
131 % \MakeShortVerb{\|}
132 %
133 % \subsection{Version Information}
134 %
135 % \begin{macrocode}
136 %<*assurelatexmode>
137 \typeout{Part of XyMTeX for Drawing Chemical Structural Formulas. Version 5.01}
138 \typeout{ -- Released May 27, 2013 by Shinsaku Fujita}
139 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 \def\j@urnalname{assurelatexmode}
141 \def\versi@ndate{May 27, 2013}
142 \def\versi@nno{ver5.01}
143 \def\copyrighth@lder{SF} % Shinsaku Fujita
144 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145 \typeout{XyMTeX Macro File `\j@urnalname' (\versi@nno) <\versi@ndate>%
146 \space[\copyrighth@lder]}
147 % \end{macrocode}
148 %
149 % \begin{macrocode}
150 \RequirePackage{chemstr}
151 % \end{macrocode}
152 %
153 % \section{Dummy Declarations}
154 % If a document written for the PostScript or PDF mode is processed by the TeX/LaTeX mode,
155 % some commands for the PS or PDF mode (defined in the \textsf{xymtx-ps} or \textsf{xymtx-pdf}
156 % package) cause errors of non-existence. To avoid these errors,
157 % dummy commands are defined as follows. These dummy commands are overwritten or replaced by
158 % equivalent commands when processed by the PS or PDF mode.
159 %
160 % \begin{macro}{changedashtowedge}
161 % \begin{macro}{changewedgetodash}
162 % \changes{v5.00}{2010/10/01}{TeX/LaTeX, PS, and PDF modes: Switch for wedged bonds}
163 % \begin{macrocode}
164 \newif\if@wedgesw \@wedgeswtrue
165 \newif\if@hasheddashsw \@hasheddashswtrue
166 \def\wedgehasheddash{\@wedgeswtrue\@hasheddashswtrue}
167 \def\wedgehashedwedge{\@wedgeswtrue\@hasheddashswfalse}
168 \def\dashhasheddash{\@wedgeswfalse\@hasheddashswtrue}
169 \@ifundefined{ifmolfront}{\newif\ifmolfront \molfrontfalse}{}
170 \@ifundefined{if@skbondlist}{\newif\if@skbondlist \@skbondlistfalse}{}
171 % \end{macrocode}
172 % \end{macro}
173 % \end{macro}
174 %
175 % \begin{macro}{\if@thicklinesw etc.}
176 % \changes{v5.00}{2010/10/01}{TeX/LaTeX mode compatible to PS, and PDF modes}
177 % \begin{macrocode}
178 \newif\if@thicklinesw \@thicklineswfalse
179 \def\Thick@Lines{\@thicklineswtrue}%redefinition
180 \def\Thin@Lines{\@thicklineswfalse}%redefinition
181 \def\thickLineWidth{1.6pt}
182 \def\thinLineWidth{0.4pt}
183 % \end{macrocode}
184 % \end{macro}
185 %
186 % \begin{macro}{WedgeAsSubst}
187 % \changes{v5.00}{2010/10/01}{TeX/LaTeX mode compatible to PS, and PDF modes}
188 % \begin{macrocode}
189 \def\WedgeAsSubstTeXLaTeX(#1,#2)(#3,#4)#5{%
190 \begingroup
191 \@thicklineswtrue \@wedgeswtrue
192 \molfrontfalse \@skbondlistfalse
193 \leavevmode
194 \Put@@Line(#1,#2)(#3,#4){#5}%
195 \endgroup}
196 \let\WedgeAsSubst=\WedgeAsSubstTeXLaTeX%for compatibility to PS/PDF mode
197 % \end{macrocode}
198 % \end{macro}
199 %
200 % The macro |\WedgeAsSubstX| has a starting point,
201 % an endpoint, and the width of a wedge as its arguments.
202 % Compare this command with |\WedgeAsSubst|, which has
203 % a starting point, a slope, and the width of a wedge
204 % as its arguments.
205 %
206 % \begin{macro}{WedgeAsSubstX}
207 % \changes{v5.01}{2013/05/27}{TeX/LaTeX mode compatible to PS, and PDF modes}
208 % \begin{macrocode}
209 \def\WedgeAsSubstXTeXLaTeX(#1,#2)(#3,#4){%
210 \@ifnextchar[{\Wedge@AsSubstXTeXLaTeX(#1,#2)(#3,#4)}%
211 {\Wedge@AsSubstXTeXLaTeX(#1,#2)(#3,#4)[10]}}
212 \def\Wedge@AsSubstXTeXLaTeX(#1,#2)(#3,#4)[#5]{%
213 \begingroup
214 %#5 not used
215 \leavevmode \thicklines
216 \drawline(#1,#2)(#3,#4)%
217 \endgroup}
218 \let\WedgeAsSubstX=\WedgeAsSubstXTeXLaTeX%for compatibility to PS/PDF mode
219 % \end{macrocode}
220 % \end{macro}
221 %
222 % The macro |\PUT@@bondLINE| is used in the macro |\Put@@Line|,
223 % which draws a bond line.
224 %
225 % \begin{macro}{\PUT@@bondLINE}
226 % \begin{macro}{\PutTeXLaTeXLine}
227 % \begin{macro}{\PutBondLine}
228 % \changes{v5.00}{2010/10/01}{TeX/LaTeX mode compatible to PS, and PDF modes}
229 % \begin{macrocode}
230 \def\PUT@@bondLINE(#1,#2)(#3,#4)#5{\begingroup%
231 \linethickness{#5}\drawline(#1,#2)(#3,#4)%
232 \endgroup}
233 \let\PutTeXLaTeXLine=\PUT@@bondLINE%for user's use
234 \let\PutBondLine=\PUT@@bondLINE%for user's use
235 % \end{macrocode}
236 % \end{macro}
237 % \end{macro}
238 % \end{macro}
239 %
240 % The macro |\PUT@@dashedLINE| is used to draw a dashed bond line,
241 % which usually links two non-adjacent atoms of a cyclic compound.
242 %
243 % \begin{macro}{\PUT@@dashedLINE}
244 % \begin{macro}{\PutTeXLaTeXdashed}
245 % \begin{macro}{\PutDashedBond}
246 % \changes{v5.00}{2010/10/01}{TeX/LaTeX mode compatible to PS, and PDF modes}
247 % \begin{macrocode}
248 \def\PUT@@dashedLINE(#1,#2)(#3,#4)#5{%
249 \begingroup
250 \ifdim\unitlength>0.08pt
251 \linethickness{#5}\dottedline{20}(#1,#2)(#3,#4)%
252 %\dashline{2}[2](#1,#2)(#3,#4)%
253 \else
254 \linethickness{#5}\dottedline{20}(#1,#2)(#3,#4)
255 %\dashline{1.8}[1.8](#1,#2)(#3,#4)%
256 \fi
257 \endgroup
258 }
259 \let\PutTeXLaTeXdashed=\PUT@@dashedLINE%for user's use
260 \let\PutDashedBond=\PUT@@dashedLINE%for compatibility to PS and PDF mode
261 % \end{macrocode}
262 % \end{macro}
263 % \end{macro}
264 % \end{macro}
265 %
266 % \begin{macro}{\HashWedgeAsSubst}
267 % \changes{v5.01}{2010/05/27}{TeX/LaTeX mode compatible to PS, and PDF modes}
268 % \begin{macrocode}
269 \def\HashWedgeAsSubstTeXLaTeX(#1,#2)(#3,#4)#5{%
270 \begingroup
271 \SlopetoXY(#1,#2)(#3,#4){#5}%%replaced (code from chemstr.sty)
272 \leavevmode
273 \linethickness{1pt}\dottedline{20}(#1,#2)(\the\@tempcntXa,\the\@tempcntYa)%
274 \endgroup}
275 \let\HashWedgeAsSubst=\HashWedgeAsSubstTeXLaTeX%for compatibility to PS and PDF mode
276 % \end{macrocode}
277 % \end{macro}
278 %
279 % The macro |\HashWedgeAsSubstX| has a starting point,
280 % an endpoint, and the width of a wedge as its arguments.
281 % Compare this command with |\HashWedgeAsSubst|, which has
282 % a starting point, a slope, and the width of a wedge
283 % as its arguments.
284 %
285 % \begin{macro}{\HashWedgeAsSubstX}
286 % \changes{v5.01}{2010/05/27}{TeX/LaTeX mode compatible to PS, and PDF modes}
287 % \begin{macrocode}
288 \def\HashWedgeAsSubstXTeXLaTeX(#1,#2)(#3,#4){%
289 \@ifnextchar[{\HashWedge@AsSubstXTeXLaTeX(#1,#2)(#3,#4)}%
290 {\HashWedge@AsSubstXTeXLaTeX(#1,#2)(#3,#4)[10]}}
291 \def\HashWedge@AsSubstXTeXLaTeX(#1,#2)(#3,#4)[#5]{%
292 \begingroup
293 \leavevmode\@tempdima=#5\unitlength
294 \linethickness{\@tempdima}\dottedline{20}(#1,#2)(#3,#4)
295 \endgroup}
296 \let\HashWedgeAsSubstX=\HashWedgeAsSubstXTeXLaTeX%for compatibility to PS and PDF mode
297 % \end{macrocode}
298 % \end{macro}
299 %
300 % The macro |\putRoundArrowTeXLaTeX| throws its main task to its inner
301 % macro |\putRound@rrowTeXLaTeX|, which is incapable of treating
302 % an optional argument for specifying the direction of an arrow head.
303 % The macro |\putRoundArrow| is defined as a user command to
304 % assure the compatibility to the PostScript and the PDF mode.
305 % This command should be used in the PostScript or the PDF mode!
306 %
307 % \begin{macro}{\putRoundArrowTeXLaTeX}
308 % \begin{macro}{\putRound@rrowTeXLaTeX}
309 % \begin{macro}{\putRoundArrow}
310 % \changes{v5.00}{2010/10/01}{For TeXLaTeX mode}
311 % \begin{macrocode}
312 \def\putRoundArrowTeXLaTeX{%
313 \@ifnextchar[{\putRound@rrowTeXLaTeX}{\putRound@rrowTeXLaTeX[->]}}
314 \def\putRound@rrowTeXLaTeX[#1]#2{\drawline#2%
315 \XyMTeXWarning{The command
316 \string\putRoundArrow\space is unavailable in TeX/LaTeX mode. ^^J
317 Please try the PostScript or PDF mode}}
318 \let\putRoundArrow=\putRoundArrowTeXLaTeX%for the compatibility to PDF and PS mode
319 % \end{macrocode}
320 % \end{macro}
321 % \end{macro}
322 % \end{macro}
323 %
324 % \begin{macro}{\thinlines}
325 % \begin{macro}{\thicklines}
326 % \changes{v5.00}{2010/10/01}{TeX/LaTeX mode compatible to PS, and PDF modes}
327 % \begin{macrocode}
328 \gdef\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc
329 \@wholewidth=\thinLineWidth \@halfwidth .5\@wholewidth}
330 \gdef\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
331 \@wholewidth=\thickLineWidth \@halfwidth .5\@wholewidth}
332 \endinput
333 %</assurelatexmode>
334 % \end{macrocode}
335 % \end{macro}
336 % \end{macro}
337 %
338 % \Finale
339 %
340 \endinput