LaTeX: How to create a vertical full page rule on each page?

I am using LaTeX and I would like to have a vertical rule along the left side of the page, topmargin to bottomommargin, 0.5in from the left edge of the page. I want this on every page, so I guess this means that it should somehow snap to the header or footer?

I didn’t achieve anything at all, so I need help in (1) making a rule of full length and (2) doing it automatically on every page of the document.

Can someone tell me how to do this?

+6
layout graphics latex
source share
3 answers

I got a working answer to my question on the Latex community forum: http://www.latex-community.org/forum/viewtopic.php?f=5&t=9072&p=34877#p34877

The answer I received uses the "Background" package and this code:

\documentclass{article} \usepackage{background} \usepackage{lipsum}% just to generate filler text for the example \SetBgScale{1} \SetBgAngle{0} \SetBgColor{black} \SetBgContents{\rule{.4pt}{\paperheight}} \SetBgHshift{-9cm} \begin{document} \lipsum[1-90] \end{document} 

Works great and is easy to configure to place one vrule in the left margin and one in the right margin.

+7
source share

There may be a LaTeX package for you, but I'm more of a TeX person, so I tried to come up with a TeX solution (not always the best idea to mix simple TeX with LaTeX, but I think I'm working).

Try it. Block 255 is a window register in which TeX places the contents of the page during page output. What I did is done using the existing output procedure and changed it to insert in field 255: an infinite set with a width and width of 0 lines containing a rule that is page height, 0.4 thick and with luck, half an inch to the left. After this rule, the existing contents of block 255 are added. Then I call the previous output procedure, which displays the page (which now includes the rule), as well as the headers and footers.

 \newtoks\oldoutput \oldoutput=\expandafter{\the\output}% \output{% \setbox255\vbox to 0pt{% \hbox to 0pt{% \vsize\ht255% \vbox to \ht255{% \vss \hbox to -0.5in{% \hss \vrule height \ht255 width 0.4pt% }% }\hss }\vss \box255% }% \the\oldoutput }% 

Place it in front of your \begin{document} command. This may not solve your problem completely, but hopefully you should start. Here is a great page to learn about TeX primitives and built-in stuff.

+2
source share

Take a look at eso-pic . From memory, what you want will look like this:

 \AddToShipoutPicture{% \setlength\unitlength{1in}% \AtPageUpperLeft{% \put(0.5,\topmargin){\vrule width .5pt height \textheight}% }% } 

It is not clear in your question whether you want the line to cover the text area or the entire height of the paper. Depending on the case, you should replace \topmargin and \textheight with the correct values, either 0pt , or any of your top \paperheight , or \paperheight . See the geometry package if you are not already using it to manage these sizes.

+1
source share

All Articles