2

How can I insert a circle around a parameter in a formula or in a text as below one: enter image description here

  • 1
    Would the solutions from here be good? https://tex.stackexchange.com/questions/7032/good-way-to-make-textcircled-numbers Or is there something you require that those can't do? – sheß Feb 25 '19 at 16:32
  • 1
    From that page especially https://tex.stackexchange.com/a/7045/ might be interesting, it is easy with TikZ to make dashed lines as in the example in this question. – Marijn Feb 25 '19 at 16:36

1 Answers1

7

All the answers linked to in the comments were written before tikzmarknode got added to the tikzmark library. With this addition, it is IMHO particularly straightforward to get something like this.

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\[\mathrm{i}\int\!\mathrm{d}t\,\mathrm{d}\theta\,\mathrm{d}\bar\theta\,
\tikzmarknode[circle,draw,dashed,inner sep=2pt]{tc}{\dfrac{\theta\bar\theta}{\hbar}}
\left(L[\Phi]+\mathbb{J}\right)\]
\end{document}

enter image description here

Of course, you could do much more with tikzmarknode.

\documentclass[fleqn]{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\tikzset{dashed circle/.style={circle,draw,dashed,inner sep=2pt}}
\begin{document}
The conventional \dots
\begin{equation}\label{eq:conventional}
 \mathcal{Z}[\mathbb{J}]=\exp\left[\mathrm{i}\int\!\mathrm{d}t\,\mathrm{d}\theta\,\mathrm{d}\bar\theta\,
 \tikzmarknode[dashed circle]{11}{1}
 \left(L[\Phi]+\mathbb{J}\right)\right]\;.
\end{equation}
The modified \dots
\begin{equation}
 \mathcal{Z}'[\mathbb{J}]=\exp\left[\mathrm{i}\int\!\mathrm{d}t\,\mathrm{d}\theta\,\mathrm{d}\bar\theta\,
 \tikzmarknode[dashed circle]{tc1}{\dfrac{\theta\bar\theta}{\hbar}}
 \left(L[\Phi]+\mathbb{J}\right)\right]\;.\label{eq:Z'}
\end{equation}
\eqref{eq:conventional} except that $\tikzmarknode[dashed circle]{12}{1}$ got replaced by 
$\tikzmarknode[dashed circle]{tc2}{\dfrac{\theta\bar\theta}{\hbar}}$ in \eqref{eq:Z'}.
\begin{tikzpicture}[overlay,remember picture]
\draw[red,latex-latex,thick] (tc1) to[bend left=10] (tc2);
\end{tikzpicture}
\end{document}

enter image description here