Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to include a logo in the pdf pages included in Beamer.

I tried writing macro and progressed so far.





  \setbeamercolor{background canvas}{bg=}




However, when I run pdfLaTeX, I get an error in the line of,

! A <box> was supposed to be here.
<to be read again> 
l.23 \getpdfpages{{9,12}}{mypdf.pdf}

I understand that the problem is with the \put command. If I replace the \logoXinpdf,\logoYinpdf lengths with absolute numbers, everything works fine.

Is there a way I can use these defined lengths with the \put command?

share|improve this question
Your mistake here is that arguments of \put are in \unitlength units, not an usual length. Try to include fp package and compute coordinates by dividing your lengths by value of \unitlength. –  Eddy_Em Feb 3 '13 at 7:50
Thanks, @Eddy_Em. Modifying the code in the following manner solved my problem, \makeatletter \FPdiv{\logoX}{\strip@pt\logoXinpdf}{\strip@pt\unitlength} \FPdiv{\logoY}{\strip@pt\logoYinpdf}{\strip@pt \unitlength} \makeatother \def\getpdfpages#1#2{\begingroup \setbeamercolor{background canvas}{bg=} \includepdf[pages={#1},picturecommand={\put(\logoX,\logoY){\pgfimage[width=\logo‌​size]{buetlogo}}}]{#2} \endgroup} –  MMA Feb 3 '13 at 8:36
@MMA: If this solved your problem please post it as an self-answer (after the waiting period) and accept it in order to conclude the question. –  Martin Scharrer Feb 3 '13 at 10:07
add comment

1 Answer

up vote 4 down vote accepted

It's actually sufficient just to locally disable \unitlength (assuming this is a picture mode command internally.

  \setbeamercolor{background canvas}{bg=}

\put expects a multiplier and does essentially


So if \unitlength is empty it is OK to pass lengths to put. Heiko's picture package takes this a bit further and adds some conditional logic so that you can use either a length or a multiplier, so that \unitlength becomes essentially a default unit. So it is probably enough just to load picture and make no change to your code.

share|improve this answer
add comment

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.