9

I want to draw a vertical line on the margin. The line may be able to continue to the next page(s) and must not cut with the end of the current page.

I'd prefer to use an environment or something like

\startline
% Text, math, figures etc
\stopline

With the line I'd mark a new or a fixed text for my co-authors.

I tried receipt of Matthew Leingang but it didn't work for me.

  • Welcome to tex.stackexchange.com! you may want to use mdframed package for your purpose. – M.Reza Nov 22 '13 at 08:16
  • This line is often called a "changebar", so perhaps the changebar package might be useful. It is rather old, so it is possible xelatex might not be supported out of the box, but it is alleged to work with both pdflatex and latex+dvips. There is also the changes package, for an alterative way to mark changes. – Dan Nov 22 '13 at 19:45
  • The changebar is exactly what I looked for. It is included into texlive-latex-extra package of Ubuntu 12.04 and works well. Thank you! – user1038377 Nov 23 '13 at 19:43

1 Answers1

9

You can use mdframed package and only keep the left line visible.

\documentclass{article}
\usepackage{lipsum}
\usepackage[%
linewidth=1pt,
middlelinecolor= black,
middlelinewidth=0.4pt,
roundcorner=1pt,
topline = false,
rightline = false,
bottomline = false,
rightmargin=0pt,
skipabove=0pt,
skipbelow=0pt,
leftmargin=-1cm,
innerleftmargin=1cm,
innerrightmargin=0pt,
innertopmargin=0pt,
innerbottommargin=0pt,
]{mdframed}

\begin{document}
    \begin{mdframed}
          \lipsum
    \end{mdframed}
    \lipsum
\end{document}
karlkoeller
  • 124,410
M.Reza
  • 3,237
  • EDIT: you can adjust the line to enter left margin by using negative values for leftmargin. – M.Reza Nov 22 '13 at 08:24
  • Using negative values for leftmargin has no effect for two sided documents. Use outermargin instead: https://tex.stackexchange.com/a/41070/49283 – Make42 Nov 27 '20 at 10:46