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.

Here is my current slide: enter image description here

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{backgrounds}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}[framed, background rectangle/.style={thick, draw=black, top color=blue!50, rounded corners}]
\node (step1) at (0, 0) {step 1};
\node (step2) at (0, -3) {step 2};
\end{tikzpicture}
\end{frame}

\end{document}

I would like to write something right next to "step 1" and something else right next to "step 2". I would like to write these two things out of the blue frame. Can you help me?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

You can also use pgfonlayer available from backgrounds library. Load positioning library and you can do something like the one below.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning,fit}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}
\node (step1) at (0, 0) {step 1};
\node (step2) at (0, -3) {step 2};
\begin{pgfonlayer}{background}
\node [fit = (step1) (step2),framed, thick, draw=black, top color=blue!50, rounded corners] {};
\end{pgfonlayer}
\node [right=0.2cm of step1, anchor = west] {Text beside step1};
\node [right=0.2cm of step2, anchor = west] {Text beside step2};
\end{tikzpicture}
\end{frame}

\end{document}
share|improve this answer
    
Great, thanks ! –  user7064 Feb 21 '13 at 7:13
    
@user7064 Don't forget to upvote this answer... –  Paul Gaborit Feb 21 '13 at 7:19

Via fit library, you can draw a frame around step1 and step2. Then, you can use base anchors to align some text:

enter image description here

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{fit,backgrounds}

\begin{document}

\begin{frame}
  \frametitle{My slide}

  \begin{tikzpicture}
    \node (step1) at (0, 0) {step 1};
    \node (step2) at (0, -3) {step 2};

    \begin{scope}[on background layer]
      \node[fit=(step1)(step2),thick,draw=black,top
      color=blue!50,rounded corners] (frame set){};
    \end{scope}

    \node[anchor=base west] at (frame set.east |- step1.base)
    {something right next to step1};

    \node[anchor=base west] at (frame set.east |- step2.base)
    {something right next to step2};

  \end{tikzpicture}
\end{frame}

\end{document}
share|improve this answer
    
Thank you very much ! Unfortunately, I cannot accept more than one answer :-( –  user7064 Feb 21 '13 at 7:14
    
@user7064 Don't forget to upvote each answer... and to accept the better solution from your point of view. ;-) –  Paul Gaborit Feb 21 '13 at 7:18
    
That's what I did :-) –  user7064 Feb 21 '13 at 7:22

One solution would be to simply add the text to the node and use \rlap so that does not effect the bounding box:

enter image description here

Code:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{backgrounds}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}[framed, background rectangle/.style={thick, draw=black, top color=blue!50, rounded corners}]
\node (step1) at (0,  0) {step 1 \rlap{\hspace*{0.5cm} Details of Step 1}};
\node (step2) at (0, -3) {step 2 \rlap{\hspace*{0.5cm} Details of Step 2}};
\end{tikzpicture}
\end{frame}

\end{document}
share|improve this answer
    
Thank you very much ! Unfortunately, I cannot accept both :-( –  user7064 Feb 21 '13 at 7:12

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.