LyXList of Theorems

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
waXve
Posts: 2
Joined: Fri Feb 03, 2012 8:31 pm

List of Theorems

Post by waXve »

Hello there,
I use Lyx 2.0.1 on Mac OS and the Theoreme (AMS) package.

My Question:
How can I make a List (like a toc) of Theoremes (and Definitions and...)? For those who want some Code:

Code: Select all

\begin{defn}
Definition...

\end{defn}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

List of Theorems

Post by Stefan Kottwitz »

Hi,

welcome to the board!

You could use the thmtools package. For example:

Code: Select all

\usepackage{thmtools}
\renewcommand{\listoftheoremname}{List of theorems and definitions}
...
\listoftheorems[ignoreall,show={theorem,defn}]
Stefan
LaTeX.org admin
waXve
Posts: 2
Joined: Fri Feb 03, 2012 8:31 pm

List of Theorems

Post by waXve »

Hi Stefan,
thank you for your answer, it might help. But I have a problem with that. I've tried your code, but it didn't work. Than I've read the manuel and it says exactyl the same as you do, so that didn't work too.

I've put

Code: Select all

\usepackage{thmtools}
\renewcommand{\listoftheoremname}{List of theorems and definitions}
in the preamble and

Code: Select all

\listoftheorems[ignoreall,show={theorem,defn}]
in an ERT evironment in LYX.

In the generated PDF it shows me the headline "List of theorems and definitions" and in a new line
[ignoreall,show=theorem,defn]
so this don't work very well.

After that I only put

Code: Select all

\usepackage{thmtools}
in the preamble to test this one, but that didn't work too.

What I've made wrong?

---------------------------------------------------------------------------------------------------------

For your Information: my Preamble:

Code: Select all

% Quellcode vorschauen

%% LyX 2.0.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\synctex=-1
\usepackage{color}
\usepackage{babel}
\usepackage{array}
\usepackage{varioref}
\usepackage{float}
\usepackage{textcomp}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={Mathematik I},
 pdfauthor={Emanuel Schulze Pröbsting}}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
  \text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}

%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
  \theoremstyle{definition}
  \newtheorem{defn}{\protect\definitionname}[section]
  \theoremstyle{definition}
  \newtheorem{example}{\protect\examplename}[section]
  \theoremstyle{remark}
  \newtheorem{rem}{\protect\remarkname}[section]
\newenvironment{lyxlist}[1]
{\begin{list}{}
{\settowidth{\labelwidth}{#1}
 \setlength{\leftmargin}{\labelwidth}
 \addtolength{\leftmargin}{\labelsep}
 \renewcommand{\makelabel}[1]{##1\hfil}}}
{\end{list}}
  \theoremstyle{plain}
  \newtheorem{prop}{\protect\propositionname}[section]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{color}
\definecolor{gray}{gray}{0.5}
\definecolor{darkgreen}{RGB}{0,100,0}
\definecolor{flida}{RGB}{255,0,255}

\usepackage{tikz}

\setlength{\parindent}{0pt}
\setlength{\parskip}{4pt}

\usepackage{lastpage}

\usepackage{thmtools}

\AtBeginDocument{
  \def\labelitemii{\(\bullet\)}
}

\makeatother

  \addto\captionsenglish{\renewcommand{\definitionname}{Definition}}
  \addto\captionsenglish{\renewcommand{\examplename}{Example}}
  \addto\captionsenglish{\renewcommand{\propositionname}{Proposition}}
  \addto\captionsenglish{\renewcommand{\remarkname}{Remark}}
  \addto\captionsngerman{\renewcommand{\definitionname}{Definition}}
  \addto\captionsngerman{\renewcommand{\examplename}{Beispiel}}
  \addto\captionsngerman{\renewcommand{\propositionname}{Satz}}
  \addto\captionsngerman{\renewcommand{\remarkname}{Bemerkung}}
  \providecommand{\definitionname}{Definition}
  \providecommand{\examplename}{Beispiel}
  \providecommand{\propositionname}{Satz}
  \providecommand{\remarkname}{Bemerkung}
MickG
Posts: 1
Joined: Fri Dec 27, 2013 1:41 pm

List of Theorems

Post by MickG »

One thing you've probably done wrong is that it's not

Code: Select all

\listoftheoremname
but

Code: Select all

\listtheoremname
, as the thmtools documentation will confirm. With that, it should work. Btw, the

Code: Select all

\renewcommand
in question can be put in the document, just before the list, and even more than once, if you need multiple lists with multiple titles.
Post Reply