This page is about page backgrounds — a full-page color or image laid behind the text, a diagonal “DRAFT” watermark, a date stamp in the corner. The foundation is the eso-pic package, which gives you the low-level machinery to place artwork at a fixed spot on every page. On top of it sit the declarative background package, the text-only draftwatermark package, and \pagecolor for a flat background color.
eso-pic — the foundation
The idea behind eso-pic is simple. Just before LaTeX ships out a page, it overlays one transparent picture environment the size of the whole page, and you drop artwork into it with \put — repeated on every page. The central command for the background is **\AddToShipoutPictureBG{...}: whatever you put in its argument is drawn behind the text on every page from here on. To restrict it to the current page only, use the starred \AddToShipoutPictureBG*{...}**.
To overlay material above the text (the foreground), use **\AddToShipoutPictureFG{...}** (and the current-page-only \AddToShipoutPictureFG*) — handy for a stamp that sits over the body and deliberately obscures it. For compatibility, the aliases \AddToShipoutPicture and \AddToShipoutPicture* also exist; they behave like the background (BG) forms. To stop a background you set earlier, call \ClearShipoutPictureBG (or \ClearShipoutPictureFG for the foreground).
The key to placement is that the coordinate origin is the lower-left corner of the page (the default). The coordinates in \put(x,y){...} are measured from there, and the unit of length is \unitlength (1 pt by default). Counting from the corner every time is tedious, so eso-pic provides helpers: **\AtPageCenter{...} (the page center), \AtPageLowerLeft{...}** (lower left), \AtPageUpperLeft, plus text-area variants such as \AtTextCenter / \AtTextLowerLeft / \AtTextUpperLeft. The texcoord option moves the origin to the upper-left corner instead.
In practice you build the background by placing an \includegraphics or a tikzpicture inside \put. Here is a minimal example that lays a photo across the entire page (full-bleed).
\documentclass{article}
\usepackage{eso-pic}
\usepackage{graphicx}
% 全ページの背景に画像を全面表示
\AddToShipoutPictureBG{%
\AtPageLowerLeft{%
\includegraphics[width=\paperwidth,height=\paperheight]{background.jpg}}%
}
\begin{document}
Text sits on top of the full-page background.
\end{document}Combined with TikZ, you can draw a tinted pattern or shapes as a background without any image. Put a tikzpicture inside \AtPageCenter and you can draw freely in coordinates whose origin is the page center. To help with placement, load eso-pic with the grid option (\usepackage[grid]{eso-pic}); it rules a coordinate grid over the whole page (units set by gridunit, mm by default).
\documentclass{article}
\usepackage{eso-pic}
\usepackage{tikz}
% TikZ でページ中央に淡い円の背景を描く
\AddToShipoutPictureBG{%
\AtPageCenter{%
\begin{tikzpicture}
\fill[blue!8] (0,0) circle (6cm);
\end{tikzpicture}}%
}
\begin{document}
A soft tinted disc sits behind the text on every page.
\end{document}background — watermarks, declaratively
If you would rather not compute \put coordinates and just want an easy diagonal watermark, the background package is the friendly option. It uses TikZ to handle the background material, and all configuration is collected into **\backgroundsetup{key=value, ...}**. Loading it bare with \usepackage{background} already gives a default: a large reddish (red!45) “Draft” running diagonally (60°) across the center of every page.
The main keys are: contents= (what to show — text, an \includegraphics, or a drawing), scale= (scale factor), opacity= (0–1), angle= (counterclockwise, −360 to 360), color= (the full xcolor range), position= (TikZ node-placement syntax, e.g. current page.center; do not wrap bare coordinates in parentheses), placement= (center/top/bottom), pages= (all/some), and firstpage= (first page only). You can call \backgroundsetup in the preamble or in the body, as many times as you like — so you can switch the design partway through.
Here is the canonical example: a translucent diagonal “DRAFT” on every page.
\documentclass{article}
\usepackage{background}
\backgroundsetup{
contents={DRAFT},
scale=8,
opacity=0.3,
angle=45,
color=red,
position=current page.center,
}
\begin{document}
Every page carries a diagonal DRAFT watermark.
\end{document}To show it on only some pages, set pages=some and call \BgThispage on the pages you want; conversely, \NoBgThispage suppresses the background on a single page. Two caveats. You must compile twice for the position to settle. And if the contents= material contains LaTeX commands, declare it via \backgroundsetup rather than as a package option (because of how options are parsed). Note too that background does not cooperate with two-column mode, where \BgThispage and friends fail.
Simpler watermarks — draftwatermark and friends
If a textual watermark is all you need, the dedicated draftwatermark package is simpler still. Just \usepackage{draftwatermark} puts a large gray “DRAFT” at the center of every page. Because it uses no PostScript specials, it works the same way under pdfLaTeX, XeLaTeX, and LuaLaTeX alike. Configuration is gathered in \DraftwatermarkOptions{key=value}, with keys such as text=, color=, scale=, angle= (default 45°), fontsize=, and firstpageonly.
\documentclass{article}
\usepackage{draftwatermark}
\DraftwatermarkOptions{text=CONFIDENTIAL, color={[gray]{0.85}}, angle=45}
\begin{document}
A light gray CONFIDENTIAL watermark appears behind the text.
\end{document}The legacy commands **\SetWatermarkText{...}, \SetWatermarkScale{...}**, \SetWatermarkColor{...}, \SetWatermarkAngle{...}, and \SetWatermarkLightness{...} (0–1, black to white) still work for compatibility, but in new documents prefer the \DraftwatermarkOptions key-value form. One design note: draftwatermark only lays text behind the body (in the background) — it cannot *stamp* over the text in the foreground. For an overlay, or fine control of stacking order, use eso-pic’s \AddToShipoutPictureFG, or rely on scrlayer / the LaTeX shipout hooks.
When a plain color or image background is enough, a humbler tool can beat a dedicated package. **\pagecolor{color}** fills the whole page with a background color from that point on (see the colors page for how to specify colors); \nopagecolor reverts it. For images, the wallpaper package (built on eso-pic) offers \CenterWallPaper{scale}{file} to center an image, \TileWallPaper{width}{height}{file} to tile it, and corner placers such as \ULCornerWallPaper. The table below sorts out which to reach for.
| Tool | Best for | Foreground? |
|---|---|---|
eso-pic | Arbitrary artwork at a fixed spot; the flexible foundation | Both BG and FG |
background | Declarative diagonal watermark; easy angle/opacity | Adjustable via placement |
draftwatermark | A text watermark (DRAFT, etc.) with least effort; all engines | Background only (no) |
\pagecolor | A flat single background color | N/A |
wallpaper | Centered or tiled image backgrounds | Background only |
Which to choose, and what trips people up
- Just a diagonal text watermark →
draftwatermark(least effort) orbackground(fine angle/opacity). - A full-page image, pattern, or elaborate drawing →
eso-pic(with atikzpictureor\includegraphicsinside\putif needed). - An overlay on top of the text (a stamp) →
eso-pic’s\AddToShipoutPictureFG;draftwatermarkis background-only and cannot do this. - A plain background color →
\pagecolor; no package required. - It shifts or does not appear → compile
backgroundtwice; tuneopacityandscaleif the watermark is too faint or too heavy. - Japanese (pLaTeX/upLaTeX + dvipdfmx) → all of these work, but color, opacity, and image inclusion are driver-dependent;
eso-picalso has advipsoption.
When in doubt, start with the humblest tool: \pagecolor for a color, draftwatermark for a text watermark, background for a tidy declarative setup — and only when none of those bends to your will, drop down to eso-pic and place things directly with \put. That progression covers nearly everything.