I am trying to insert a vertical line and some text or image in the margin as in the picture no matter if it is an image or a text with several lines
However the source code embeds the line and text in all pages and the text after the \begin{document} is too narrow.
Thanks for the support
\documentclass[10pt,a4paper]{article}
\usepackage[all]{background}
\usepackage{lipsum}
\SetBgContents{Text here but with several lines}% Set contents
\SetBgPosition{-0.0cm,1.5cm}% Select location
\SetBgOpacity{1.0}% Select opacity
\SetBgAngle{0.0}% Select rotation of logo
\SetBgScale{1.0}% Select scale factor of logo
\newlength{\leftrule}
\newlength{\rightrule}
\setlength{\leftrule}{2\leftmargin-\marginparsep}
\setlength{\rightrule}{2\leftmargin+\textwidth+\marginparsep}
\AddToShipoutPicture{%
\AtPageLowerLeft{%
\put(\LenToUnit{\leftrule},0){\rule{0.3pt}{\paperheight}} % Rule on the left
%\put(\LenToUnit{\rightrule},0){\rule{1pt}{\paperheight}} % Rule on the right
}
}
\begin{document}
\lipsum
\end{document}
Best Answer
I'd use the
fancyhdr
package for that. See the example. It surely contains many hardcoded constants, so it could be done better.