I try something like this
I wanted to adapt the following solution: Explanatory bubbles in beamer
and using Ethan's answer below I managed to do this (see picture below):
\documentclass[11pt, a4paper, parskip=half]{scrartcl}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\usepackage{amsmath, amsfonts, amssymb}
\usetikzlibrary{calc,shapes.callouts}
\usetikzlibrary{arrows,shapes,trees,positioning}
\begin{document}
\newcommand{\marker}[1]{\tikz[baseline,remember picture] \coordinate (#1) {};}
\tikzset{mycalloutstyle/.style={
rectangle callout, rounded corners,align=center,text
width=1.5cm, callout absolute pointer = {#1}}}
[ \left( {\color{blue}\marker{a}\sqrt{x-12}}+{\color{red}\marker{b}\sqrt{x}} \right)^{2} = ]% };
\begin{tikzpicture}[remember picture,overlay]
\draw (b) ++ (-1,-1) node[mycalloutstyle={(b)++(0.4,-.1)},fill=cyan!20]{$\phantom{({\color{blue}A}+{\color{red}B})^2}$};
\draw (a) ++ (0.7,-1) node[mycalloutstyle={(a)++(.5,-.1)},fill=cyan!20,text width=2cm]{$\hspace{0.0cm}({\color{blue}A}+{\color{red}B})^2$};
\end{tikzpicture}
\end{document}
If there is a more elegant solution, I'm open to improvements.




tikzmarklibrary. Should be very helpful for this kind of things. – SebGlav Jun 23 '21 at 20:02