TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have three tikz/pgf pictures which I want to overlay using something like that

\draw [yshift=5cm](0,0) rectangle (5,5);

but that doesn't work, since it draws the three pictures, one after another (even the yshift has no effect). How can I do that?

share|improve this question
Welcome to TeX.SX! – Claudio Fiandrino Nov 11 '13 at 14:41
Did you try putting only the draw commands in the files and inputing them in the same TikZ-picture? Like \begin{tikzpicture} \draw...; \input{} }input{} \input{figures/hahn_long.pgf}? – Tom Bombadil Nov 11 '13 at 14:52
yeah, not really, because the two .pgf pictures are created with python-matplotlib, and are therefore quite complicated, and not just simple \draw... commands... – wa4557 Nov 11 '13 at 15:04
up vote 1 down vote accepted

Without a minimal working example (MWE) it is a bit difficult to know what exactly shall be achieved here. However, if your goal is to horizontally overprint the context of your three figures, this can be achieved either using low-level TeX commands (\llap{<content>}, \rlap{<content>}) or, a bit more generic and less error-prone, LaTeX's \makebox[<width>][<align>]{<content>} command, with a zero value for the <width> parameter.

This TUBboat article provides a bit of background on these (and more) commands. In the following, I will use \makebox; in the last example additionally \raisebox{<yshift>}{<content>} to implement a vertical shift:



    Text starts here:



    Text ends here:



      Centered, y-shifted:


      And so on...


Lacking the real figures, I have substituted the tree figures by colored squares of different size. The output looks like following:

enter image description here

share|improve this answer
I'd recommend \makebox[0pt][l]{...} instead of \rlap{...}; it's a bit longer to type, but avoids strange surprises by \rlap. – egreg Nov 11 '13 at 18:49
@egreg: \makebox is certainly more flexible, but what strange surprises have to be expected by \rlap? – Daniel Nov 11 '13 at 19:31
\rlap doesn't start horizontal mode. – egreg Nov 11 '13 at 20:24
@egreg: Alright, thanks for telling me. I have switched to \makebox. – Daniel Nov 11 '13 at 23:21
Cool. Works thanks! – wa4557 Nov 12 '13 at 10:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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