Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
3  
Please post what you have tried so far and we will correct it for you. We do not even know your documentclass and would have to guess around. You should always try to minimize the work, the helpers have to do for you. Just an advice. Welcome to the page, btw. –  LaRiFaRi Aug 29 at 14:27
    
I tryed some shananigans with tables, but they dont override the header and fooder. Also i tried a whole Box over the page, stolen this form the method of puting source code in my text. There i could set borders. But with the answers from Steven and Harish i am 100% sadisvied. @ Turion, thanks for the editing, my english isnt that good. –  Fulli Sep 1 at 6:55
1  
Glad to hear. It would be good, if you mark your preferred answer by klicking on the check mark on the left. This will close this issue as it has been resolved. Thanks. –  LaRiFaRi Sep 1 at 7:08

4 Answers 4

up vote 3 down vote accepted

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}

enter image description here

share|improve this answer
\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}
share|improve this answer
    
I dont know why but this solution didnt work in my document. –  Fulli Sep 1 at 7:01
    
@Fulli: Well it works in my example (after two compilations). So you will have to find out what's different in your document. –  Ulrike Fischer Sep 1 at 7:35
    
@ Ulrike: could it be the documentclass? i write in a paper not an article? –  Fulli Sep 1 at 7:46
    
@Fulli: I won't try to guess around without any information. Make a complete minimal example that demonstrates your problem and show it along with the log-file. Create a new question or add the informations to your question above. –  Ulrike Fischer Sep 1 at 7:52

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.

enter image description here

share|improve this answer
    
9 second difference ;-) –  Ulrike Fischer Aug 29 at 15:10
    
@UlrikeFischer I have a different method ;-) –  Harish Kumar Aug 29 at 16:12

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}
share|improve this answer
    
(current page.north) -- (current page.south)? –  Manuel Aug 29 at 15:37
    
@Manuel I thought this would work too but it doesn't: Package PGF Math Error: Unknown function north' (in 'north ').` –  Andrew Aug 29 at 15:39
    
(current page.90) -- (current page.270)? I can't compile right now. –  Manuel Aug 29 at 15:41
    
@Manuel I am very confused as it is working now... Will edit. I'm sure that I tried this earlier too before resorting to using the calc library. Whatever... –  Andrew Aug 29 at 15:43
1  
Ah, space matters here: when I first tried this I had (current page.north ) and the space after north leads to the error above... –  Andrew Aug 29 at 15:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.