我如何将这两棵树放在同一页面上?
\documentclass[11pt]{article}
\usepackage{forest}
\usepackage{amsmath}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\textit{Generator $(12)$}
\[\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree={grow'=east,l sep=8em,s sep=3em,circle,inner sep=2pt,fill}
[,label=left:{$(12)$}
[,label=above:{$()$},edge label={node[midway,sloped,above]{$(12)$}}
[,label=right:$(12)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(13)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
[,label=below:{$(123)$},edge label={node[midway,sloped,below]{$(13)$}}
[,label=right:$(23)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(12)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
]
\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 & 1 & 0 \\
1 & 0 & 0 \\
0 & 0 & 1
\end{bmatrix}$}
[,label=above:{$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
[,label=right:$\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 \\
0 & 1 & 0 \\
1 & 0 & 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}
1 & 0 & 0 \\
0 & 0 & 1 \\
0 & 1 & 0
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
[,label=right:$\begin{bmatrix}
0 & 1 & 0 \\
1 & 0 & 0 \\
0 & 0 & 1
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
]
]
\end{forest}}}
\]
\textit{Generator $(13)$}
\[\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree={grow'=east,l sep=8em,s sep=3em,circle,inner sep=2pt,fill}
[,label=left:{$(13)$}
[,label=above:{$(132)$},edge label={node[midway,sloped,above]{$(12)$}}
[,label=right:$(13)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(23)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
[,label=below:{$()$},edge label={node[midway,sloped,below]{$(13)$}}
[,label=right:$(12)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(13)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
]
\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 \\
0 & 1 & 0 \\
1 & 0 & 0
\end{bmatrix}$}
[,label=above:{$\begin{bmatrix}
0 & 0 & 1 \\
1 & 0 & 0 \\
0 & 1 & 0
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
[,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 & 0 & 1 \\
0 & 1 & 0
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
]
[,label=below:{$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}$},edge label={node[midway,sloped,below]{$(132)$}}
[,label=right:$\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 \\
0 & 1 & 0 \\
1 & 0 & 0
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
]
]
\end{forest}}}
\]
\end{landscape}
\end{document}
答案1
一种方法如下:
- 使用以下方法减少矩阵中的空间
\setlength\arraycolsep{2pt}
\renewcommand\arraystretch{0.8}
- 减少
s sep
距离4em
3em
- 减少树标题和树之间的空间,例如
\textit{Generator $(13)$}
\vspace{-\baselineskip}
综合考虑以上因素我得到以下结果:
完整的 MWE 给出上述结果是:
\documentclass[11pt]{article}
\usepackage{forest}
\usepackage{amsmath}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\setlength\arraycolsep{2pt}
\renewcommand\arraystretch{0.8}
\textit{Generator $(12)$}
\vspace{-\baselineskip}
\[\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree = {grow'=east,
l sep=7em,
s sep=3em,
circle,inner sep=2pt,fill,
}
[,label=left:{$(12)$}
[,label=above:{$()$},edge label={node[midway,sloped,above]{$(12)$}}
[,label=right:$(12)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(13)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
[,label=below:{$(123)$},edge label={node[midway,sloped,below]{$(13)$}}
[,label=right:$(23)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(12)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
]
\end{forest}}}
\rightarrow\hspace*{-10em}
\vcenter{\hbox{\begin{forest}
for tree = {grow'=east,
l sep=7em,
s sep=3em,
circle,inner sep=2pt,fill,
font=\small}
[,label=left:{$\begin{bmatrix}
0 & 1 & 0 \\
1 & 0 & 0 \\
0 & 0 & 1
\end{bmatrix}$}
[,label=above:{$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
[,label=right:$\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 \\
0 & 1 & 0 \\
1 & 0 & 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}
1 & 0 & 0 \\
0 & 0 & 1 \\
0 & 1 & 0
\end{bmatrix}$,edge label={node[midway,sloped,above]{$(23)$}}]
[,label=right:$\begin{bmatrix}
0 & 1 & 0 \\
1 & 0 & 0 \\
0 & 0 & 1
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
]
]
\end{forest}}}
\]
\textit{Generator $(13)$}
\vspace{-\baselineskip}
\[\hspace*{-10em}\vcenter{\hbox{
\begin{forest}
for tree = {grow'=east,
l sep=7em,
s sep=3em,
circle,inner sep=2pt,fill,
font=\small}
[,label=left:{$(13)$}
[,label=above:{$(132)$},edge label={node[midway,sloped,above]{$(12)$}}
[,label=right:$(13)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(23)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
[,label=below:{$()$},edge label={node[midway,sloped,below]{$(13)$}}
[,label=right:$(12)$,edge label={node[midway,sloped,above]{$(12)$}}]
[,label=right:$(13)$,edge label={node[midway,sloped,below]{$(13)$}}]
]
]
\end{forest}}}
\rightarrow\hspace*{-10em}
\vcenter{\hbox{\begin{forest}
for tree = {grow'=east,
l sep=7em,
s sep=3em,
circle,inner sep=2pt,fill,
font=\small}
[,label=left:{$\begin{bmatrix}
0 & 0 & 1 \\
0 & 1 & 0 \\
1 & 0 & 0
\end{bmatrix}$}
[,label=above:{$\begin{bmatrix}
0 & 0 & 1 \\
1 & 0 & 0 \\
0 & 1 & 0
\end{bmatrix}$},edge label={node[midway,sloped,above]{$(23)$}}
[,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 & 0 & 1 \\
0 & 1 & 0
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
]
[,label=below:{$\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}$},edge label={node[midway,sloped,below]{$(132)$}}
[,label=right:$\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 \\
0 & 1 & 0 \\
1 & 0 & 0
\end{bmatrix}$,edge label={node[midway,sloped,below]{$(132)$}}]
]
]
\end{forest}}}
\]
\end{landscape}
\end{document}