노드 내부의 여러 줄 수학 모드가 전혀 작동하지 않습니다.

노드 내부의 여러 줄 수학 모드가 전혀 작동하지 않습니다.

나는 그림을 그리고 그 아래에 특정 기호(이 경우 등호)에 정렬될 몇 가지 방정식을 작성하고 싶습니다.

\documentclass{report}
\usepackage{amsmath,tikz,mathtools}
\usetikzlibrary{shapes}
\begin{document}
    \begin{tikzpicture}
        \node[draw,regular polygon,regular polygon sides=4] (square) {};
        \node[below=of square] () {$
        Area &= side \times side \\
        Perimeter &= 4 \times side
        $}
    \end{tikzpicture}
\end{document}

불행히도 이것은 작동하지 않으며 그 이유를 이해하지 못합니다.

답변1

  • 인라인 수학은 더 이상 줄로 나누어지지 않았습니다. 귀하의 경우 수학 표현식 은 multlinedamsmathmathtools
  • 위치 지정을 위해 라이브러리를 사용 positioning하지만 로드하지는 않습니다.
\documentclass{report}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{positioning,
                shapes}

\begin{document}
    \begin{tikzpicture}
\node[draw,regular polygon,regular polygon sides=4] (square) {};
\node[below=of square]  
    {$\begin{aligned}
        Area        & = side \times side \\
        Perimeter   & = 4 \times side
      \end{aligned}$};
    \end{tikzpicture}
\end{document}

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

답변2

제공된 코드에는 몇 가지 문제가 있습니다.

  • 구문 에는 tikz lib가 below=of ...필요합니다.positioning
  • 수학이 포함된 노드 ;뒤에 a가 누락되었습니다.
  • 수학 노드의 콘텐츠 &=는 오류를 일으키는 정렬 환경을 사용하지만 정렬 환경은 사용하지 않습니다.

이것은 컴파일

\documentclass{report}
\usepackage{amsmath,tikz,mathtools}
\usetikzlibrary{shapes}
\usetikzlibrary{positioning}
\begin{document}
    \begin{tikzpicture}
        \node[draw,regular polygon,regular polygon sides=4] (square) {};
        \node[below=of square] {$
          \begin{aligned}
        Area &= side \times side \\
        Perimeter &= 4 \times side
        \end{aligned}$};
    \end{tikzpicture}
\end{document}

관련 정보