I'm basing my code on Overlay red rectangles on top of verbatim text in order to grab draw arrows over the source code.
I've successfully incorporated the solution into my code, however one problem appears: when I escape within lstlisting, it inserts a space in the source code.
LaTeX source
\begin{lstlisting}
@Template(`This is a /@\tikz[remember picture] \node [] (view-left) {};@/{{ value }}/@\tikz[remember picture] \node [] (view-right) {};@/.`)
class Component {
value/@\tikz[remember picture] \node [] (code-right) {};@/ = 21
}
\end{lstlisting}
\begin{tikzpicture}[remember picture, overlay]
\node (view) at ($(view-left)!.5!(view-right)$) {};
\draw (view.south) edge [bend left] (code-right.south east);
\end{tikzpicture}
Result
Problem
- There are two spaces between
aand{{in the template (one was intentional, there's an extra one). - A space between
}}in.in template. - Double space after
valuein the code.
Why do they appear and how can I get rid of them?


