3

Using tikz is there a way to do a double (or even multiple) callout. Below is a MWE which demonstrates what I already have and does indeed give a desired output. What I am asking is whether there is a more elegant way to do this. This question looks similar, but the solution seems to be based on a path.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes.symbols,shapes.callouts}
\usetikzlibrary{positioning}

\newcommand{\Callout}[1]{\tikz[remember picture,baseline=(#1.base),inner xsep=0pt]{\node(#1){#1};}}


\begin{document}
Point to \Callout{here1} and to \Callout{here2}.

\tikz[remember picture, note/.style={rectangle callout, fill=red!30!white}]{\node [note, overlay,callout absolute pointer={(here1.south east)},text centered,below right=of here1] {Point from here};}% 
\tikz[remember picture, note/.style={rectangle callout, fill=red!30!white}]{\node [note, overlay,callout absolute pointer={(here2.south east)},text centered,below right=of here1] {Point from here};}% 

\end{document}

enter image description here

Geoff
  • 2,637
  • Why the $ around \Callout? You could put both \node .. ; inside the same \tikz environment. – Manuel Feb 04 '15 at 19:26
  • @Manuel You're right! I minimised the code and forgot to remove the $. Further, I have tested now putting all into one \tikz and it produces the same result. It would be nice though to not need to repeat so much information within the two nodes. – Geoff Feb 04 '15 at 19:29
  • The solution in linked question uses \path to declare the multiple callout but looking at the code, you'll see that it draws a callout node and adds some more paths from them. – Ignasi Feb 04 '15 at 19:37
  • @Ignasi Ok, I think I have something, but it doesn't point to the right positions! I pasted the appropriate code from the other question and then added: \tikz[remember picture]{\path[multiple absolute pointers={[fill=blue!20, below right=20mm and 10mm of here1]{here1.south,here2.south}{new pointer}}];} – Geoff Feb 04 '15 at 20:00
  • @Geoff Have you considered moving the definition of the note style into a \tikzset{} in the preamble? You can add the overlay and text centered options to that style as well... – darthbith Feb 04 '15 at 20:02
  • @Geoff Try with \tikz[remember picture, overlay] ... You need this option when making reference to nodes in other tikzpictures. – Ignasi Feb 04 '15 at 20:34
  • @Ignasi Bingo! It works! Many thanks. Should I delete the question as a duplicate? – Geoff Feb 04 '15 at 20:36

0 Answers0