# Making a line-separated left-margin in LaTeX

I'm trying to write a user guide in LaTeX, and I want to layout my page in a way that I can put in a left margin for comments / notes on the corresponding lines of text in the main portion of the page (eg. a pcture of an exclamation mark and some words of caution to the reader about something said in the content on the right).

Furthermore it would be nice if I could somehow get a thin line separating the margin and the main body of text.

I've tried playing around with minipage, but I don't know how to specify the placement of the columns: I can't make the "margin" column align to the left side of the page, minipage always splits the page in half.

EG:

          |  main content of the page
|  ctd.....................
! Warning |  ctd.....................
|  ctd.....................
|  ctd.....................
? Note    |  ctd.....................
|  ctd.....................

-

One possible solution would be to use the space reserved for marginal notes to place the comments/notes and to use the background package to place the vertical rule separating the text from the notes/comments; a little example (feel free to adapt and improve my example to suit your needs):

\documentclass{article}
\usepackage{marginnote}
\usepackage{graphicx}
\usepackage{background}
\usepackage{lipsum}% just to generate filler text

% settings for the vertical line
\SetBgScale{1}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgHshift{-0.52\textwidth}
\SetBgVshift{-1mm}
\SetBgContents{\rule{0.4pt}{\textheight}}

\newcommand*\Note{%
\marginnote[\textcolor{blue}{\raggedright{\LARGE ?}\ Note }]{}%
}
\newcommand*\Warn{%
\marginnote[\textcolor{red}{\raggedright{\LARGE !}\ Warning }]{}%
}
\reversemarginpar

\begin{document}
some test text\Note{sdfasdfdsfsd} \lipsum[1]
\Warn{sdfasdfdsfsd} \lipsum[1]
\end{document}


A portion of the resulting document:

-
background is a very nice package. Thanks for writing it. – Alan Munn Mar 21 '11 at 2:16
@Alan Munn: thank you. I am preparing a new version of the package. – Gonzalo Medina Mar 21 '11 at 2:19

none of these worked for me. here is a simple method to draw a line seperated the right margin. you can easily adjust it for the left one:

\usepackage{eso-pic}
\AtTextLowerLeft{
\put(\LenToUnit{\textwidth},0){
\rule{1pt}{\textheight}
}
}
}

-

Use \marginpar:

\documentclass{article}
\begin{document}
Here's a paragraph.
\marginpar{\raggedright Warning! That paragraph is only one sentence long!}
\end{document}


If this is really a two-column document with margin notes, then you may want to look at the memoir class as well.

-