ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger <w.egger@boede.nl>
Subject: Re: placing a tikz/pgf figure
Date: Tue, 09 Jan 2007 19:15:52 +0100	[thread overview]
Message-ID: <45A3DBD8.70803@boede.nl> (raw)
In-Reply-To: <20070109164240.58526.qmail@web51807.mail.yahoo.com>

Indeed I also get the results as you describe them. When looking at the 
file *.tmp then you see, that the figure is generated on the fly. When 
external figure is issued, then the textwidth is the base and therefore 
the figure ends up leftaligned. -- In such cases I prefer to have the 
figures prepared in a separate pdf-file by means of
    \startTEXpage -- \stopTEXpage. Afterwards I include the TEXpages 
with \externalfigure referencing the page in the file obtained. -- In my 
experience this makes the runs faster.

Kind regards

Willi

M.J. Kallen wrote:
> Hi all,
>
> I'm trying to determine how to best insert a figure/graph created using the tikz/pgf module (I'm using v1.10). The attached sample file compares the result of just using \placefigure and \placefigure with \startcombination[1*1]. In the first case, the result is not centered (which should be default in ConTeXt, if I'm correct) but flushed left. Only if I place the figure inside a \startcombination by using \input, do I get the desired result. If I use \externalfigure inside the \startcombination, I again get an incorrect result. 
>
> In theory, the first version should work but some special settings (using e.g. \useexternalfigure) may be required. I do not know why the second version does work. Does anyone have an idea?
>
> Thanks,
>
> Maarten-Jan
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> ------------------------------------------------------------------------
>
> \usemodule[tikz]
> \setupfloat[figure][location=middle,frame=on]
>
> \starttext
>
> \startbuffer[tikz]
> \starttikzpicture
> \draw[red,thick] (0,0) -- (1,1)
> 	     {[rounded corners] -- (2,0) -- (3,1)}
> 	          -- (3,0) -- (2,1);
> \stoptikzpicture
> \stopbuffer
>
> \placefigure
> 	[here]
> 	[fig:test1]
> 	{The figure is flushed left, whereas it should be centered.}
> 	{\externalfigure[tikz.tmp]}
>
> \placefigure
> 	[here]
> 	[fig:test2]
> 	{Using \type{\startcombination[1*1]} together with \type{\input}, the result looks as expected.}
> 	{\startcombination[1*1]
> 		{\input test-pgf-tikz.tmp } {}
> 	\stopcombination
> 	}
>
> \placefigure
> 	[here]
> 	[fig:test3]
> 	{Using \type{\startcombination[1*1]} together with \type{\externalfigure}, the result looks again as in the first figure.}
> 	{\startcombination[1*1]
> 		{\externalfigure[tikz.tmp]} {}
> 	\stopcombination
> 	}
>
>
> \stoptext
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   

  reply	other threads:[~2007-01-09 18:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 16:42 M.J. Kallen
2007-01-09 18:15 ` Willi Egger [this message]
2007-01-09 19:26   ` Hans Hagen
2007-01-09 22:51     ` Aditya Mahajan
2007-01-09 23:26     ` Mojca Miklavec
2007-01-10 20:08     ` Willi Egger
2007-01-10  0:21 ` Mojca Miklavec
2007-01-10  1:08   ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45A3DBD8.70803@boede.nl \
    --to=w.egger@boede.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).