5

With the following code I put an image in the bottom left corner of a page (see How to place an image in bottom left hand corner on every page? too).

\newcommand{\BackgroundPic}
{%
\put(0,0){%
\includegraphics[width=1cm,height=1cm,%
keepaspectratio]{images/test.png}%
}}

\AddToShipoutPicture*{\BackgroundPic}

But I want to put the image to the bottom right corner of the type area. How can I do this? I need the coordinates of the bottom right corner of the type area (without TikZ) …

  • -1 for without TikZ ;-) Joking. – user11232 Nov 27 '13 at 13:31
  • Haha :D Is it possible with TikZ? – Ronny Nov 27 '13 at 13:33
  • 1
    I prefer a more „native“ solution, but will accept TikZ if no native solution exists (which I don’t believe). – Ronny Nov 27 '13 at 13:37
  • I was joking again. There is a tikz solution that may get updated within an hour. :-) – user11232 Nov 27 '13 at 13:44
4
\documentclass{article}
\usepackage[a4paper,margin=1in,showframe,marginparsep=0pt,marginparwidth=0pt]{geometry}
\usepackage{graphicx}
\usepackage{eso-pic}
\AddToShipoutPictureBG*{%
  \AtTextLowerLeft{\makebox[\textwidth][r]{%
    \includegraphics[width=1cm,height=1cm,keepaspectratio]{example-image-a}}}}
\begin{document}
 Some text here
\end{document}

enter image description here

  • RTFM :D Thank you! It does the job perfectly! – Ronny Nov 27 '13 at 14:29
2

A tikz solution any way.

\documentclass{article}
\usepackage[a4paper,margin=1in,showframe]{geometry}
\usepackage{tikz}
\usetikzlibrary{backgrounds,calc}
\usepackage{graphicx,lipsum}
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\begin{pgfonlayer}{background}
  \node[anchor=south east,outer sep=0pt,inner sep=0pt] at ($(current page.south east) +(-1in,1in)$) {\includegraphics[width=2cm]{example-image-a}};
\end{pgfonlayer}
\end{tikzpicture}
\lipsum[1-15]
\end{document}

enter image description here

Notes:

I have added the picture in the background and picture is added only for one page. If you want the picture for all / some pages, use background package. If you change the margin, use appropriate values in ($(current page.south east) +(-1in,1in)$). (-1in,1in) is actually (<-right margin>,<bottom margin>).

  • Thanks for the suggestion, but it does not fully answer my question. First, I can put coordinates at \put(x,y) too, so no TikZ is necessary, right? Second, my type area is automatically calculated with KOMA Script. So I have to obtain the coordinates and do not set constants. – Ronny Nov 27 '13 at 14:05
  • I think we have to use something like \evensidemargin, \oddsidemargin, \textheight and \textwidth – Ronny Nov 27 '13 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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