1

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.

Instead the result is
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.

2

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} 

enter image description here

Added:

With the ntheorem package in the place of amsthm, the preamble should only contain these lines (theoremtools would be unnecessary for this problem):

\usepackage[amsmath, thref, thmmarks]{ntheorem} \theoremstyle{empty} \theorembodyfont{\normalfont} \newtheorem{defn}{}

2
  • 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.
    – rubik
    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.
    – Bernard
    Apr 17 '16 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.