Hey! Seems I'm going to ask lots of questions here - I'm starting to _really_ use ConTeXt;). Why this does not center the figure horizontally? What should I do to center it? \placefigure{none}{ \starttikzpicture[scale=0.3] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture } I discovered that using combinations with "1*1" helps, but this is a dirty trick;). (Also, "none" as a label does not work with combinations - is it a bug or a feature?) Thanks in advance -- Marcin Borkowski (http://mbork.faculty.fmcs.amu.edu.pl) _ _ _ / \ / \ / \ OSTRE SŁOWA \_/ \_/ \_/ OSTRA MUZYKA / \ / \ / \ OSTRA PŁYTA \_/ \_/ \_/ 2 Tm 2,3
Dnia Wed, Aug 27, 2008 at 11:14:26AM +0200, Marcin Borkowski napisał(a):
Why this does not center the figure horizontally? What should I do to center it?
\placefigure{none}{ \starttikzpicture[scale=0.3] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }
I discovered that using combinations with "1*1" helps, but this is a dirty trick;). (Also, "none" as a label does not work with combinations - is it a bug or a feature?)
OK, so I'm answering myself. The problem is (I guess so at least) that the second parameter somehow gets typeset "as a paragraph" - that is, with full paragraph's width (=width of the whole column). Since nothing is said about centering, it is flush left. This helps: \placefigure{none}{\hbox{ \starttikzpicture[scale=0.5] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }} Maybe it's not very clean, but it seems to work. If anyone has a cleaner (more "ConTeXt-way-ish" solution), I'd be thankful for a hint. Greets -- Marcin Borkowski (http://mbork.faculty.fmcs.amu.edu.pl)
Marcin Borkowski wrote:
Dnia Wed, Aug 27, 2008 at 11:14:26AM +0200, Marcin Borkowski napisał(a):
Why this does not center the figure horizontally? What should I do to center it?
\placefigure{none}{ \starttikzpicture[scale=0.3] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }
I discovered that using combinations with "1*1" helps, but this is a dirty trick;). (Also, "none" as a label does not work with combinations - is it a bug or a feature?)
OK, so I'm answering myself. The problem is (I guess so at least) that the second parameter somehow gets typeset "as a paragraph" - that is, with full paragraph's width (=width of the whole column). Since nothing is said about centering, it is flush left. This helps:
\placefigure{none}{\hbox{ \starttikzpicture[scale=0.5] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }}
Maybe it's not very clean, but it seems to work. If anyone has a cleaner (more "ConTeXt-way-ish" solution), I'd be thankful for a hint.
often
\placefigure{none}{\dontleavehmode \starttikzpicture[scale=0.5] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }
works as well; the second ars to placefigure goes into a vbox Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Marcin Borkowski wrote:
Dnia Wed, Aug 27, 2008 at 11:14:26AM +0200, Marcin Borkowski napisał(a):
Why this does not center the figure horizontally? What should I do to center it?
\placefigure{none}{ \starttikzpicture[scale=0.3] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }
I discovered that using combinations with "1*1" helps, but this is a dirty trick;). (Also, "none" as a label does not work with combinations - is it a bug or a feature?)
OK, so I'm answering myself. The problem is (I guess so at least) that the second parameter somehow gets typeset "as a paragraph" - that is, with full paragraph's width (=width of the whole column). Since nothing is said about centering, it is flush left. This helps:
\placefigure{none}{\hbox{ \starttikzpicture[scale=0.5] \draw (0,0) -- (5,0) -- (4.5,6) -- (1.5,6) -- cycle; \stoptikzpicture }}
Maybe it's not very clean, but it seems to work. If anyone has a cleaner (more "ConTeXt-way-ish" solution), I'd be thankful for a hint.
You could probably use \framed[frame=off]{} instead of \hbox{} Best wishes, Taco
participants (3)
-
Hans Hagen
-
Marcin Borkowski
-
Taco Hoekwater