Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to draw a circle around a bunch of nodes in a flow chart that I've created using beamer and I can't figure out how to do it. Ideally, I'd like the circle to encompass most (but not all of the nodes). How do I do this?

Here is my code:

\begin{frame}
\frametitle{The Regime Complex for Climate Change\\(Keohane and Victor (2011) )}


\tikzstyle{type1} = [rectangle, rounded corners, minimum width=3cm, minimum height=0.1cm,text centered, draw=black, fill=blue!10, text width=2cm]

\tikzstyle{type2} = [rectangle, rounded corners, minimum width=3cm, minimum height=0.1cm, text centered, draw=black, fill=blue!10, text width=5cm]

\tikzstyle{info} = [rectangle, rounded corners, minimum width=2.5cm, minimum height=0.1cm, text centered, draw=black, 
fill=blue!30, text width=2.5cm]
\tikzstyle{org} = [rectangle, rounded corners, minimum width=2cm, minimum height=0.1cm, text centered, draw=black, 
fill=blue!30, text width=3cm]
\tikzstyle{decision} = [square, minimum width=1cm, minimum height=0.1cm, text centered, 
draw=black, fill=green!30, text width=4cm]

\tikzstyle{arrow} = [thick,->,>=stealth]

\begin{tikzpicture}[node distance=1.2cm]

\node (un) [type1, xshift=-3cm] {UN Legal Regimes};
\node (expert) [type1, right of=un, xshift=4cm]{Expert Assessments};

\node (montreal)[type1, below of=un, xshift=-1cm]{Montreal Protocol};
\node (bilateral)[type1, right of=montreal, xshift=3cm]{Bilateral Initiatives};
\node (clubs)[type1, right of=bilateral, xshift=2cm]{Clubs};

\node(subnat)[type1, below of=montreal, xshift=1cm]{Subnational Action};
\node(MDA)[type1, right of=subnat, xshift=4cm]{MDA};

\node(geo)[type1, below of=subnat, xshift=-1cm]{Geoengineering Governance};
\node(nuc)[type1, right of=geo, xshift=2cm]{Nuclear Technology};
\node(fin)[type1, right of=nuc, xshift=2cm]{Financial Market Rules};

\node(intel)[type2, below of=geo, xshift=1cm]{Intel Property and Investment Rules};
\node(trade)[type2, right of=intel, xshift=5cm]{International Trade Regime};


\end{tikzpicture}

\end{frame}
share|improve this question
1  
Hi, welcome to TeX.SX. If you select your code and click on the button marked {} it will be highlighted as you see above. (Edit: I also added a missing semicolon after the last node.) –  Torbjørn T. Nov 27 '13 at 19:47
add comment

1 Answer

This can be achieved using the fit library, using for example

    \node[draw=red,double,fit=(un) (montreal) ,inner sep=1ex,circle] (tmp) {};

screenshot

Note that in the code below I have used tikzset instead of tikzstyle as described in Should \tikzset or \tikzstyle be used to define TikZ styles?

% arara: pdflatex
\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{fit}

\tikzset{type1/.style={rectangle, rounded corners, minimum width=3cm, minimum height=0.1cm,text centered, draw=black, fill=blue!10, text width=2cm},
        type2/.style={rectangle, rounded corners, minimum width=3cm, minimum height=0.1cm, text centered, draw=black, fill=blue!10, text width=5cm},
        info/.style = {rectangle, rounded corners, minimum width=2.5cm, minimum height=0.1cm, text centered, draw=black, 
            fill=blue!30, text width=2.5cm},
        org/.style={rectangle, rounded corners, minimum width=2cm, minimum height=0.1cm, text centered, draw=black, 
            fill=blue!30, text width=3cm},
        decision/.style = {square, minimum width=1cm, minimum height=0.1cm, text centered, 
            draw=black, fill=green!30, text width=4cm},
        arrow/.style = {thick,->,>=stealth},
    }

\begin{document}

\begin{frame}
    \frametitle{The Regime Complex for Climate Change\\(Keohane and Victor (2011) )}

    \begin{tikzpicture}[node distance=1.2cm]

        \node (un) [type1, xshift=-3cm] {UN Legal Regimes};
        \node (expert) [type1, right of=un, xshift=4cm]{Expert Assessments};

        \node (montreal)[type1, below of=un, xshift=-1cm]{Montreal Protocol};
        \node (bilateral)[type1, right of=montreal, xshift=3cm]{Bilateral Initiatives};
        \node (clubs)[type1, right of=bilateral, xshift=2cm]{Clubs};

        \node(subnat)[type1, below of=montreal, xshift=1cm]{Subnational Action};
        \node(MDA)[type1, right of=subnat, xshift=4cm]{MDA};

        \node(geo)[type1, below of=subnat, xshift=-1cm]{Geoengineering Governance};
        \node(nuc)[type1, right of=geo, xshift=2cm]{Nuclear Technology};
        \node(fin)[type1, right of=nuc, xshift=2cm]{Financial Market Rules};

        \node(intel)[type2, below of=geo, xshift=1cm]{Intel Property and Investment Rules};
        \node(trade)[type2, right of=intel, xshift=5cm]{International Trade Regime};

        \node[draw=red,double,fit=(un) (montreal) ,inner sep=1ex,circle] (tmp) {};

    \end{tikzpicture}

\end{frame}
\end{document}
share|improve this answer
1  
You mean "tikzset instead of tikzstyle" right? :) –  Kevin C Nov 27 '13 at 20:09
    
Isn't the of= syntax deprecated or something, in favour of =of with the positioning library? There was a question about this, but I can't find it right now. –  Torbjørn T. Nov 27 '13 at 20:12
    
Found it: tex.stackexchange.com/questions/9386/… –  Torbjørn T. Nov 27 '13 at 20:13
    
@KevinC thanks- got the code right, but not the description :) –  cmhughes Nov 27 '13 at 20:18
    
@TorbjørnT. yes indeed, thanks for the link... it requires a fair bit of tweaking to update it- I'll leave that as something for the OP –  cmhughes Nov 27 '13 at 20:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.