帶有 tikz-mindmap 的圖形標題不會出現在 tikzpicture 下

帶有 tikz-mindmap 的圖形標題不會出現在 tikzpicture 下

我使用以下程式碼在單一 A3 頁面上產生心智圖,該頁麵包含在常見的 A4 格式的紙張中。我希望標題位於整個心智圖下方,但顯然它被放置在第一個設定節點下方。我認為這是因為我使用“記住圖片”和“覆蓋”選項將起始節點放置在某個位置。因此,有些子節點恰好位於標題下方。如何讓標題真正位於整個心智圖下方?

我的程式碼:

\documentclass[
a4paper,%a4 Papier
11pt, %schriftgroesse
BCOR=12mm, %binding correction
DIV=11,
twoside, %doppelseitig 
openright, %erstes kapitel steht rechts
cleardoublepage=plain, %Leere Seiten werden nummeriert (wegen openright)
parskip=half-
]{scrreprt}

\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,calc,math,angles,quotes,trees,mindmap}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\usepackage{lipsum}
\captionsetup[figure]{font=small,labelfont=small}

\begin{document}
\lipsum
\paragraph{Mindmap}
\clearpage
\KOMAoptions{paper=A3,DIV=23,paper=landscape}
\recalctypearea
\begin{figure}
\centering
\begin{tikzpicture}[remember picture, overlay,mindmap, grow cyclic, every node/.style={concept,font=\small,minimum size=0cm}, concept color=gray!60, 
    level 1/.append style={font=\footnotesize, level distance=4cm,sibling angle=90},
    level 2/.append style={font=\footnotesize,level distance=3cm,sibling angle=45},
    level 3/.append style={font=\footnotesize,level distance=3cm,sibling angle=37},
    level 4/.append style={font=\footnotesize,level distance=2.5cm,sibling angle=50},
    level 5/.append style={font=\footnotesize,level distance=2cm,sibling angle=40}]
    \node[xshift=2.5cm,yshift=2cm,inner sep=0cm] at (current page.center) (mac) {First node}
    child { node  {Second node}
    [level 2/.append style={sibling angle=60}] 
    [level 3/.append style={sibling angle=45}] 
    [level 4/.append style={sibling angle=30}] 
        child { node  {Third node}
            child { node[xshift=0.5cm]  (Macsup) {Child}}
            child { node[xshift=-0cm,yshift=2.5cm]  {Child}}
        }
        child { node[xshift=-1cm]  (Macro) {Third node}
            child { node[xshift=-2cm,yshift=3cm]  (Qubits) {Text}}  
        }
    };
\end{tikzpicture}
\caption{Mindmap.}
\label{mindmap}
\end{figure}
\clearpage
\KOMAoptions{paper=A4,paper=portrait,DIV=11}
\recalctypearea
\lipsum

\end{document}

答案1

我自己找到了答案,如果其他人需要類似的幫助,我仍然會保留這個問題。我擺脫了 tikzpicture 選項中的「覆蓋」。顯然,此選項使圖片本身不需要任何空間 - 這使得標題出現在頁面中間,就好像根本沒有圖片一樣。

相關內容