XΥMTEX for Typesetting Chemical Structural Formulas. Size Reduction and Added Commands for

Version 3.00

Shinsaku Fujita

Department of Chemistry and Materials Technology,

Kyoto Institute of Technology, Matsugasaki, Sakyoku, Kyoto, 606-8585 Japan

April 30, 2002 (For Version 3.00) May 30, 2002 (Revised for Version 4.00)

December 20, 2004 (Typeset by TEX/L^{A}TEX Compatible Mode of Version 4.02)

Contents

1 Introduction 5 1.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 Package Files of XΥMTEX Version 3.00 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Size Reduction 9

2.1 Basic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.1 Changing Unit Lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.2 Size Reduction of Carbocycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1.3 Size Reduction of Heterocycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.4 Nested Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Chapter 1

Introduction

1.1 History

The previous versions of the XΥMTEX system are summarized in Table 1.1. A brief history has been described in the on-line manual attached to Version 2.00. The manual for Version 1.01 (attached to this distribution and published as a reference book [3]) and the manual for Version 2.00 (attached to this distribution) have described the specification and the usage of commands supported by the XΥMTEX system. They are still effective for Version 3.00.

Table 1.1: Versions of XΥMTEX

version  package files and comments

1.00 (1993) (for L^{A}TEX2.09) See Ref. [1, 2]. aliphat.sty, carom.sty, lowcycle.sty, hetarom.sty, hetaromh.sty, hcycle.sty, chemstr.sty, locant.sty, xymtex.sty

1.01 (1996) (for L^{A}TEX 2ε) See Ref. [3]. ccycle.sty, polymers.sty, chemist.sty
1.02 (1998) (not released) Nested substitution by ‘yl’-function.

2.00 (1998) Enhanced version based on the XΥM Notation. See Ref. [4]. fusering.sty, methylen.sty

2.01 (2001) (not released) Size reduction, sizeredc.sty (version 1.00)

3.00 (2002) (this version) Size reduction (sizeredc.sty, version 1.01), and reconstruction of the command system

To be as portable as possible, the XΥMTEX system has been designed to depend on the L^{A}TEX picture environment and only one command of epic.sty (\dottedline), since the mechanism of epic.sty for obtaining the slope of a line sometimes provides an erroneous result so that it occasionally gives a split line. For

example, the commands \drawline(0,0)(171,103) and \drawline(0,0)(171,-103) of epic.sty under

\unitlength=0.08pt give the following split lines if we encounter the wrongest situation:

[figure]

This is because we have adopted the \dottedline of epic.sty only in the XΥMTEX system. This means, however, that the previous versions of XΥMTEX have no methods of reducing the size of a formula into less than \unitlength=0.1pt, since the original picture environment of L^{A}TEX 2ε cannot draw a short line.

The XΥMTEX version 2.00 permits us to a nested usage of commands, where many flags (\@acliptrue etc.) have been declared for designating vertices to be clipped. It follows that these flags may interfere each other in a nested condition.

Accordingly, the purposes of the present version (3.00) are

1. to give functions for reducing sizes of structural formulas (sizeredc.sty),

2. to give a more reliable mechanism for clipping (truncating) vertices, and

3. to add further commands for drawing cyclic sugars (hcycle.sty).

1.2 Package Files of XΥMTEX Version 3.00

The XΥMTEX system (version 3.00) consists of package files listed in Table 1.2.

Table 1.2: Package Files of XΥMTEX

package name  included functions
aliphat.sty  macros for drawing aliphatic compounds

carom.sty macros for drawing vertical and horizontal types of carbocyclic

compounds

lowcycle.sty  macros for drawing five-or-less-membered carbocycles.
ccycle.sty  macros for drawing bicyclic compounds etc.
hetarom.sty  macros for drawing vertical types of heterocyclic compounds
hetaromh.sty macros for drawing horizontal types of heterocyclic compounds

hcycle.sty macros for drawing pyranose and furanose derivatives (added further commands for cyclic sugars in Version 3.00)

