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

3

5 Answers 5

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.

4
  • Your MWE needs a \usepackage{color} doesn't it?
    – Seamus
    Dec 19, 2010 at 18:19
  • @Saemus No, that is automatically loaded by tikz.
    – Caramdir
    Dec 19, 2010 at 20:32
  • I agree that the watermark is probably added in postprocessing, since even some of the uncompilable sources they provide seem to have it. Dec 21, 2010 at 5:40
  • can we repeat such text in all pages?
    – enthu
    Jan 15, 2020 at 12:26
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}
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.

3
  • This seems to be similar to @Thorsten's solution.
    – Caramdir
    Dec 19, 2010 at 20:39
  • True, I hadn't actually checked the other solutions when I added this...
    – Seamus
    Dec 20, 2010 at 12:29
  • And it seems to contradict what you called "the ideal" in your initial post. Apart from the fact that it also doesn't involve »tikZ«. Dec 20, 2010 at 18:10
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.

1
  • What would be the modification so that it appears on all pages?
    – robintux
    May 18, 2020 at 1:05

You must log in to answer this question.

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