On Thursday 18 November 2010 00:00:33 Mojca Miklavec wrote:
Dear Hans,
The following example worked perfectly fine with the version of ConTeXt MKIV I was using one hour ago (no idea which version, but something less than two weeks old). It still works OK with MKII and it works much worse in the real document that I'm using.
In my document both images are completely screwed up. Here it's only the second one and if I comment out the first one, the second figure comes out fine, so I'm a bit clueless about what magic is going on inbetween.
Nothing in TikZ has changed (I'm still using the "frozen" version from November 2009 from minimals), so it must have something to do with ConTeXt MKIV. It just messes up with some boxes on the page in some unpredictable way.
\usemodule[tikz] \starttext \placefigure[force][BCl3 sigma]{x}{ \hbox to .9\textwidth{\hss\starttikzpicture \node[circle,inner sep=0pt] (B) at (0,0) {B}; \node[circle,inner sep=0pt] (a1) at ( 90:0.9cm) {Cl}; \node[circle,inner sep=0pt] (a2) at (210:0.9cm) {Cl}; \node[circle,inner sep=0pt] (a3) at (330:0.9cm) {Cl}; \draw (B)--(a1); \draw (B)--(a2); \draw (B)--(a3); \stoptikzpicture \hbox to 2cm{} \starttikzpicture[>=stealth,very thick] % \node[label=above:$a_1$] (a1) at ( 90:1cm) {$a_1$}; \node[circle,inner sep=0pt] (a1) at ( 90:1.2cm) {$a_1$}; \node[circle,inner sep=0pt] (a2) at (210:1.2cm) {$a_2$}; \node[circle,inner sep=0pt] (a3) at (330:1.2cm) {$a_3$}; % \draw[->] (0,0)--(-30:1cm); % \draw[->] (0,0)--( 90:1cm); % \draw[->] (0,0)--(210:1cm); \draw[->] (0,0)--(a1); \draw[->] (0,0)--(a2); \draw[->] (0,0)--(a3); \stoptikzpicture\hss} } \stoptext
Thanks, Mojca
Seems to work OK for me. Alan P.S. You can try (I did not look into "stealth"): \usemodule[tikz] \starttext \placefigure[force][BCl3 sigma]{x}{ \hbox to .9\textwidth{\hss\starttikzpicture \node[circle,inner sep=0pt] (B) at (0,0) {B}; \node[circle,inner sep=0pt] (a1) at ( 90:0.9cm) {Cl}; \node[circle,inner sep=0pt] (a2) at (210:0.9cm) {Cl}; \node[circle,inner sep=0pt] (a3) at (330:0.9cm) {Cl}; \draw (B)--(a1); \draw (B)--(a2); \draw (B)--(a3); \stoptikzpicture \hbox to 2cm{} \starttikzpicture[>=stealth,very thick] \node[circle,inner sep=0pt] (a1) at ( 90:1.2cm) {$a_1$}; \node[circle,inner sep=0pt] (a2) at (210:1.2cm) {$a_2$}; \node[circle,inner sep=0pt] (a3) at (330:1.2cm) {$a_3$}; \draw[->] (0,0)--(a1); \draw[->] (0,0)--(a2); \draw[->] (0,0)--(a3); \stoptikzpicture\hss} } \placefigure [force] [BCl3 sigma bis]{x}{ \framed [frame=off,width=.9\textwidth] { \startMPcode label(textext("B"),(0,0)); for i=1 upto 3: pair p; p := (0.9cm,0) rotated (90+120(i-1)); draw (p scaled .25)--(p scaled .75); label(textext("Cl"),p); endfor \stopMPcode \hbox to 2cm{} \startMPcode for i=1 upto 3: pair p; p := (1.2cm,0) rotated (90+120(i-1)); drawarrow (0,0)--(p scaled .75) withpen pencircle scaled 1pt ;; label(textext("$a_"&decimal i&"$"),p); endfor \stopMPcode } } \stoptext