# How to draw a TikZ diagram that does not occupy space

I am new to TikZ and I have a trivial question. How to draw a borderless diagram? In other words, I need something that does not displace the text. Similar to the effect achieved with a regular LaTeX picture with {0,0} for width and height. Here is a minimal example of what I need the diagram to look like:

\documentclass[a4paper]{report}
\usepackage{tikz}
\begin{document}
\begin{picture}(0,0)(0,0)
\put(0,3){\vector(1,0){60}}
\end{picture}
Picture
\tikz{\draw [->] (0,0) -- (0:80pt);}
TikZ
\end{document}


This results in the following:

example http://ubuntuone.com/1Kgnezgx4gUSZ9sgJIcjJR

I would like the vector (and the environment in general) of TikZ to be over the word and not displace it. Similar to the one with Picture. I feel there's a straightforward solution for this, but I can't seem to find it.

Thank you

• Use the option overlay. BTW: welcome to TeX.SX! – Claudio Fiandrino Mar 25 '14 at 10:38
• @ClaudioFiandrino overlay is exactly what I needed. Thank you! – Tymric Mar 25 '14 at 10:45

## 2 Answers

You can use the overlay option:

\tikz[overlay]{\draw [->] (0,0) -- (0:80pt);}


If you want to raise the error the baseline option might help:

\tikz[overlay,baseline=-0.8ex]{\draw [->] (0,0) -- (0:80pt);}


Together with overlay the remember picture option offers some nice features, like drawing at an absolute position of the current page

\tikz[remember picture, overlay]{\draw (current page.center) circle [radius=10mm];}


(where current page has the anchors of a rectangular node) or connecting two pictures

\tikz[remember picture,baseline=(first.base)]{\node [blue] (first) {First Node};}
Some regular Text her in this line.

A new paragraph and more text, ending with a
\tikz[remember picture,baseline=(second.base)]{\node [blue] (second) {second Node};}.

\tikz[remember picture, overlay]{\draw [blue,<->] (first) to[bend left] (second);}


\documentclass[a4paper]{report}
\usepackage{tikz}
\begin{document}
\begin{picture}(0,0)(0,0)
\put(0,3){\vector(1,0){60}}
\end{picture}
Picture

\makebox(0,0){\put(0,3){\vector(1,0){60}}}
Picture

\makebox[0pt][l]{\tikz\draw [->] (0,0) -- (0:80pt);}
TikZ

\tikz\draw [overlay,->] (0,0) -- (0:80pt);
TikZ
\end{document}