# Changing the format of numbering definition?

I want to appear statement "Def 1.1.1-" instead of "Def 1.1.1." I use Texlive 2017 and the following codes:

 \documentclass{report}
\usepackage{amsthm}
%\usepackage{hyperref}
\makeatletter
\def\@thm#1#2#3{%
\ifhmode\unskip\unskip\par\fi
\normalfont
\trivlist
\let\thm@swap\@gobble
\thm@notefont{\fontseries\mddefault\upshape}%
\thm@space@setup
#1% style overrides
\@topsep \thm@preskip
\def\@tempa{#2}\ifx\@empty\@tempa
\def\@tempa{\@oparg{\@begintheorem{#3}{}}[]}%
\else
\refstepcounter{#2}%
\def\@tempa{\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]}%
\fi
\@tempa
}
\makeatother
\theoremstyle{definition}
\newtheorem{definition}{ِDef}[section]
\begin{document}
\chapter{TEST}
\section{Introduction}
\begin{definition}
content...
\end{definition}
\end{document}


But when I use hyperref package, output is "Def 1.1.1." Can you help me?

• The trailing - looks awkward, in my point of view – user31729 Dec 7 '17 at 7:03
• Since you're loading the amsthm package, would you want to create a solution that makes use of this package's machinery? – Mico Dec 7 '17 at 7:32

I suggest to use a special theorem style rather than explicitly changing \@thm which is the base macro for all theorems definitions, meaning any theorem will have the same settings unless explicitly changed with \theoremstyle later on.

Change the spacings at will, the given 3pt values are just the usual values from the amsthm manual.

I find the trailing - at the end of the theorem number weird, however, but this is my opinion only.

\documentclass{report}

\usepackage{amsthm}
\usepackage{hyperref}

\newtheoremstyle{dashed}{3pt}{3pt}{\fontseries\mddefault\upshape}{}{\bfseries\itshape}{-}{3pt}{}

\theoremstyle{dashed}
\newtheorem{definition}{ِDef}[section]

\begin{document}
\chapter{TEST}
\section{Introduction}
\begin{definition}
content...
\end{definition}
\end{document}


Here's a solution for users of the ntheorem package.

\documentclass{report}
\usepackage{amsmath}
\usepackage[amsmath]{ntheorem}

\theoremstyle{plain}
\theoremseparator{-}
\theorembodyfont{\upshape}
\newtheorem{definition}{ِDef}[section]
\crefname{definition}{definition}{definitions}

\begin{document}
\setcounter{chapter}{1} % just for this example
\setcounter{section}{1}

\begin{definition} \label{def:dash}
content...
\end{definition}
A cross-reference to \cref{def:dash}.
\end{document}