8

I'm in the process of creating a Beamer presentation using some tikz concepts, how do I make a mindmap fit to the slide? My code is as follows:

\documentclass[T]{beamer}

\definecolor{links}{HTML}{2A1B81}
\hypersetup{colorlinks,linkcolor=,urlcolor=red}

\usetheme{Frankfurt}
\usecolortheme{dolphin}
\usefonttheme{structuresmallcapsserif}
\usefonttheme{serif}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\usepackage[graphics,tightpage]{preview}

\setbeamertemplate{button}{\tikz
\node[
inner xsep=10pt,
draw=structure!80,
fill=structure!50,
rounded corners=4pt]  {\Large\insertbuttontext};}


\title{Presentation Template}
\setbeamercolor{author}{fg=yellow}
\author{asdfasdfa}
\setbeamercolor{date}{fg=yellow}
\date\today



\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section*{Outline}


\begin{frame}
\begin{multicols}{2}
\frametitle{Contents}
\tableofcontents
\end{multicols} 
\end{frame}

\section{Timeline}
\begin{frame}
\frametitle{ Timeline}
\centering

\end{frame}

\begin{frame}
\begin{tikzpicture}
\path[mindmap,concept color=blue, text=white, transform shape]
node[concept]{bicycle}
    child[grow=0, concept color=red]{node[concept]{road bicycle}
        child[grow=30]{node[concept]{time trial bicycle}}
        child[grow=30]{node[concept]{road racing bicycle}}}
    child[grow=60, concept color=black]{node[concept]{mountain bicycle}}    
    child[grow=120, concept color=orange]{node[concept]{tandem bicycle}};
\end{tikzpicture}
\end{frame}
\end{document}
  • One way would be to simply scale the entire tikzpicture. So something like \begin{tikzpicture}[scale=0.8]. – Peter Grill Apr 25 '13 at 0:32
  • From the PGF manual: “Mindmaps with small mindmap will also fit onto a standard frame of the beamer package.” You do need to change the direction of the time trial and road racing bicycle nodes to 0 and 60 respectively. – Qrrbrbirlbel Apr 25 '13 at 0:57
  • Perhaps duplicate: Scaling tikz mindmaps within a beamer frame. – Claudio Fiandrino Apr 25 '13 at 6:52
5

Another option would be to use \resizebox:

\documentclass[T]{beamer}

\definecolor{links}{HTML}{2A1B81}
\hypersetup{colorlinks,linkcolor=,urlcolor=red}

\usetheme{Frankfurt}
\usecolortheme{dolphin}
\usefonttheme{structuresmallcapsserif}
\usefonttheme{serif}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\usepackage[graphics,tightpage]{preview}

\setbeamertemplate{button}{\tikz
\node[
inner xsep=10pt,
draw=structure!80,
fill=structure!50,
rounded corners=4pt]  {\Large\insertbuttontext};}


\title{Presentation Template}
\setbeamercolor{author}{fg=yellow}
\author{asdfasdfa}
\setbeamercolor{date}{fg=yellow}
\date\today



\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section*{Outline}


\begin{frame}
\begin{multicols}{2}
\frametitle{Contents}
\tableofcontents
\end{multicols} 
\end{frame}

\section{Timeline}
\begin{frame}
\frametitle{ Timeline}
\centering

\end{frame}

\begin{frame}
\resizebox{\textwidth}{!}{%
\begin{tikzpicture}
            \path[mindmap,concept color=blue, text=white, transform shape]
            node[concept,scale=0.8]{bicycle}
            child[grow=0, concept color=red]{node[concept]{road bicycle}
                child[grow=30]{node[concept]{time trial bicycle}}
                child[grow=90]{node[concept]{road racing bicycle}}}
            child[grow=60, concept color=black]{node[concept]{mountain bicycle}}    
            child[grow=120, concept color=orange]{node[concept]{tandem bicycle}};
        \end{tikzpicture}%
}
\end{frame}
\end{document}

enter image description here

  • @GonzaloMedina how would I then make those nodes links within the presentation? – user28552 Apr 25 '13 at 0:53
  • 1
    @user28552 You can use the \hypertarget, \hyperlink mechanism to build links to other parts of the presentation, or \href to make them links to outer destinations. If you need some additional guidance, perhaps this deserves a new question. – Gonzalo Medina Apr 25 '13 at 0:56
4

You can change scale=<whatever you like> for a few of the nodes- also wrapping it in a \makebox[\textwidth] helps a little.

screenshot

You can also change the level distance if you like- it's a fairly manual process, but that's ok for a presentation, as they are very different from regular documents.

% arara: pdflatex
% !arara: indent: { overwrite: on}
\documentclass{beamer}

\usetheme{Frankfurt}
\usecolortheme{dolphin}
\usefonttheme{structuresmallcapsserif}
\usefonttheme{serif}
\usepackage{tikz}
\usetikzlibrary{mindmap}

\begin{document}

\begin{frame}
    \makebox[\textwidth][c]{%
        \begin{tikzpicture}
            \path[mindmap,concept color=blue, text=white, transform shape]
            node[concept,scale=0.8]{bicycle}
            child[grow=0, concept color=red]{node[concept]{road bicycle}
                child[grow=30]{node[concept]{time trial bicycle}}
                child[grow=90]{node[concept]{road racing bicycle}}}
            child[grow=60, concept color=black]{node[concept]{mountain bicycle}}    
            child[grow=120, concept color=orange]{node[concept]{tandem bicycle}};
        \end{tikzpicture}
    }
\end{frame}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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