수동 V2.10 페이지 70에서 Tikz를 사용한 다이어그램 및 그래프에 대한 예가 실패합니다.

수동 V2.10 페이지 70에서 Tikz를 사용한 다이어그램 및 그래프에 대한 예가 실패합니다.

책의 스크린샷

내 질문은 TikZ 매뉴얼 V2.10의 70페이지에 제공된 코드를 컴파일할 수 없다는 것입니다. 일부 패키지를 추가했지만 컴파일할 수 없습니다. 누구든지 도와줄 수 있나요? 내 코드는 아래와 같이 표시됩니다.

\documentclass[tikz]{standalone}
\usetikzlibrary{calc,shapes,positioning,arrows,graphs}
\begin{document}

\tikz [>=stealth', black!50, text=black, thick,
every new ->/.style = {shorten >=1pt},
graphs/every graph/.style = {edges=rounded corners},
skip loop/.style = {to path={-- ++(0,#1) -| (\tikztotarget)}},
hv path/.style = {to path={-| (\tikztotarget)}},
vh path/.style = {to path={|- (\tikztotarget)}},
nonterminal/.style = {
rectangle, minimum size=6mm, very thick, draw=red!50!black!50, top color=white,
bottom color=red!50!black!20, font=\itshape, text height=1.5ex,text depth=.25ex},
terminal/.style = {
rounded rectangle, minimum size=6mm, very thick, draw=black!50, top color=white,
bottom color=black!20, font=\ttfamily, text height=1.5ex, text depth=.25ex},
shape = coordinate
]
\graph [grow right sep, branch down=7mm, simple] {
/ -> unsigned integer[nonterminal] -- p1 -> "." [terminal] -- p2 -> digit[terminal] --
p3 -- p4 -- p5 -> E[terminal] -- q1 ->[vh path]
{[nodes={yshift=7mm}]
"+"[terminal], q2, "-"[terminal]
} -> [hv path]
q3 -- /unsigned integer [nonterminal] -- p6 -> /;
p1 ->[skip loop=5mm] p4;
p3 ->[skip loop=-5mm] p2;
p5 ->[skip loop=-11mm] p6;
q1 -- q2 -- q3; % make these edges plain
};

\end{document}

답변1

여기에 이미지 설명을 입력하세요

패키지 라이브러리를 업데이트했는데 이제 작동합니다. MikTex 소프트웨어를 설치한 후 패키지 라이브러리를 업데이트해야 합니다. Gonzalo, CFR, Paul에게 감사드립니다^_^

관련 정보