1 #\DeclareLyXModule{Theorems (thmtools, Numbered by Type)}
2 #\DeclareCategory{Maths}
4 #Defines the theorem environments defined in the AMS-Theorem modules using the
5 #thmtools machinery. Both numbered and unnumbered types are provided. In Addition,
6 #one can use the \listoftheorems command provided by the thmtools.sty package.
8 #Excludes: theorems-std | theorems-ams | theorems-bytype | theorems-ams-bytype
10 # Original Author: Udi Fogiel
15 # The environments defined are:
43 # We need separate counters for each theorem-like style.
82 OutlinerName thm "Definitions & Theorems"
94 LabelString "Theorem Name"
95 Tooltip "Additional text appended to the theorem header"
109 LabelString "Theorem \thetheorem."
119 \usepackage{thmtools}
120 \renewcommand{\thmt@mklistcmd}{%
121 \ifcsname lyx\csname thmt@envname\endcsname name\endcsname
124 \@xa\def\csname ll@\thmt@envname\endcsname{%
125 \protect\ifthmt@listswap
127 \protect\numberline{\protect\let\protect\autodot\protect\@empty}%
129 \csname lyx\csname thmt@envname\endcsname name\endcsname
130 \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi
133 \@xa\def\csname ll@\thmt@envname\endcsname{%
134 \protect\ifthmt@listswap
135 \csname lyx\csname thmt@envname\endcsname name\endcsname~\csname the\thmt@envname\endcsname
137 \protect\numberline{\csname the\thmt@envname\endcsname}%
138 \csname lyx\csname thmt@envname\endcsname name\endcsname
140 \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi
143 \@xa\gdef\csname thmt@contentsline@\thmt@envname\endcsname{%
144 \thmt@contentslineShow
149 \@xa\def\csname ll@\thmt@envname\endcsname{%
150 \protect\ifthmt@listswap
152 \protect\numberline{\protect\let\protect\autodot\protect\@empty}%
155 \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi
158 \@xa\def\csname ll@\thmt@envname\endcsname{%
159 \protect\ifthmt@listswap
160 \thmt@thmname~\csname the\thmt@envname\endcsname
162 \protect\numberline{\csname the\thmt@envname\endcsname}%
165 \ifx\@empty\thmt@shortoptarg\else\protect\thmtformatoptarg{\thmt@shortoptarg}\fi
168 \@xa\gdef\csname thmt@contentsline@\thmt@envname\endcsname{%
169 \thmt@contentslineShow
173 \expandafter\providecommand\csname lyxthmname\endcsname{}
174 \declaretheorem[numberwithin=section,name=\protect\csname lyxthmname\endcsname]{thm}
177 \expandafter\renewcommand\csname lyxthmname\endcsname{_(Theorem)}
180 \addto\captions$$lang{\expandafter\renewcommand\csname lyxthmname\endcsname{_(Theorem)}}
183 DocBookWrapperTag figure
184 DocBookWrapperAttr role='theorem'
186 DocBookGenerateTitle true
192 LatexType Environment
196 LabelString "Theorem."
202 LabelString "Theorem Name"
203 Tooltip "Additional text appended to the theorem header"
224 \expandafter\providecommand\csname lyxthm*name\endcsname{}
225 \declaretheorem[numbered=no,name=\protect\csname lyxthm*name\endcsname]{thm*}
228 \expandafter\renewcommand\csname lyxthm*name\endcsname{_(Theorem)}
231 \addto\captions$$lang{\expandafter\renewcommand\csname lyxthm*name\endcsname{_(Theorem)}}
235 DocBookWrapperTag figure
236 DocBookWrapperAttr role='theorem'
238 DocBookGenerateTitle true
245 LabelString "Corollary \thecorollary."
247 \expandafter\providecommand\csname lyxcorname\endcsname{}
248 \declaretheorem[numberwithin=section,name=\protect\csname lyxcorname\endcsname]{cor}
250 LabelCounter corollary
252 \expandafter\renewcommand\csname lyxcorname\endcsname{_(Corollary)}
255 \addto\captions$$lang{\expandafter\renewcommand\csname lyxcorname\endcsname{_(Corollary)}}
258 DocBookWrapperTag figure
259 DocBookWrapperAttr role='corollary'
261 DocBookGenerateTitle true
268 LabelString "Corollary."
270 \expandafter\providecommand\csname lyxcor*name\endcsname{}
271 \declaretheorem[numbered=no,name=\protect\csname lyxcorname\endcsname]{cor*}
274 \expandafter\renewcommand\csname lyxcor*name\endcsname{_(Corollary)}
277 \addto\captions$$lang{\expandafter\renewcommand\csname lyxcor*name\endcsname{_(Corollary)}}
280 DocBookWrapperTag figure
281 DocBookWrapperAttr role='corollary'
283 DocBookGenerateTitle true
290 LabelString "Lemma \thelemma."
292 \expandafter\providecommand\csname lyxlemname\endcsname{}
293 \declaretheorem[numberwithin=section,name=\protect\csname lyxlemname\endcsname]{lem}
296 \expandafter\renewcommand\csname lyxlemname\endcsname{_(Lemma)}
299 \addto\captions$$lang{\expandafter\renewcommand\csname lyxlemname\endcsname{_(Lemma)}}
303 DocBookWrapperTag figure
304 DocBookWrapperAttr role='lemma'
306 DocBookGenerateTitle true
315 \expandafter\providecommand\csname lyxlem*name\endcsname{}
316 \declaretheorem[numbered=no,name=\protect\csname lyxlem*name\endcsname]{lem*}
319 \expandafter\renewcommand\csname lyxlem*name\endcsname{_(Lemma)}
322 \addto\captions$$lang{\expandafter\renewcommand\csname lyxlem*name\endcsname{_(Lemma)}}
325 DocBookWrapperTag figure
326 DocBookWrapperAttr role='lemma'
328 DocBookGenerateTitle true
335 LabelString "Proposition \theproposition."
337 \expandafter\providecommand\csname lyxpropname\endcsname{}
338 \declaretheorem[numberwithin=section,name=\protect\csname lyxpropname\endcsname]{prop}
341 \expandafter\renewcommand\csname lyxpropname\endcsname{_(Proposition)}
344 \addto\captions$$lang{\expandafter\renewcommand\csname lyxpropname\endcsname{_(Proposition)}}
346 LabelCounter proposition
348 DocBookWrapperTag figure
349 DocBookWrapperAttr role='proposition'
351 DocBookGenerateTitle true
358 LabelString "Proposition."
360 \expandafter\providecommand\csname lyxprop*name\endcsname{}
361 \declaretheorem[numbered=no,name=\protect\csname lyxprop*name\endcsname]{prop*}
364 \expandafter\renewcommand\csname lyxprop*name\endcsname{_(Proposition)}
367 \addto\captions$$lang{\expandafter\renewcommand\csname lyxprop*name\endcsname{_(Proposition)}}
369 LabelCounter proposition
371 DocBookWrapperTag figure
372 DocBookWrapperAttr role='proposition'
374 DocBookGenerateTitle true
381 LabelString "Conjecture \theconjecture."
383 \expandafter\providecommand\csname lyxconjecturename\endcsname{}
384 \declaretheorem[numberwithin=section,name=\protect\csname lyxconjecturename\endcsname]{conjecture}
387 \expandafter\renewcommand\csname lyxconjecturename\endcsname{_(Conjecture)}
390 \addto\captions$$lang{\expandafter\renewcommand\csname lyxconjecturename\endcsname{_(Conjecture)}}
392 LabelCounter conjecture
394 DocBookWrapperTag figure
395 DocBookWrapperAttr role='conjecture'
397 DocBookGenerateTitle true
403 LatexName conjecture*
404 LabelString "Conjecture."
406 \expandafter\providecommand\csname lyxconjecture*name\endcsname{}
407 \declaretheorem[numbered=no,name=\protect\csname lyxconjecture*name\endcsname]{conjecture*}
410 \expandafter\renewcommand\csname lyxconjecture*name\endcsname{_(Conjecture)}
413 \addto\captions$$lang{\expandafter\renewcommand\csname lyxconjecture*name\endcsname{_(Conjecture)}}
416 DocBookWrapperTag figure
417 DocBookWrapperAttr role='conjecture'
419 DocBookGenerateTitle true
427 LabelString "Fact \thefact."
429 \expandafter\providecommand\csname lyxfactname\endcsname{}
430 \declaretheorem[numberwithin=section,name=\protect\csname lyxfactname\endcsname]{fact}
433 \expandafter\renewcommand\csname lyxfactname\endcsname{_(Fact)}
436 \addto\captions$$lang{\expandafter\renewcommand\csname lyxfactname\endcsname{_(Fact)}}
440 DocBookWrapperTag figure
441 DocBookWrapperAttr role='fact'
443 DocBookGenerateTitle true
452 \expandafter\providecommand\csname lyxfact*name\endcsname{}
453 \declaretheorem[numbered=no,name=\protect\csname lyxfact*name\endcsname]{fact*}
456 \expandafter\renewcommand\csname lyxfact*name\endcsname{_(Fact)}
459 \addto\captions$$lang{\expandafter\renewcommand\csname lyxfact*name\endcsname{_(Fact)}}
462 DocBookWrapperTag figure
463 DocBookWrapperAttr role='fact'
465 DocBookGenerateTitle true
473 LabelString "Definition \thedefinition."
482 \expandafter\providecommand\csname lyxdefnname\endcsname{}
483 \declaretheorem[numberwithin=section,name=\protect\csname lyxdefnname\endcsname,style=definition]{defn}
486 \expandafter\renewcommand\csname lyxdefnname\endcsname{_(Definition)}
489 \addto\captions$$lang{\expandafter\renewcommand\csname lyxdefnname\endcsname{_(Definition)}}
491 LabelCounter definition
493 DocBookWrapperTag figure
494 DocBookWrapperAttr role='definition'
496 DocBookGenerateTitle true
504 LabelString "Definition."
513 \expandafter\providecommand\csname lyxdefn*name\endcsname{}
514 \declaretheorem[numbered=no,name=\protect\csname lyxdefn*name\endcsname,style=definition]{defn*}
517 \expandafter\renewcommand\csname lyxdefn*name\endcsname{_(Definition)}
520 \addto\captions$$lang{\expandafter\renewcommand\csname lyxdefn*name\endcsname{_(Definition)}}
523 DocBookWrapperTag figure
524 DocBookWrapperAttr role='definition'
526 DocBookGenerateTitle true
533 LabelString "Example \theexample."
535 \expandafter\providecommand\csname lyxexamplename\endcsname{}
536 \declaretheorem[numberwithin=section,name=\protect\csname lyxexamplename\endcsname,style=definition]{example}
539 \expandafter\renewcommand\csname lyxexamplename\endcsname{_(Example)}
542 \addto\captions$$lang{\expandafter\renewcommand\csname lyxexamplename\endcsname{_(Example)}}
546 DocBookWrapperTag example
549 DocBookGenerateTitle true
554 CopyStyle Definition*
556 LabelString "Example."
558 \expandafter\providecommand\csname lyxexample*name\endcsname{}
559 \declaretheorem[numbered=no,name=\protect\csname lyxexample*name\endcsname,style=definition]{example*}
562 \expandafter\renewcommand\csname lyxexample*name\endcsname{_(Example)}
565 \addto\captions$$lang{\expandafter\renewcommand\csname lyxexample*name\endcsname{_(Example)}}
568 DocBookWrapperTag informalexample
578 LabelString "Problem \theproblem."
580 \expandafter\providecommand\csname lyxproblemname\endcsname{}
581 \declaretheorem[numberwithin=section,name=\protect\csname lyxproblemname\endcsname,style=definition]{problem}
584 \expandafter\renewcommand\csname lyxproblemname\endcsname{_(Problem)}
587 \addto\captions$$lang{\expandafter\renewcommand\csname lyxproblemname\endcsname{_(Problem)}}
591 DocBookWrapperTag figure
592 DocBookWrapperAttr role='problem'
594 DocBookGenerateTitle true
599 CopyStyle Definition*
601 LabelString "Problem."
603 \expandafter\providecommand\csname lyxproblem*name\endcsname{}
604 \declaretheorem[numbered=no,name=\protect\csname lyxproblem*name\endcsname,style=definition]{problem*}
607 \expandafter\renewcommand\csname lyxproblem*name\endcsname{_(Problem)}
610 \addto\captions$$lang{\expandafter\renewcommand\csname lyxproblem*name\endcsname{_(Problem)}}
613 DocBookWrapperTag figure
614 DocBookWrapperAttr role='problem'
616 DocBookGenerateTitle true
623 LabelString "Exercise \theexercise."
625 \expandafter\providecommand\csname lyxxcaname\endcsname{}
626 \declaretheorem[numberwithin=section,name=\protect\csname lyxxcaname\endcsname,style=definition]{xca}
629 \expandafter\renewcommand\csname lyxxcaname\endcsname{_(Exercise)}
632 \addto\captions$$lang{\expandafter\renewcommand\csname lyxxcaname\endcsname{_(Exercise)}}
634 LabelCounter exercise
636 DocBookWrapperTag figure
637 DocBookWrapperAttr role='exercise'
639 DocBookGenerateTitle true
644 CopyStyle Definition*
646 LabelString "Exercise."
648 \expandafter\providecommand\csname lyxxca*name\endcsname{}
649 \declaretheorem[numbered=no,name=\protect\csname lyxxca*name\endcsname,style=definition]{xca*}
652 \expandafter\renewcommand\csname lyxxca*name\endcsname{_(Exercise)}
655 \addto\captions$$lang{\expandafter\renewcommand\csname lyxxca*name\endcsname{_(Exercise)}}
658 DocBookWrapperTag figure
659 DocBookWrapperAttr role='exercise'
661 DocBookGenerateTitle true
668 LabelString "Solution \thesolution."
670 \expandafter\providecommand\csname lyxsolname\endcsname{}
671 \declaretheorem[numberwithin=section,name=\protect\csname lyxsolname\endcsname,style=definition]{sol}
674 \expandafter\renewcommand\csname lyxsolname\endcsname{_(Solution)}
677 \addto\captions$$lang{\expandafter\renewcommand\csname lyxsolname\endcsname{_(Solution)}}
679 LabelCounter solution
681 DocBookWrapperTag figure
682 DocBookWrapperAttr role='solution'
684 DocBookGenerateTitle true
689 CopyStyle Definition*
691 LabelString "Solution."
693 \expandafter\providecommand\csname lyxsol*name\endcsname{}
694 \declaretheorem[numbered=no,name=\protect\csname lyxsol*name\endcsname,style=definition]{sol*}
697 \expandafter\renewcommand\csname lyxsol*name\endcsname{_(Solution)}
700 \addto\captions$$lang{\expandafter\renewcommand\csname lyxsol*name\endcsname{_(Solution)}}
703 DocBookWrapperTag figure
704 DocBookWrapperAttr role='solution'
706 DocBookGenerateTitle true
713 LabelString "Remark \theremark."
723 \expandafter\providecommand\csname lyxremname\endcsname{}
724 \declaretheorem[numberwithin=section,name=\protect\csname lyxremname\endcsname,style=remark]{rem}
727 \expandafter\renewcommand\csname lyxremname\endcsname{_(Remark)}
730 \addto\captions$$lang{\expandafter\renewcommand\csname lyxremname\endcsname{_(Remark)}}
734 DocBookWrapperTag figure
735 DocBookWrapperAttr role='remark'
737 DocBookGenerateTitle true
744 LabelString "Remark."
754 \expandafter\providecommand\csname lyxrem*name\endcsname{}
755 \declaretheorem[numbered=no,name=\protect\csname lyxrem*name\endcsname,style=remark]{rem*}
758 \expandafter\renewcommand\csname lyxrem*name\endcsname{_(Remark)}
761 \addto\captions$$lang{\expandafter\renewcommand\csname lyxrem*name\endcsname{_(Remark)}}
764 DocBookWrapperTag figure
765 DocBookWrapperAttr role='remark'
767 DocBookGenerateTitle true
774 LabelString "Claim \theclaim."
776 \expandafter\providecommand\csname lyxclaimname\endcsname{}
777 \declaretheorem[numberwithin=section,name=\protect\csname lyxclaimname\endcsname,style=remark]{claim}
780 \expandafter\renewcommand\csname lyxclaimname\endcsname{_(Claim)}
783 \addto\captions$$lang{\expandafter\renewcommand\csname lyxclaimname\endcsname{_(Claim)}}
787 DocBookWrapperTag figure
788 DocBookWrapperAttr role='claim'
790 DocBookGenerateTitle true
799 \expandafter\providecommand\csname lyxclaim*name\endcsname{}
800 \declaretheorem[numbered=no,name=\protect\csname lyxclaim*name\endcsname,style=remark]{claim*}
803 \expandafter\renewcommand\csname lyxclaim*name\endcsname{_(Claim)}
806 \addto\captions$$lang{\expandafter\renewcommand\csname lyxclaim*name\endcsname{_(Claim)}}
809 DocBookWrapperTag figure
810 DocBookWrapperAttr role='claim'
812 DocBookGenerateTitle true
816 InsetLayout "Flex:List of Theorems"
820 LatexName listoftheorems
821 LabelString "List of theorems"
824 Tooltip "Insert wanted keys here"
841 ParbreakIsNewline true
845 \usepackage{thmtools}
846 \declaretheorem{lyxdummytheorem}
850 Input theorems-case.inc
851 Input theorems-proof.inc
852 Input theorems-refprefix.inc