ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Text and figure side by side
@ 2014-04-24 14:20 Fabrice Couvreur
  2014-04-25 13:47 ` Fabrice
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Couvreur @ 2014-04-24 14:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,
Is it possible to put side by side text and a figure created in a TikZ
environment
?
Thank you,
Fabrice

\usemodule[tikz]
\usetikzlibrary[calc]
\starttext
\def\smiley{%
\starttikzpicture[baseline=-0.75ex,black]
\filldraw[fill=orange] circle (2mm);
\node[fill,circle,inner sep=0.5pt] (left eye) at (135:0.8mm) {};
\node[fill,circle,inner sep=0.5pt] (right eye) at (45:0.8mm) {};
\draw (-145:0.9mm) arc (-120:-60:1.5mm);
\stoptikzpicture}
\placefigure[right,none]{}{
\starttikzpicture
\coordinate (c1) at (0,0);
\draw[thick,fill=darkgreen] ($(c1) + (0:30mm)$) arc (0:360:30mm)
($(c1) + (360:35mm)$) arc (360:0:35mm);
\draw[thick,fill=gray] ($(c1) + (0:3mm)$) arc (0:360:3mm);
\foreach \x in {0,36,...,180}
\draw[fill=red, draw=black](c1)--(\x:30mm) arc (\x:\x+36:30mm)--(c1);
\foreach \x in {216,252,...,324}
\draw[fill=blue, draw=black](c1)--(\x:30mm) arc (\x:\x+36:30mm)--(c1);
\foreach \x in {3,12,...,360}
\draw[fill=lightgray] (\x:28mm) circle (2pt);
\draw[thick,fill=white!30] ($(c1) + (0:3mm)$) arc (0:360:3mm)
($(c1) + (360:4mm)$) arc (360:0:4mm);
\draw[thick,fill=darkgray] ($(c1) + (0:3mm)$) arc (0:360:3mm);
\foreach \x in {18,54,...,198}
\node [white,rotate=\x] at (\x:17.5mm){\small \bf PERDU};
\foreach \x in {234,270,306,342}
\node [] at (\x:17.5mm) {\smiley};
\draw[darkgray,-latex,line width=4pt, line cap=round] (90:37mm) --
(90:26mm);
\stoptikzpicture}
\input knuth
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1927 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] 2+ messages in thread

* Re: Text and figure side by side
  2014-04-24 14:20 Text and figure side by side Fabrice Couvreur
@ 2014-04-25 13:47 ` Fabrice
  0 siblings, 0 replies; 2+ messages in thread
From: Fabrice @ 2014-04-25 13:47 UTC (permalink / raw)
  To: ntg-context

May be a solution, but why all the text is not in the left column and 
the single figure in the right column?

> \setuppapersize[A4]
> \setuplayout[
>         backspace=15mm,
>         width=middle,
>         topspace=15mm,
>         height=middle,
>         header=0pt,
>         footer=0pt,
>             ]
> \mainlanguage[fr]
>
> \usemodule[tikz]
> \usetikzlibrary[calc]
> \starttext
> \blank[small]
> \leftaligned{\bf Partie A}
> \blank[small]
> \startitemize[n][stopper=),style=bold]
> \item \input knuth
> \item \input knuth
> \stopitemize
> \startcolumns
> \blank[small]
> \leftaligned{\bf Partie B}
> \blank[small]
> \startitemize[n][stopper=),style=bold]
> \item
> \item
> \item
> \startitemize[a][stopper=),style=bold]
> \item \input knuth
> \item
> \stopitemize
> \stopitemize
> \column
> \starttikzpicture[level 1/.style={level distance=30mm,sibling 
> distance=40mm},level 2/.style={level distance=25mm,sibling 
> distance=25mm},grow=right]
> \node{}
> child{node[blue]{$B$}
> child{node[blue]{$B$}
> edge from parent
> node[below=0.2cm]{$0,75$}}
> child{node[red]{$R$}
> edge from parent
> node[above=0.2cm]{$0,25$}}
> edge from parent
> node[below=0.2cm]{$0,75$}}
> child{node[red]{$R$}
> child{node[blue]{$B$}
> edge from parent
> node[below=0.2cm]{$0,75$}}
> child{node[red]{$R$}
> edge from parent
> node[above=0.2cm]{$0,25$}}
> edge from parent
> node[above=0.2cm]{$0,25$}};
> \stoptikzpicture
> \stopcolumns
> \stoptext

___________________________________________________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2014-04-25 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 14:20 Text and figure side by side Fabrice Couvreur
2014-04-25 13:47 ` Fabrice

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