我在使用饼图时遇到问题 ( pgf-pie
)。我无法将饼图放在一边的块中,为什么?
\RequirePackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\newenvironment{aside}{%
\let\oldsection\section
\renewcommand{\section}[1]{
\par\vspace{\baselineskip}{\Large\headingfont\color{pblue} ##1
}
}
\begin{textblock}{3.6}(2.0, 0.55)
\begin{flushright}
\obeycr
}{%
\restorecr
\end{flushright}
\end{textblock}
\let\section\oldsection
}
\begin{aside}
\section{Personal Skills}
\includegraphics[scale=0.62]{img/personal.png}
\begin{tikzpicture}%there is bug
\pie [square]{40/A,30/B,20/C,10/D}
\end{tikzpicture}
~
\end{aside}
输出:
! 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.64 ^^I^^I\begin{tikzpicture}
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Missing character: There is no b in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no u in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 6 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no y in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 6 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no y in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no w in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 6 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no a in font nullfont!
Missing character: There is no n in font nullfont!
Missing character: There is no g in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no ! in font nullfont!
Missing character: There is no 6 in font nullfont!
Missing character: There is no 0 in font nullfont!
! 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.65 ^^I^^I^^I\pie[square]{40/A,30/B,20/C,10/D}
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
答案1
这段代码有很多问题:
- 无文档类(无
\documentclass
命令) - 不
\begin{document}
,不\end{document}
\headingfont
未定义pblue
不是定义的颜色- 未找到图像(您的文件
img/personal.png
在此处不可用)
提到的错误“出现问题 — — 可能缺少某个 \item。“来自flushright
环境。删除它即可看到。您可以在文档文本\raggedleft
中稍后使用aside
,或者\hfill
。