Within my thesis I am attempting to number the studies listed throughout.
I have used a custom theorem style for this:
\newtheorem{study}{Study}
First Issue
I then want to use this within my section headings, so that a section heading will look something like 5.2 Study 1. This is a test
To achieve this, I am using the following code
\section[This is a test]{\protect\begin{study}This is a test\protect\end{study}}
This is both messy, and means that the Study number does not show up in my ToC. Is there a better way to include a theorem in a section heading?
Second Issue
The theorem class puts breaks above and below the study, meaning the formatting of the heading has a line break after the section number, like so:
5.2
Study 1. This is a test
I have attempted to fix this by altering the theoremstyle, but has not worked. I want it to stop linebreaking, and to bold the text after Study 1. The code I am using to attempt that is below
\newtheoremstyle{study2}
{0} % Space above
{0} % Space below
{} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{:} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{study2} \newtheorem{study}{Study}
How can I remove this line break, and how can I make the whole section heading bold?
Thank you very much in advance for any advice you can give.
Working Example
\documentclass{report}
\usepackage{amsthm}
\newtheoremstyle{study2}
{0} % Space above
{0} % Space below
{} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{:} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{study2} \newtheorem{study}{Study}
\begin{document}
\section[This is a test]{\protect\begin{study}This is a test\protect\end{study}}
\end{document}
Desired Outcome Mock-up
SOLUTION
I have ended up using the following code:
\newenvironment{study}
{\enskip\refstepcounter{studyish}\textbf{Study~\thestudyish:\space}}% \begin{shortthm}
{\enskip}% \end{shortthm}
\makeatother
\newtheorem{studyish}{Study}
This fixes the line breaking problem. And allows for the Study number to be listed in the ToC. The new section headings look like this:
\section{\protect\begin{study}\label{study:FirstStudy}This is a test\protect\end{study}}
study
s are used as section headings, and if you are usingamsthm
you can use\swapnumbers
and use[section]
as the controlling counter:\swapnumbers \newtheorem[section]{study}{Study}
. or if only some of them are at the section level, you could define a second version, saysecstudy
and tinker with counters to keep them in synch.