在 Beamer 中使用 TikZ 手写路径(路径装饰?)

在 Beamer 中使用 TikZ 手写路径(路径装饰?)

我正在制作手写风格的演示文稿。我希望所有功能都与手写非常相似。从我的例子可以看出,我几乎可以做到这一点。问题是 Ti 中的路径Z 框架。正如您所注意到的,为 tikzmarknode 给出的关键词似乎不适用于“路径”。

所以我的问题是:1) 是否可以将箭头看起来像 tikzmarknode?2) 如果是,我错在哪里?

我确实感觉“decorations.pathmorphing”也适用于路径。


\documentclass{beamer}
%\url{https://tex.stackexchange.com/q/593958/86}
\usepackage{tikz}
\usetikzlibrary{
  positioning,
  arrows,
  shapes,
  backgrounds,
  tikzmark,
  calc,
  decorations.pathmorphing,
  patterns,
  overlay-beamer-styles %% <-- use this library
}

% \tikzstyle is depreciated
\tikzset{
  every picture/.append style={remember picture},
  na/.style={baseline=-.5ex},
  nb/.style={baseline=10.5ex}
}



\usepackage{amsmath}
\usepackage[subdued]{mathastext}


\begin{document}

\begin{frame}
\tikzstyle{na} = [baseline=-.5ex]

\begin{equation*}
\tikzmarknode[circle,decorate, decoration={random steps,segment
    length=5pt,amplitude=1pt},alt=<2>{draw=red,line width=0.5mm, minimum size=20pt}{}]{p2}{A}  = B ;
\end{equation*}


\tikz[na] \node[coordinate] (n1) {};Hello
 
\begin{tikzpicture}[overlay]
        \path[->,red,line width=0.5mm,decorate, decoration={random steps,segment length=5pt,amplitude=10pt}]<2-> (n1) edge [bend left] (p2);
\end{tikzpicture}

\end{frame}

\end{document}

答案1

您需要将装饰说明移至edge而不是path

\documentclass{beamer}
%\url{https://tex.stackexchange.com/q/593958/86}
\usepackage{tikz}
\usetikzlibrary{
  positioning,
  arrows,
  shapes,
  backgrounds,
  tikzmark,
  calc,
  decorations.pathmorphing,
  patterns,
  overlay-beamer-styles %% <-- use this library
}

% \tikzstyle is depreciated
\tikzset{
  every picture/.append style={remember picture},
  na/.style={baseline=-.5ex},
  nb/.style={baseline=10.5ex}
}



\usepackage{amsmath}
\usepackage[subdued]{mathastext}


\begin{document}

\begin{frame}
\tikzset{na/.style={baseline=-.5ex}}

\begin{equation*}
\tikzmarknode[circle,decorate, decoration={random steps,segment
    length=5pt,amplitude=1pt},alt=<2>{draw=red,line width=0.5mm, minimum size=20pt}{}]{p2}{A}  = B ;
\end{equation*}


\tikz[na] \node[coordinate] (n1) {};Hello
 
\begin{tikzpicture}[overlay]
        \path[->,red,line width=0.5mm]<2-> (n1) edge [bend left,decorate, decoration={random steps,segment length=5pt,amplitude=2pt}] (p2);
\end{tikzpicture}

\end{frame}

\end{document}

在此处输入图片描述

相关内容