How to achieve this theorem style (a very common one)
definitionnewtheoremtheorems
Consider:
How can I achieve this style for definitions, theorems, …? I only know the standard or "plain" style (bold for header, italics for body) for theorem-like environments.
Best Answer
Here's a solution that employs the machinery of the amsthm package to create a new theorem style called (why not?) descrates.
\documentclass{article}
\usepackage[T1]{fontenc}
\setlength\textwidth{11cm} % just for this example
\usepackage{amsthm}
%% See p. 9 of the user guide of the 'amsthm' package
%% for the "\newtheoremstyle" macro:
\newtheoremstyle{descrates}
{3pt}% Space above
{3pt}% Space below
{}% Body font
{}% Indent amount
{\scshape}% Theorem head font % <-- small caps
{.}% Punctuation after theorem head
{.5em}% Space after theorem headi
{}% Theorem head spec (can be left empty, meaning `normal' )
\theoremstyle{descrates} % switch to the newly create style
\newtheorem{defn}{Definition}[section]
\begin{document}
\setcounter{section}{1} % just for this example
\setcounter{defn}{32}
\begin{defn}
A topological space is said to be \textbf{Lindelöf} if
every open cover has a \textsl{countable} subcover.
\end{defn}
\end{document}
Addendum: If one were to use the ntheorem package rather than the amsthm package, one would need to replace the \usepackage{amsthm} and \newtheoremstyle directives in the code above with the following code:
This might be the theorem scheme that you're after, called mytheorem:
\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
\makeatletter
\newtheoremstyle{mytheorem}% <name>
{3pt}% <Space above>
{3pt}% <Space below>
{\itshape}% <Body font>
{}% <Indent amount>
{\itshape\bfseries}% <Theorem head font>
{.}% <Punctuation after theorem head>
{.5em}% <Space after theorem heading>
{\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }#2}%
\thmnote{ {\the\thm@notefont(#3)}}}% <Theorem head spec (can be left empty, meaning `normal')>
\makeatother
\theoremstyle{mytheorem}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}\lipsum[1]\end{theorem}
\end{document}
The key here is to include a theorem head specification (argument #9) in order to reformat the theorem number from \textup (or \@upn) to plain. Here's the default definition of the theorem head specification (associated with the plain style):
Best Answer
Here's a solution that employs the machinery of the
amsthm
package to create a new theorem style called (why not?)descrates
.Addendum: If one were to use the
ntheorem
package rather than theamsthm
package, one would need to replace the\usepackage{amsthm}
and\newtheoremstyle
directives in the code above with the following code: