I want to put a block of text into the top right corner of my document (which uses the article class). The specifications of the document's formatting are very detailed, and it has taken me about 2 days to get them right.

I do not want to put a line across the top, or to do anything which will change the margin. In fact, I would prefer to avoid using any additional packages at all.

Any suggestions?

  • 3
    The textpos package or the background package could be an option. Why don't you want to use additional package(s)? Oct 1, 2011 at 21:19
  • Yes, many pages add functionality without modifying the document layout/margins. Another one that can be used to place document elements anywhere on the page is eso-pic. And, I'm pretty sure both pstricks and tikz/pkg will be able to accommodate this.
    – Werner
    Oct 1, 2011 at 21:27
  • 1
    The packages I've already tried (e.g. scrpage2) produce strange additional changes, which are sometimes hard to notice at first. For example, scrpage2 insists on a flexible page size, and cuts off the page numbers as a side effect of adding the header if I try to use fixed margins (which are required) Oct 1, 2011 at 21:27

4 Answers 4


Using atbegshi guarantees that the text block will not be modified in any way, as it acts by "overlaying", so to speak.


  \put(\dimexpr\paperwidth-1cm\relax,-1.5cm){\makebox[0pt][r]{\framebox{Copyright DTV}}}%




Every page of the document will bear the copyright notice.

  • How can I make this appear only on the front page?
    – finstats
    Jan 11, 2016 at 5:36
  • @roland Use \AtBeginShipoutFirst
    – egreg
    Jan 11, 2016 at 7:28
  • @egreg i tried that but it didn't work. It just removes the first page.
    – finstats
    Jan 11, 2016 at 23:40
  • 3
    @roland \AtBeginShipoutNext
    – egreg
    Jan 11, 2016 at 23:46

Here's a simple example using the background package:

\usepackage{lipsum}% just to generate filler text

\SetBgContents{some additional text}
\SetBgPosition{current page.north east}




Here is a minimal example using the eso-pic package.

enter image description here

\usepackage{eso-pic}% http://ctan.org/pkg/eso-pic
\usepackage{lipsum}% http://ctan.org/pkg/lipsum


      \makebox[0pt][r]{Here is some interesting text}



\AddToShipoutPictureBG will print something on every page, while the starred version \AddToShipoutPictureBG* prints it on the current page only. Placement is possible with spacing commands, with the help of predefined locations (like \AtPageUpperLeft and the like). See the package documentation for more on this.

eso-pic also provides placement of contents in the foreground to overlay with the existing page layout (in contrast to placing something in the background layer as suggested above) using \AddToShipoutPictureFG or \AddToShipoutPictureFG* with similar connotations as above.


Here is an option with textpos, the process is automatized so that the text will always stay at top right corner even when page geometry is changed

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = xelatex

\usepackage[a4paper, twoside]{geometry}

\usepackage[absolute, overlay]{textpos}

\setlength{\TPHorizModule}{1.0 pt}
\textblockorigin{\paperwidth}{0.0 pt}
%% set the origin used by 'textpos' to be top right corner of page



\pgfmathwidth{"top right corner at page \thepage"}
%% the width of text is stored in '\pgfmathresult'
\begin{textblock}{\pgfmathresult}[1, 0](0, 0)
%% value of '\pgfmathresult' is used to set the width of text block
%% '[1, 0]' sets the anchor point of text block to be its top right corner
%% '(0, 0)' sets the anchor point right at the origin which is set by '\textblockorigin' in the preamble
top right corner at page \thepage




here is what is produced

top right corner text

You must log in to answer this question.

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