我有以下代码
\documentclass{article}
\usepackage[left=0in,top=2in]{geometry}
\usepackage{tikz,amsmath}
\usetikzlibrary{arrows,shapes}
\newcommand{\tikzmarkC}[1]{\tikz[overlay,remember picture,baseline={-3pt}] \node[] (#1) {
};}
\tikzset{cloud/.pic={
\node[cloud, cloud puffs=10.8,cloud puff arc=110, aspect=2, draw, text width=3cm
] () at (0,0) {\tikzpictext};
}}
\begin{document}
$$\tikzmarkC{a}x = \tikzmarkC{b}y$$
\begin{tikzpicture}[overlay,remember picture]
\pic (c1) at (5,3) [pic text=$x$ is ....]{cloud};
\pic (c2) at (15,3) [pic text=$y$ is ...]{cloud};
\draw[-latex'] (c1) to[bend left] (a);
\draw[-latex'] (c2) to[bend right] (b);
\end{tikzpicture}
\end{document}
看起来像
我想制作类似的东西来代替云,有什么可以帮忙的吗?
答案1
像这样?
编辑:
添加的是形状内的内联方程callout
。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,
shapes.callouts,
tikzmark}
\tikzset{CO/.style={% Call Out
shape=rectangle callout,
callout absolute pointer={#1},
callout pointer width=1.2 mm,
callout pointer shorten=-1mm,
draw, semithick,
align=left}
}
\begin{document}
\[
\tikzmark{A}x = \tikzmark{B}y
\]
\begin{tikzpicture}[overlay, remember picture,
node distance=8mm and 4mm
]
\coordinate[above=2ex of pic cs:A] (a);
\coordinate[above right=2ex and 1ex of pic cs:B] (b);
%
\node[CO=(a),above left=of a] {$y=x^2+x+1$\\ BBBBBBBB};
\node[CO=(b),above right=of a] {AAAAAA\\ BBBBBBBB};
\end{tikzpicture}
\end{document}