我有以下 WME,它运行良好,但是当我取消注释这些行以将其置于图形环境中时,它将无法编译。
\documentclass{book}
\usepackage{tkz-euclide}
\usepackage{tikz-qtree}
\usepackage{float}
\begin{document}
%\begin{figure}[h]
%\centering
\Tree [.Quadrilaterals
[.Parallelograms
[.Rectangular square oblong ]
[.Non-rectangular rhombus rhomboid ]
]
[.Non-parallelograms
[.{Two sides parallel \\ (trapezium)} isosceles trapezium scalene trapezium ]
[.{No sides parallel \\ (trapezoid)} ]
]
]
%\end{figure}
\end{document}
出现以下错误。
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.22 \end
{figure}
?
qtree 与图不兼容吗?
答案1
没有问题,figure
但是\centering
改变了和的定义,无论您是否使用,在树中\\
使用时都会产生错误。\\
figure
由于图形比页面宽
Overfull \hbox (142.74435pt too wide) in paragraph at lines 20--28
\centering
无论如何都没什么用处所以:
\documentclass{book}
\usepackage{tkz-euclide}
\usepackage{tikz-qtree}
\usepackage{float}
\begin{document}
\begin{figure}[htp]
%\centering
\Tree [.Quadrilaterals
[.Parallelograms
[.Rectangular square oblong ]
[.Non-rectangular rhombus rhomboid ]
]
[.Non-parallelograms
[.{Two sides parallel \\ (trapezium)} isosceles trapezium scalene trapezium ]
[.{No sides parallel \\ (trapezoid)} ]
]
]
\end{figure}
\end{document}