Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Tikz scopes with coordinates relative to a node
% This file adds two environments for TkiZ.
% The first, tikzonnode, simply changes the coordinate system so that (0,0) is
% at the south west anchor of the given node and (1,1) is at the north east
% anchor.
% The second environment, tikzonimage, displays the given image file (the first
% optional argument is passed to \includegraphics) and creates a tikzpicture on
% top of it with coordinates relative to the image corners.
% Both environments accept an optional argument with TikZ options.
\pgfpointanchor{#1}{south west}%
x={(#1.south east)},
y={(#1.north west)},
\node[inner sep=0] (image) {\includegraphics[#1]{#2}};
\node at (0,0) {test};
\node (A) [text width=2cm] {abc abc abc abc abc abc abc abc abc};
\node at (0,0) {test};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment