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 am trying to modify some of the theorem environments defined in ntheorem. I wanted the definitions in my document to be boxed the way in which ntheorem does for the framed theorem classes which they define by:

\theoremclass{Theorem}
\theoremstyle{break}
\newframedtheorem{importantTheorem}[Theorem]{Theorem}

and so I modified the above code to the following:

\theoremclass{Theorem}
\theoremstyle{break}
\newframedtheorem{defn}[Theorem]{Definition}

then in my document called up an instance of a definition by:

\begin{defn}[Logical Equivalance] Two propositions are said to be logically equivalent iff ...
\end{defn}

Now, I wish to modify their shaded theorem environment which is coded as follows:

\theoremclass{Theorem}
\theoremstyle{break}
\newshadedtheorem{moreImportantTheorem}[Theorem]{Theorem}

I tried the following:

\theoremclass{Theorem}
\theoremstyle{break}
\newshadedtheorem{prop}[Theorem]{Proposition}

but keep getting the error:

Undefined control sequence: begin{prop}

Can anyone help me with this?

\documentclass[10pt,a4paper]{article}

\usepackage[left=2.50cm,right=2.50cm,top=2.50cm,bottom=2.75cm]{geometry}
\usepackage{amsmath,amssymb,amscd,amstext,amsbsy,array,color,epsfig}
\usepackage{fancyhdr,framed,latexsym,multicol,pstricks,slashed,xcolor}
\usepackage[amsmath,framed,thmmarks]{ntheorem}


\begin{document}

\theoremstyle{marginbreak}
\theoremheaderfont{\bfseries\scshape}
\theorembodyfont{\slshape}
\theoremsymbol{\ensuremath{\star}}
\theoremseparator{:}
\newtheorem{axm}{Axiom}[section]

\theoremstyle{marginbreak}
\theoremheaderfont{\bfseries\scshape}
\theorembodyfont{\slshape}
\theoremsymbol{\ensuremath{\diamondsuit}}
\theoremseparator{:}
\newtheorem{Theorem}{Theorem}[section]

\theoremclass{Theorem}
\theoremstyle{break}
\newshadedtheorem{prop}[Theorem]{Proposition}

\theoremstyle{changebreak}
\theoremsymbol{\ensuremath{\heartsuit}}
\theoremindent0.5cm
\theoremnumbering{greek}
\newtheorem{lem}{Lemma}[section]

\theoremindent0cm
\theoremsymbol{\ensuremath{\spadesuit}}
\theoremnumbering{arabic}
\newtheorem{cor}[Theorem]{Corollary}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\bullet}}
\theoremseparator{}
\newtheorem{exm}{Example}

\theoremclass{Theorem}
\theoremstyle{plain}
\theoremsymbol{\ensuremath{\clubsuit}}
\newframedtheorem{defn}[Theorem]{Definition}

\theoremheaderfont{\sc}
\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremseparator{.}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Proof}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\ast}}
\theoremseparator{.}
\newtheorem{rem}{Remark}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\newtheorem{exc}{Exercise}[section]


\begin{defn}[Logical Equivalance] Two propositions are said to be logically equivalent iff ...
\end{defn}  

\begin{prop}
Let $P$ and $Q$ be propositions. Then ...
\end{prop}

\end{document}

Thanks!!!

I am now added more "theorem"-like enviornments and am getting even more errors and would ask that some one please help me use mdframed to fix the problem if that is possible. Here is a current and up-to-date mwe:

\documentclass[a4paper,12pt,twoside]{book}

\usepackage[left=2.50cm,right=2.50cm,top=2.50cm,bottom=2.75cm]{geometry}
\usepackage{amsmath,amssymb,amscd,amsbsy,array,color,epsfig}
\usepackage{fancyhdr,framed,latexsym,multicol,pstricks,slashed,xcolor}
\usepackage{picture}
\usepackage{indentfirst}
\usepackage{enumitem}

\usepackage{tikz}
\usepackage{subfig}
\usetikzlibrary{calc,positioning,shapes.geometric}

\setenumerate[1]{label=(\alph*)}

\usepackage[amsmath,framed,thmmarks]{ntheorem}

