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.

How would you define theorem-like environments so that: (1) theorems are set in italics with italic correction and (2) proof endmarks occur directly after text?

share|improve this question
    
@user4483: You should split your question/answer and add a separate answer. (A suggestion: Change your username to something more telling than "user4483".) –  lockstep Apr 28 '11 at 18:38
    
@lockstep: OK. Hadn't bothered to edit the question yet because no one seemed interested in it. Didn't know you could change your username... I'll look into to eventually. –  Audrey Apr 28 '11 at 19:21

2 Answers 2

Here's a solution that uses mathtools and ntheorem, though I would like to see what would be possible with amsthm. No guarantees this will work when proofs end with a numbered equation, though.

\documentclass{article}
\usepackage{mathtools}
\usepackage{amssymb,amsmath}
\usepackage[amsmath,thmmarks]{ntheorem}

\makeatletter
\gdef\endtrivlist{%
    \@endtrivlist{\PotEndMark{\unskip\nobreak\hskip\labelsep\nobreak}}}
\gdef\@endtheorem{%
    \expandafter
    \ifx\csname\InTheoType Symbol\endcsname\@empty\setendmarkfalse\fi
    \@endtrivlist{\ifsetendmark
        \unskip\nobreak\hskip\labelsep\nobreak\csname\InTheoType Symbol\endcsname
        \setendmarkfalse \fi}%
    \ifsetendmark\OrganizeTheoremSymbol\else\global\setendmarktrue\fi
    \csname\InTheoType @postwork\endcsname}
\makeatother

\qedsymbol{\ensuremath{\blacksquare}}
\theoremstyle{plain}
\theoremsymbol{}
\theoremheaderfont{\scshape}
\theorembodyfont{\itshape\mathtoolsset{mathic=true}}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\theoremheaderfont{\itshape}
\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremsymbol{\the\qedsymbol}
\newtheorem{proof}{Proof}

\begin{document}
\section{Section}
\begin{lemma}
    If \(U\) or \(V\) then...
    \begin{proof}
        The Proof.
    \end{proof}
\end{lemma}
\begin{theorem}
    If \(U\) or \(V\) then...
    \begin{proof}
        The Proof
        \begin{equation*}
            Ax = b.
        \end{equation*}
    \end{proof}
\end{theorem}
\end{document}

enter image description here enter image description here

share|improve this answer

Based on Audrey's answer, I came up with this workaround using amsthm:

\documentclass{article}

\usepackage{amsthm}
\usepackage{amssymb,amsmath}
\newtheorem{mytheorem}{Theorem}[section]

\begin{document}

\section{Hello World}

\begin{mytheorem}
If \(U\) or \(V\) then...

\begin{proof}[Proof]
\renewcommand{\qedsymbol}{}
The Proof. $\square$
\end{proof}
\end{mytheorem}

\begin{mytheorem}
If \(U\) or \(V\) then...

\begin{proof}[Proof]
The Proof
        \begin{equation*}
            Ax = b.
        \end{equation*}
\end{proof}

\end{mytheorem}

\end{document}

Possibly not the most elegant way. The output:

Sample output

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.