在图形环境中合并 tikz 树会弄乱“景观”选项

在图形环境中合并 tikz 树会弄乱“景观”选项

我有一棵大树tikz,只有将页面转到 才能正确显示landscape。这样做不是问题:\begin{landscape}\end{landscape}命令可以很好地完成这一点。

但是,我想将我的树包含在我的图形列表中,所以我决定figure在它周围放置一个环境。这会弄乱横向视图——页面再次旋转为纵向视图。

我不太明白问题出在哪里...

以下是一段代码:

\documentclass[paper=a4, fontsize=11pt]{scrartcl} 
\usepackage{todonotes}
\usepackage[T1]{fontenc} 
\usepackage{fourier}
\usepackage{arydshln}
\usepackage[ngerman, english]{babel} 
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amsthm} 
\usepackage{lipsum} 
\usepackage{sectsty} 
\pagestyle{fancyplain} 
\usepackage{tikz}
\usepackage{lscape}
\usetikzlibrary{trees,shapes}

\begin{document}

\section{start}
here comes the text in portrait mode.

\begin{landscape}
\tikzstyle{level 1}=[level distance=0.9cm, sibling distance=11cm]
\tikzstyle{level 2}=[level distance=0.9cm, sibling distance=12cm]
\tikzstyle{level 3}=[level distance=0.9cm, sibling distance=6cm]
\tikzstyle{level 4}=[level distance=1.1cm, sibling distance=3cm]
\tikzstyle{level 5}=[level distance=1.5cm, sibling distance=2cm]
\tikzstyle{level 6}=[level distance=1.5cm, sibling distance=2cm]
\tikzstyle{bag} = [rectangle, text width=5em, text centered, draw,]
\tikzstyle{Group Name} = [circle, minimum height=8pt, minimum width=8pt,  inner sep=0pt, draw]
\tikzstyle{choice} = [circle, minimum width=8pt, fill, inner sep=0pt]
\tikzstyle{end_good} = [rectangle, rounded corners, text width=7em,text centered, draw, text=green]
\tikzstyle{end_bad} = [rectangle, rounded corners, text width=7em,text centered, draw, text=red]
\tikzstyle{end} = [rectangle, rounded corners, text width=10em,text centered, draw]

\begin{figure}
\begin{tikzpicture}[grow=down,child anchor=north]
\node[end]{blah}
   child {node[Group Name]{B}
         child {node[bag]{blah}
               child {node[Group Name]{A}
                     child {node[bag]{blah}
                           child{node[end_bad]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
               }  
               child {node[Group Name]{B}
                     child {node[bag]{blah}
                           child{node[end_bad]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
               }  
         }
         child {node[bag]{blah}
               child {node[Group Name]{A}
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
                 }
                 child {node[Group Name]{B}
                     child {node[bag]{blah}
                           child{node[end_bad]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
                 }
         }
                }                          
;
\end{tikzpicture}

\begin{tikzpicture}[grow=down,child anchor=north]
\node[end]{more blah}
   child {node[Group Name]{B}
         child {node[bag]{more blah}
               child {node[Group Name]{A}
                     child {node[bag]{more blah}
                           child{node[end_bad]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
               }  
               child {node[Group Name]{B}
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
               }  
         }
         child {node[bag]{more blah}
               child {node[Group Name]{A}
                     child {node[bag]{more blah}
                           child{node[end_bad]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                 }
                 child {node[Group Name]{B}
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                 }
         }
                }                          
;
\end{tikzpicture}
\end{figure}

Assumptions:
Here go some assuptions

\begin{itemize}
\item blah blah
\item blah
\item blah
\end{itemize}


\end{landscape}
go on in portrait mode.

\end{document}

有趣的是,原本应该张贴在树下(仍然处于横向模式)的假设实际上是处于横向模式,而树却不是。

有没有什么办法可以让树在图形环境中处于横向模式?

谢谢您的任何建议!


编辑

我切换到\usepackage{pdflscape}并在图中加入了假设。tikz代码现在如下所示:

 \begin{figure}
\begin{landscape}


\tikzstyle{level 1}=[level distance=0.9cm, sibling distance=11cm]
\tikzstyle{level 2}=[level distance=0.9cm, sibling distance=12cm]
\tikzstyle{level 3}=[level distance=0.9cm, sibling distance=6cm]
\tikzstyle{level 4}=[level distance=1.1cm, sibling distance=3cm]
\tikzstyle{level 5}=[level distance=1.5cm, sibling distance=2cm]
\tikzstyle{level 6}=[level distance=1.5cm, sibling distance=2cm]
\tikzstyle{bag} = [rectangle, text width=5em, text centered, draw,]
\tikzstyle{Group Name} = [circle, minimum height=8pt, minimum width=8pt,  inner sep=0pt, draw]
\tikzstyle{choice} = [circle, minimum width=8pt, fill, inner sep=0pt]
\tikzstyle{end_good} = [rectangle, rounded corners, text width=7em,text centered, draw, text=green]
\tikzstyle{end_bad} = [rectangle, rounded corners, text width=7em,text centered, draw, text=red]
 \tikzstyle{end} = [rectangle, rounded corners, text width=10em,text centered, draw]

 \begin{tikzpicture}[grow=down,child anchor=north]
\node[end]{blah}
   child {node[Group Name]{B}
         child {node[bag]{blah}
               child {node[Group Name]{A}
                     child {node[bag]{blah}
                           child{node[end_bad]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
               }  
               child {node[Group Name]{B}
                     child {node[bag]{blah}
                           child{node[end_bad]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
               }  
         }
         child {node[bag]{blah}
               child {node[Group Name]{A}
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
                 }
                 child {node[Group Name]{B}
                     child {node[bag]{blah}
                           child{node[end_bad]{blah}
                           }
                     }
                     child {node[bag]{blah}
                           child{node[end_good]{blah}
                           }
                     }
                 }
         }
                }                          
;
\end{tikzpicture}

\begin{tikzpicture}[grow=down,child anchor=north]
\node[end]{more blah}
   child {node[Group Name]{B}
         child {node[bag]{more blah}
               child {node[Group Name]{A}
                     child {node[bag]{more blah}
                           child{node[end_bad]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
               }  
               child {node[Group Name]{B}
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
               }  
         }
         child {node[bag]{more blah}
               child {node[Group Name]{A}
                     child {node[bag]{more blah}
                           child{node[end_bad]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                 }
                 child {node[Group Name]{B}
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                     child {node[bag]{more blah}
                           child{node[end_good]{more blah}
                           }
                     }
                 }
         }
                }                          
;
\end{tikzpicture}


Some assumptiona:
\begin{itemize}
\item 
\item blah    
\item blah    
\end{itemize}


\end{landscape}
\end{figure}


\end{document}

但是,它仍然以纵向模式显示图形,因此只有一半......还有其他建议吗?

相关内容