我尝试实施我找到的解决方案这里这是我的问题。不过我确实遇到了一点小问题。如果我在示例的上方和下方添加一些文本,图表和文本就会相互叠加,如下所示:
我尝试使用包装将其放入盒子中,tcolorbox
但没有用。以下是我的代码。
感谢您的帮助!
\documentclass{article}
\usepackage{amsmath} % loaded automatically by beamer
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{>=stealth}
\newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture,baseline] \node [anchor=base,#1](#2) {#3};}
\begin{document}
Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it.
\begin{equation*}
\mathcal{A} = (\,\tikzmark{identity}{\texttt{I}} -\tikzmark[red]{G}{\texttt{G}}\,\,\,
\tikzmark[blue]{L}{\texttt{L}} - \tikzmark[purple]{C}{\texttt{C }}\,)
\end{equation*}
\begin{tikzpicture}[overlay, remember picture,node distance =1.5cm]
\node (identitydescr) [below left=of identity ]{words};
\draw[,->,thick] (identitydescr) to [in=-90,out=90] (identity);
\node[red] (Gdescr) [below =of G]{other words};
\draw[red,->,thick] (Gdescr) to [in=-90,out=90] (G);
\node[blue,xshift=1cm] (Ldescr) [above right =of L]{some words};
\draw[blue,->,thick] (Ldescr) to [in=45,out=-90] (L.north);
\node[purple] (Cdescr) [below right =of C]{more words};
\draw[purple,->,thick] (Cdescr) to [in=-90,out=90] (C.south);
\end{tikzpicture}
Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it.
\end{document}
答案1
使用具有minipage
合适高度和垂直居中内容的。
\documentclass{article}
\usepackage{amsmath} % loaded automatically by beamer
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{>=stealth}
\newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture,baseline] \node [anchor=base,#1](#2) {#3};}
\begin{document}
Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it.
\noindent
\begin{minipage}[t][4.2cm][c]{\linewidth}
\begin{equation*}
\mathcal{A} = (\,\tikzmark{identity}{\texttt{I}} -\tikzmark[red]{G}{\texttt{G}}\,\,\,
\tikzmark[blue]{L}{\texttt{L}} - \tikzmark[purple]{C}{\texttt{C }}\,)
\end{equation*}
\begin{tikzpicture}[overlay, remember picture,node distance =1.5cm]
\node (identitydescr) [below left=of identity ]{words};
\draw[,->,thick] (identitydescr) to [in=-90,out=90] (identity);
\node[red] (Gdescr) [below =of G]{other words};
\draw[red,->,thick] (Gdescr) to [in=-90,out=90] (G);
\node[blue,xshift=1cm] (Ldescr) [above right =of L]{some words};
\draw[blue,->,thick] (Ldescr) to [in=45,out=-90] (L.north);
\node[purple] (Cdescr) [below right =of C]{more words};
\draw[purple,->,thick] (Cdescr) to [in=-90,out=90] (C.south);
\end{tikzpicture}
\end{minipage}
\noindent
Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it. Some random text. And more of it.
\end{document}