
現在、StackExchange の回答が見つかりませんが、以前は、次のように、1 つの方程式から 2 つの方程式に矢印分岐できるコードをコピーしました。
これは次のコードで再現できます。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{tikzsymbols}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{subequations}
\label{eq1}
\noindent
\begin{tikzpicture}[node distance=-.4cm and 1.5cm]
\node (A)
{$ \overset{t_{B}}{\text{A}} $};
\node[above right=of A] (B)
{$ \overset{t_{B}}{\text{B}} $
};
\node[below right=of A] (C)
{$ \overset{t_{C}}{\text{C}}$};
\draw[-stealth, line width=1mm] (A.0) -- ( $ (A.0)!0.15!(B.west|-A.0) $ ) |- (B.west) node[auto,pos=0.75] {\scalebox{1}{$h$}};
\draw[-stealth, line width=1mm] (A.0) -- ( $ (A.0)!0.15!(C.west|-A.0) $ ) |- (C.west) node[auto,pos=0.75] {\scalebox{1}{$g$}} ;
\end{tikzpicture}
\end{subequations}
\end{document}
しかし、画像からわかるように、方程式のオーバーセットにより、矢印の中心に対して方程式の線が下方向にずれているように見えます。矢印が方程式の中央を指すようにしたいのですが、現在はオフセットされているように見えます。(このミニマリストの例ではそれほど悪く見えませんが、これらの分岐が長い方程式である場合、これは非常にオフセットされており、非常に不自然に見えることは明らかです。)
このコードは実際にはコピー アンド ペーストされたコードのハックであるため、私のユース ケース (ノードをわずかに下にシフトする) に合わせて変更するのに十分なほど何が行われたのかを実際に理解していません。
何ができるのか、何かアイデアはありますか?
答え1
オフセットの理由は、\overset
方程式で を使用しているためです。 を使用しない場合、\overset
矢印は方程式の中心を指します。 解決策があります:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{tikzsymbols}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{subequations}
\label{eq1}
\noindent
\begin{tikzpicture}[node distance=-.4cm and 1.5cm]
\node (A)
{$ \overset{t_{B}}{\text{A}}-M\cdot C^2 $};
\node[above right=of A] (B)
{$ \overset{t_{B}}{\text{B}}-M\cdot C^2 $
};
\node[below right=of A] (C)
{$ \overset{t_{C}}{\text{C}}-M\cdot C^2$};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% shift down the arrows pointing location %
% by 3.5pt %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\coordinate (AR) at ($(A.east)-(0pt,3.5pt)$);
\coordinate (BL) at ($(B.west)-(0pt,3.5pt)$);
\coordinate (CL) at ($(C.west)-(0pt,3.5pt)$);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw[-stealth, line width=1mm] (AR) -- ( $ (AR)!0.15!(BL|-AR) $ ) |- (BL) node[auto,pos=0.75] {\scalebox{1}{$h$}};
\draw[-stealth, line width=1mm] (AR) -- ( $ (AR)!0.15!(CL|-AR) $ ) |- (CL) node[auto,pos=0.75] {\scalebox{1}{$g$}} ;
\end{tikzpicture}
\end{subequations}
\end{document}