3

How to add a thin vertical border line (left side of each page) in PDF documents. Please see the attached image for more informationattached image.

Thank you

2 Answers 2

3

One option using the background package:

\documentclass{article}
\usepackage[scale=1,angle=0,opacity=1]{background}
\usepackage{lipsum}

\definecolor{myblue}{RGB}{29,57,127}

\backgroundsetup{
  position=current page.north west,
  color=myblue,
  nodeanchor=north west, 
  contents={\rule{10pt}{\paperheight}} 
}

\begin{document}

\lipsum[1-10]

\end{document}

enter image description here

2
  • Thanks a lot for your support. While running I found this error ... May you have a look in this issue ... Thanks ... line 12: Package xkeyval Error: nodeanchor' undefined in families background'. }
    – lokibd
    Commented Sep 19, 2015 at 6:45
  • @ibrahimkbd You're welcome. The error indicates that your version of the background package is outdated; you should update it. In the meantime, replace node anchor=north west with anchor=below right, and it should work. Please let me know if this fixes the problem. Commented Sep 19, 2015 at 14:21
3

This uses the \AddEverypageHook macro of the everypage package.

\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]{%
 \AddEverypageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{\textcolor{blue!70}{#3}}}}}
\atxy{0in}{0in}{\rule[-\paperheight]{4pt}{\paperheight}}
\begin{document}
\lipsum[1-35]
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .