指向方程式的箭头

指向方程式的箭头

从下面的 MWE 中,我想要获得这种效果: 在此处输入图片描述

我怎样才能让文本显示在不同的行中,如上所示?

这是我的代码:

\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc,,arrows,shapes,decorations.pathreplacing}
\tikzset{every picture/.style={remember picture}}
\usepackage{accents}
\newcommand\myubar[1]{%
\underaccent{\bar}{#1}}

\begin{document}

\begin{equation*}
\tikz[baseline]{\node(d4) {$\hat{\myubar{\theta}}_{k+1}$}} = \tikz[baseline]{\node(d5){$\hat{\myubar{\theta}}_{k}$}} + \tikz[baseline]{\node(d6) {$K_{k+1}$}}\tikz[baseline]{\node(d7){$(\underbrace{y_{k+1}-h'_{k+1}\hat{\myubar{\theta}}_{k}})$}}
\end{equation*}

\begin{tikzpicture}[remember picture,overlay]
\draw[blue,thick,->] (d4) to [in=90,out=245] + (225:2.7cm) node[anchor=north,text = black,] {$current~estimate$};
\draw[blue,thick,->] (d5) to [in=90,out=265] +(235:1.8cm) node[anchor=north,text = black,] {$previous~estimate$};
\draw[blue,thick,->] (d6) to [in=90,out=265] +(235:1.4cm) node[anchor=north,text = black,] {$(gain)\newline The~weight\\of~the~adjustment$};
\draw[blue,thick,->] (d7) to [in=90,out=265] +(235:1.4cm) node[anchor=north,text = black,] {$(gain)\newline The~weight\\of~the~adjustment$};


\end{tikzpicture}

\end{document}

答案1

图示方程

\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc,,arrows,shapes,decorations.pathreplacing}
\tikzset{every picture/.style={remember picture}}
\usepackage{accents}
\newcommand\myubar[1]{%
\underaccent{\bar}{#1}}

\begin{document}

\begin{equation*}
\tikz[baseline]{\node(d4) {$\hat{\myubar{\theta}}_{k+1}$}} = \tikz[baseline]{\node(d5){$\hat{\myubar{\theta}}_{k}$}} + \tikz[baseline]{\node(d6) {$K_{k+1}$}}\tikz[baseline]{\node(d7){$(\underbrace{y_{k+1}-h'_{k+1}\hat{\myubar{\theta}}_{k}})$}}
\end{equation*}

\begin{tikzpicture}[remember picture,overlay]
\draw[blue,thick,->] (d4) to [in=90,out=245] + (225:2.7cm) node[anchor=north,text = black] {current estimate};
\draw[blue,thick,->] (d5) to [in=90,out=265] +(235:1.8cm) node[anchor=north,text = black] {previous estimate};
\draw[blue,thick,->] (d6) to [in=90,out=265] +(270:2.3cm) node[anchor=north,text = black,text width=3cm,align=center]
 {(gain)\\ The weight\\ of the adjustment};
\draw[blue,thick,->] (d7) to [in=90,out=265] +(290:1.4cm) node[anchor=north,text = black,text width=3cm,align=center]
 {(gain)\\ The~weight\\ of the adjustment};
\end{tikzpicture}

\end{document}

这是一种替代方法,使用一个 tikzpicture 添加节点(无覆盖),使用另一个 tikzpicture 绘制线条(覆盖)。

对齐节点

\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc,,arrows,shapes,decorations.pathreplacing}
\tikzset{every picture/.style={remember picture}}
\usepackage{accents}
\newcommand\myubar[1]{%
\underaccent{\bar}{#1}}

\begin{document}

\begin{equation*}
\tikz[baseline]{\node(d4) {$\hat{\myubar{\theta}}_{k+1}$}} = \tikz[baseline]{\node(d5){$\hat{\myubar{\theta}}_{k}$}} + \tikz[baseline]{\node(d6) {$K_{k+1}$}}\tikz[baseline]{\node(d7){$(\underbrace{y_{k+1}-h'_{k+1}\hat{\myubar{\theta}}_{k}})$}}
\end{equation*}
\vspace{1cm}\par
% insert text
\noindent\hfil\begin{tikzpicture}
\node (t1) {current estimate};
\node[above right] (t2) at (t1.east) {previous estimate};
\node[right,text width=2.5cm,align=center] (t3) at (t2.east)
 {(gain)\\ The weight\\ of the adjustment};
\node[right,text width=2.5cm,align=center] (t4) at (t3.east)
 {(gain)\\ The~weight\\ of the adjustment};
\end{tikzpicture}
% insert lines between text
\begin{tikzpicture}[overlay]
\draw[blue,thick,->] (d4) to [in=90,out=245] (t1.north);
\draw[blue,thick,->] (d5) to [in=90,out=265] (t2.north);
\draw[blue,thick,->] (d6) to [in=90,out=265] (t3.north);
\draw[blue,thick,->] (d7) to [in=90,out=265] (t4.north);
\end{tikzpicture}

Following text starts here.

\end{document}

相关内容