示例来自TikZ 手册v 3.0.1a(我正在使用的版本),p118:
我的最小示例代码(直接从手册中复制和粘贴,但我将其插入\usetikzlibrary{angles}
到文档中,否则angle radius
无法识别):
\documentclass[11pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{angles}
\begin{tikzpicture}[angle radius=.75cm]
\node (A) at (-2,0) [red,left] {$A$};
\node (B) at ( 3,.5) [red,right] {$B$};
\node (C) at (-2,2) [blue,left] {$C$};
\node (D) at ( 3,2.5) [blue,right] {$D$};
\node (E) at (60:-5mm) [below] {$E$};
\node (F) at (60:3.5cm) [above] {$F$};
\coordinate (X) at (intersection cs:first line={(A)--(B)}, second line={(E)--(F)});
\coordinate (Y) at (intersection cs:first line={(C)--(D)}, second line={(E)--(F)});
\path
(A) edge [red, thick] (B)
(C) edge [blue, thick] (D)
(E) edge [thick] (F)
pic ["$\alpha$", draw, fill=yellow] {angle = F--X--A}
pic ["$\beta$", draw, fill=green!30] {angle = B--X--F}
pic ["$\gamma$", draw, fill=yellow] {angle = E--Y--D}
pic ["$\delta$", draw, fill=green!30] {angle = C--Y--E};
\node at ($ (D)!.5!(B) $) [right=1cm,text width=6cm,rounded corners,fill=red!20,inner sep=1ex]
{
When we assume that $\color{red}AB$ and $\color{blue}CD$ are
parallel, i.\,e., ${\color{red}AB} \mathbin{\|} \color{blue}CD$,
then $\alpha = \delta$ and $\beta = \gamma$.
};
\end{tikzpicture}
\end{document}
完整的错误日志:
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./just4fun.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(e:/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(e:/texlive/2016/texmf-dist/tex/latex/base/size11.clo))
(e:/texlive/2016/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(e:/texlive/2016/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(e:/texlive/2016/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex)
) (e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
(e:/texlive/2016/texmf-dist/tex/latex/ms/everyshi.sty))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex))
(e:/texlive/2016/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(e:/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty
(e:/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty)
(e:/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
(e:/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty)
(e:/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(e:/texlive/2016/texmf-dist/tex/latex/graphics-def/xetex.def)))
(e:/texlive/2016/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex)
) (e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
(e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
(e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def))
))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
)) (e:/texlive/2016/texmf-dist/tex/latex/xcolor/xcolor.sty
(e:/texlive/2016/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.te
x)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric
.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.t
ex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.co
de.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.te
x)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex
)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithm
etics.code.tex)))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.cod
e.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.te
x)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code
.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.c
ode.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.co
de.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code
.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
)))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex)
(e:/texlive/2016/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.st
y)
(e:/texlive/2016/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.st
y)) (e:/texlive/2016/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
(e:/texlive/2016/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex))
(e:/texlive/2016/texmf-dist/tex/latex/pgf/math/pgfmath.sty
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)))
(e:/texlive/2016/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
(e:/texlive/2016/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.co
de.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex)
(e:/texlive/2016/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzli
brarytopaths.code.tex))) (./just4fun.aux)
ABD: EveryShipout initializing macros
(e:/texlive/2016/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzli
braryangles.code.tex)
! Missing \endcsname inserted.
<to be read again>
\alpha
l.33 pic ["$\alpha$", draw, fill=yellow]
{angle = F--X--A}
?
我不知道\endcsname
应该插入哪里。有人能帮忙吗?谢谢!