Tell me more ×
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.

How would I define a proof environment that is basically used with

\begin{proof}
some proof here
\end{proof}

and it would be equivalent to:

\paragraph{Proof:} some proof here
\hfill \box

?

share|improve this question
You probably want to add a “qed” box at the end of a proof. For this, it is enough to load a package such as amsmath. – Juan A. Navarro Feb 3 '11 at 7:25
2  
Environments for proofs, theorems etc. are provided by either the amsthm or the ntheorem package. – Carsten Thiel Feb 3 '11 at 8:34

2 Answers

up vote 4 down vote accepted

With LaTeX syntax:

\newenvironment{proof}{\paragraph{Proof:}}{\hfill\null}

I assume here that you mean \hbox{} not \box in your code. The \null macro is short for \hbox{}. The \box is a TeX primitive and is more like \usebox.

share|improve this answer
\def\QEDmark{\square}
\def\proof{\paragraph{Proof:}}
\def\endproof{\hfill\QEDmark}
share|improve this answer
this one seems to be giving an error about \begin{document} missing whenever I try to use \begin{proof} \end{proof} – kloop Feb 2 '11 at 23:46
@kloop: I think it's the problem Martin pointed out - \box is a Tex primitive that looks ahead for the box number, and I guess then will eat the closing parenthesis. I've changed the code. – Charles Stewart Feb 2 '11 at 23:58
@kloop: BTW, you can vote up as well as accept Martin's answer. – Charles Stewart Feb 2 '11 at 23:59
Aaahhh, he meant to draw a box using \box, ok ... I sometimes I think to complicated. – Martin Scharrer Feb 3 '11 at 0:20

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.