Math & Sciencehached and wedged bonds in chemical structures

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
jilly
Posts: 5
Joined: Sat Nov 15, 2008 1:56 am

hached and wedged bonds in chemical structures

Post by jilly »

As colleagues, we have been working on typesetting chemistry using (predominantly) streetex.
The program is both powerful and flexible (much more flexible tht XyMTeX, for example),
but it does not provide hached and wedged bonds that are suitable for our purposes. It
took us a long time to work out the solution, which might have been obvious to more
experienced users. In case it is helpful to members of the community, we would like
to describe our strategy, and post the code definitions we developed.

Streetex works brilliantly in the picture environment, and we found that, using the \put
command, we could position items to less than one-onehundredth of an inch.
However, to create a hached or wedged bond each time one was needed was simply
too time consuming to be considered, and eventually, we defined the sequences
"hached" and "wedged" in such a way that they could be "called" into the picture
environment, and manipulated using \rotatebox. The code below defines the original
bonds we developed, now called \lwedged and \lhached. We have also provided an example
of a structure containing both (you would need the package "street" to read it).

Note that this message continues below the code.

\def\lwedged{
\setlength{\unitlength}{0.1em}
\begin{picture}(22,8)
\put(22,0){\pstriangle*[gangle=90](0,0)(0.21,0.8)}
\end{picture}}

\def\lhached{
\setlength{\unitlength}{0.1em}
\begin{picture}(22,8)
\put(0,3){{\footnotesize{.}}}
\put(1.75,2.75){\line(0,1){1.5}}
\put(3.5,2.5){\line(0,1){2}}
\put(5.25,2.25){\line(0,1){2.5}}
\put(7,2){\line(0,1){3}}
\put(8.75,1.75){\line(0,1){3.5}}
\put(10.5,1.5){\line(0,1){4}}
\put(12.25,1.25){\line(0,1){4.5}}
\put(14,1){\line(0,1){5}}
\put(15.75,0.75){\line(0,1){5.5}}
\put(17.5,0.5){\line(0,1){6}}
\put(19.25,0.25){\line(0,1){6.5}}
\put(21,0){\line(0,1){7}}
\end{picture}}


Example:

\setlength{\unitlength}{0.1em}

\begin{picture}(350,85)

\put(20,53){\stree{0 2 4 6 8 10}}
\put(28,70){\rotatebox{90}{\lwedged}}
\put(28.5,68){\rotatebox{30}{\lhached}}
\put(45,45.5){\rotatebox{-30}{\lhached}}
\put(32.5,41){\rotatebox{-90}{\lhached}}
\put(16.7,38.5){\rotatebox{-150}{\lwedged}}
\put(20,6.5){\stree{2 >4}}
\put(57,82){H}
\put(72,30){OH}
\put(6,20){H}
\put(100,53){ $\displaystyle{\rarrowfill{7em}}$}
\put(115,61){CrO$_{3}$}
\put(115,44){H$_{3}$O$^{+}$}
\end{picture}


If you are familiar with streetex, you will note that these bonds are
somewhat longer than the standard streetex bonds. This works
well for some applications, but we have found that, if we use invisible
bonds, and later insert hached and wedged bonds that are the same
size of the invisible bond, we can use more of the features of streetex
without needing to fuss too much with placement. Therefore, we
developed a shorter version of hached and wedged bonds that can simply
be shifted into place at the point where invisible bonds have been
created. The code follows.


Note that this message continues below the code.

\def\wedged{
\setlength{\unitlength}{0.1em}
\begin{picture}(8,15)
\put(0,0){\pstriangle*[gangle=90](0,0)(0.17,0.55)}
\end{picture}}

\def\hached{
\setlength{\unitlength}{0.1em}
\begin{picture}(5,5)
\put(0,3){\line(0,1){1}}
\put(1.75,2.75){\line(0,1){1.5}}
\put(3.5,2.5){\line(0,1){2}}
\put(5.25,2.25){\line(0,1){2.5}}
\put(7,2){\line(0,1){3}}
\put(8.75,1.75){\line(0,1){3.5}}
\put(10.5,1.5){\line(0,1){4}}
\put(12.25,1.25){\line(0,1){4.5}}
\put(14,1){\line(0,1){5}}
\put(15.75,0.75){\line(0,1){5.5}}
\end{picture}}

Finally, we found that we had to create "wriggly" bonds
\swriggle, below, is the same length as a standard streetex invisible
bond; \wriggle is somewhat longer.

\def\swriggle{
\setlength{\unitlength}{0.1em}
\begin{picture}(5,8)
\put(1,5){\pscurve[linewidth=0.5pt](0,0.1)(-0.1,0)(0,-0.1) (-0.1,-0.2) (0,-0.3)(-0.1,-0.4)}
\end{picture}}

\def\wriggle{
\setlength{\unitlength}{0.1em}
\begin{picture}(5,8)
\put(1,5){\pscurve[linewidth=0.5pt](0,0.1)(-0.1,0)(0,-0.1) (-0.1,-0.2) (0,-0.3) (-0.1,-0.4)(0,-0.5)(-0.1,-0.6)(0,-0.7) (-0.1,-0.8) (0,-0.9) (-0.1,-1)}
\end{picture}}

We'd like to thank the LaTeX community for the help it has given us in
the past, and we hope that this solution may save someone some time.

Cheers

jilly, audreyk, avandyke

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: hached and wedged bonds in chemical structures

Post by localghost »

Somehow I can't manage to translate your code snippets into a compilable document and produce a usable result. So a complete and smoothly compilable example would be very helpful. Nevertheless, many thanks for giving something back.


Best regards
Thorsten
Post Reply