如何在节点内使用 \ begin {spacing} {1} \ textbf {About Courses}} \ end {spacing}?
\documentclass[margin=10pt]{standalone}
\PassOptionsToPackage{usenames,svgnames}{xcolor}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{microtype,setspace}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\begin{document}
\pagecolor{black!50!green!50!}
\begin{tikzpicture}[
nodes = { font = \sffamily\bfseries, align = center,
execute at begin node = {\hspace{0pt}}},
large/.style = { concept, font = \Large\sffamily\bfseries},
huge/.style = { concept, font = \Huge\sffamily\bfseries},
black/.style = { color = black},
white/.style = { color = white},
black45/.style = { color = black, sibling angle = 45},
white40/.style = { color = white, sibling angle = 40},
]
\path[mindmap, concept color = purple!30!yellow!70!, text = white]
node[huge, scale = 0.85, text = purple] {Manual}
[clockwise from = -60]
child[concept color = blue] {
node[large, level distance = 2.4cm] {\textbf{\fontsize{3mm}{3mm}\selectfont About Courses}}};
\end{tikzpicture}
\end{document}
答案1
您只需添加一个键,如align=center
。
\documentclass[margin=10pt]{standalone}
\PassOptionsToPackage{usenames,svgnames}{xcolor}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{microtype,setspace}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\begin{document}
\pagecolor{black!50!green!50!}
\begin{tikzpicture}[
nodes = { font = \sffamily\bfseries, align = center,
execute at begin node = {\hspace{0pt}}},
large/.style = { concept, font = \Large\sffamily\bfseries},
huge/.style = { concept, font = \Huge\sffamily\bfseries},
black/.style = { color = black},
white/.style = { color = white},
black45/.style = { color = black, sibling angle = 45},
white40/.style = { color = white, sibling angle = 40},
]
\path[mindmap, concept color = purple!30!yellow!70!, text = white]
node[huge, scale = 0.85, text = purple] {Manual}
[clockwise from = -60]
child[concept color = blue] {
node[large, level distance = 2.4cm,align=center] {
\begin{spacing}{1} \textbf{About Courses} \end{spacing}
%\textbf{\fontsize{3mm}{3mm}\selectfont About Courses}
}};
\end{tikzpicture}
\end{document}