8

I'm using the \newtheoremstyle{name} command to generate a specific theorem head spec in the form of:

{\thmname{#1}\thmnumber{ #2}.\thmnote{ #3}}

where #1 is Theorem, #2 is 'the theorem number', and #3 is 'my theorem name'.

However, when I don't use 'my theorem name' as in some cases, the output gives two dots (the one after \thmnumber, and the one after the thm head).

How can I avoid this? I mean, how to avoid the extra dot in case of a theorem with no name?

1
  • @: Welcome to tex.sx! A tip: you can use backticks ` to mark your inline code as I did in my edit. Commented Feb 25, 2011 at 14:43

1 Answer 1

8

Move the dot into the argument of \thmnote.

Full example:

\documentclass{article}
\usepackage{amsthm}
\newtheoremstyle{mystyle}
  {3pt}{3pt}{\itshape}{}{\bfseries}{.}{.5em}
  {\thmname{#1}\thmnumber{ #2}\thmnote{. #3}}
\theoremstyle{mystyle}
\newtheorem{thm}{Theorem}
\begin{document}

\begin{thm}[name]
text
\end{thm}

\begin{thm}
text
\end{thm}

\end{document}
1
  • thanks a lot! it was trivial but I didn't see it!
    – Paul
    Commented Feb 25, 2011 at 15:19

You must log in to answer this question.

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