I have a custom style for definitions, but I'd like to customize the heading every time:

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[
spaceabove=\topsep,
spacebelow=\topsep,
bodyfont=\normalfont,
numbered=no,
]{defsty}
\declaretheorem[style=defsty]{defn}

\documentclass{article}
\begin{document}
\begin{defn}[Open set]
Open set definition here.
\end{defn}
\end{document}


The above code should result in
Open set. Open set definition here.

Defn (Open set). Open set definition here.

I tried to pass a custom name argument to the defn environment, but it does not work:

\begin{defn}[name=Open set]
...
\end{defn}


The thing is, I have many definitions, so I cannot declare a theorem for every one of them.

Here is a solution. Note it would be simpler to do with ntheorem as it defines an empty theorem style, which has only an optional argument.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[showframe]{geometry}

\declaretheoremstyle[
spaceabove=\topsep,
spacebelow=\topsep,
name=\hspace*{-\fontdimen2\font},
notefont=\bfseries,
notebraces={}{},
bodyfont=\normalfont,
numbered=no,
]{defsty}
\declaretheorem[style=defsty]{defn}

\begin{document}

\begin{defn}[Open set]
Open set definition here.
\end{defn}

\end{document}


With the ntheorem package in the place of amsthm, the preamble should only contain these lines (theoremtools would be unnecessary for this problem):
• Works perfectly, thanks! If I understand correctly, you've set name to be a single space? I've got a question, what does \font do? I get the warning: Don't use "\font" in Latex documents. However, if I replace it with \normalfont it fails with missing font identifier. Apr 17 '16 at 10:13
• I didn't add a single space: I deleted the interword space (\fontdimen 2\font) that amsthm/thmtools insert, for some reason, at the beginning of the line when there is no theorem name. I have no such warning on my system. \font is the identifier for the current font, and I don't know how to do without it. Apr 17 '16 at 10:22