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.

Context.

I am having this kind of tikzpicture in my article which I would like to include in a beamer presentation : fig1

Please note that the figure was simplified, since groupI represents a group of nodes in order to clarify the question.

(The code of this MWE is below)


The problem.

My aim is to insert this figure in a way in my presentation. As you can notice, the figure fill completely an A4 page. It is therefore difficult to transpose it into a beamer format, which is in landscape, and staying "readable".

For example, if I simply use the same code in beamer, here is the display : fig12


Questions

  1. What do you advise/propose me in order to include these kind of pictures inside a beamer presentation ?
  2. Is this possible to keep all nodes from a presentation (to keep the structure of a figure) and only printing certain nodes ?
  3. Is there a way to "break" a picture in several pages without splitting the code itself into several tikzpicture environment ?

Ideas

What I am thinking is, for example, to print only 2 groups on some beamer page, but keeping the structure like arrows, relative postiion, etc. as shown on the picture below :

fig2

And having some dotted lines on edges of the pictures, in order to show that this is only a part of the global figure.

Utopic : The awesomeness would be to be able animate the reading of this figure like :

  1. Global visualization of the figure
  2. Zooming in on group1 \pause
  3. Moving slightly to group2 \pause
  4. etc.

But this is utopic to have this kind of fluent animation, which should (and can) be done with other softwares than by using latex.

Anyway, I am looking for ideas and code on how I could make it a bit interactive, easily readable, and fitting with a beamer page. I leave this question open for few hours/days in case someone has other interesting ideas to propose.


Minimal working example.

Article

\documentclass[10pt,a4paper]{article}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,arrows}
\tikzstyle{arr} = [draw, -latex']

\begin{document}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm] (1) {group1} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 1, xshift = 9cm] (2) {group2} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 2, xshift = -9cm] (3) {group3} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 3, xshift = 9cm] (4) {group4} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 4, xshift = -9cm] (5) {group5} ;

\path   [arr] (1) -- (2);
\path   [arr] (2) -- (3);
\path   [arr] (3) -- (4);
\path   [arr] (4) -- (5);
\end{tikzpicture}
\end{figure}

\end{document}

Beamer

\documentclass{beamer}


\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,arrows}
\tikzstyle{arr} = [draw, -latex']

\begin{document}

\begin{frame} 
\frametitle{Figure (1)}


\begin{figure}[H]
\centering
\begin{tikzpicture}
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm] (1) {group1} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 1, xshift = 9cm] (2) {group2} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 2, xshift = -9cm] (3) {group3} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 3, xshift = 9cm] (4) {group4} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 4, xshift = -9cm] (5) {group5} ;

\path   [arr] (1) -- (2);
\path   [arr] (2) -- (3);
\path   [arr] (3) -- (4);
\path   [arr] (4) -- (5);
\end{tikzpicture}
\end{figure}


\end{frame}

\end{document}

Thank you in advance for any help you may provide. Please do note hesitate to ask questions in comments if it is not clear enough.

share|improve this question

2 Answers 2

up vote 17 down vote accepted

Maybe with the spy library:

\documentclass{beamer}


\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,arrows,spy}
\tikzstyle{arr} = [draw, -latex']

\begin{document}

\begin{frame} % premier transparent
\frametitle{Figure (1)}

\scalebox{.3}{
\begin{tikzpicture}[spy using outlines={circle, magnification=3, size=20cm, connect spies}]
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm] (1) {group1} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 1, xshift = 9cm] (2) {group2} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 2, xshift = -9cm] (3) {group3} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 3, xshift = 9cm] (4) {group4} ;
\node [rectangle,draw,minimum width = 6cm, minimum height = 3cm,below=2cm of 4, xshift = -9cm] (5) {group5} ;

\path   [arr] (1) -- (2);
\path   [arr] (2) -- (3);
\path   [arr] (3) -- (4);
\path   [arr] (4) -- (5);

\only<2>{\spy [overlay,red] on (1.center) in node [right] at (15,-7);}
\only<3>{\spy [overlay,red] on (2.center) in node [right] at (15,-7);}
\only<4>{\spy [overlay,red] on (3.center) in node [right] at (15,-7);}
\only<5>{\spy [overlay,red] on (4.center) in node [right] at (15,-7);}
\only<6>{\spy [overlay,red] on (5.center) in node [right] at (15,-7);}
\end{tikzpicture}
}


\end{frame}

\end{document}

enter image description here

If the circle is stealing too much space you can also spy into a rectangle that matches the original one.

share|improve this answer
    
Thanks you very much, that is an interesting solution, I didn't know the spy lib. I am trying to make it on my figure. If you don't mind, I let this question open for few hours in case they are some other proposals and ideas. –  booba24 Sep 2 at 9:01
2  
@booba24 of course I don't mind :) –  dcmst Sep 2 at 9:06
    
when adding \usepackage[french]{babel}, I receive the following error : \tikz@lib@spy@parse@opta has an extra } . How can I fix this, still using the the french babel (I need it) –  booba24 Sep 3 at 20:44
1  
@booba24 Found the issue, you need to add \usetikzlibrary{babel} and it will work, see: tex.stackexchange.com/questions/74860/… –  dcmst Sep 4 at 8:41

Using Spy library is a very good idea but if you don't want to touch your original graphic and have it in an independent pdf file you can use viewport+clip option from graphicx (which is already loaded by beamer.cls) or clip/Clip from adjustbox to include part of the original figure in your slides.

For next code I've compiled your TiKZ example inside a standalone document named 199051.tex. And the result 199051.pdf file is clipped and shown in next presentation:

\documentclass{beamer}

%\usepackage{adjustbox}

\begin{document}

\begin{frame} % premier transparent
\frametitle{Figure (1)}

\centering
\includegraphics[height={.9\paperheight},keepaspectratio]{199051}
\end{frame}

\begin{frame}{Group 5}

\centering
\fbox{\includegraphics[width={.8\paperwidth},keepaspectratio,viewport=0 0 6.5cm 3.5cm, clip]{199051}}
\end{frame}

\begin{frame}{Group 3+4}

\centering
\fbox{\includegraphics[width={.85\paperwidth},keepaspectratio,viewport=0 5cm 15.5cm 13.5cm, clip]{199051}}
\end{frame}
\end{document}

The result is: enter image description here

share|improve this answer
    
Another interesting idea indeed. But I guess that it means that we lost the vector image property with this solution, is that right ? –  booba24 Sep 3 at 11:21
    
@booba24 I don't think so. The original image is vectorial and the result is also vectorial. If I'm not wrong, the whole image is included but only clipped part is shown. –  Ignasi Sep 3 at 11:26

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.