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 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?

share|improve this question
2  
The textpos package or the background package could be an option. Why don't you want to use additional package(s)? –  Gonzalo Medina Oct 1 '11 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 '11 at 21:27
    
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) –  John Doucette Oct 1 '11 at 21:27
add comment

3 Answers

up vote 10 down vote accepted

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

\documentclass[a4paper]{article}
\usepackage{atbegshi,picture}
\usepackage{lipsum}


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

\begin{document}

\lipsum

\end{document}

Every page of the document will bear the copyright notice.

share|improve this answer
    
This does exactly what I wanted. –  John Doucette Oct 1 '11 at 22:59
add comment

Here's a simple example using the background package:

\documentclass{article}  
\usepackage{background}
\usepackage{lipsum}% just to generate filler text

\SetBgContents{some additional text}
\SetBgScale{1}
\SetBgAngle{0}
\SetBgPosition{current page.north east}
\SetBgHshift{-2cm}
\SetBgVshift{-1cm}

\begin{document}

\lipsum[1-3]

\end{document}
share|improve this answer
add comment

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

enter image description here

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

\begin{document}

\AddToShipoutPictureBG*{%
  \AtPageUpperLeft{%
    \hspace{\paperwidth}%
    \raisebox{-\baselineskip}{%
      \makebox[0pt][r]{Here is some interesting text}
}}}%

\lipsum[1-3]

\end{document}

\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.

share|improve this answer
add comment

Your Answer

 
discard

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.