10

The first page of articles on the arXiv have a grey watermark on the first page with the information about the file in it. I want to replicate this, in the easiest way possible. Obligatory TikZ solutions welcome (since I already normally have that loaded...

This is the sort of thing I would like to hack together myself, but I just don't know where to start... I tried looking at the source of an arXiv paper, but it seems that the watermark is added by their autoTeX thing, so it doesn't show up in the source file...

The text needs to be vertical, grey, and allowed to contain macros (like \today or \GITHash from the vc bundle.)

Bonus marks for an additional "every page" solution (but my primary aim is first page only). Actually, the ideal would be something that could be added to the page style "plain" so that it appears on the first page of every chapter...

Seamus
  • 73,242

5 Answers5

10

I suspect that arxiv adds the watermark in postprocessing.

Obligatory TikZ solution:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext,tikz}
\usetikzlibrary{calc}
\begin{document}

\tikz[overlay,remember picture]
{
    \node at ($(current page.west)+(1.5,0)$) [rotate=90] {\Huge\textcolor{gray}{\today}};
}

\blinddocument    
\end{document}

You could add that snippet for example to the \chapter command.

Caramdir
  • 89,023
  • 26
  • 255
  • 291
7

You can use the background package to achieve this. The package uses the TikZ positiong system to position an image either on one page or on all the pages (great also if you just need draft to be printed on one or all the pages of a publication).

It uses any valid TikZ positioning command for example:

\SetBgPosition{0,0}
\SetBgPosition{current page.north}
\SetBgPosition{5cm,7cm}
yannisl
  • 117,160
4

I found an answer of my own that someone emailed me:

\usepackage{graphicx,eso-pic,xcolor}
\makeatletter
\AddToShipoutPicture{%
\setlength{\@tempdimb}{.5\paperwidth}%
\setlength{\@tempdimc}{.5\paperheight}%
\setlength{\unitlength}{1pt}%
\put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
    \makebox(-500,200){\rotatebox{90}{\textcolor[gray]{0.70}%
       {\Large \textsf{Draft of \today}}}}
  }%
}
\makeatother

I don't understand why this works though... For completeness, I'll add it to the collection.

Seamus
  • 73,242
1

Packages for the job have already been mentioned. You talked about something that only appears on the chapter pages. The code below shows how you could to do that.

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[
  headheight=14pt,
  includeheadfoot,
  margin=3cm
]{geometry}
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{blindtext}

\newcommand{\chapmark}{%
  \AddToShipoutPictureBG*{%
    \AtPageCenter{%
   \put(\LenToUnit{-0.45\paperwidth},0){%
        \rotatebox[origin=c]{90}{\scalebox{3}{\textcolor{gray!50}{\fontfamily{phv}\selectfont\today}}}
   }
    }
  }
}

\fancypagestyle{plain}{%
  \fancyhf{}
  \renewcommand{\headrulewidth}{0pt}
  \chead{\chapmark}
  \cfoot{\thepage}
}

% Setup for headers and footers (fancyhdr)
\fancyhf{}
\rhead{\nouppercase{\leftmark}}
\rfoot{\thepage}
\pagestyle{fancy}

\begin{document}
  \blinddocument

  \blinddocument
\end{document}

Not a »tikZ« solution though.

0

I also suspect that arxiv adds the watermark in postprocessing. Obligatory TikZ solution:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext,tikz}
\usetikzlibrary{calc}
\begin{document}
\tikz[overlay,remember picture] {
    \node at ($(current page.west)+(1.5,0)$) [rotate=90] {\Huge\textcolor{gray}{\today}};
}
\blinddocument    
\end{document}

You could add that snippet for example to the \chapter command.

dexteritas
  • 9,161