为什么我在考试类和 newicktree 包中遇到这个问题?

为什么我在考试类和 newicktree 包中遇到这个问题?

我无法让系统发育树在考试类的解决方案环境中正确显示。出于某种原因,它们在该环境中的位置非常靠右(超出页面范围)。请参阅下面的 MWE。

% Compile with XeLaTeX to deal with EPS graphics in trees.

\documentclass[letterpaper,12pt,addpoints]{exam}
\usepackage{newicktree}
\printanswers

\begin{document}
\begin{questions}

\question[5] The tree is correctly positioned on the page if it comes after the solution environment.
\begin{solution}
\end{solution}
\begin{newicktree}
\righttree \contemporarytips\nobranchlengths \setunitlength{4in}
\drawtree{(((ferns \& allies, (angiosperms, gymnosperms)),bryophytes), blue-green algae);}
\end{newicktree}

\question[5] The tree is not correctly positioned within the solution environment.
\begin{solution}
\begin{newicktree}
\righttree \contemporarytips\nobranchlengths \setunitlength{4in}
\drawtree{(((ferns \& allies, (angiosperms, gymnosperms)),bryophytes), blue-green algae);}
\end{newicktree}
\end{solution}

\end{questions}
\end{document}

答案1

在解决方案环境中插入一个空白行,在 newicktree 环境之前创建一个新段落即可。请参阅下面的完整代码。

% Compile with XeLaTeX to deal with EPS graphics in trees.

\documentclass[letterpaper,12pt,addpoints]{exam}
\usepackage{newicktree}
\printanswers

\begin{document}
\begin{questions}

\question[5] The tree is correctly positioned on the page if it comes after the solution environment.
\begin{solution}
\end{solution}
\begin{newicktree}
\righttree \contemporarytips\nobranchlengths \setunitlength{4in}
\drawtree{(((ferns \& allies, (angiosperms, gymnosperms)),bryophytes), blue-green algae);}
\end{newicktree}

\question[5] The tree is not correctly positioned within the solution environment.
\begin{solution}

\begin{newicktree}
\righttree \contemporarytips\nobranchlengths \setunitlength{4in}
\drawtree{(((ferns \& allies, (angiosperms, gymnosperms)),bryophytes), blue-green algae);}
\end{newicktree}
\end{solution}

\end{questions}
\end{document}

相关内容