我无法使这里提出的解决方案发挥作用:访问由 Beamer 颜色主题定义的独立 tikzpicture 的颜色
\documentclass[hyperref={pdfpagelabels=false},xcolor=x11names,compress]{beamer}
\usetheme{Boadilla}
\usepackage{tikz}%Mind map
\usetikzlibrary{mindmap,trees} %Mind map
\usepackage{media9,multimedia,comment,booktabs,datetime}
\begin{document}
\begin{frame}
\frametitle{Literature Review}
%\tikzset{every node/.append style={scale=2}}
\resizebox{0.9\textwidth}{!}{
\hspace{50pt}\begin{tikzpicture}
%\tikzstyle{every node}=[font=\Large,level distance=8cm]
\path[mindmap,concept color=DeepSkyBlue4,text=white,font=\sf\bf,text width=5cm,
level 1/.append style={level distance=6cm,sibling angle=60},
level 2/.append style={level distance=4cm},]
node[concept] {Learning}[clockwise from=0]
child[concept color=DeepSkyBlue4] {
node[concept] {practical}[clockwise from=90]
child { node[concept] {algorithms} [clockwise from=40]
child { node[concept] {databases} }
child { node[concept] {WWW} }}
child { node[concept] {data structures} }
}
child[concept color=red,text=black] {
node[concept] {applied}[clockwise from=360]
child { node[concept,level distance=16cm,sibling angle=60] {databases} }
}
child[concept color=red,text=black] {
node[concept] {technical}
}
child[concept color=red,text=black] {
node[concept,text width=2cm] {theoretical}
};
\end{tikzpicture}}
\end{frame}
\end{document}
我怎样才能red
用所选主题设置的内容(或自定义的内容)替换上面的内容\setbeamercolor*{palette tertiary}{fg=black,bg=black!10}
?我想对各种 tikzpicture、pgfplots 等执行此操作。
答案1
我不知道为什么有些beamer
颜色可用(例如structure.fg
),而有些则不可用。但你总是可以定义基于 beamer 主题的颜色。这样,当您更改 beamer 主题时,所有颜色都会改变。
后
\usebeamercolor{block title alerted}
\colorlet{color1}{bg}
color1
将等于block title alerted.bg
颜色。您可以重复此行以定义更多颜色。下面的代码显示了使用此解决方案的示例。
Claudio Fiandrino 在如何获取投影仪中颜色主题颜色的实际值?其中\ccft
使用新命令(从模板创建颜色)来定义普通的颜色基于投影机那些。
\documentclass[hyperref={pdfpagelabels=false},xcolor=x11names,compress]{beamer}
\usetheme{Boadilla}
\usepackage{tikz}%Mind map
\usetikzlibrary{mindmap,trees} %Mind map
\usepackage{media9,multimedia,comment,booktabs,datetime}
\usebeamercolor{block title alerted}
\colorlet{color1}{bg}
\usebeamercolor{block body}
\colorlet{color2}{bg}
\colorlet{color3}{bg!30!color1}
\setbeamercolor*{palette tertiary}{fg=red,bg=black!10}
\usebeamercolor{palette tertiary}
\colorlet{color4}{bg}
\begin{document}
\begin{frame}
\frametitle{Literature Review}
\resizebox{0.9\textwidth}{!}{
\hspace{50pt}\begin{tikzpicture}
\path[mindmap,
concept color=structure.fg,
text=white,font=\sf\bf,text width=5cm,
level 1/.append style={level distance=6cm,sibling angle=60},
level 2/.append style={level distance=4cm},]
node[concept] {Learning}[clockwise from=0]
child[concept color=color1] {
node[concept] {practical}[clockwise from=90]
child { node[concept, concept color=color2] {algorithms} [clockwise from=40]
child { node[concept] {databases} }
child { node[concept] {WWW} }}
child { node[concept] {data structures} }
}
child[concept color=color3,text=black] {
node[concept] {applied}[clockwise from=360]
child { node[concept,level distance=16cm,sibling angle=60] {databases} }
}
child[concept color=color4,text=black] {
node[concept] {technical}
}
child[concept color=color4!30!black, text=white] {
node[concept,text width=2cm] {theoretical}
};
\end{tikzpicture}}
\end{frame}
\end{document}