I need a vertical rule to the left of each column.
I have a macro, say \foo, which appears in the text. When a \foo appears, a counter is increased and printed on the margin (i.e. on the left of the vertical rule to the left of that line).
It is possible that two \foo s appears on the same line, and in that case two numbers has to be printed on the same line of margin.
Code: Select all
\documentclass{article}
\newcount\cntr
\def\foo{\llap{\rule[6pt]{2pt}{2pt}\hskip1pt}\advance\cntr by 1\bar}
\def\bar{}% print the \cntr on the left of that line.
\usepackage{multicol}
\columnsep=40pt
\begin{document}
\begin{multicols}{2}
\leavevmode \foo Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \foo Ut purus elit, vestibulum, placerat ac, adipiscing vitae, felis. \foo Curabitur mauris. \foo Nam arcu libero, \foo nonummy gravida eget, consectetuer id, vulputate a, magna.
\end{multicols}
\end{document}

Note that the paragragh on column 2 is shorter and the vertical rule for that column is also shorter.
I have no idea how to finish this task. can anyone help? Thank you very much.