chemstr.sty  basic commands for atom- and bond-typesetting
locant.sty  commands for printing locant numbers
polymers.sty  commands for drawing polymers
fusering.sty  commands for drawing units for ring fusion
methylen.sty  commands for drawing zigzag polymethylene chains
xymtex.sty  a package for calling all package files
chemist.sty  commands for using ‘chem’ version and chemical environments
sizeredc.sty  commands for size reduction (Version 1.01)

The use of xymtex.sty calling all package files may sometimes cause the “TEX capacity exceeded” error. In this case, you should call necessary packages distinctly by using the \usepackage command in the following way:

\documentclass{article}
%\usepackage{xymtex}% to use for large capacity of computer
\usepackage{carom}
\usepackage{hetaromh}
\usepackage{aliphat,hcycle}
\usepackage{fusering}
\usepackage{locant}
\usepackage{epic}
\usepackage{sizeredc}

\usepackage{xymman}
\begin{document}
(texts and formulas)
\end{document}

Chapter 2

Size Reduction

2.1 Basic Functions

2.1.1 Changing Unit Lengths

The default unit length of the XΥMTEX system is equal to 0.1pt. This setting can be changed by the command \changeunitlength, which is defined in the sizeredc.sty package. As shown in the following code, the setting by \changeunitlength can be done in the preamble of a document if the value is used in the whole document.

\documentclass{article}
\usepackage{carom}
\usepackage{sizeredc}
\changeunitlength{0.08pt}
\begin{document}
\bzdrv{1==OH;4==OH}
\end{document}

[figure: OH; OH]

Compare this formula with the counterpart with the standard unit length (0.1pt).

[figure: OH; OH]

The command \changeunitlength can be declared at any place of a document, where the setting of the command is effective after the declaration place until an alternative declaration is carried out afterward. The grouping technique can be used to limit the effect of the setting within a pair of braces. For example, the code represented by

{%grouping by braces
\changeunitlength{0.06pt}
\bzdrv{1==OH;4==OH}}
\qquad \bzdrh{1==OH;4==OH}

produces a size-reduced formula as follows:

[figure: OH; OH; OH; OH]

The \changeunitlength sets a unit length given as an argument and declares a flag represented by \sizereductiontrue if the argument is less than 0.1pt. The flag is used to substitute the \drawline command of epic.sty for the \line command of L^{A}TEX 2ε. Hence, the following setting is equivalent to the setting derived from the declaration command \changeunitlength{0.05pt} within the TEX/L^{A}TEX compatible mode.

                {%
                \scriptsize
                \unitlength=0.05pt
                \sizereductiontrue
                \bzdrv{1==OH;4==OH}
                }

{OH \atop OH}

2.1.2 Size Reduction of Carbocycles

When the \sizereductiontrue is not declared (i.e. \sizereductionfalse), the original picture environment of L^{A}TEX 2ε works. The following example shows the comparison between cases with and without the use of sizeredc.sty. Note Version 4.00 requires the declaration of \originalpicture.

\begin{table}
\caption{With and Without \textsf{sizeredc.sty}}
\label{tt:300c}
\begin{center}
\begin{tabular}{ll}
\hline
without \textsf{sizeredc.sty} & with \textsf{sizeredc.sty} \\
\hline
0.08pt &  \\
{\originalpicture\unitlength=0.08pt \bzdrv{}} &
{\changeunitlength{0.08pt}\bzdrv{}} \\
0.07pt & \\
{\originalpicture\unitlength=0.07pt\bzdrv{}} &
{\changeunitlength{0.07pt}\bzdrv{}} \\
0.06pt & \\
{Version 4.00 \originalpicture\unitlength=0.06pt \bzdrv{}} &
{\changeunitlength{0.06pt}\bzdrv{}} \\
\hline
\end{tabular}
\end{center}
\end{table}

Table 2.1: With and Without sizeredc.sty

without sizeredc.sty with sizeredc.sty

0.08pt

[figure]

0.07pt

