Looking at the wikibooks article on theorems has me wondering... I'd like to do something, if possible, similar to the default "proof" theorem style, whereby I can add a custom name to each theorem as I go along..

Eample: In the wikibooks here, it says that if I use the following code, I get the opportunity to name the proof:

\begin{proof}[Proof of important theorem]
    Here is my important proof

If I were to leave out the [proof of important theorem], it would just say "Proof:" instead.

I'd like to make it possible to define a definition theorem that always says "Definition #", but I can optionally add a name to it so it may say something like "Definition 3.1 - The answer of the universe and everything", followed by the definition in question.

Right now, this is all I have. I don't know much about TeX yet as I'm just learning it now.

\newtheoremstyle{definitionstyle} % name of the style to be used
  {10mm}        % measure of space to leave above the theorem. E.g.: 3pt
  {10mm}        % measure of space to leave below the theorem. E.g.: 3pt
  {}            % name of font to use in the body of the theorem
  {}            % measure of space to indent
  {\bfseries}   % name of head font
  {\newline}    % punctuation between head and body
  {10mm}        % space after theorem head
  {}            % Manually specify head

1 Answer 1


All theorem environments support an optional argument for a theorem's name or a note. In the following example, I use the thmtools package to format the note. (The amsthm package still provides some underlying functionality, but I prefer thmtools' key-value-syntax.)



  notebraces={--~}{},% punctuation before and after the note




\begin{mydef}[The answer of the universe and everything]


enter image description here

  • Interesting. What's the difference between \newtheorem and \declaretheorem?
    – Mirrana
    Nov 20, 2012 at 21:48
  • @agent154 \declaretheorem is the main thmtools command; it uses a syntax different from that of \newtheorem.
    – lockstep
    Nov 21, 2012 at 23:19

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.