如何使这棵树适合默认边距?

如何使这棵树适合默认边距?

我有以下代码,并希望它适合默认边距而不使页面垂直,可以做到这一点吗?

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{forest}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\textit{Generator $(12)$}
\[\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree={grow'=east,l sep=5em,s sep=2em,circle,inner sep=2pt,fill}
[,label=left:{$(132)$}
 [,label=above:{$(12)$},edge label={node[midway,sloped,above]{$(23)$}}
  [,label=right:$(132)$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$(23)$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
 [,label=below:{$(123)$},edge label={node[midway,sloped,below]{$(132)$}}
  [,label=right:$(13)$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$()$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
]
\end{forest}}}
\rightarrow\hspace*{-10em}
\vcenter{\hbox{\begin{forest}
for tree={grow'=east,l sep=7em,s sep=4em,circle,inner sep=2pt,fill}
[,label=left:{$\begin{bmatrix} 0 & 0 & 1 \\ 
1 & 0 & 0 \\ 
0 & 1 & 0 
\end{bmatrix}$}
 [,label=above:{$\begin{bmatrix} 0 & 1 & 0 \\ 
1 & 0 & 0 \\ 
0 & 0 & 1 
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
  [,label=right:$\begin{bmatrix} 0 & 0 & 1 \\ 
1 & 0 & 0 \\ 
0 & 1 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$\begin{bmatrix} 1 & 0 & 0 \\ 
0 & 0 & 1 \\ 
0 & 1 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
 [,label=below:{$\begin{bmatrix} 0 & 1 & 0 \\ 
0 & 0 & 1 \\ 
1 & 0 & 0 
\end{bmatrix}$},edge label={node[midway,sloped,below]{$(132)$}}
  [,label=right:$\begin{bmatrix} 0 & 0 & 1 \\ 
0 & 1 & 0 \\ 
1 & 0 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$\begin{bmatrix} 1 & 0 & 0 \\ 
0 & 1 & 0 \\ 
0 & 0 & 1 
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
]
\end{forest}}}
\]
\end{landscape}
\end{document}

答案1

除了使用pdflscape,您还可以使用rotating包,MWE如下所示:

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{forest}
\usepackage[figuresright]{rotating}
\usepackage{showframe}
\begin{document}
\begin{sidewaysfigure}
\textit{Generator $(12)$}
\[\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree={grow'=east,l sep=5em,s sep=2em,circle,inner sep=2pt,fill}
[,label=left:{$(132)$}
 [,label=above:{$(12)$},edge label={node[midway,sloped,above]{$(23)$}}
  [,label=right:$(132)$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$(23)$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
 [,label=below:{$(123)$},edge label={node[midway,sloped,below]{$(132)$}}
  [,label=right:$(13)$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$()$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
]
\end{forest}}}
\rightarrow\hspace*{-10em}
\vcenter{\hbox{\begin{forest}
for tree={grow'=east,l sep=7em,s sep=4em,circle,inner sep=2pt,fill}
[,label=left:{$\begin{bmatrix} 0 & 0 & 1 \\ 
1 & 0 & 0 \\ 
0 & 1 & 0 
\end{bmatrix}$}
 [,label=above:{$\begin{bmatrix} 0 & 1 & 0 \\ 
1 & 0 & 0 \\ 
0 & 0 & 1 
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
  [,label=right:$\begin{bmatrix} 0 & 0 & 1 \\ 
1 & 0 & 0 \\ 
0 & 1 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$\begin{bmatrix} 1 & 0 & 0 \\ 
0 & 0 & 1 \\ 
0 & 1 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
 [,label=below:{$\begin{bmatrix} 0 & 1 & 0 \\ 
0 & 0 & 1 \\ 
1 & 0 & 0 
\end{bmatrix}$},edge label={node[midway,sloped,below]{$(132)$}}
  [,label=right:$\begin{bmatrix} 0 & 0 & 1 \\ 
0 & 1 & 0 \\ 
1 & 0 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$\begin{bmatrix} 1 & 0 & 0 \\ 
0 & 1 & 0 \\ 
0 & 0 & 1 
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
]
\end{forest}}}
\]
\end{sidewaysfigure}
\end{document}

答案2

免责声明:我不知道树木为什么有这么大的边界框,即为什么\hspace需要负数。除此之外,我只会稍微重新排列它们。

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{forest}
\begin{document}
\textit{Generator $(12)$}
\[\bgroup\tikzset{label distance=-3.14pt}\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree={grow'=east,l sep=2em,s sep=4em,circle,inner sep=2pt,fill}
[,label=left:{$(132)$}
 [,label=above left:{$(12)$},edge label={node[midway,sloped,above]{$(23)$}}
  [,label=right:$(132)$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$(23)$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
 [,label=below left:{$(123)$},edge label={node[midway,sloped,below]{$(132)$}}
  [,label=right:$(13)$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$()$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
]
\end{forest}}}
\rightarrow\hspace*{-10em}
\vcenter{\hbox{\begin{forest}
for tree={grow'=east,l sep=3em,s sep=8em,circle,inner sep=2pt,fill}
[,label=left:{$\begin{bmatrix} 0 & 0 & 1 \\ 
1 & 0 & 0 \\ 
0 & 1 & 0 
\end{bmatrix}$}
 [,label=above left:{$\begin{bmatrix} 0 & 1 & 0 \\ 
1 & 0 & 0 \\ 
0 & 0 & 1 
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
  [,label=right:$\begin{bmatrix} 0 & 0 & 1 \\ 
1 & 0 & 0 \\ 
0 & 1 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$\begin{bmatrix} 1 & 0 & 0 \\ 
0 & 0 & 1 \\ 
0 & 1 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
 [,label=below left:{$\begin{bmatrix} 0 & 1 & 0 \\ 
0 & 0 & 1 \\ 
1 & 0 & 0 
\end{bmatrix}$},edge label={node[midway,sloped,below]{$(132)$}}
  [,label=right:$\begin{bmatrix} 0 & 0 & 1 \\ 
0 & 1 & 0 \\ 
1 & 0 & 0 
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
  [,label=right:$\begin{bmatrix} 1 & 0 & 0 \\ 
0 & 1 & 0 \\ 
0 & 0 & 1 
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
 ]
]
\end{forest}}}\egroup
\]
\end{document}

在此处输入图片描述

顺便说一句,我更赞同这些置换矩阵。是否有必要如此详细地阐述它们,而不是仅仅保留循环符号,则由其他人决定。

相关内容