\newtheorem{Theorem}{Thm}
\theoremclass{Theorem}
\theoremstyle{break}
\shadecolor{blue}
\newshadedtheorem{them}[Theorem]{Theorem}

\theoremclass{Theorem}
\theoremstyle{break}
\shadecolor{gray}
\newshadedtheorem{prop}{Proposition}[section]

\theoremclass{Theorem}
\theoremstyle{plain}
\newframedtheorem{lema}[Theorem]{Lemma}

\theoremclass{Theorem}
\theoremstyle{plain}
\newframedtheorem{coro}[Theorem]{Corollary}

\theoremstyle{plain}
\theoremsymbol{\ensuremath{\blacktriangle}}
\theoremseparator{.}
\theoremprework{\bigskip\hrule}
\theorempostwork{\hrule\bigskip}
\newtheorem{defn}{Definition}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\bullet}}
\theoremseparator{}
\newtheorem{exam}{Example}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\bullet}}
\newtheorem{exer}{Exercise}[section]

\theoremheaderfont{\sc}
\theorembodyfont{\color{blue}\bfseries\boldmath}
\theoremstyle{nonumberplain}
\theoremseparator{.}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Proof}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\bigstar}}
\theoremseparator{.}
\newtheorem{remk}{Remark}


\def    \all    {\forall}
\def    \ex     {\exists}
\def    \imp    {\Rightarrow}
\def    \limp   {\Leftarrow}
\def    \iff    {\Longleftrightarrow}
\def    \contra {\rightarrow\negmedspace\leftarrow}
\def    \es     {\emptyset}
\def    \st     {\backepsilon}



\def    \bn{\mathbb N}
\def    \bz{\mathbb Z}
\def    \bq{\mathbb Q}
\def    \br{\mathbb R}
\def    \bc{\mathbb C}
\def    \bp{\mathbb P}
\def    \bt{\mathbb T}



\begin{defn}[Statement/Proposition]
Declarative sentences or strings of symbols in mathematics which can be said     to have \textit{exactly} one \textit{truth value}, that is, are either true (denoted T), or false (denoted F), are known as \textbf{statements} or \textbf{propositions}.
\end{defn}

\begin{exam}
Hence, the truth value of the negation of a proposition is \textit{merely} the opposite of the truth value of said proposition. Hence, the truth value of the proposition '$7$ is divisible by $2$' is the proposition 'It is not the case that $7$ is not divisible by $2$' or '$7$ is not divisible by $2$' (both of which are true).
\end{exam}

\begin{prop}
Let $P$ and $Q$ be propositions. Then:
\begin{enumerate}
    \item $P \imp Q \equiv (\neg Q) \imp (\neg P).$
    \item $P \imp Q  \not \equiv Q \imp P.$
\end{enumerate}
\end{prop}

\begin{prop}
Let $P,Q,$ and $R$ be propositions. Then:
    \begin{enumerate}
        \item $P \imp Q \equiv (\neg P) \vee (Q).$
        \item $P \iff Q \equiv (P \imp Q) \wedge (Q \imp P).$
        \item $\neg(P \imp Q) \equiv (P) \wedge (\neg Q).$
        \item $\neg(P \wedge Q) \equiv (P) \imp (\neg Q) \equiv (Q) \imp (\neg P).$
        \item $P \imp (Q \imp R) \equiv (P \wedge Q) \imp R.$
        \item $P \imp (Q \vee R) \equiv (P \imp Q) \wedge (P \imp R).$ 
        \item $(P \vee Q) \imp R \equiv (P \imp R) \wedge (Q \imp R).$
    \end{enumerate}
\end{prop}

\begin{proof}
The proof for the above proposition is left to the reader. All of the above statements may be proved using truth tables.
\end{proof}

