ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \placefigure not centering
@ 2008-08-27  9:14 Marcin Borkowski
  2008-08-27 17:46 ` Marcin Borkowski
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Borkowski @ 2008-08-27  9:14 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

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
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \placefigure not centering
  2008-08-27  9:14 \placefigure not centering Marcin Borkowski
@ 2008-08-27 17:46 ` Marcin Borkowski
  2008-08-27 19:58   ` Hans Hagen
  2008-08-28 12:23   ` Taco Hoekwater
  0 siblings, 2 replies; 4+ messages in thread
From: Marcin Borkowski @ 2008-08-27 17:46 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

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)
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \placefigure not centering
  2008-08-27 17:46 ` Marcin Borkowski
@ 2008-08-27 19:58   ` Hans Hagen
  2008-08-28 12:23   ` Taco Hoekwater
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2008-08-27 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \placefigure not centering
  2008-08-27 17:46 ` Marcin Borkowski
  2008-08-27 19:58   ` Hans Hagen
@ 2008-08-28 12:23   ` Taco Hoekwater
  1 sibling, 0 replies; 4+ messages in thread
From: Taco Hoekwater @ 2008-08-28 12:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-28 12:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-27  9:14 \placefigure not centering Marcin Borkowski
2008-08-27 17:46 ` Marcin Borkowski
2008-08-27 19:58   ` Hans Hagen
2008-08-28 12:23   ` Taco Hoekwater

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).