# Subsections for theorems

\documentclass[14pt]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\newtheorem{thm}{Theorem}[section]
\newtheorem{defn}[thm]{Definition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\begin{document}
\section{Sample}

\begin{thm}\label{mmm}
qwerty
\end{thm}

\begin{defn}
\label{ppp}
qwerty
\end{defn}

Theorem \ref{mmm}

\end{document}

1. When implementing this code into LaTeX, my theorem and definition comes out as Theorem 1.1. and Definition 1.2. How can I remove the . at the end? So it would come out as Theorem 1.1 and Definition 1.2?

2. Theorem \ref{mmm} would correctly as Theorem 1.1, but is there a way that would enable me to not have the need to type Theorem before the \ref{mmm}? I.E. I don't need to type theorem every time I want to reference to a theorem.

-
For the second question: Define your own command something like \newcommand{\thmref}[1]{Theorem~\ref{#1}} in the preamble of your document. Use as \thmref{mmm_tasty_theorem} –  percusse Dec 7 '11 at 4:08
thanks, is that a standard thing to do in a thesis or do people just type out theorem? –  Thomas Dec 7 '11 at 4:12
Well, they are simply equivalent so I can't see how it can make a difference in a thesis context. (I wrote two theses with it) Maybe I don't get your question properly. –  percusse Dec 7 '11 at 4:14
Thanks, its ok, you've answered my question. –  Thomas Dec 7 '11 at 4:19
@David: cleveref defines \crefname and \Crefname so you can use \cref and \Cref in order to capitalize the first letter of the object. In my answer I only defined \crefname since typically one would use Theorem ?? regardless of whether it follows a period (end-of-sentence) or not. –  Werner Dec 7 '11 at 7:28

In answer to your first question, this is the default behaviour for the plain theorem style in amsthm. In order to remove this, define your own theorem style, say mytheorem using \newtheoremstyle:

\documentclass{article}
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
\newtheoremstyle{mytheorem}% <name>
{\topsep}% <space above>
{\topsep}% <space below>
{\itshape}% <body font>
{}% <indent amount>
\theoremstyle{mytheorem}% choose style
\newtheorem{thm}{Theorem}[section]
\newtheorem{defn}[thm]{Definition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\begin{document}
\section{Sample}

\begin{thm}\label{mmm}
qwerty
\end{thm}

\begin{defn}
\label{ppp}
qwerty
\end{defn}

Theorem \ref{mmm}

\end{document}


The punctuation is given as the seventh parameter to \newtheoremstyle. For the (default) plain style, this is .. Also, plain has \topsep as the "above" and "below" space.

In answer to your second question, the cleveref package provides an easy work-around. You define the reference name associated with that particular reference using \crefname{<style>}{<singular>}{<plural>}, where <style> is your defined theorem thm:

\documentclass{article}
\usepackage{cleveref}% http://ctan.org/pkg/cleveref
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
\newtheoremstyle{mytheorem}% <name>
{\topsep}% <space above>
{\topsep}% <space below>
{\itshape}% <body font>
{}% <indent amount>
\theoremstyle{mytheorem}% choose style
\newtheorem{thm}{Theorem}[section] \crefname{thm}{Theorem}{Theorems}
\newtheorem{defn}[thm]{Definition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\begin{document}
\section{Sample}

\begin{thm}\label{mmm}
qwerty
\end{thm}

\begin{defn}
\label{ppp}
qwerty
\end{defn}

Theorem \ref{mmm}, or \cref{mmm}.

\end{document}


The above example combines a solution to both problems.

-
The plain style uses \topsep for "space above" and "space below". –  Gonzalo Medina Dec 7 '11 at 5:01
@GonzaloMedina: Thanks. It wasn't meant to be exactly duplicate, but I changed it anyways. –  Werner Dec 7 '11 at 5:10
Thanks so much Werner, most appreciated! –  Thomas Dec 7 '11 at 23:13