8 Nov 2007 02:15

## Creating cloud and reusing it

Dear TikZ users,

I would like to create a shape that looks like a comic-book cloud,
and to be able to place copies of it wherever I want. Can anyone give
me some pointers as to how to do this?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.

8 Nov 2007 09:48

### Re: Creating cloud and reusing it

On Nov 8, 2007 2:15 AM, Kubovy Michael <mk9y <at> mac.com> wrote:
> Dear TikZ users,
>
> I would like to create a shape that looks like a comic-book cloud,
> and to be able to place copies of it wherever I want. Can anyone give
> me some pointers as to how to do this?

If you want to place it wherever you want on a page, overlays are
probably the way to go. Maybe you could try something like this:

--
\documentclass{article}
\usepackage{tikz}
\begin{document}

\newcommand\callout[1]{%
\tikz[overlay] {\path[draw] (0,0) -- (60:1) node[draw,fill=blue!20] {#1};}}%

This is some text\callout{Test} skldjf lskd lkjsdlfkj lk sdlkfj lskdf
sdlfkj sdf lskdjf lskdjf lkjs dlfkjs dlfk

Lorem\callout{More text} ipsum dolor sit amet\callout{Test}, consectetuer
adipiscing elit. Vestibulum a urna. Donec nisl. Vestibulum euismod
fringilla magna.
Pellentesque posuere pede ut erat. Lorem ipsum dolor sit amet,

\end{document}
----

(I have not used the cloud shape)


8 Nov 2007 16:52

### Re: Creating cloud and reusing it

Hi Kjell,

Actually I'm looking for two things: (1) a cloud object, and (2) the
general technique for creating an object (e.g., a cloud, but it could
be an object of arbitrary complexity I want to reuse), and then,
*inside the tikz environment*, issue several commands such as
\draw (x, y) node[cloud,cloud size = cs,cloud lobes = cl]{text}
or
\draw (x, y) cloud[cloud size = cs,cloud lobes = cl]

To give you an idea of an obviously inefficient (programming-wise)
attempt:

\begin{tikzpicture}
\draw[thick,rounded corners = 12pt] (0, 1.5) -- (10, 1.5) -- (10,
13) -- (0, 13) -- cycle;
\draw[thick] (2.5, 4) -- (5, 7.25) -- (5, 10.5);
\draw[thick] (5, 7.25) -- (7.5, 4);
\draw[out=75,in=105, relative, fill = white] (4,12) to (6,12) to
(7,11) to (7, 10) to (6, 9) to (4, 9) to (3, 10) to (3, 11) to (4, 12);
\draw (5, 10.5) node{\textsf{audio-visual objects}};

\draw[thick] (2.5, 4) -- (3.5, 0.4);
\draw[thick] (2.5, 4) -- (1.5, 0.4);
\draw[rounded corners = 8pt, fill = white] (3, 6.5) -- (3, 8) --
(7, 8) -- (7, 6.5) -- cycle;
\draw (3, 7.45) node[anchor = east]{\textsf{\emph{conditions\/}}};
\draw (3, 7.05) node[anchor = east]{\textsf{\emph{for binding\/}}};
\draw (5, 7.5) node {\textsf{simultaneity}};
\draw (5, 7) node {\textsf{plausible common cause}};


9 Nov 2007 08:38

### Re: Creating cloud and reusing it

On 08/11/2007, Kubovy Michael <mk9y <at> mac.com> wrote:
> Actually I'm looking for two things: (1) a cloud object, and (2) the
> general technique for creating an object (e.g., a cloud, but it could
> be an object of arbitrary complexity I want to reuse.

To create objects' to you could get into \pgfdeclareshape, this is
how all the node shapes use in TikZ are created. It is described in
the manual, but It does however require you be familiar with the basic
level commands.

I bunged an updated version of the cloud in the CVS last night, which
responds a little better to minimum size. If you like "living on the
edge" with the newer CVS stuff (including the keys stuff and the fit
library) the picture you coded can be pretty much done in LaTeX like
this:

\usetikzlibrary{shapes.symbols}
\usetikzlibrary{fit}

\begin{tikzpicture}
\tikzset{
cloud node/.style={
cloud, cloud puff arc=140, inner sep=0pt, minimum width=3.5cm,
minimum height=2.5cm, draw, font=\sf},
rectangle node/.style={
rectangle, text width=#1, font=\sf, text centered,
minimum height=1.5cm, draw,rounded corners=1ex},
label node/.style={anchor=#1, font=\sf, text width=2cm},
every child/.style={sibling distance=5cm},
level distance=3cm, level 3/.style={level distance=4cm},


10 Nov 2007 07:42

### Re: Creating cloud and reusing it

On  9 Nov, 2007, at 01:38, Mark Wibrow wrote:

> On 08/11/2007, Kubovy Michael <mk9y <at> mac.com> wrote:
>
>> Actually I'm looking for two things: (1) a cloud object, and (2) the
>> general technique for creating an object (e.g., a cloud, but it could
>> be an object of arbitrary complexity I want to reuse.
>>
>
> To create objects' to you could get into \pgfdeclareshape, this is
> how all the node shapes use in TikZ are created. It is described in
> the manual, but It does however require you be familiar with the basic
> level commands.
>
> I bunged an updated version of the cloud in the CVS last night, which
> responds a little better to minimum size.
>

I upgraded from CVS today. Unfortunately, now typesetting the Manual
sends the error

!Package pgfkeys Error: I do not know the key '/tikz/could aspect'
and I am going to ignore it. Perhaps you misspelled it.

Indeed, the old library pgflibraryshapes.symbols.code.tex has

\pgfkeys{/pgf/cloud aspect/.value required}%
\pgfkeys{/pgf/cloud aspect/.code={%, etc.

missing in the new library.


10 Nov 2007 10:51

### Re: Creating cloud and reusing it

On 10/11/2007, Axel E. Retif <axel.retif <at> mac.com> wrote:
> Indeed, the old library pgflibraryshapes.symbols.code.tex has
>
> \pgfkeys{/pgf/cloud aspect/.value required}%
> \pgfkeys{/pgf/cloud aspect/.code={%, etc.
>
> missing in the new library.

Hi!

Indeed, I have (possibly permanently) removed the cloud aspect key but
had not updated the documentation, which has now been done in the CVS.

Regards,

Mark

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.

11 Nov 2007 13:14

### Re: Creating cloud and reusing it

On  10 Nov, 2007, at 03:51, Mark Wibrow wrote:

> On 10/11/2007, Axel E. Retif <axel.retif <at> mac.com> wrote:
>> Indeed, the old library pgflibraryshapes.symbols.code.tex has
>>
>> \pgfkeys{/pgf/cloud aspect/.value required}%
>> \pgfkeys{/pgf/cloud aspect/.code={%, etc.
>>
>> missing in the new library.
>
> Hi!
>
> Indeed, I have (possibly permanently) removed the cloud aspect key but
> had not updated the documentation, which has now been done in the CVS.

Thank you. I just upgraded and the Manual typesets OK in pdfLaTeX
(there is a problem with dvipdfm that I'm reporting in a separate mail).

I'm no one to question your decisions, but I have always in mind
backwards compatibility ---for example, I have TeX documents more
then 20 years old that typeset exactly as they did originally (well,
better, because now we use Postscript fonts); but you can read in the
PSTricks site

http://tug.org/PSTricks/main.cgi?file=doc/docs

> Complete PSTricks user guide: as one PDF (without an index) (with
> an index (old version!)).
> The sources of the old version are here, but cannot be compiled
> with the current LaTeX version.


8 Nov 2007 09:28

### Re: Creating cloud and reusing it

Hi!

There is a cloud shape in the symbol shape library in the CVS which
can be used as a node. I seem to recall somehing on my to do' list
concerning the cloud shape (can't remember what), but it should be
working.

You can change the number of puffs' the cloud has using the option

cloud puffs=<integer>

I hope this is what you require.

Regards

Mark

On 08/11/2007, Kubovy Michael <mk9y <at> mac.com> wrote:
> Dear TikZ users,
>
> I would like to create a shape that looks like a comic-book cloud,
> and to be able to place copies of it wherever I want. Can anyone give
> me some pointers as to how to do this?
> _____________________________
> Professor Michael Kubovy
> University of Virginia
> Department of Psychology
> USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
> Parcels:    Room 102        Gilmer Hall
>         McCormick Road    Charlottesville, VA 22903