Math & ScienceDipolar bonds with XymTeX

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
feynman
Posts: 6
Joined: Tue Feb 01, 2011 2:03 am

Dipolar bonds with XymTeX

Post by feynman »

unbonpetit wrote:
feynman wrote:I guess you are the same person who reply at the same request into the italian Latex forum. Thanks again for your help :) I'm going to learn TikZ and chemfig after exams :)
Yes, I'm the author of the package, I know it pretty well :lol:
So compliments for the great work :)

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

Dipolar bonds with XymTeX

Post by localghost »

unbonpetit wrote:It is important to undersatnd that the "@" char puts a global tikz node. After that, everything can be done with TikZ and nodes (ie a lot of things) is possible. […]
I was pretty sure that I missed something. Thanks for pointing that out. I tried to draw the arrow by postaction on a path and using an arrow tip as decoration, but had no success.
feynman wrote:So compliments for the great work […]
Now that the problem seems to be solved, please mark the topic accordingly as written in Section 3 of the Board Rules.
unbonpetit

Dipolar bonds with XymTeX

Post by unbonpetit »

localghost wrote:I was pretty sure that I missed something. Thanks for pointing that out. I tried to draw the arrow by postaction on a path and using an arrow tip as decoration, but had no success.
Yes, chemmove (which is a \begin{tikzpicture} with appropriate options) enables to see the nodes defined with a "@" inside a previous molecule.

Code: Select all

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{@aA-B}
\chemmove{\draw[fill=red](a)circle(2pt);}

\chemfig{@aA-@bB}
\chemmove{\draw[red,thick](a)--([yshift=-4mm]a.center)--(b);}

\chemfig{@aA-@bB-[2]@cC}
\chemmove{\fill[blue](a.center)--(b.center)--(c.center)--cycle;}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Dipolar bonds with XymTeX

Post by localghost »

That's indeed really nice. Always good to get ideas at first hand. I'm looking forward to further developments of this excellent package.
unbonpetit

Dipolar bonds with XymTeX

Post by unbonpetit »

localghost wrote:I'm looking forward to further developments of this excellent package.
Hum... Developments? Right now, it's becoming a headache! I rewrote the code of chemfig in plain-tex in order to make the package compatible with all formats. This work is finished and chemfig works well with documents written in TeX, and of course latex. Unfortunately, I can not compile any document written in context which calls chemfig. I do not understand why... For me, something written and working with plain TeX should also work with conTeXt!

If you have any knowledge about this format, could you help me (via PM)?
ShinsakuFujita
Posts: 2
Joined: Wed Aug 17, 2011 9:09 am

Dipolar bonds with XymTeX

Post by ShinsakuFujita »

Too late comment but ...

If you use XyMTeX under PostScript Mode (latex --> dvips etc.),
please try the following code:

Code: Select all

\documentclass{article}
\usepackage{xymtexps}
\begin{document}
\def\updipolar#1{\psline[unit=0.1pt]{->}(40,100)(40,220)\put(0,240){#1}}
\DtetrahedralS{0==\lonepairA[1]{N};0==\updipolar{H$^+$};2==H;3A==H;4B==H}  
\end{document}
If you use XyMTeX under PDF Mode (latex --> dvipdfmx etc.),
please try the following code:

Code: Select all

\documentclass{article}
\usepackage{xymtexpdf}
\begin{document}
\def\updipolar#1{\tikznodimension{%
\draw[-stealth](40\unitlength,100\unitlength)--%
(40\unitlength,220\unitlength);}\put(0,240){#1}}
\DtetrahedralS{0==\lonepairA[1]{N};0==\updipolar{H$^+$};2==H;3A==H;4B==H}  
\end{document}
Last edited by Stefan Kottwitz on Wed Aug 17, 2011 10:46 am, edited 1 time in total.
Post Reply