Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I don't have much experience in creating environments, and my understanding of them allows me to create environments which do something at the beginning and at the end (like for instance, in a "proof" environment, I can begin it with "Proof." and end it with a little square in the bottom right.

What I want to do now is slighty more complicated (so it seems to me), I just want something looking like

Proof.
|
|
| content here
|
|
| end of proof

I want those vertical dashes to be a straight line from bottom to top. Any way I could be able to do that?

share|improve this question
1  
I think you'll be able to find a solution using mdframed, since it allows even for page breaking and setting particular borders. In that regard, see Double vertical bars alongside statements of theorems. –  Werner Mar 8 '13 at 18:14
    
@Werner It's a good start, but the problem is that instead of putting a line where the text should be and pushing the text to the right, it puts a line to the left of the text, which is not quite what I want to do. Do you think we could tweak it so that it works? –  Patrick Da Silva Mar 8 '13 at 18:23
    
Yes, things can be modified. In your image, it shows that you have the vertical rule flush with the left margin and the content here pushed to the right. That's exactly what the link does (see the image in the linked answer when you add some text before/after the theo environment). You don't want that? –  Werner Mar 8 '13 at 18:39
    
@Werner : I tried what the link said, and it compiled well, but the vertical rule is to the left of the left margin, and the text is where it would've been if I had done nothing particular. It doesn't show as in the image, although if for instance I would remove the "bottomline=false,...," part of the code, it would surround the whole text with a box. –  Patrick Da Silva Mar 8 '13 at 18:41
    
Should I modify the position of the left margin inside the environment to fix the problem? (I don't know how to do that by the way, that's why I ask.) –  Patrick Da Silva Mar 8 '13 at 18:46

1 Answer 1

up vote 3 down vote accepted

Here is a slight modification of Double vertical bars alongside statements of theorems to accommodate for the layout of your proof environment:

enter image description here

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}% http://ctan.org/pkg/mdframed
\usepackage{lipsum}% http://ctan.org/pkg/lipsum

\newtheorem{theorem}{Theorem}
\newenvironment{proof}
  {\par\noindent\normalfont\textbf{Proof.}\par\nopagebreak%
  \begin{mdframed}[
     linewidth=1pt,
     linecolor=black,
     bottomline=false,topline=false,rightline=false,
     innerrightmargin=0pt,innertopmargin=0pt,innerbottommargin=0pt,
     innerleftmargin=1em,% Distance between vertical rule & proof content
     skipabove=.5\baselineskip
   ]}
  {\end{mdframed}}

\begin{document}

\lipsum[1]

\begin{theorem}
\lipsum[1]
\begin{proof}
\lipsum[2-4]
\end{proof}
\end{theorem}
\lipsum[1]

\end{document}

Margin adjustments in mdframed allows for a block that spans page breaks. See the mdframed documentation for more options (including colours, if needed).

Since you're using a vertical rule to define the scope of the proof environment, I don't think it's necessary to add anything else.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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