This seems like it should be the most basic question, but I can't find a comprehensible answer on the site, I'm afraid. I'm trying to define a definition environment that 1) replaces the default period by a colon 2) allows for an optional argument with a parenthetical statement of the term being defined. I've constructed code that does this, but it's really hideously kludgy. Would somebody mind telling me how to do the same thing in an elegant and robust way? Thanks for any suggestions.
Here's my awful code:
\documentclass{amsart}
\usepackage{amsthm}
\usepackage{xpatch}
\theoremstyle{myStyle}
\newtheoremstyle{myStyle}% name
{3pt}% space above
{3pt}% space below
{italic}% body font
{}% indent amount
{bold}% theorem head font
{:}% punctuation after theorem head
{.5em}% space after theorem head
{}% theorem head spec
%Get rid of the default period after Defn
\makeatletter
\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}
\makeatother
\newtheorem{definition}{Defn}
\newenvironment{myDefn}[3]
{
\label{defn:#1}
\begin{definition}{{\bf{(#2):}}}
{#3}
\end{definition}}
{}
\newtheorem{definitionAlt}{Defn}
\newenvironment{myDefnAlt}[2]
{
\setcounter{definitionAlt}{\thedefinition}
\label{defn:#1}
\begin{definitionAlt}{{\hspace*{-0.1in} \bf :}}
{#2}
\end{definitionAlt}}
{\setcounter{definition}{\thedefinitionAlt}}
\begin{document}
\begin{myDefn}
{myLabel}
{Dog}
{A dog is something that you take for a walk}
\end{myDefn}
\begin{myDefnAlt}
{myLabelAlt}
{A dog is something that you take for a walk}
\end{myDefnAlt}
\begin{myDefn}
{myLabel}
{Dog}
{A dog is something that you take for a walk}
\end{myDefn}
\begin{myDefnAlt}
{myLabelAlt}
{A dog is something that you take for a walk}
\end{myDefnAlt}
\end{document}