\begin{axm}[Field Axioms of $\br$]
On the set $\br$ of real numbers, there are two binary operations, denoted by $\pmb{+}$ and $\pmb{\cdot}$ and called \textbf{addition} and \textbf{multiplication} respectively. These operations satisfy the following properties:
\begin{itemize}
    \item[$A_0$] $x,y \in \br \imp x+y \in \br \q \all \, x,y \in \br$. [additive closure]
    \item[$A_1$] $x+y=y+x \q \all \, x,y \in \br$. [additive commutativity]
    \item[$A_2$] $(x+y)+z=x+(y+z) \q \all \, x,y,z \in \br$. [additive associativity]
    \item[$A_3$] There is a unique $0 \in \br \text{ such that } 0+x=x=x+0 \q \all \, x \in \br$. [existence of an additive identity]
    \item[$A_4$] There is a unique $-x \in \br \text{ such that } x+(-x)=0=(-x)+x \q \all \, x \in \br$. [existence of an additive inverse]
    \item[$M_0$] $x,y \in \br \imp x \cdot y \in \br \q \all \, x,y \in \br$. [multiplicative closure]
    \item[$M_1$] $x \cdot y=y \cdot x \q \all \, x,y \in \br$. [multiplicative commutativity]
    \item[$M_2$] $(x \cdot y) \cdot z=x \cdot (y \cdot z) \q \all \, x,y,z \in \br$. [multiplicative associativity]
    \item[$M_3$] There is a unique $1 \in \br \text{ such that } 1 \cdot x=x=x \cdot 1 \q \all \, x \in \br$. [existence of multiplicative identity]
    \item[$M_4$] There is a unique $\nicefrac{1}{x} \in \br \text{ such that } x \cdot (\nicefrac{1}{x})=1=(\nicefrac{1}{x}) \cdot x \q \all x \in \br$. [existence of multiplicative inverse]
    \item[$AM_1$] $x \cdot (y+z) = (x \cdot y) + (x \cdot z)$ and $(y + z) \cdot x = (y \cdot x) + (z \cdot x)$. [distributivity]
\end{itemize}
\end{axm}


