Re: [NTG-context] Problem with text floating around tikz picture

2008-09-29 Thread Hans Hagen
Mojca Miklavec wrote:
> Hello,
> 
> I'm forwarding the author's answer back to the mailing list. If anyone
> has some nice idea about possible solutions, let us/him know ...
> I don't remember how I was solving such problems so far, but I know
> that I have always been missing:
> 
> % maybe even some external file with extremely long code
> \starttikzpicture{picture name}
> 
> \stoptikzpicture
> 
> \placefigure{some figure}{\usetikzpicture{picture name}}
> 
> If that was implemented, maybe \usetikzpicture could be inside an hbox?
> 
> Mojca
> 
> On Mon, Sep 29, 2008 at 3:12 PM, Till Tantau wrote:
>> Hi!
>>
>> the problem is caused by the fact that a tikz/pgf picture is a \hbox, but
>> with \leavevmode before it. This turned out to be necessary to ensure that
>> tikzpictures behave the same way for all backend drivers.
>>
>> Certainly the added \hbox is a correct solution to this problem since it
>> gets tex back into the right "mode"...
>>
>> I don't really know how to change this in an elegant manner since existing
>> code will now assume that tikzpictures are always set in horizontal mode, so
>> any change could have desastrous consequences for existing documents.

maybe you can use (in the context variant)

   \ifinsidefloat

(true when inside a floating body, so just then put an hbox around it)

(sometimes putting \dontleavehmode in front also helps)

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
___


Re: [NTG-context] Problem with text floating around tikz picture

2008-09-29 Thread Mojca Miklavec
Hello,

I'm forwarding the author's answer back to the mailing list. If anyone
has some nice idea about possible solutions, let us/him know ...
I don't remember how I was solving such problems so far, but I know
that I have always been missing:

% maybe even some external file with extremely long code
\starttikzpicture{picture name}
...
\stoptikzpicture

\placefigure{some figure}{\usetikzpicture{picture name}}

If that was implemented, maybe \usetikzpicture could be inside an hbox?

Mojca

On Mon, Sep 29, 2008 at 3:12 PM, Till Tantau wrote:
> Hi!
>
> the problem is caused by the fact that a tikz/pgf picture is a \hbox, but
> with \leavevmode before it. This turned out to be necessary to ensure that
> tikzpictures behave the same way for all backend drivers.
>
> Certainly the added \hbox is a correct solution to this problem since it
> gets tex back into the right "mode"...
>
> I don't really know how to change this in an elegant manner since existing
> code will now assume that tikzpictures are always set in horizontal mode, so
> any change could have desastrous consequences for existing documents.
>
> Sorry,
> Till
>
>
> Am 22.09.2008 um 20:13 schrieb Mojca Miklavec:
>
>> On Mon, Sep 22, 2008 at 8:03 PM, Marcin Borkowski
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi again;),
>>>
>>> this won't work:
>>>
>>> \placefigure[right]{none}{\starttikzpicture
>>> \draw (0,0) -| (2,2) -| (0,0) -- (2,2)
>>>  (2,0) -- (0,2)
>>>  (1,1) circle(1);
>>> \stoptikzpicture}
>>> (some text...)
>>>
>>> The tikzpicture apparently extends to the whole text width, resulting in
>>> an overfull box (and nasty paragraph formatting).  Putting it into an
>>> \hbox helps, so I know what to do; the question is, _why_ this works
>>> that way?
___
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
___


Re: [NTG-context] Problem with text floating around tikz picture

2008-09-22 Thread Hans Hagen
Marcin Borkowski wrote:
> Hi again;),
> 
> this won't work:
> 
> \placefigure[right]{none}{\starttikzpicture
>   \draw (0,0) -| (2,2) -| (0,0) -- (2,2)
> (2,0) -- (0,2)
> (1,1) circle(1);
> \stoptikzpicture}
> (some text...)
> 
> The tikzpicture apparently extends to the whole text width, resulting in
> an overfull box (and nasty paragraph formatting).  Putting it into an
> \hbox helps, so I know what to do; the question is, _why_ this works
> that way?

\starttikzpicture

should do the box trick ...

\let\normalstarttikzpicture\starttikzpicture
\let\normalstoptikzpicture \stoptikzpicture

\def\starttikzpicture{\hbox\bgroup\nomalstarttikzpicture}
\def\stoptikzpicture {\nomalstoptikzpicture\egroup}

but i'm not maintaining thst module myself

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
___


[NTG-context] Problem with text floating around tikz picture

2008-09-22 Thread Marcin Borkowski
Hi again;),

this won't work:

\placefigure[right]{none}{\starttikzpicture
  \draw (0,0) -| (2,2) -| (0,0) -- (2,2)
(2,0) -- (0,2)
(1,1) circle(1);
\stoptikzpicture}
(some text...)

The tikzpicture apparently extends to the whole text width, resulting in
an overfull box (and nasty paragraph formatting).  Putting it into an
\hbox helps, so I know what to do; the question is, _why_ this works
that way?

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
___