5

I'd like to use the leftbar command from the framed package to put a line next to some parts of text. The only problem I have with the command is that it indents the text in question, as illustrated below.

\documentclass{article}
\usepackage{framed,lipsum}
\usepackage{showframe}

\begin{document}
\lipsum[10]
\begin{leftbar}
\lipsum[10]
\end{leftbar}
\end{document}

result

Is there a way to modify the command so that the text is still outlined as normal, and the bar instead appears somewhat to the left of the body of text?

7

You can do it like this:

\documentclass{article}
\usepackage{framed}
\usepackage{lipsum}
\usepackage{showframe}
\renewenvironment{leftbar}{%
  \def\FrameCommand{\hspace{-13pt}\vrule width 3pt \hspace{10pt}}%
  \MakeFramed {\advance\hsize-\width \FrameRestore}}%
 {\endMakeFramed}
\begin{document}
\lipsum[10]
\begin{leftbar}
\lipsum[10]
\end{leftbar}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.