* Ugly bug with TikZ in recent ConTeXt MKIV @ 2010-11-17 23:00 Mojca Miklavec 2010-11-18 8:25 ` Alan BRASLAU 2010-11-18 8:48 ` Hans Hagen 0 siblings, 2 replies; 9+ messages in thread From: Mojca Miklavec @ 2010-11-17 23:00 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-17 23:00 Ugly bug with TikZ in recent ConTeXt MKIV Mojca Miklavec @ 2010-11-18 8:25 ` Alan BRASLAU 2010-11-18 8:48 ` Hans Hagen 1 sibling, 0 replies; 9+ messages in thread From: Alan BRASLAU @ 2010-11-18 8:25 UTC (permalink / raw) To: Mojca Miklavec; +Cc: ntg-context 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 ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-17 23:00 Ugly bug with TikZ in recent ConTeXt MKIV Mojca Miklavec 2010-11-18 8:25 ` Alan BRASLAU @ 2010-11-18 8:48 ` Hans Hagen 2010-11-18 9:03 ` Mojca Miklavec 1 sibling, 1 reply; 9+ messages in thread From: Hans Hagen @ 2010-11-18 8:48 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Mojca Miklavec On 18-11-2010 12:00, 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. I have no clue ... maybe some magic tikz variable (or shared register) that does not get reset? \usemodule[tikz] \starttext \startbuffer[1] \starttikzpicture \draw[->] (0,0)--(1cm,1cm); \stoptikzpicture \stopbuffer % \ruledhbox{\getbuffer[1]} \ruledhbox {\ruledhbox{\getbuffer[1]} \ruledhbox{\getbuffer[1]}} \ruledhbox {\ruledhbox{\getbuffer[1]}% \ruledhbox{\getbuffer[1]}} \ruledhbox{\getbuffer[1]} \stoptext Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-18 8:48 ` Hans Hagen @ 2010-11-18 9:03 ` Mojca Miklavec 2010-11-18 9:49 ` Hans Hagen 2010-11-18 10:39 ` Hans Hagen 0 siblings, 2 replies; 9+ messages in thread From: Mojca Miklavec @ 2010-11-18 9:03 UTC (permalink / raw) To: Hans Hagen; +Cc: mailing list for ConTeXt users On Thu, Nov 18, 2010 at 09:48, Hans Hagen wrote: > On 18-11-2010 12:00, 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. Hans, thanks a lot for the really nice simple example. > I have no clue ... maybe some magic tikz variable (or shared register) that > does not get reset? I have no clue either, but this has never been a problem before and it still works perfectly in both pdfTeX and XeTeX. So something really looks suspicious on the MKIV part. I would love to help debugging, but I have zero clue what and where to look for. > \usemodule[tikz] > > \starttext > > \startbuffer[1] > \starttikzpicture > \draw[->] (0,0)--(1cm,1cm); > \stoptikzpicture > \stopbuffer > > % \ruledhbox{\getbuffer[1]} > > \ruledhbox > {\ruledhbox{\getbuffer[1]} > \ruledhbox{\getbuffer[1]}} > > \ruledhbox > {\ruledhbox{\getbuffer[1]}% > \ruledhbox{\getbuffer[1]}} > > \ruledhbox{\getbuffer[1]} > > \stoptext Thanks, Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-18 9:03 ` Mojca Miklavec @ 2010-11-18 9:49 ` Hans Hagen 2010-11-18 16:56 ` Vedran Miletić 2010-11-18 10:39 ` Hans Hagen 1 sibling, 1 reply; 9+ messages in thread From: Hans Hagen @ 2010-11-18 9:49 UTC (permalink / raw) To: Mojca Miklavec; +Cc: mailing list for ConTeXt users On 18-11-2010 10:03, Mojca Miklavec wrote: > On Thu, Nov 18, 2010 at 09:48, Hans Hagen wrote: >> On 18-11-2010 12:00, 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. > > Hans, > > thanks a lot for the really nice simple example. > >> I have no clue ... maybe some magic tikz variable (or shared register) that >> does not get reset? > > I have no clue either, but this has never been a problem before and it > still works perfectly in both pdfTeX and XeTeX. So something really > looks suspicious on the MKIV part. After some tracing and hard thinking Taco and I found interesting spaces showing up in the output that result from a kludge in tikz: Normally one will use \ignorespaces to catch spurious spaces but tikz invokes \nullfont assuming that its fontdimen 2 is zero. But, in context it no longer is (prelude to delayed font loading). You can put this in cont-new.mkiv as a temporary hack \let\normalnullfont\nullfont \def\nullfont {\fontdimen1\normalnullfont\zeropoint \fontdimen2\normalnullfont\zeropoint \fontdimen3\normalnullfont\zeropoint \fontdimen4\normalnullfont\zeropoint \fontdimen5\normalnullfont\zeropoint \fontdimen6\normalnullfont\zeropoint \fontdimen7\normalnullfont\zeropoint \normalnullfont} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-18 9:49 ` Hans Hagen @ 2010-11-18 16:56 ` Vedran Miletić 2010-11-18 17:32 ` Hans Hagen 0 siblings, 1 reply; 9+ messages in thread From: Vedran Miletić @ 2010-11-18 16:56 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Mojca Miklavec [-- Attachment #1.1: Type: text/plain, Size: 1011 bytes --] 2010/11/18 Hans Hagen <pragma@wxs.nl> > After some tracing and hard thinking Taco and I found interesting spaces > showing up in the output that result from a kludge in tikz: > > Normally one will use \ignorespaces to catch spurious spaces but tikz > invokes \nullfont assuming that its fontdimen 2 is zero. But, in context it > no longer is (prelude to delayed font loading). > > You can put this in cont-new.mkiv as a temporary hack > > \let\normalnullfont\nullfont > > \def\nullfont > {\fontdimen1\normalnullfont\zeropoint > \fontdimen2\normalnullfont\zeropoint > \fontdimen3\normalnullfont\zeropoint > \fontdimen4\normalnullfont\zeropoint > \fontdimen5\normalnullfont\zeropoint > \fontdimen6\normalnullfont\zeropoint > \fontdimen7\normalnullfont\zeropoint > \normalnullfont} > > Perhaps this should be forwared to Christian Feuersaenger. He is very open to bug reports and will probably be willing to fix it in some way in TikZ. Regards, -- Vedran Miletić [-- Attachment #1.2: Type: text/html, Size: 1345 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-18 16:56 ` Vedran Miletić @ 2010-11-18 17:32 ` Hans Hagen 0 siblings, 0 replies; 9+ messages in thread From: Hans Hagen @ 2010-11-18 17:32 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Mojca Miklavec On 18-11-2010 5:56, Vedran Miletić wrote: > 2010/11/18 Hans Hagen<pragma@wxs.nl> > >> After some tracing and hard thinking Taco and I found interesting spaces >> showing up in the output that result from a kludge in tikz: >> >> Normally one will use \ignorespaces to catch spurious spaces but tikz >> invokes \nullfont assuming that its fontdimen 2 is zero. But, in context it >> no longer is (prelude to delayed font loading). >> >> You can put this in cont-new.mkiv as a temporary hack >> >> \let\normalnullfont\nullfont >> >> \def\nullfont >> {\fontdimen1\normalnullfont\zeropoint >> \fontdimen2\normalnullfont\zeropoint >> \fontdimen3\normalnullfont\zeropoint >> \fontdimen4\normalnullfont\zeropoint >> \fontdimen5\normalnullfont\zeropoint >> \fontdimen6\normalnullfont\zeropoint >> \fontdimen7\normalnullfont\zeropoint >> \normalnullfont} >> >> > Perhaps this should be forwared to Christian Feuersaenger. He is very open > to bug reports and will probably be willing to fix it in some way in TikZ. feel free to do so; probably something like this is needed: \def\pushnullfont {\edef\popnullfont {\fontdimen2\nullfont\the\fontdimen2\nullfont \fontdimen3\nullfont\the\fontdimen3\nullfont \fontdimen4\nullfont\the\fontdimen4\nullfont}% \fontdimen2\nullfont 0pt\relax \fontdimen3\nullfont 0pt\relax \fontdimen4\nullfont 0pt\relax} \pushnullfont .... \popnullfont as fontdimens are assigned global. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-18 9:03 ` Mojca Miklavec 2010-11-18 9:49 ` Hans Hagen @ 2010-11-18 10:39 ` Hans Hagen 2010-11-18 13:06 ` Mojca Miklavec 1 sibling, 1 reply; 9+ messages in thread From: Hans Hagen @ 2010-11-18 10:39 UTC (permalink / raw) To: Mojca Miklavec; +Cc: mailing list for ConTeXt users Mojca, Can you test the beta on the ftp server and see if tikz works better? (I hate this kind of patching as it is a work around assumptions that are somewhat wrong, in this case the fact that nullfont has zero parameters, and it makes the mkiv code messier.) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Ugly bug with TikZ in recent ConTeXt MKIV 2010-11-18 10:39 ` Hans Hagen @ 2010-11-18 13:06 ` Mojca Miklavec 0 siblings, 0 replies; 9+ messages in thread From: Mojca Miklavec @ 2010-11-18 13:06 UTC (permalink / raw) To: Hans Hagen; +Cc: mailing list for ConTeXt users On Thu, Nov 18, 2010 at 11:39, Hans Hagen <pragma@wxs.nl> wrote: > Mojca, > > Can you test the beta on the ftp server and see if tikz works better? Yes, it works better, thanks. Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-11-18 17:32 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-11-17 23:00 Ugly bug with TikZ in recent ConTeXt MKIV Mojca Miklavec 2010-11-18 8:25 ` Alan BRASLAU 2010-11-18 8:48 ` Hans Hagen 2010-11-18 9:03 ` Mojca Miklavec 2010-11-18 9:49 ` Hans Hagen 2010-11-18 16:56 ` Vedran Miletić 2010-11-18 17:32 ` Hans Hagen 2010-11-18 10:39 ` Hans Hagen 2010-11-18 13:06 ` Mojca Miklavec
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).