[figure]

0.06pt

[figure]

This code gives the results shown in Table 2.1. Without sizeredc.sty, the resulting formulas (0.07pt and 0.06pt in the left column) have no slanting lines (inner double bonds) in agreement with the original specification of the L^{A}TEX 2ε picture environment.^{1} By using sizeredc.sty, the slanted lines are revived, as shown in the right column of Table 2.1.

2.1.3 Size Reduction of Heterocycles

Table 2.2 shows the effect of size reduction to the drawing of 4-chloropyridine, where \unitlength is changed from 0.1pt (default value) to 0.04pt by using \changeunitlength.

Table 2.2: Size Reduction of 4-Chloropyridine

0.1pt  0.08pt  0.07pt  0.06pt  0.05pt  0.04pt

(default)

[figure: N; Cl; N; Cl; N; Cl; N; Cl; ^{^{N}^{Cl}}; ^{^{N}^{Cl}}]

1Note that XΥMTEX is based on the L^{A}TEX 2ε picture environment without using sizeredc.sty. The slanted lines of the benzene ring are drawn by the \line command with slopes (5, 3) and (5, −3).

2.1.4 Nested Substitution

Formulas by nested substitution can be totally reduced in size by the following code:

\changeunitlength{0.07pt}
\scriptsize
\decaheterov[]{4a==N}{4D==O;7B==HO;{{10}A}==H;%
5==\bzdrv{3==OMe;4==OMe;6==Br;1==(yl)}}

This code produces the left formula shown below:

[figure: N; O; HO; OMe; OMe; Br; H; N; O; HO; OMe; OMe; Br; H]

The right formula is drawn by the same code with the standard unit length (0.1pt).

Spaces between dots in a dotted line can be changed by redefining the command \dottedline as follows.

