I'd like to know if it's possible to do something like that in an equation using beamer
2 Answers
It's easy to do with pstricks
: just use the commands \circlenode
and join them by an arc node connection, inside the psmatrix
environment:
\documentclass[x11names]{article}
\usepackage[utf8]{inputenc}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\begin{document}
\[
\begin{psmatrix}
\psset{linewidth=0.5pt, linecolor=Coral1,arrows=<->, arrowinset=0.15, arcangle=45, shortput=nab, labelsep=2pt}
x = \circlenode{A}{a} + b + \circlenode{C}{c}
\ncarc[linewidth = 0.2pt, linecolor=black]{A}{C}^{\scriptstyle=}
\end{psmatrix}
\]
\end{document}
auto-pst-pdf
must be loaded after pstricks
, and pdflatex
must be launched with the --enable-write18
switch (MiKTeX) or -shell-escape
(TeX Live, MacTeX). To illustrate this, here is a screenshot of TeXmaker configuration:
-
Hello, thank you for your help. I really appreciate it. I've tried my best to make this work but my latex editor accuse the following error: Package auto-pst-pdf Error: "shell escape" (or "write18") is not enabled: auto-pst-pdf will not work! Is there something I can do to fix it? I'm looking forward to here from you again. Thank you in advance!– h3r0n3dUCommented Nov 14, 2015 at 2:50
-
@h3r0n3dU: Yes, I should have explained that point: either you follow the way latex->dvips->pstopdf, which is longer, or you compile with pdflatex and the switch
pdflatex -shell-escape
if you're underTeX Live or MacTeX,--enable-write18
under MiKTeX. Alternatively, you can compile withxelatex
. The switches can be set from within your editor, usually.– BernardCommented Nov 14, 2015 at 9:39 -
Hi @Bernard, thank you again. I'm using Texmaker on Windows 10. I followed the steps provided in this answer: tex.stackexchange.com/a/236648/92090 The editor shows a lot of warning messages, but no errors. However it doesn't work, actually the equation didn't appear in the presentation, in spite of there are no errors. Sorry, but I'm new with the LaTeX tool, so maybe I should try another alternatives. Is there something more that I can do?– h3r0n3dUCommented Nov 14, 2015 at 11:05
-
Did you compile the file I posted, exactly as it is? Also, what is your distribution? What you can do is trying to compile from the command line, to see if it works and what are the messages.– BernardCommented Nov 14, 2015 at 11:29
This can be quite easily done using the tried and tested tikzmark
idea, demonstrated throughout this site, for example How to draw arrows between circled coefficients of polynomials using tikz and How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?
Here's the output:
and the code:
% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{beamer}
\usepackage{tikz}
% tikzmark command
\newcommand{\tikzmark}[2]{%
\tikz[remember picture,baseline=(#1.base)]
\node[circle,red,draw,text=black,anchor=center,inner sep=1pt] (#1) {#2};}
\begin{document}
\begin{frame}
\[
x = \tikzmark{a}{a}+b+\tikzmark{c}{c}
\]
\tikz[overlay,remember picture]{\draw[blue,thick,->] (a.north) to [bend left=45] node[anchor=south]{$=$}(c.north);}
\end{frame}
\end{document}