When writing a beamer presentation, I often use textblocks containing a single includegraphics to place pictures freely on a slide, e.g.


Unfortunately, images are alwyas placed above the textbody of the slide with respect to the z-order, i.e. the pictures overlap and cover the text. Sometimes this is very inconvenient, especially if the picture itself is not square-shaped.

I read about using beamer background templates as a solution, but this not work in my case. Our corporate beamer style also uses background templates which interferes with this solution. Moreover, using textblocks does not seem to work inside a beamer background template.

I also read about wrapping everything in tikz to get the correct z-order. But this additional layer code is also very inconvient when you need it on every other slide.

So, is there an easier solution to place pictures anywhere on the slide and have them behind the text?

  • Do you need to load a library in order to use textblock*? I obtain ! LaTeX Error: Environment textblock* undefined.
    – Karlo
    Commented Apr 20, 2018 at 12:57
  • Yes: textpos.
    – Karlo
    Commented Apr 20, 2018 at 13:04

1 Answer 1


You can define a custom environment backgroundblock like this:


% For demonstration purposes only, can be removed without harm

% beamer: How to place images behind text (z-order)
% (http://tex.stackexchange.com/a/134311)
    \vbox to0pt\bgroup\vskip#2\hbox to0pt\bgroup\hskip#1\relax%


It is used very much like the textpos environment textblock(*) in absolute mode, i. e.


places <Content> in a box at the coordinates (<hpos>,<vpos>) relative to the top left corner of the slide.

example slide with two backgroundblock environments

Explanation of the code

A box \@backgroundblock is added to the beamer template background which is later filled by the content of the backgroundblock environments. This shouldn't interfere with custom themes, as it is ensured that the box doesn't any occupy any space.

  • Cool, thanks for the solution! EDIT: Sadly, this still seems to interfere with our beamer style. With default styles it works nicely, but with the official style the background block always seems to be empty; or -what I assume- it is behind the background which is probably a tikz rectangle spanning the slide.
    – shiin
    Commented Sep 23, 2013 at 11:08
  • @shiin That's a pity :-( Please try adding my code (between \makeatletter and \makeatother) after loading your corporate theme with \usetheme to ensure that these changes aren't overwritten. If that doesn't work, you can try changing \addtobeamertemplate{background}{\box\@backgroundblock}{} to \addtobeamertemplate{headline}{\box\@backgroundblock}{} in l. 16 as a last ressort (this also has to be done after loading the corporate theme).
    – diabonas
    Commented Sep 23, 2013 at 12:13
  • Thanks for the additional tips. Putting the code after loading our theme didn't work. Adding to the headline template instead of the background template shows the images, but they are again on top of the text. As this was quite frustrating, I played around with our theme and your code. In the end, I found that I simply had to move the backgroundblock up by one slide height, as it was added right below (vertically speaking) our background that spans the entire slide.
    – shiin
    Commented Sep 24, 2013 at 7:58
  • Is there a way of using backgroundblock without beamer class and just put vertical text in the backgroundblock where the coordinates specify?
    – Josh E.
    Commented Mar 16, 2020 at 9:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .