Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using the amsthm package. I defined some enviroments like

\theoremstyle{plain}
\newtheorem{theo}[subsection]{Theorem}
\newtheorem{satz}[subsection]{Satz}

the numbering works as expectect, counting the theorems as if they where subsections. However I also want them to appeare in the table of contend as if they where subsections.

UPDATE

To be more precise, say I have the fwollowing document:

\begin{document}
\tableofcontents

\chapter{Chapter One}

\section{Section A}
\begin{theo}[First Theorem]
Whatever.
\end{theo}

\section{Section B}
\begin{theo}[Second Theorem]
Whatever.
\end{theo}

\chapter{Chapter Two}

\section{Section A} 
\begin{theo}[Third Theorem]
Whatever.
\end{theo}

\begin{theo}[Fourth Theorem]
Whatever.
\end{theo}
\end{document}

I want my Table of content to look like this

1. Chapter One
    1.1 Section A
        1.1.1 First Theorem
    1.2 Section B
        1.2.1 Second Theorem
2. Chapter Two
    2.1 Section A
        2.1.1 Third Theorem
        2.1.2 Fourth Theorem
share|improve this question
    
Do you want the theorem headers themselves to subsections (in which case they'll automatically show up in the table of contents at the subsection level), or do you just want to be able to create a list of all theorems and theorem-like environments for the table of contents, with all theorems numbered the way they are in the body of the document? Please elaborate. –  Mico Jun 22 '12 at 18:30
    
@Mico: I have added an example of how I want it. –  Haatschii Jun 22 '12 at 18:41
    
In that case, why not just (i) issue commands such as \subsubsection{First Theorem} through \subsubsection{Fourth Theorem} and (ii) surround each theorem's actual expression with {\em and }? –  Mico Jun 22 '12 at 18:47
    
Here is another solution: golatex.de/… –  canaaerus Jun 22 '12 at 19:05
2  
this is the first time i remember seeing a request that theorems be listed in the toc. i have seen theorems entered as (sub)sections, with the text set as `\emph{...}. –  barbara beeton Jun 22 '12 at 19:17

2 Answers 2

up vote 3 down vote accepted

You can incorporate the writing in the .toc file by defining an auxiliary environment; I use xparse because it makes easy to cope with the presence of an optional argument.

\documentclass{article}

\usepackage{amsthm,xparse}

\usepackage{lipsum}

\theoremstyle{plain}
\newtheorem{theoaux}[subsection]{Theorem}

\NewDocumentEnvironment{theo}{o}
 {\IfNoValueTF{#1}
   {\theoaux\addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection}Theorem}}
   {\theoaux[#1]\addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection}Theorem (#1)}}%
   \ignorespaces}
 {\endtheoaux}

\begin{document}

\tableofcontents

\section{A section}

\lipsum[1]

\subsection{A subsection}

\lipsum[2]

\subsection{A subsection}

\lipsum[3-4]

\begin{theo}\label{theo1}
$0=0$
\end{theo}

\section{Sec 2}

\lipsum[4]

\begin{theo}[B. C. Dull]\label{theo2}
$1>0$
\end{theo}

\end{document}
share|improve this answer

Try this:

\documentclass{report}

\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{theo}[subsection]{Theorem}
\newtheorem{satz}[subsection]{Satz}

\newcommand{\counttosubsec}{\arabic{chapter}.\arabic{section}.\arabic{subsection}}
\newcommand{\addtheocontentsline}[1]{\addcontentsline{toc}{subsection}{\counttosubsec \quad Theorem~\ref{#1}}}
\newcommand{\addsatzcontentsline}[1]{\addcontentsline{toc}{subsection}{\counttosubsec \quad Satz~\ref{#1}}}

\begin{document}

\tableofcontents
\clearpage

\section{Sec 1}

\addtheocontentsline{theo1}
\begin{theo}\label{theo1}
Something
\end{theo}

\section{Sec 2}

\addsatzcontentsline{satz1}
\begin{satz}\label{satz1}
Something else
\end{satz}

\end{document}
share|improve this answer
    
Thanks, this could be a work around. However I think there should be a better way, that does not require me to add one extra line before each theorem? :( Another big drawback is, that the names of the theorems will not show up in the TOC... –  Haatschii Jun 22 '12 at 18:51
    
@Haatschii I've edited my answer to give the formatting that you want and to simplify the "extra line" before each theorem, but this approach still needs the extra line. –  Andrew Uzzell Jun 22 '12 at 19:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.