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 would like to place in a slide a block of words and at right of it a figure so that in the slide the figure will be on the left and the block explaining it at right. I'm using Beamer.

I tried the example posted in Beamer text and image on the same slide but it doesn't work.

How can this be done?

share|improve this question
    
Welcome to TeX.SX!. Which are the errors you get compiling that example? As further reference, you can also have a look to this question. –  Claudio Fiandrino Jul 14 '12 at 12:24
    
Hi Claudio! I tried another time and it seems to function magically....but I have another question. Haw can I move/allocate blocks arbitrarily in the slide? –  elb Jul 14 '12 at 14:26
    
For move/allocate, do you mean when (or in which order) to present block in the frame? –  Claudio Fiandrino Jul 14 '12 at 17:09
    
Yes exactly!I mean in which order. –  elb Jul 14 '12 at 22:48

1 Answer 1

up vote 7 down vote accepted

I built an example with a mindmap as figure and three blocks as explanation text (just to use both block, alertblock and exampleblock).

The code used to create the mindmap is taken from How to shade mindmap concepts?, so maybe you are not interested in, but I think this could be useful to show you also how to present figures dynamically, not only blocks.

Here is the code (commented such that you can skip the part useful for the mindmap):

\documentclass{beamer}
\usepackage{lmodern}

%%% Theme definitions
\usetheme{Singapore}
\usecolortheme{rose} % to have colored blocks
\setbeamertemplate{blocks}[rounded][shadow=true]

\usepackage{tikz}
\usetikzlibrary{mindmap}
% ---- from now starts code useful to draw the mindmap

%%% Overlay definitions
% based on Daniel's code
% http://tex.stackexchange.com/questions/55806/tikzpicture-in-beamer/55849#55849

\tikzset{
    invisible/.style={opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
      \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
    }
}

%%% Shadings definitions
% based on
% http://tex.stackexchange.com/questions/58249/how-to-add-shade-to-mindmap-concept/62097#62097

\makeatletter

\pgfdeclareradialshading[tikz@ball]{myball}{\pgfqpoint{5bp}{10bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(9bp)=(tikz@ball!75!white);
 color(18bp)=(tikz@ball!90!black);
 color(25bp)=(tikz@ball!70!black);
 color(50bp)=(black)}

 % to make possible use "myball color=..." 
\tikzoption{myball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball}\tikz@addmode{\tikz@mode@shadetrue}}

 \pgfdeclareradialshading[tikz@ball]{myball-left}{\pgfqpoint{5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)}

\tikzoption{myball-left color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-left}\tikz@addmode{\tikz@mode@shadetrue}}

\pgfdeclareradialshading[tikz@ball]{myball-right}{\pgfqpoint{-5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 

\tikzoption{myball-right color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-right}\tikz@addmode{\tikz@mode@shadetrue}}

\makeatother

\tikzset{level 1 concept/.append style={font=\sf, sibling angle=90,level distance = 25mm}}
\tikzset{level 2 concept/.append style={font=\sf, sibling angle=45,level distance = 16mm}}
\tikzset{level 3 concept/.append style={font=\sf, sibling angle=45,level distance = 17mm}}
\tikzset{every node/.append style={scale=0.45}}

% ---- end of code useful to draw the mindmap

\begin{document}
\begin{frame}{Title}
\begin{columns}
% Figure
\begin{column}{0.49\textwidth}
\begin{tikzpicture}[mindmap, concept color=blue, font=\sf\bf, text=white,scale=0.7]
\node[circle,shading=myball,visible on=<1->]{Root Concept}[clockwise from=315]
    child [concept color=orange,visible on=<2->] {node[circle, myball-left color=orange] (c1){Child 1}                                
        child[visible on=<3->]  {node [circle, myball-left color=orange](c11){Child 1-1}}
        child[visible on=<3->]  {node [circle,myball-left color=orange](c12){Child 1-2}}
        child[visible on=<3->]  {node [circle,myball-left color=orange](c13){Child 1-3}}                                                   
     }
     child [concept color=violet,visible on=<4->]{node [circle,myball-right color=violet](c2){Child 2}
        child[visible on=<5->] {node [circle,myball-right color=violet](c21){Child 2-1}}
        child[visible on=<5->] {node [circle,myball-right color=violet](c22){Child 2-2}}
        child[visible on=<5->] {node [circle,myball-right color=violet](c22){Child 1-3}}
    };
\end{tikzpicture}

\end{column}
% Explanation Blocks
\begin{column}{0.49\textwidth}
\begin{block}<1>{Root concept explanation}
This ... consist of... because....\\
and is peculiar of...
\end{block}
\begin{exampleblock}<2,3>{Child concept}
This ... consist of... because....\\
and is peculiar of...
\end{exampleblock}
\begin{alertblock}<4,5>{Another child concept}
This ... consist of... because....\\
and is peculiar of...
\end{alertblock}
\end{column}
\end{columns}
\end{frame}
\end{document}

The result is:

enter image description here

To be coherent with the image, blocks related to a given concept are displayed when the concept is shown; in the picture, to decide when a new concept should be presented, it is used visible on=<value>. The same value, therefore, is applied to the block: \begin{block}<value>.... If the value does not comprise a -, that block will presented just in the moments given in value. This idea is taken from tikzpicture in beamer.

Let's change a bit the previous example to show this fact (the change is just for the block part, the rest of the code is still the same):

% Blocks
\begin{column}{0.49\textwidth}
\begin{block}<1->{Root concept explanation}
This ... consist of... because....\\
and is peculiar of...
\end{block}
\begin{exampleblock}<2,3->{Child concept}
This ... consist of... because....\\
and is peculiar of...
\end{exampleblock}
\begin{alertblock}<4,5->{Another child concept}
This ... consist of... because....\\
and is peculiar of...
\end{alertblock}
\end{column}

The result now is:

enter image description here

The important thing to notice is the - in all overlay specifications.


Since in the comments has been mentioned the dynblocks package, I provide a solution that makes use of it. Note: to compile the version 0.2a is required.

Code:

\documentclass{beamer}
\usepackage{lmodern}
\usepackage[shadow,roundedcorners,customcolors]{dynblocks}

%%% Theme definitions
\usetheme{Singapore}
\usecolortheme{rose} % to have colored blocks
\setbeamertemplate{blocks}[rounded][shadow=true]

\usepackage{tikz}
\usetikzlibrary{mindmap}
% ---- from now starts code useful to draw the mindmap

%%% Overlay definitions
% based on Daniel's code
% http://tex.stackexchange.com/questions/55806/tikzpicture-in-beamer/55849#55849

\tikzset{
    invisible/.style={opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
      \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
    }
}

%%% Shadings definitions
% based on
% http://tex.stackexchange.com/questions/58249/how-to-add-shade-to-mindmap-concept/62097#62097

\makeatletter

\pgfdeclareradialshading[tikz@ball]{myball}{\pgfqpoint{5bp}{10bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(9bp)=(tikz@ball!75!white);
 color(18bp)=(tikz@ball!90!black);
 color(25bp)=(tikz@ball!70!black);
 color(50bp)=(black)}

 % to make possible use "myball color=..." 
\tikzoption{myball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball}\tikz@addmode{\tikz@mode@shadetrue}}

 \pgfdeclareradialshading[tikz@ball]{myball-left}{\pgfqpoint{5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)}

\tikzoption{myball-left color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-left}\tikz@addmode{\tikz@mode@shadetrue}}