\begin{rem}
The reader should be familiar with all of the aforementioned field properties. We note that all of the `familiar' properties of algebra (those learned in middle school and high school, for example) may be deduced from this list. We now establish the basic fact that both the additive identity, $0$, and the multiplicative identity are in fact unique; and that multiplication by $0$ always results in $0$.
\end{rem}


\end{document}
share|improve this question
    
Please, add a minimal working example; it doesn't matter if it produces the error, but for help us in finding the issue it should start with \documentclass and end with \end{document}. However, the undefined sequence seems to be \psframebox, due to not loading PSTricks. –  egreg Jul 28 '13 at 20:26

1 Answer 1

up vote 2 down vote accepted

You can fix your MWE by adding the line

\newtheorem{Theorem}{Thm}

which is needed for both of your subsequent theorem-like environments, prop and defn.

% arara: latex
% arara: dvips
% arara: ps2pdf
% !arara: indent: {overwrite: yes}
\documentclass[10pt,a4paper]{article}

\usepackage[left=2.50cm,right=2.50cm,top=2.50cm,bottom=2.75cm]{geometry}
\usepackage{amsmath}
\usepackage{pstricks}
\usepackage{framed}
\usepackage[amsmath,framed,thmmarks]{ntheorem}

\newtheorem{Theorem}{Thm}
\theoremclass{Theorem}
\theoremstyle{break}
\newshadedtheorem{prop}[Theorem]{Proposition}

\theoremclass{Theorem}
\theoremstyle{plain}
\theoremsymbol{\ensuremath{\clubsuit}}
\newframedtheorem{defn}[Theorem]{Definition}

\begin{document}

\begin{defn}[Logical Equivalance] 
    Two propositions are said to be logically equivalent iff ...
\end{defn}  

\begin{prop}
    Let $P$ and $Q$ be propositions. Then ...
\end{prop}

\end{document}

Note that this MWE relies upon the pstricks package, so needs to be compiled through the latex->dvips->ps2pdf unless you want to follow the instructions in How to use PSTricks in pdfLaTeX?

For all of your framing needs I would highly recommend the mdframed package, which addresses the many short comings of its competitors.

Here's a version of the previous MWE using the mdframed package; note that this package does not rely upon the pstricks package (in contrast to the previous method). As such, you can (easily) compile this document with pdflatex.

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[10pt,a4paper]{article}

\usepackage[left=2.50cm,right=2.50cm,top=2.50cm,bottom=2.75cm]{geometry}
\usepackage{amsmath}
\usepackage[amsmath,framed,thmmarks]{ntheorem}
\usepackage[ntheorem,xcolor]{mdframed}

\newtheorem{Theorem}{Thm}
\theoremclass{Theorem}
\theoremstyle{break}
\newmdtheoremenv[
outerlinewidth = 2 ,%
roundcorner = 10 pt ,%
leftmargin = 40 ,%
rightmargin = 40 ,%
backgroundcolor=yellow!40,%
outerlinecolor=blue!70!black,%
innertopmargin=\topskip,%
splittopskip = \topskip ,%
ntheorem = true ,%
]{prop}[Theorem]{Proposition}

\theoremstyle{plain}
\theoremsymbol{\ensuremath{\clubsuit}}
%\newframedtheorem{defn}[Theorem]{Definition}
\newmdtheoremenv{defn}[Theorem]{Definition}

\begin{document}

\begin{defn}[Logical Equivalance] 
    Two propositions are said to be logically equivalent iff ...
\end{defn}  

\begin{prop}
    Let $P$ and $Q$ be propositions. Then ...
\end{prop}

\end{document}

Of course, the mdframed package can be told to use pstricks or tikz if you wish, but that is beyond the scope of the question- see the manual for more details.


Update, following the question edit.

With the additional theorem-like environments, this MWE works- note that you can't define a theorem-like environment twice using \newtheorem

% arara: latex
% arara: dvips
% arara: ps2pdf
% !arara: indent: {overwrite: yes}
\documentclass[10pt,a4paper]{article}

\usepackage[left=2.50cm,right=2.50cm,top=2.50cm,bottom=2.75cm]{geometry}
\usepackage{amsmath}
\usepackage{pstricks}
\usepackage{framed}
\usepackage[amsmath,framed,thmmarks]{ntheorem}

\theoremstyle{marginbreak}
\theoremheaderfont{\bfseries\scshape}
\theorembodyfont{\slshape}
\theoremsymbol{\ensuremath{\diamondsuit}}
\theoremseparator{:}
\newtheorem{Theorem}{Theorem}[section]

\theoremclass{Theorem}
\theoremstyle{break}
\newshadedtheorem{prop}[Theorem]{Proposition}

\theoremclass{Theorem}
\theoremstyle{plain}
\theoremsymbol{\ensuremath{\clubsuit}}
\newframedtheorem{defn}[Theorem]{Definition}

\theoremstyle{marginbreak}
\theoremheaderfont{\bfseries\scshape}
\theorembodyfont{\slshape}
\theoremsymbol{\ensuremath{\star}}
\theoremseparator{:}
\newtheorem{axm}{Axiom}[section]

\theoremstyle{changebreak}
\theoremsymbol{\ensuremath{\heartsuit}}
\theoremindent0.5cm
\theoremnumbering{greek}
\newtheorem{lem}{Lemma}[section]

\theoremindent0cm
\theoremsymbol{\ensuremath{\spadesuit}}
\theoremnumbering{arabic}
\newtheorem{cor}[Theorem]{Corollary}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\bullet}}
\theoremseparator{}
\newtheorem{exm}{Example}

\theoremheaderfont{\sc}
\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremseparator{.}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Proof}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\ast}}
\theoremseparator{.}
\newtheorem{rem}{Remark}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\newtheorem{exc}{Exercise}[section]

\begin{document}

\begin{defn}[Logical Equivalance] 
    Two propositions are said to be logically equivalent iff ...
\end{defn}  

\begin{prop}
    Let $P$ and $Q$ be propositions. Then ...
\end{prop}

\end{document}
share|improve this answer
    
I just added my current definitions of theorem-like environments that I use for this document, and when I add \newtheorem{Theorem}{thm} I get the error message: Command \Theorem already defined. –  Michael Dykes Jul 28 '13 at 23:20
    
@MichaelDykes you've added them after your \end{document}. Please make a complete MWE :) –  cmhughes Jul 29 '13 at 7:51
    
I just corrected my mistake. Sorry about that :)- –  Michael Dykes Jul 29 '13 at 9:41
    
@MichaelDykes see my updated answer :) –  cmhughes Jul 29 '13 at 9:48
    
Now, I get the errors: No counter theorem defined for the proposition, and definition environments. –  Michael Dykes Jul 31 '13 at 1:35

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.