\makeatletter
\let\olddottedline=\dottedline
\def\dottedline#1(#2,#3)(#4,#5){\ifsizereduction
\olddottedline{30}(#2,#3)(#4,#5)\else
\olddottedline{#1}(#2,#3)(#4,#5)\fi}
\makeatother
\changeunitlength{0.07pt}
\scriptsize
\decaheterov[]{4a==N}{4D==O;7B==HO;{{10}A}==H;%
5==\bzdrv{3==OMe;4==OMe;6==Br;1==(yl)}}

[figure]

[figure]

[figure]

[figure]

N

O HO

[figure: OMe; OMe; Br]

H

A cyan dye releaser has been drawn by using two or more \ryl and \lyl commands, as shown in the on-line manual of XΥMTEX Version 2.00 and has also been depicted in different ways (see Chapters 14 and 15 of the XΥMTEXbook [3]). The size of the formula can be reduced with a code represented by

\changeunitlength{0.07pt}
%\changeunitlength{0.08pt}
\scriptsize
\bzdrv{1==OH;5==CH$_{3}$;4==OC$_{16}$H$_{33}$;%
2==\ryl(4==NH--SO$_{2}$){4==\bzdrh{1==(yl);2==OCH$_{2}$CH$_{2}$OCH$_{3}$;%
5==\ryl(2==NH--SO$_{2}$){4==\bzdrh{1==(yl);%
5==\ryl(2==SO$_{2}$--NH){4==\naphdrh{1==(yl);5==OH;%
8==\lyl(4==N=N){4==\bzdrh{4==(yl);1==NO$_{2}$;5==SO$_{2}$CH$_{3}$}}}}}}}}}

Thereby, we obtain a target formula:

—0.07pt:

[figure: OH; CH_{3}; OC_{16}H_{33}; NH–SO_{2}; OCH_{2}CH_{2}OCH_{3}; NH–SO_{2}; SO_{2}–NH; OH; N=N; NO_{2}; SO_{2}CH_{3}]

—0.08pt:

[figure: OH; CH_{3}; OC_{16}H_{33}; NH–SO_{2}; OCH_{2}CH_{2}OCH_{3}; NH–SO_{2}; SO_{2}–NH; OH; N=N; NO_{2}; SO_{2}CH_{3}]

A further reduction is possible. The following example shows the case of \unitlength=0.05pt and font size of \tiny.

—0.05pt:

OH CH3  OC16H33 NH–SO2 OCH2CH2OCH3 NH–SO2 SO2–NH _{OH N=N _{NO2  SO2CH3}}

The structural formula of adonitoxin, which has once been depicted in a different way in Chapter 15 of the XΥMTEXbook can be obtained by the code,

\steroid{{{10}}==\lmoiety{OHC};{{14}}==OH;%
{{13}}==\lmoiety{H$_{3}$C};{{16}}==OH;%
{{17}}==\fiveheterov[e]{3==O}{4D==O;1==(yl)};%
3==\lyl(3==O){8==%
\pyranose{1Sb==(yl);1Sa==H;2Sb==H;2Sa==OH;3Sb==H;3Sa==OH;4Sb==HO;%
4Sa==H;5Sb==H;5Sa==CH$_{3}$}}}

—0.1pt

[figure: O; O; H; H; OH; H; OH; HO; H; H; CH_{3}; OH; O; O; OHC; OH; H_{3}C]

—0.08pt

[figure: O; O; H; H; OH; H; OH; HO; H; H; CH_{3}; OH; O; O; OHC; OH; H_{3}C]

[figure: O; O; H; H; OH; H; OH; HO; H; H; CH_{3}; OH; O; O; OHC; OH; H_{3}C]

Bibliography

[1] Fujita S., “Typesetting structural formulas with the text formatter TEX/L^{A}TEX”, Comput. Chem., 18, 109 (1994).

[2] Fujita S., “XΥMTEX for Drawing Chemical Structural Formulas”, TUGboat, 16 (1), 80 (1995).

[3] Fujita, S., XΥMTEX—Typesetting Chemical Structural Formulas, Addison-Wesley, Tokyo (1997). The book title is abbreviated as “XΥMTEXbook” in the present manual.

[4] Fujita, S.; Tanaka, N. “XyM Notation for Electronic Communication of Organic Chemical Structures”, J. Chem. Inf. Comput. Sci., 39, 903 (1999).

[5] NIFTY-Serve achieves, FPRINT library No. 7, Item Nos. 201, 202, 204.

[6] CTAN, tex-archive/macros/latex209/contrib/xymtex/.

[7] Lamport L., L^{A}TEX. A document Preparation System, 2nd ed. for L^{A}TEX 2ε, Addison-Wesley, Reading (1994). See also Lamport L., L^{A}TEX. A document Preparation System, Addison-Wesley, Reading (1986).

[8] Goossens, M., Mittelbach, F., & Samarin, A., The L^{A}TEX Companion, Addison-Wesley, Reading (1994).

[9] NIFTY-Serve achieves, FPRINT library No. 7, Item Nos. 385, 386.

[10] http://imt.chem.kit.ac.jp/fujita/fujitas/fujita.html

[11] For the TEX system, see Knuth D. E., The TEXbook, Addison-Wesley, Reading (1984).

[12] For the ChemTEX macros, see Haas R. T. & O’Kane K. C., Comput. Chem., 11, 251 (1987).

[13] For drawing chemical formulas by TEX, see Ramek, M., in Clark, M. (ed), TEX: Applications, Uses, Methods, Ellis Horwood, London (1990), p. 277.

[14] For chemical application of the L^{A}TEX system, see Fujita S., Kagakusha-Seikagakusha no tame no L^{A}TEX (L^{A}TEX for Chemists and Biochemists), Tokyo Kagaku Dozin, Tokyo (1993).

[15] For epic macros, see Podar S., “Enhancements to the picture environment of L^{A}TEX”, Manual for Version 1.2 dated July 14, 1986.

[16] For graphic applications of TEX, L^{A}TEX and relevant systems, see Goossens, M., Rahtz, S., & Mittelbach, F., L^{A}TEX Graphics Companion, Addison Wesley Longman, Reading (1997).