
노드 내부에 수학 표현식을 레이블로 추가하면 문제가 없습니다.
\begin{figure}
\begin{tikzpicture}[]
\node[circle, draw] (c1) [label=left: text] {};
\node[block, draw, right = of c1] (e1) {$1*1=1$};
\draw[->] (c1) -- (e1);
\end{tikzpicture}
\end{figure}
그러나 위의 'text' 레이블에 했던 것처럼 노드 옆에 수학 표현식을 배치하려는 경우 컴파일되지 않습니다.
\begin{figure}
\begin{tikzpicture}[]
\node[circle, draw] (c1) [label=left: text] {};
\node[block, draw, right = of c1] (e1) [label=right: $1*1=1$] {};
\draw[->] (c1) -- (e1);
\end{tikzpicture}
\end{figure}
어떻게 작동시킬 수 있는지에 대한 생각이 있습니까?
답변1
{}
문제를 해결하려면 수학 표현식을 다음과 같이 표현하세요.
설명
처럼@Zarko는 그의 의견에서 설명했습니다.문제는 수학 표현식 자체가 아니라 기호입니다. =
이로 인해 tikz
옵션을 잘못 구문 분석하게 됩니다. {}
표현식 주변 에 레이어를 추가하면 =
tikz에서 숨겨집니다.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}
\begin{tikzpicture}[]
\node[circle, draw] (c1) [label=left: text] {};
\node[draw, right = of c1] (e1) [label=right: {$1*1=1$}] {};
\draw[->] (c1) -- (e1);
\end{tikzpicture}
\end{figure}
\end{document}