! 패키지 tikz 오류: 이 경로를 포기합니다. 세미콜론을 잊으셨나요?

! 패키지 tikz 오류: 이 경로를 포기합니다. 세미콜론을 잊으셨나요?

나는 tikz의 작동 방식에 대해 상당히 근본적인 것을 놓치고 있는 것 같습니다... 누락된 세미콜론이 어디에 있는지 정말 알 수 없습니다!

MWE:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[sibling distance=10em,
  every node/.style = {draw=none, fill=none}]]
  \node {What are the types of \code{a} and \code{b}?}
  child { \node {\code{int} and \code{int}}
    child { \node{Execute procedure \code{int\_add}. }; }; }
  child { \node {\code{float} and \code{float}}
    child { \node{Execute procedure \code{float\_add}.}; }; }
  child { \node {\code{float} and \code{int}}
    child { \node{Execute procedure \code{float\_plus\_int}.}; }; }
  child { \node {\code{int} and \code{float}}
    child { \node{Execute procedure \code{int\_plus\_float}.}; }; }
  child { \node {\code{string} and \code{string}}
    child { \node{Execute procedure \code{string\_concatenate}.}; }; }
  child { \node {Any other combination}
    child { \node{Raise \code{TypeError}.}; }; };
\end{tikzpicture}
\end{document}

답변1

  • ]옵션 뒤에는 가짜가 있습니다 tikzpicture(많은 해를 끼치지는 않지만 거기에 있어서는 안 됩니다).

  • 닫는 중괄호보다 여는 중괄호가 더 많습니다.

  • \node트리 내의 s는 s(백슬래시 없음)여야 하며 종료 node세미콜론이 필요하지 않습니다.

.

\documentclass{standalone}
\usepackage{tikz}
\newcommand\code[1]{\texttt{#1}}
\begin{document}
\begin{tikzpicture}[sibling distance=10em,
  every node/.style = {draw=none, fill=none}]]
  \node {What are the types of \code{a} and \code{b}?}
  child { node {\code{int} and \code{int}}
          child { node{Execute procedure \code{int\_add}. }
                }
          }
  child { node {\code{float} and \code{float}}
          child { node{Execute procedure \code{float\_add}.}
                }
        }
  child { node {\code{float} and \code{int}}
          child { node{Execute procedure \code{float\_plus\_int}.}
                }
        }
  child { node {\code{int} and \code{float}}
          child { node{Execute procedure \code{int\_plus\_float}.}
                }
        }
  child { node {\code{string} and \code{string}}
          child { node{Execute procedure \code{string\_concatenate}.}
                }
        }
  child { node {Any other combination}
          child { node{Raise \code{TypeError}.}
                }
        };
\end{tikzpicture}
\end{document}

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

관련 정보