![如何让思维导图适合框架?](https://linux22.com/image/267181/%E5%A6%82%E4%BD%95%E8%AE%A9%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE%E9%80%82%E5%90%88%E6%A1%86%E6%9E%B6%EF%BC%9F.png)
我正在使用一些 tikz 概念创建 Beamer 演示文稿,如何使思维导图适合幻灯片?我的代码如下:
\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}
答案1
另一个选择是使用\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}
答案2
您可以改变scale=<whatever you like>
其中的一些nodes
- 将其包装起来也有\makebox[\textwidth]
一点帮助。
如果您愿意,您还可以进行更改 -level distance
这是一个相当手动的过程,但对于演示文稿来说这是可以的,因为它们与常规文档有很大不同。
% 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}