6

I want to display a theorem title, it is simple:

\begin{theorem}[Name]

I get

Theorem 4.5 (Name).

but I don't like the dot at the end. I want it to look like this:

Theorem 4.5. (Name)

Can you help me with that?

1
  • 1
    Welcome to TeX.SE! It would be best if you could provide a MWE in particular, please include the packages you use to create your theorems (amsthm?, thmtools? ntheorem? other?). Welcome!
    – cmhughes
    Commented Oct 27, 2012 at 18:04

1 Answer 1

7

The amsthm package allows you to define custom theorem styles, with custom heading specifications. To get the formatting you desire, you can define a new style, say custom, and then declare a theorem environment using that style. Here's an example:

\documentclass{article}
\usepackage{amsthm}

% Create a `custom` theorem style.
\newtheoremstyle{custom}
  {\topsep}   % Space above
  {\topsep}   % Space below
  {\itshape}  % Body font
  {0pt}       % Indent amount (empty value is the same as 0pt)
  {\bfseries} % Theorem head font
  {}          % Punctuation after theorem head
  {5pt plus 1pt minus 1pt} % Space after theorem head
  {\thmname{#1}\thmnumber{ #2}.\thmnote{ (#3)}} % Theorem head spec

% Create a `theorem` environment using the `custom` style.
\theoremstyle{custom}
\newtheorem{theorem}{Theorem}

\begin{document}

\begin{theorem}[Name]
This is the new theorem environment.
\end{theorem}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .