I realize this is almost certainly impossible; however, I would love to see the TeX wizardry hidden here (and I actually also really desperately want this feature).

So I have a tikzpicture, and inside this picture, I have some node. Inside this, node, I have a math equation, say:

          \left(\sum_{i=1}^n a_i^2\right) \cdot
          \left(\sum_{i=1}^n b_i^2\right)
        }{ (\sum_{i=1}^n \underbrace{a_ib_i}_{HERE})^2} \right| \geq 1$

Now, the underbrace gives me a nice rotated "}", and I can label it "HERE". However, I don't want to label it "HERE".

I want to draw an arrow from a tikzNode to where the "HERE" is located. I want to be able to do something like:

    \draw [->] (cauchySchwarzLabelNode) -- (HERE);

So basically, I need to be able to "grab the location of where 'HERE' is in the equation" ... and somehow draw an arrow to it from tikz.

Is there any hack to make this possible?

  • 3
    PS: I promise not to self answer this question within the next 30 days :-) This requires an understanding of tex/tikz internals far beyond my comprehension. – interactive_tikz Jun 3 '13 at 9:50
  • 2
    search for tikzmark questions and answers on the main site. An example : tex.stackexchange.com/questions/60763/… – percusse Jun 3 '13 at 9:55
  • @percusse: nice, thanks! for some stupid reason I never thought it'd be named tikzmark – interactive_tikz Jun 3 '13 at 11:33

Here's a solution using the \subnode command from the tikzmark TikZ library.



\begin{tikzpicture}[remember picture]
\node {\(\displaystyle\left|
          \left(\sum_{i=1}^n a_i^2\right) \cdot
          \left(\sum_{i=1}^n b_i^2\right)
        }{ (\sum_{i=1}^n \underbrace{a_ib_i}_{\subnode{brace}{}})^2} \right| \geq 1\)};
\draw[->] (-3,-3) to[out=0,in=-90] (brace.north);

I used brace.north because the subnode is actually the subscript of the underbrace, not the point of the underbrace itself. Note the remember picture on the containing environment.

arrow to underbrace

|improve this answer|||||
  • Unrelated stupid question: I see lots of image examples on tex.stackexchange -- are people just taking screen shots, or is there some webservice on tex.stackexchange that auto renders TeX and crops it online? – interactive_tikz Jun 3 '13 at 11:35
  • @interactive_tikz: I guess we all take screen shots, no web service. – juliohm Jun 3 '13 at 13:11
  • @interactive_tikz It used to be able to upload PDF, which led to many of us using the standalone class to generate the images. But that doesn't work any more so I just take a screenshot. – Andrew Stacey Jun 3 '13 at 16:43
  • Can anyone tell me how can I do the same thing in TikzEdt? I've tried the code in a simple Latex code, and it worked.Thanks. – user2536125 Jul 15 '13 at 22:26
  • @user2536125 I've never used TikzEdt so can't help you on that, I'm afraid. – Andrew Stacey Jul 16 '13 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.