0

How to use eso-pic to print, right-aligned, at the top-right of the page?

The manual can be found here: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/eso-pic/eso-pic.pdf

epR8GaYuh
  • 2,432
O0123
  • 1,773
  • At the top-right of the sheet of of the text area? And what would you like to print there? – Bernard Aug 31 '20 at 18:10
  • @Bernard Could be an image, could be text. Could be single-line or multi-line text. – O0123 Aug 31 '20 at 18:14
  • But where, precisely? – Bernard Aug 31 '20 at 18:16
  • If it would print "This is a sentence." Then the dot "." should be printed at the top-right of the page, everything else before it. Should be a way to fiddle with the exact height afterwards as well :) – O0123 Aug 31 '20 at 18:17
  • The ‘page’ may mean the sheet of paper or the text area. Which do you mean? – Bernard Aug 31 '20 at 18:19
  • @Bernard With 'page' I mean the sheet of paper. Vertically speaking, it would be nice if the top line was printed with its top edge right matching the top edge of the page (with an option to fiddle with additional y spacing to bring everything further down). – O0123 Aug 31 '20 at 18:33

2 Answers2

3

A variant code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{eso-pic}

\usepackage{lipsum}

\begin{document}

\AddToShipoutPictureBG{\AtPageUpperLeft{\hspace*{\paperwidth\llap{\raisebox{-\height}{\includegraphics{pepe-le-pew2}}}}}} \lipsum[1]

\begin{figure}[!h] \centering \includegraphics{pepe-le-pew2} \caption{Pepe le Pew in action} \end{figure}

\end{document}

enter image description here

Bernard
  • 271,350
2

The following places the contents like you want them. To move the contents a bit just change the 0pt to your liking.

\documentclass[]{article}

\usepackage{eso-pic}

\AddToShipoutPictureBG {% \put(\LenToUnit{\paperwidth-0pt},\LenToUnit{\paperheight-0pt}) {% \llap % make it overlap to the left from this point {% \raisebox{-\height} % move it down a bit to make it top-aligned {\parbox{5cm}{\blindduck}}% contents }% }% }

\usepackage{duckuments} % dummy text

\begin{document} \mbox{}% produces one empty page \end{document}

Skillmon
  • 60,462