I need on one specific page a line from the very top to the end of the page (it is for folding).
Everything I tried so far stopped at the head/foot room.
Someone got an idea?
I need on one specific page a line from the very top to the end of the page (it is for folding).
Everything I tried so far stopped at the head/foot room.
Someone got an idea?
Specializing my answer from What are the ways to position things absolutely on the page?, this MWE sets up the line on page two, because that is where the \atxy
was invoked. The line is 6 inches from the left paper edge, as given in the \atxy
arguments.
\documentclass{article}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
\AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
\raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{\textcolor{red}{#3}}}}}
% VERIFIED THAT SETTING \hoffset AND \voffset DO NOT BREAK SOLUTION.
%\hoffset=0.4in
%\voffset=0.2in
\begin{document}
\lipsum[1-7]
\atxy{6in}{0in}{\rule[-11in]{1pt}{11in}}
\lipsum[8-12]
\end{document}
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikz[overlay,remember picture]\draw[<->,red,dashed] ([xshift=3cm]current page.north west)-- ([xshift=3cm]current page.south west);
blablablabla
\end{document}
Like this?
\documentclass{article}
\usepackage{eso-pic,graphicx}
\begin{document}
\newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
\put(\LenToUnit{4cm},\LenToUnit{0cm}){#1}%
}}%
\AddToShipoutPictureBG*{%
\AtPageUpperMyleft{\color{red}\rule[-\paperheight]{4pt}{\paperheight}}
}
Some text
\end{document}
Adjust the value 4cm
in \LenToUnit{4cm}
as you desire.
Here is a variation/edit on Ulrike's solution (so please give her the tick!) to get the line to go down the centre of the page.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikz[overlay,remember picture]\draw[red,dashed](current page.north)--(current page.south);
blablablabla
\end{document}
Package PGF Math Error: Unknown function
north' (in 'north ').`
(current page.north )
and the space after north
leads to the error above...