ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Environment \starttikzpicture \stoptikzpicture like float
@ 2015-05-24  9:20 Fabrice Couvreur
  2015-05-24  9:33 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fabrice Couvreur @ 2015-05-24  9:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1217 bytes --]

Hi,
Why the command \placerecipe{}{} does not with an environment \
starttikzpicture
\stoptikzpicture ?
Fabrice

\setupexternalfigures[location={local,global,default}]

\setuppagenumbering[location=]

\usemodule[tikz]
\usemodule[pgfplots]
\pgfplotsset{compat=1.8}

\definefloat
   [recipe]
   [figure]

\setupfloat
   [recipe]
   [default={right,none}]

\starttext
\startitemize[n][stopper={.},style=bold]
\placerecipe
   {}
{\externalfigure[cow.pdf][width=4cm]}
\item \input knuth
\placerecipe
   {}
{
\starttikzpicture[level 1/.style={level distance=35mm,sibling
distance=40mm},level 2/.style={level distance=25mm,sibling
distance=15mm},cadre/.style={rectangle,draw}]
\node{}[grow=right]
child{node{$\overline{R}$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [below=0.2cm,midway] {\unknown}
}
child{node{$R$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [above=0.2cm,scale=0.75] {\unknown}
};
\stoptikzpicture
}
\item \input knuth
\stopitemize
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1955 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Environment \starttikzpicture \stoptikzpicture like float
  2015-05-24  9:20 Environment \starttikzpicture \stoptikzpicture like float Fabrice Couvreur
@ 2015-05-24  9:33 ` Hans Hagen
  2015-05-24  9:48 ` Mojca Miklavec
  2015-05-24 15:19 ` Wolfgang Schuster
  2 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2015-05-24  9:33 UTC (permalink / raw)
  To: ntg-context

On 5/24/2015 11:20 AM, Fabrice Couvreur wrote:
>
> Hi,
> Why the command \placerecipe{}{} does not with an environment
> \starttikzpicture
> \stoptikzpicture?
> Fabrice
>
> \setupexternalfigures[location={local,global,default}]
>
> \setuppagenumbering[location=]
>
> \usemodule[tikz]
> \usemodule[pgfplots]
> \pgfplotsset{compat=1.8}
>
> \definefloat
>     [recipe]
>     [figure]
>
> \setupfloat
>     [recipe]
>     [default={right,none}]
>
> \starttext
> \startitemize[n][stopper={.},style=bold]
> \placerecipe
>     {}
> {\externalfigure[cow.pdf][width=4cm]}
> \item \input knuth
> \placerecipe
>     {}
> {
> \starttikzpicture[level 1/.style={level distance=35mm,sibling
> distance=40mm},level 2/.style={level distance=25mm,sibling
> distance=15mm},cadre/.style={rectangle,draw}]
> \node{}[grow=right]
> child{node{$\overline{R}$}
> child{node{$\overline{M}$}
> edge from parent node [below=0.2cm,midway] {\unknown}}
> child{node{$M$}
> edge from parent node [above=0.2cm,midway] {\unknown}}
> edge from parent node [below=0.2cm,midway] {\unknown}
> }
> child{node{$R$}
> child{node{$\overline{M}$}
> edge from parent node [below=0.2cm,midway] {\unknown}}
> child{node{$M$}
> edge from parent node [above=0.2cm,midway] {\unknown}}
> edge from parent node [above=0.2cm,scale=0.75] {\unknown}
> };
> \stoptikzpicture
> }
> \item \input knuth
> \stopitemize
> \stoptext

probably bevause of the way such pictures are wrapped, you can try

\hbox{\starttikzpicture.. \stoptikzpicture}

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Environment \starttikzpicture \stoptikzpicture like float
  2015-05-24  9:20 Environment \starttikzpicture \stoptikzpicture like float Fabrice Couvreur
  2015-05-24  9:33 ` Hans Hagen
@ 2015-05-24  9:48 ` Mojca Miklavec
  2015-05-24 10:24   ` Fabrice
  2015-05-24 12:36   ` Aditya Mahajan
  2015-05-24 15:19 ` Wolfgang Schuster
  2 siblings, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2015-05-24  9:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, May 24, 2015 at 11:20 AM, Fabrice Couvreur wrote:
>
> Hi,
> Why the command \placerecipe{}{} does not with an environment
> \starttikzpicture
> \stoptikzpicture ?

In my opinion this is a "bug" in TikZ that has been pointed out a
while ago already. The picture creates a "wrong type of the box". If I
remember correctly the behaviour is different in LaTeX.

An easy workaround (that I always use) is to enclose the graphic into
an \hbox{}, like this:

\hbox{\starttikzpicture
...
% content
...
\stoptikzpicture}

(With \placefigure or \placerecipe or whatever used as usual before
the \hbox{}.)

We might want to coordinate a patch with the TikZ team.

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

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

* Re: Environment \starttikzpicture \stoptikzpicture like float
  2015-05-24  9:48 ` Mojca Miklavec
@ 2015-05-24 10:24   ` Fabrice
  2015-05-24 12:36   ` Aditya Mahajan
  1 sibling, 0 replies; 7+ messages in thread
From: Fabrice @ 2015-05-24 10:24 UTC (permalink / raw)
  To: ntg-context

Thank you for your suggestions, it works.
Fabrice
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Environment \starttikzpicture \stoptikzpicture like float
  2015-05-24  9:48 ` Mojca Miklavec
  2015-05-24 10:24   ` Fabrice
@ 2015-05-24 12:36   ` Aditya Mahajan
  2015-05-24 15:03     ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2015-05-24 12:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On May 24, 2015, at 5:48 AM, Mojca Miklavec <mojca.miklavec.lists@gmail.com> wrote:
> 
>> On Sun, May 24, 2015 at 11:20 AM, Fabrice Couvreur wrote:
>> 
>> Hi,
>> Why the command \placerecipe{}{} does not with an environment
>> \starttikzpicture
>> \stoptikzpicture ?
> 
> In my opinion this is a "bug" in TikZ that has been pointed out a
> while ago already. The picture creates a "wrong type of the box". If I
> remember correctly the behaviour is different in LaTeX.
> 
> An easy workaround (that I always use) is to enclose the graphic into
> an \hbox{}, like this:
> 
> \hbox{\starttikzpicture
> ...
> % content
> ...
> \stoptikzpicture}
> 
> (With \placefigure or \placerecipe or whatever used as usual before
> the \hbox{}.)
> 
> We might want to coordinate a patch with the TikZ team.

Yes, it is a two line change in t-tikz that would not affect the latex or plain tex behavior. 

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

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

* Re: Environment \starttikzpicture \stoptikzpicture like float
  2015-05-24 12:36   ` Aditya Mahajan
@ 2015-05-24 15:03     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2015-05-24 15:03 UTC (permalink / raw)
  To: ntg-context

On 5/24/2015 2:36 PM, Aditya Mahajan wrote:
>
>
>> On May 24, 2015, at 5:48 AM, Mojca Miklavec <mojca.miklavec.lists@gmail.com> wrote:
>>
>>> On Sun, May 24, 2015 at 11:20 AM, Fabrice Couvreur wrote:
>>>
>>> Hi,
>>> Why the command \placerecipe{}{} does not with an environment
>>> \starttikzpicture
>>> \stoptikzpicture ?
>>
>> In my opinion this is a "bug" in TikZ that has been pointed out a
>> while ago already. The picture creates a "wrong type of the box". If I
>> remember correctly the behaviour is different in LaTeX.
>>
>> An easy workaround (that I always use) is to enclose the graphic into
>> an \hbox{}, like this:
>>
>> \hbox{\starttikzpicture
>> ...
>> % content
>> ...
>> \stoptikzpicture}
>>
>> (With \placefigure or \placerecipe or whatever used as usual before
>> the \hbox{}.)
>>
>> We might want to coordinate a patch with the TikZ team.
>
> Yes, it is a two line change in t-tikz that would not affect the latex or plain tex behavior.

it all depends how sensitive the environment is with respect to spaces 
as unwanted one can creep in when in horizontal mode

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Environment \starttikzpicture \stoptikzpicture like float
  2015-05-24  9:20 Environment \starttikzpicture \stoptikzpicture like float Fabrice Couvreur
  2015-05-24  9:33 ` Hans Hagen
  2015-05-24  9:48 ` Mojca Miklavec
@ 2015-05-24 15:19 ` Wolfgang Schuster
  2 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2015-05-24 15:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 604 bytes --]


> Am 24.05.2015 um 11:20 schrieb Fabrice Couvreur <fabrice1.couvreur@gmail.com>:
> 
> 
> Hi,
> Why the command \placerecipe{}{} does not with an environment \starttikzpicture 
> \stoptikzpicture ?
> Fabrice
> 
> \setupexternalfigures[location={local,global,default}]
> 
> \setuppagenumbering[location=]
> 
> \usemodule[tikz]
> \usemodule[pgfplots]
> \pgfplotsset{compat=1.8}
> 
> \definefloat
>    [recipe]
>    [figure]

To make a clone of the figure environment you have to use all three arguments for the \definefloat command.

\definefloat[recipe][recipes][figure]

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1938 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

end of thread, other threads:[~2015-05-24 15:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24  9:20 Environment \starttikzpicture \stoptikzpicture like float Fabrice Couvreur
2015-05-24  9:33 ` Hans Hagen
2015-05-24  9:48 ` Mojca Miklavec
2015-05-24 10:24   ` Fabrice
2015-05-24 12:36   ` Aditya Mahajan
2015-05-24 15:03     ` Hans Hagen
2015-05-24 15:19 ` Wolfgang Schuster

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