1

I noticed that the list of theorems doesn't make much sense for definitions because what I get basically is just 1.5 Def etc. which doesn't convey any information. Hence I added the extra information as shown below so that I'd get 1.5 Def (Vector Space) in the list of theorems which helps me a lot actually. However it makes the text a bit less legible because now instead of Def. 1.5 I get Def. 1.5 (Vector Space) as expected. Is there a way to remove this additional information in the actual text but have it shown in the list of theorems?

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}

\begin{document}

\listoftheorems[ignoreall,show={definition}]
\begin{definition}[Vector Space]
....
\end{defintion}
\end{document}
Gonenc
  • 164
  • What is math.sty? Your own collection of math macros? –  Dec 06 '15 at 21:20
  • Yes you can say that. In math.sty there is stuff like \usepackage{amsmath} – Gonenc Dec 06 '15 at 21:21
  • i suggest defining and using a command \SkipTocEntry comparable to what's explained in this answer: http://tex.stackexchange.com/a/24798/579. that would permit you to omit the optional argument to definition, and insert it only for the toc. – barbara beeton Dec 06 '15 at 21:22
  • @gonenc: 'hidden' user-defined package files are in general not useful for users willing to help you ;-) –  Dec 06 '15 at 21:30
  • @ChristianHupfer I wasn't trying to hide it :) I was just too lazy to type it out but in any case I'll edit the question accordingly. – Gonenc Dec 06 '15 at 21:37
  • @gonenc Do you plan having theorems with the optional argument to be printed along with the label? – egreg Dec 06 '15 at 22:00
  • @egreg I have theorems with additional arguments, apart from the definitions, whose additional arguments are quasi optional. – Gonenc Dec 06 '15 at 22:02
  • @gonenc Please explain whether your list of theorems should include also the other theorems and in that case what you expect the output is. – egreg Dec 06 '15 at 22:03
  • @egreg The list that I'm making should only include the definitions. I edited the question accordingly. – Gonenc Dec 06 '15 at 22:05

1 Answers1

2

The idea is to modify the definition of \ll@definition, but actually some more work is needed.

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}

\declaretheorem[
  style=definition,
  name=Definition,
]{innerdefinition}

\makeatletter
\newenvironment{definition}[1][]
 {\def\gonenc@thmt@shortoptarg{#1}\innerdefinition}
 {\endinnerdefinition}
\def\ll@innerdefinition{%
  \protect\numberline{\csname the\thmt@envname\endcsname}%
    \thmt@thmname
  \ifx\@empty\gonenc@thmt@shortoptarg
  \else
    \ (\gonenc@thmt@shortoptarg)%
  \fi}
\makeatother

\begin{document}

\listoftheorems[ignoreall,show={innerdefinition}]

\begin{definition}[Vector Space]
You know what a \emph{vector space} is, don't you?
\end{definition}

\end{document}

enter image description here

egreg
  • 1,121,712