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 insert a sentence (Author's personal copy) at the top of the page which is centered. I don't want a header with line. Just want to add a sentence (bold or italic). How can I add that for

  1. first page only

  2. each page

share|improve this question
    
Check out the fancyhdr package; it's pretty easy to just remove that line and an example is given in the documentation. –  Sean Allred Apr 19 at 14:33
    
Here's another way: tex.stackexchange.com/questions/158752/… –  Steven B. Segletes Apr 19 at 17:28

3 Answers 3

up vote 11 down vote accepted

On only one page:

\documentclass{article}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}[remember picture, overlay]
      \node[draw,minimum width=4in,fill=olive!40,text=magenta,font=\LARGE\bfseries] at ([yshift=-1cm]current page.north)  {Author's personal copy};
    \end{tikzpicture}
    Some text comes here

\end{document}

enter image description here

On all pages:

Using background package:

\documentclass{article}
\usepackage{background}

\backgroundsetup{
angle=0,
scale=1,
opacity=1,
color=black,
contents={%
\begin{tikzpicture}[remember picture, overlay]
      \node[draw,minimum width=4in,fill=olive!40,text=magenta,font=\LARGE\bfseries] at ([yshift=-1cm]current page.north)  {Author's personal copy};
    \end{tikzpicture}
}
}
\begin{document}

    Some text comes here
    \clearpage
    Some text again

\end{document}

enter image description here

Using eso-pic package with only text as requested:

\documentclass{article}
\usepackage{tikz,eso-pic}

\AddToShipoutPicture{%
\begin{tikzpicture}[remember picture, overlay]
      \node[minimum width=4in,font=\bfseries] at ([yshift=-1cm]current page.north)  {Author's personal copy};
    \end{tikzpicture}%

}

\begin{document}

    Some text comes here
    \clearpage
    Some text again

\end{document}

enter image description here

share|improve this answer
    
That is fine. Still I need a simple layout without box or color. Just a sentence –  mahmood Apr 19 at 14:36
    
@mahmood See the last code with eso-pic. I simplified the node. You have to remove the options given to \node. –  Harish Kumar Apr 19 at 14:39

I would suggest using eso-pic with the following setup:

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

\AddToShipoutPictureBG{%
  \AtPageUpperLeft{%
    \makebox[\pdfpagewidth]{\raisebox{\dimexpr-\height-20pt}{%
      \large Author's personal copy
    }}%
  }%
}

The above places the required text 20pt below the top margin of the page boundary and can be used as-is in the preamble. Use \AddToShipoutPictureBG* for a page-only addition. There's also a \..FG option if you want to place content in the ForeGround (as opposed to the BackGround).

share|improve this answer

You can use the titlesec package with pagestyles option, and define a new page style, say "copy" (the formatting is up to you, to be put in the middle argument of sethead:

\newpagestyle{copy}{%
\sethead{}{\small Author's personal copy}{}
\setfoot{}{\thepage}{}}% 

As a title rule is not asked for, you won't have one. Then call \pagestyle{copy} in your preamble (case 2) or thispagestyle{copy} at the beginning of your document (case 1).

share|improve this answer

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.