Page LayoutVertical Line left of Proofs

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
carte_apuces
Posts: 1
Joined: Mon Aug 06, 2012 11:30 pm

Vertical Line left of Proofs

Post by carte_apuces »

Hi everybody,

I'm sorry to disturb you with probably such an easy thing, but I just begin to use LaTeX and I would like to put a vertical line on the left of every mathematical proof I do (please see the attached example). How can I do in math mode?


Thank you,
Vince
Attachments
layout.pdf
(77.1 KiB) Downloaded 865 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Vertical Line left of Proofs

Post by kaiserkarl13 »

I think using the leftbar environment of the framed package will do what you wish, like so:

Code: Select all

\documentclass{article}
\usepackage{framed}
\usepackage{amsmath,amsthm}

\newenvironment{theorem}[1][Proof]
    {\begin{leftbar}\begin{proof}[#1]}
    {\end{proof}\end{leftbar}}

\begin{document}
Hello!  This is text, leading to
\begin{theorem}[Proof by Paradox]
\begin{equation}
  \begin{split}
    \mathrm{A.}\quad & \mathrm{A} \oplus \mathrm{B} \\
    \mathrm{B.}\quad & 1 = 2
  \end{split}
\end{equation}
  Case 1:  Statement A is FALSE, meaning statement B is TRUE \\
  Case 2:  Statement A is TRUE, meaning statement B is TRUE
\end{theorem}
And here's another one for you,
\begin{theorem}
  \begin{gather}
    ax^2 + bx + c = 0 \\
    x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
  \end{gather}
\end{theorem}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Vertical Line left of Proofs

Post by localghost »

You may also want to take a look at the mdframed package. The example of kaiserkarl13 modified accordingly.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage[framemethod=TikZ]{mdframed}

\surroundwithmdframed[
  topline=false,
  rightline=false,
  bottomline=false,
  leftmargin=\parindent,
  skipabove=\medskipamount,
  skipbelow=\medskipamount
]{proof}

\begin{document}
  \noindent
  Preceding Text
  \begin{proof}[Proof by Paradox]
    \begin{equation}
      \begin{split}
        \mathrm{A.}\quad & \mathrm{A} \oplus \mathrm{B} \\
        \mathrm{B.}\quad & 1 = 2
      \end{split}
    \end{equation}
    Case 1:  Statement A is FALSE, meaning statement B is TRUE \\
    Case 2:  Statement A is TRUE, meaning statement B is TRUE
  \end{proof}
  Following Text
\end{document}
For further customization please have a look at the comprehensive package manual.


Best regards and welcome to the board
Thorsten
Post Reply