crosshair in the middle of a page
You can use eso-pic
to place content in the F
oreG
round in the centre of every page:
\documentclass{article}
\usepackage{eso-pic,xcolor,lipsum}
\AddToShipoutPictureFG{%
\AtPageCenter{%
\color{red}%
\makebox[0pt]{\rule{250pt}{2pt}}%
\makebox[0pt]{\rule[-250pt]{2pt}{500pt}}%
}%
}
\begin{document}
\lipsum[1-50]
\end{document}
This uses TikZ and places a cross hair at the page center, extending some size to the top/bottom and left/right margins, the dimensions of this is used from the 1st and 2nd arguments of the macro \crosshair
. The 3rd argument is meant for colour etc. settings.
Please compile twice to get the node anchor placement correctly.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{blindtext}
\newcommand{\crosshair}[3]{%
\begin{tikzpicture}[remember picture,overlay,opacity=0.2]
\draw[black, line width=2pt,#3] ($(current page.center)-(#1,0)$) -- ($(current page.center)+(#1,0)$);
\draw[black, line width=2pt,#3] ($(current page.center)-(0,#2)$) -- ($(current page.center)+(0,#2)$);
\end{tikzpicture}%
}
\begin{document}
\crosshair{5cm}{10cm}{blue}
\blindtext[10]
\crosshair{10cm}{2cm}{red,dashed}
\end{document}
Update for crosshairs on every page with everypage
package
Use the \AddEverypageHook
macro in order to add some code that should be used on every page, i.e. place the \crosshair
macro inside \AddEverypageHook
as has been done in the code below.
\documentclass{article}
\usepackage{everypage}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{blindtext}
\newcommand{\crosshair}[4][opacity=0.2]{%
\begin{tikzpicture}[remember picture,overlay,#1]
\draw[black, line width=2pt,#4] ($(current page.center)-(#2,0)$) -- ($(current page.center)+(#2,0)$);
\draw[black, line width=2pt,#4] ($(current page.center)-(0,#3)$) -- ($(current page.center)+(0,#3)$);
\end{tikzpicture}%
}
\AddEverypageHook{\crosshair[opacity=0.5]{5cm}{10cm}{blue}}
\begin{document}
\blindtext[10]
\end{document}
You can use also \watermark
or \leftwatermark
and \rightwatermark
for even/odd pages, or \thiswatermark
for a particular page:
\documentclass{article}
\usepackage{watermark,xcolor}
\usepackage{lipsum} % dummy text
\begin{document}
\thiswatermark{\color{red!50}\rule{.5\textwidth}{0pt}%
\rule[\dimexpr-1\textheight-\headsep]{1pt}{1\textheight}}
\lipsum[1-6]
\end{document}