如何修复 LaTeX 中超出页面的树形图

如何修复 LaTeX 中超出页面的树形图
\documentclass[12pt, letterpaper]{article}
\usepackage{qtree}
\pagestyle{fancy}

\begin{document}  
\paragraph{Question 6}
\Tree[.Ad [.\text{Sees Ad} 
                   [.\text{Doesn't Try} ][.\text{Tries} 
                        [.\text{Doesn't Become Regular} ] [.\text{Becomes Regular} ]
                                                                                                               ]][.\text{Doesn't See Ad} 
                                                                    [.\text{Doesn't Try} ][.\text{Tries}
                                                                                    [.\text{Doesn't Become Regular} ][.\text{Becomes Regular} ] ]]
]
\end{document}

您好,当我尝试绘制此树形图时,它会超出页面范围。我该如何解决此问题?

答案1

欢迎!我建议您改用,forest因为forest这样更容易避免不必要的空间(讽刺的是,这可以节省树木。;-)

\documentclass[12pt, letterpaper]{article}
\usepackage{fancyhdr}
\usepackage{forest}
\pagestyle{fancy}

\begin{document}

\paragraph{Question 6}
\begin{center}
\begin{forest}
for tree={align=center}
 [Ad
  [Sees Ad
   [Doesn't Try]
   [Tries
    [Doesn't\\ Become\\ Regular]
    [Becomes\\ Regular]
   ]
  ]
  [Doesn't See Ad
   [Doesn't Try]
   [Tries
    [Doesn't\\ Become\\ Regular]
    [Becomes\\ Regular]
   ]
  ]
 ]   
\end{forest}
\end{center}
\end{document}

在此处输入图片描述

相关内容