tikz picture is placed align left-upper corner
I draw a figure by tikz but found it is not in the middle but a little left of the page, and then I wrote a piece code and impoved my view. And I tried to add some parameters to put the figure in the middle but failed. Thanks for any tips and test code is below. \usemodule[tikz] \usetikzlibrary[positioning, shapes, shadows, arrows] \usetikzlibrary[backgrounds] \starttext \placefigure[here][fig:pci]{PCI System}{ \framed{ \hbox{ \tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=blue!40, drop shadow, text=white, font=\small] \tikzstyle{cache}=[rectangle, draw=black, rounded corners, fill=green, drop shadow, text=white, font=\small] \starttikzpicture[background rectangle/.style={draw=blue}, framed] \draw[help lines] (-5, -4) grid (5, 1); \node (Processor) [abstract, rectangle split, rectangle split parts=2] { {Processor} \nodepart{second}Cache }; \node (AuxNode01) [below=of Processor] {}; \node (Coherency) [cache, left=of AuxNode01] { {Cache Coherency} }; \node (L2-Cache) [cache, right=of AuxNode01] { {Cache} }; \stoptikzpicture } } } \stoptext
On Tue, 3 May 2011, Gao Ya'nan wrote:
I draw a figure by tikz but found it is not in the middle but a little left of the page, and then I wrote a piece code and impoved my view.
And I tried to add some parameters to put the figure in the middle but failed.
Does this http://archive.contextgarden.net/message/20090722.010815.d9c051d3.en.html help.
\placefigure[here][fig:pci]{PCI System}{ \framed{
Also, in TeX you have to be careful about trailing whitespaces. It is better to use \framed{% or \framed {.... and the same for \hbox etc. Aditya
participants (2)
-
Aditya Mahajan
-
Gao Ya'nan