\pgfdeclareradialshading[tikz@ball]{myball-right}{\pgfqpoint{-5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 

\tikzoption{myball-right color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-right}\tikz@addmode{\tikz@mode@shadetrue}}

\makeatother

\tikzset{level 1 concept/.append style={font=\sf, sibling angle=90,level distance = 25mm}}
\tikzset{level 2 concept/.append style={font=\sf, sibling angle=45,level distance = 16mm}}
\tikzset{level 3 concept/.append style={font=\sf, sibling angle=45,level distance = 17mm}}
\tikzset{mynode/.style={scale=0.45}}

% ---- end of code useful to draw the mindmap

\begin{document}
\begin{frame}{Title}
\begin{columns}[T]
% Figure
\begin{column}{0.49\textwidth}
\begin{tikzpicture}[mindmap, concept color=blue, font=\sf\bf, text=white,scale=0.7]
\node[mynode,circle,shading=myball,visible on=<1->]{Root Concept}[clockwise from=315]
    child [concept color=orange,visible on=<2->] {node[mynode,circle, myball-left color=orange] (c1){Child 1}                                
        child[visible on=<3->]  {node [mynode,circle, myball-left color=orange](c11){Child 1-1}}
        child[visible on=<3->]  {node [mynode,circle,myball-left color=orange](c12){Child 1-2}}
        child[visible on=<3->]  {node [mynode,circle,myball-left color=orange](c13){Child 1-3}}                                                   
     }
     child [concept color=violet,visible on=<4->]{node [mynode,circle,myball-right color=violet](c2){Child 2}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c21){Child 2-1}}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c22){Child 2-2}}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c22){Child 1-3}}
    };
\end{tikzpicture}

\end{column}
% Blocks
\begin{column}{0.49\textwidth}
\begin{dynblock}
\opaqueblock<1>{
This ... consist of... because....\\
and is peculiar of...
}
\invblock<2->
\end{dynblock}
\\[2ex]
\begin{dynblock}
\setblockcolor{orange!20}
\setbordercolor{orange}
\opaqueblock<{2,3}>{
This ... consist of... because....\\
and is peculiar of...
}
\invblock<4->
\end{dynblock}
\\[2ex]
\begin{dynblock}
\setblockcolor{violet!20}
\setbordercolor{violet}
\opaqueblock<{4,5}>{
This ... consist of... because....\\
and is peculiar of...
}
\end{dynblock}
\end{column}
\end{columns}
\end{frame}
\end{document}

Result:

enter image description here

share|improve this answer
    
Hi Claudio!! I applied your code to my presentation! It works fine and it gave me other suggestions to perform it. But I have a question.Is it ok to use the package dynplot you developed? I find it easy. Thanks a lot! –  elb Jul 15 '12 at 14:40
    
Yes of course. The dynblocks package is developed exactly for these situations :). –  Claudio Fiandrino Jul 15 '12 at 14:46
    
Very nice presentation! Thanks @Claudio. –  Yang May 26 at 23:00
    
@Yang: glad you like it :) –  Claudio Fiandrino May 27 at 6:20
    
@ClaudioFiandrino I don't know why, but \opaqueblock<{2,3}> doesn't work; another set of braces seems necessary: \opaqueblock<{{2,3}}> –  egreg Sep 17 at 21:37

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.