TikZ 노드는 줄 바꿈을 허용하지 않습니까?

TikZ 노드는 줄 바꿈을 허용하지 않습니까?

Ti 내부에 줄 바꿈을 추가하려고 하면 오류가 발생합니다.케이Z 노드. 어떤 아이디어?

코드:

\documentclass[12pt,dvipsnames]{article}
\usepackage[a4paper, bindingoffset=0.1in, left=1in, right=1in, 
top=.51in, bottom=1in, footskip=.25in]{geometry}
\usepackage{listings,xcolor,amssymb,tikz,amsmath,enumitem}  
\usetikzlibrary{shadows.blur, shapes.arrows, shapes.geometric, shapes.misc}
\begin{document}
\tikzset{decision/.style= {diamond, draw, aspect=2,text badly centered, node
distance=2.5em, inner sep=0pt}}
\begin{center}
  \begin{tikzpicture}
    \node[decision] (dic) at (0,0) {\scriptsize{is $dE<0$}};
    \node[decision](metro) at (-3,-2) {\scriptsize{is\\ $rand< e^{-\Delta E/k_BT}$}};
  \end{tikzpicture}
\end{center}
\end{document}

오류

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.12 ...sion](metro) at (-3,-2) {\scriptsize{is\\ 
                                                  $rand< e^{-\Delta E/k_BT}$}};

답변1

노드 내용을 center허용하려면 정렬(예: )을 추가해야 합니다 .\\

\documentclass[12pt,dvipsnames]{article}
\usepackage[a4paper, bindingoffset=0.1in, left=1in, right=1in, 
top=.51in, bottom=1in, footskip=.25in]{geometry}
\usepackage{listings,xcolor,amssymb,tikz,amsmath,enumitem}  
\usetikzlibrary{shadows.blur, shapes.arrows, shapes.geometric, shapes.misc}
\begin{document}
\tikzset{decision/.style= {diamond, draw, aspect=2,text badly centered, node
distance=2.5em, inner sep=0pt,font=\scriptsize,align=center}}
\begin{center}
  \begin{tikzpicture}
    \node[decision] (dic) at (0,0) {is $\mathrm{d}E<0$}; 
    \node[decision](metro) at (-3,-2) {is\\ $\text{rand}< e^{-\Delta E/k_\mathrm{B}T}$}; 
   \end{tikzpicture}
\end{center}
\end{document}

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

관련 정보