summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/eso-pic/eso-ex1.tex
blob: c780356975a6ec101d83246567cd4553282fc1d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

% file `eso-ex1.tex'; a framed background example

\documentclass[a4paper]{article}
\usepackage{eso-pic}
\listfiles

\newdimen\myLenA
\newdimen\myLenB
\newdimen\myLenC

\AddToShipoutPictureBG{%
  \begingroup
    \setlength\myLenA{15mm}%
    \setlength\myLenB{\dimexpr\paperwidth-2\myLenA}%
    \setlength\myLenC{\dimexpr\paperheight-2\myLenA}%
    \thicklines%
    \put(\myLenA,\myLenA){\framebox(\myLenB,\myLenC){}}%
  \endgroup
}

\begin{document}

  \section*{First page}

  This page and all the following have a frame with 15~mm
  distance from the paper edges.
  
  \newpage

  \section*{Second page}

  \AddToShipoutPictureBG*{\put(100,100){\circle{40}}}

  Only this page has a circle on the lower left side.

  \newpage

  \section*{Last page}

\end{document}