Math & Sciencentheorem and the list of theorems

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
polymorphisme
Posts: 1
Joined: Wed Sep 05, 2018 1:52 pm

ntheorem and the list of theorems

Post by polymorphisme »

Hello,

I'm trying to use the package ntheorem. I want display the list of the theorem.

Code: Select all

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[standard,thref,hyperref]{ntheorem}
\usepackage{thmtools}

\renewcommand*{\listtheoremname}{Liste des théorèmes}

\begin{document}

\section{Introduction}

\begin{theorem}
Let $f$ be a function whose derivative exists in every point, then $f$ is 
a continuous function.
\end{theorem}

\begin{theorem}[Pythagorean theorem]
This is a theorema about right triangles and can be summarised in the next 
equation \[ x^2 + y^2 = z^2 \]
\end{theorem}

\begin{corollary}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{corollary}

\listtheoremname
\theoremlisttype{allname}
\listtheorems{all}

\end{document}
I obtain juste a simple line as list of theorem :

Liste des théorèmes theoremTheorem2Pythagorean theorem1 lemmaLemma11

I'm looking for how to obtain a real list of theorem.
Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
deimi
Posts: 1
Joined: Fri Sep 14, 2018 1:17 pm

ntheorem and the list of theorems

Post by deimi »

please load hyperref package and replace \listtheorems{all} with \listtheorems{corollary,theorem}. Compile few times.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10311
Joined: Mon Mar 10, 2008 9:44 pm

ntheorem and the list of theorems

Post by Stefan Kottwitz »

Hi deimi,

welcome to the forum!

Indeed, ntheorem doesn't load hyperref implicitly even though the option hyperref was used. Very good catch! I didn't notice that. Indeed it then compiles fine.

Instead of just outputting \listtheoremname, using a \section command would be good, to have a proper heading.

With your advice, the code can be this way:

Code: Select all

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[hidelinks]{hyperref}
\usepackage[standard,thref,hyperref]{ntheorem}
\usepackage{thmtools}
\renewcommand*{\listtheoremname}{Liste des théorèmes}
\begin{document}
\section{Introduction}
 
\begin{theorem}
Let $f$ be a function whose derivative exists in every point, then $f$ is 
a continuous function.
\end{theorem}
 
\begin{theorem}[Pythagorean theorem]
This is a theorema about right triangles and can be summarised in the next 
equation \[ x^2 + y^2 = z^2 \]
\end{theorem}
 
\begin{corollary}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{corollary}

\section*{\listtheoremname}
\theoremlisttype{allname}
\listtheorems{corollary,theorem}
 \end{document}
theorem-list.png
theorem-list.png (39.63 KiB) Viewed 5367 times
Stefan
LaTeX.org admin
Post Reply