![Tikzpicture - 功能分析树被强制置于页面顶部 - 想要居中到页面中心](https://linux22.com/image/366234/Tikzpicture%20-%20%E5%8A%9F%E8%83%BD%E5%88%86%E6%9E%90%E6%A0%91%E8%A2%AB%E5%BC%BA%E5%88%B6%E7%BD%AE%E4%BA%8E%E9%A1%B5%E9%9D%A2%E9%A1%B6%E9%83%A8%20-%20%E6%83%B3%E8%A6%81%E5%B1%85%E4%B8%AD%E5%88%B0%E9%A1%B5%E9%9D%A2%E4%B8%AD%E5%BF%83.png)
第一次在这个论坛上发帖。我使用了一个模板来制作这个功能分析树。(还没有完全完成,因为我想先把格式弄对)。但是当我编译它时,图形被强制放在页面顶部,而不是在页面中心居中。我不确定如何做到这一点,因为我已经尝试了很多可能性,浏览了这个论坛。
非常感谢您提供的任何帮助!
\documentclass[a3paper]{article} % say
\usepackage{tikz}
\usetikzlibrary{graphs}
\usepackage{filecontents}
\usepackage{tikz}
\usepackage{tikzscale}
\usepackage[margin=0pt]{geometry}
\pagestyle{empty}
\usepackage{pdflscape}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
\begin{document}
\begin{landscape}
\begin{center}
\resizebox*{1\textwidth}{!}{
\begin{tikzpicture}[inner sep=2mm,
place/.style={circle,draw=blue!50,fill=blue!20,thick},
transition/.style={rectangle,draw=black!50,fill=black!20,thick, minimum
width={width("Allow installation")+2pt}}, skip loop/.style={to path={-- ++
(0,#1) -| (\tikztotarget)}},
hv path/.style={to path={-| (\tikztotarget)}},
vh path/.style={to path={|- (\tikztotarget)}}]]
\node at ( 0,10) [transition, align=center] (one) {Improve\\Tonearm};
\node at ( -12,8) [transition, align=center] (two) {Enhance
User\\Experience};
\node at ( 6,8) [transition, align=center] (three) {Extract Quality\\Audio};
\node at ( -18,6) [transition, align=center](fam1row11){Allow easy\\record
switching};
\node at ( -14,6) [transition, align=center](fam1row12){Meet
budget\\constraints};
\node at ( -10,6) [transition, align=center](fam1row13){Enable
easy\\installation};
\node at ( -6,6) [transition, align=center](fam1row14)
{Complement\\aesthetic};
\node at ( -18,4) [transition, align=center](fam1row21){Include
intuitive\\mechanism};
\node at ( -12,4) [transition, align=center](fam1row22){Include
auto\\adjustment};
\node at ( -8,4) [transition, align=center](fam1row23)
{Allow\\customization};
\node at ( -15.5,2) [transition, align=center](fam1row31){Allow
feedback\\mechanism};
\node at ( -12,2) [transition, align=center](fam1row32){Include
intuitive\\controls};
\node at ( -8.5,2) [transition, align=center](fam1row33){Include\\calibrated
dials};
\node at ( -2,6) [transition, align=center]{Improve\\Tonearm};
\node at ( 6,6) [transition, align=center]{Improve\\Tonearm};
\node at ( 12,6) [transition, align=center]{Improve\\Tonearm};
\node at ( 14,6) [transition, align=center]{Improve\\Tonearm};
\node at ( 18,6) [transition, align=center]{Improve\\Tonearm};
\node at ( 24,6) [transition, align=center]{Improve\\Tonearm};
\node at ( 26,6) [transition, align=center]{Improve\\Tonearm};
\node at ( -2,4) [transition, align=center]{Improve\\Tonearm};
\node at ( -2,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 6,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 2,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 10,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 1,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 3,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 5,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 7,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 10,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 12,4) [transition, align=center](fam2row25){Improve\\Tonearm};
\node at ( 14,4) [transition, align=center](fam2row26){Improve\\Tonearm};
\node at ( 15.5,2) [transition, align=center](fam2row37){Improve\\Tonearm};
\node at ( 17,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 19,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 22,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 24,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 26,4) [transition, align=center]{Improve\\Tonearm};
\node at ( 23,2) [transition, align=center]{Improve\\Tonearm};
\node at ( 25,2) [transition, align=center](fam2row39){Improve\\Tonearm};
\draw [->] (one) to (two);
\draw [->] (one) to (three);
%\draw [->] (two.south) to (fam1row11.north);
%\draw [->] (two.south) to (fam1row12.north);
%\draw [->] (two.south) to (fam1row13.north);
%\draw [->] (two.south) to (fam1row14.north);
\graph {
(two.south) ->[skip loop=-5mm] (fam1row11.north);
(two.south) ->[skip loop=-5mm] (fam1row12.north);
(two.south) ->[skip loop=-5mm] (fam1row13.north);
(two.south) ->[skip loop=-5mm] (fam1row14.north);
(fam1row11.south) ->[skip loop=-5mm] (fam1row21.north);
(fam1row13.south) ->[skip loop=-5mm] (fam1row22.north);
(fam1row13.south) ->[skip loop=-5mm] (fam1row23.north);
(fam1row22.south) ->[skip loop=-5mm] (fam1row31.north);
(fam1row22.south) ->[skip loop=-5mm] (fam1row32.north);
(fam1row22.south) ->[skip loop=-5mm] (fam1row33.north);
(fam1row23.south)->[skip loop=-5mm] (fam2row25.south);
(fam1row23.south)->[skip loop=-5mm] (fam2row26.south);
(fam1row23.south)->[skip loop=-5mm] (fam2row37.north);
(fam1row23.south)->[skip loop=-5mm] (fam2row39.north);
%(p2) ->[skip loop=5mm] (p5);
%(p6) ->[skip loop=-11mm] (p9);
%(p7) ->[vh path] (plus) -> [hv path] (p8);
%(p7) ->[vh path] (minus) -> [hv path] (p8);
};
\end{tikzpicture}
}
\end{center}
\end{landscape}
\end{document}
答案1
尝试将您的tikzpicture
内部figure
环境而不是center
环境放置其中。
\begin{figure}[p]
\centering
\begin{tikzpicture}
....
\end{tikzpicture}
\caption{if required \label{if required too}}
\end{figure}
该[p]
选项将图形放在单独的页面上