그래프의 노드 내부 방정식 참조

그래프의 노드 내부 방정식 참조

나는 tikz 패키지에 익숙하지 않습니다. 인터넷 여기저기서 읽고 이렇게 해냈어요

\begin{tikzpicture}
  [node distance=.8cm,
  start chain=going below,]
     \node[punktchain, join] (Telegrapher){Telegrapher's equations $\begin{aligned}
          \frac{d}{d z} {\vec V} \left(z,s\right) &=-\vec Z'(s){\vec I}\left(z,s\right) \\
       \frac{d}{d z} {\vec I} \left(z,s\right) &=-\vec Y'(s){\vec V} \left(z,s\right)\label{test}
       \end{aligned}$};
     \node[punktchain, join] (test) {test};
  \end{tikzpicture}

노드에 대한 정의는 다음과 같습니다.

\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
    matrix,shapes.symbols}
\tikzset{
>=stealth',
  punktchain/.style={
    rectangle, 
    rounded corners, 
    % fill=black!10,
    draw=black, very thick,
    text width=25em, 
    minimum height=3em, 
    text centered, 
    on chain},
  line/.style={draw, thick, <-},
  element/.style={
    tape,
    top color=white,
    bottom color=blue!50!black!60!,
    minimum width=8em,
    draw=blue!40!black!90, very thick,
    text width=10em, 
    minimum height=3.5em, 
    text centered, 
    on chain},
  every join/.style={->, thick,shorten >=1pt},
  decoration={brace},
  tuborg/.style={decorate},
  tubnode/.style={midway, right=2pt},
}

이제 내 질문은: 내 노드에 방정식이 있습니다. 내 라텍스의 다른 모든 방정식처럼 번호가 매겨지기를 원합니다. 아니면 적어도 그것을 참조할 수 있기를 바랍니다. 지금은 을 사용하고 있는데 \label{test}, 를 참조하면 \ref{label}그 부분을 참고로 삼는 것 같습니다.

노드 내부에 구축된 방정식을 그래프에서 올바르게 참조하는 방법을 알고 계십니까?

답변1

댓글에 솔루션이 구성되었지만 답변으로 게시되지 않았으므로 나중에 이 문제가 발생하는 모든 사람을 위한 솔루션이 있습니다. 이 질문에 대한 의견은 사용자에게 있습니다.

방정식 번호를 참조하려면 equation또는 align환경을 사용하십시오. 그러나 기본적으로 이는 TikZ 노드 내에서 작동하지 않습니다. 따라서 미니페이지로 래핑할 수 있습니다 : \begin{minipage}{0.9\textwidth}... \end{minipage}. align이제 상호 참조는 평소대로 작동하며 hyperref.

또한 사소한 문제: 일반 크기의 괄호만 사용하는 경우 간격이 조금 더 좋기 때문에 (and )대신 \left(and 를 사용하는 것이 좋습니다 . \right)보다이 게시물상세 사항은.

이 작업을 수행하는 코드는 다음과 같습니다.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
    matrix,shapes.symbols}
\tikzset{
% ... same settings as in the question post ... 
}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
\begin{tikzpicture}
  [node distance=.8cm,
  start chain=going below,]
     \node[punktchain, join] (Telegrapher){Telegrapher's equations
     % Here's the difference: a minipage and align environment
     \begin{minipage}{0.9\textwidth}
     \begin{align}
       % now, we can use \label, \ref, and \eqref as usual
       \frac{d}{d z} \vec V(z,s) &= -\vec Z'(s)\vec I(z,s) \label{test1}\\
       \frac{d}{d z} \vec I(z,s) &= -\vec Y'(s)\vec V(z,s) \label{test2}
       \end{align}
       \end{minipage}};
     % Reference from another node
     \node[punktchain, join] (test) {Test: reference to equation~\eqref{test1}.};
  \end{tikzpicture}

% References from outside the tikzpicture also work
Reference to equation~\eqref{test2}.
\end{document}

다음은 PDF 출력 사진입니다.

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

관련 정보