2

My ultimate goal is to have some portion of text in a tikz node within a tikzpicture and be able to draw arrows to it. I am struggeling with this for over ten years now. cfr suggested I ask the question in a tikz-related way.

\documentclass{standalone} 
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document} \begin{tikzpicture}[remember picture] \node {A node with a \subnode{sn}{subnode}}; \end{tikzpicture} \begin{tikzpicture}[remember picture, overlay]
\draw [red,<-] (pic cs:sn) -- ++(0pt,25pt); \end{tikzpicture}

\end{document}

This is the code and when using pdflatex, I get:

enter image description here

But for xelatex I get no arrow at all.

Ultimately I try to use subnodes in forest, but maybe the way is to solve the problem via solving the tikz problem first.

These are my earlier questions: Drawing lines between parts of nodes in forest trees

Stefan Müller
  • 6,901
  • 3
  • 29
  • 61
  • 1
    Isn't this still the same problem as in https://tex.stackexchange.com/q/229500/47927 ? – Jasper Habicht Jul 06 '23 at 09:20
  • Yes. But the comments are too complicated for me. The solution does not have a MWE, so I do not know what to do. – Stefan Müller Jul 06 '23 at 09:32
  • 1
    Well, the solution hasn't become much easier over time, I guess. You should probably rather again try to get in touch with the package maintainer and ask about improvements. I take it that a bug report has already been submitted, and an answer to that links to this https://tex.stackexchange.com/a/339975/47927 which actually should be the solution for your problem. – Jasper Habicht Jul 06 '23 at 09:40
  • 1
    The arrow will be drawn at the wrong position. The subnode's position stored in the aux file is very different to the one stored by pdflatex. Using the solution linked to by @JasperHabicht seems to fix this. – Qrrbrbirlbel Jul 06 '23 at 09:57
  • 1
    Thanks a lot! This also helped me to solve my original question! https://tex.stackexchange.com/a/690425/18561 – Stefan Müller Jul 06 '23 at 11:20
  • 1
    I think the linked answer is actually still the way to go. There is no simpler way (yet) as far as I understand this issue. But I have to admit that I don't fully understand why this is a solution and where exactly the problem is. The problem seems to be related to the driver, so it is not really related to the tikzmark package/library actually. – Jasper Habicht Jul 06 '23 at 11:33
  • 1
    I "pinged" the GitHub report here: https://github.com/pgf-tikz/pgf/issues/353. Let's see... (the good part is that there is no problem in lualatex ;-P) – Rmano Jul 06 '23 at 13:41
  • Ah, yes, I used lualatex sometimes to get workarounds and then safed PDFs which I included into my xelatex files. – Stefan Müller Jul 06 '23 at 14:39

0 Answers0