Discussion:
list of theorems
(too old to reply)
Dan Owen
2004-02-17 11:07:32 UTC
Permalink
(Hopefully) a quick question:

How does one generate a list of theorems in latex? I am 'overloading' the
theorem definition for 'Lemma', 'Definition' in the following way:

\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}

\theoremstyle{definition} % use "definition-style" font for the rest

\newtheorem{Defn}[thm]{Definition}
\newtheorem{example}[thm]{Example}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{rmk}[thm]{Remark}
\newtheorem{Assn}[thm]{Assumption}

and would also like these to be listed for my thesis?

MANY TIA
Dan
Lars Madsen
2004-02-17 12:07:55 UTC
Permalink
Post by Dan Owen
How does one generate a list of theorems in latex? I am 'overloading' the
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}
\theoremstyle{definition} % use "definition-style" font for the rest
\newtheorem{Defn}[thm]{Definition}
\newtheorem{example}[thm]{Example}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{rmk}[thm]{Remark}
\newtheorem{Assn}[thm]{Assumption}
and would also like these to be listed for my thesis?
MANY TIA
Dan
use the ntheorem package. it provides tools to do such a thing automatically.
--
/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
AMSMATH Intro: http://www.ams.org/tex/short-math-guide.html
LaTeX Intro: http://people.ee.ethz.ch/~oetiker/lshort/lshort.pdf
Graphics Intro: http://www.ctan.org/tex-archive/info/epslatex.pdf
Superb Class: http://www.ctan.org/tex-archive/help/Catalogue/entries/memoir.html
Remember to post minimal working examples.
Dan Owen
2004-02-18 09:44:00 UTC
Permalink
Post by Lars Madsen
use the ntheorem package. it provides tools to do such a thing
automatically.
Thanks, but - there seems to be an issue with cross-referencing, which
generates an error on the 2nd latex run, I have trimed the problem down to:

%% LyX 1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% User specified LaTeX commands.

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[thmmarks,standard,thref]{ntheorem}
\usepackage{babel}
\makeatother
\begin{document}
test\label{test}
\end{document}

Many TIA
Dan
Morten Høgholm
2004-02-18 09:55:34 UTC
Permalink
Post by Lars Madsen
Post by Lars Madsen
use the ntheorem package. it provides tools to do such a thing
automatically.
Thanks, but - there seems to be an issue with cross-referencing, which
%% LyX 1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% User specified LaTeX commands.
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[thmmarks,standard,thref]{ntheorem}
\usepackage{babel}
\makeatother
\begin{document}
test\label{test}
\end{document}
If all else fails read the manual... ;-)

As ntheorem wants to provide an awful lot of nice things it messes with
several ``standard'' packages, hence the section in the ntheorem manual
about Possible Interferences.

This will work:

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{babel}
\usepackage[thmmarks,standard,thref,amsmath]{ntheorem}
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Dan Owen
2004-02-18 12:41:02 UTC
Permalink
Hi,
Post by Morten Høgholm
If all else fails read the manual... ;-)
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{babel}
\usepackage[thmmarks,standard,thref,amsmath]{ntheorem}
--
though I did look at the section you refer to, I overlooked that clue, but
now I can express the same (???) issue with floats/labels?

%% LyX 1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% User specified LaTeX commands.
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{babel}
\usepackage[thmmarks,standard,thref,amsmath]{ntheorem}
\makeatother
\begin{document}
%
\begin{figure}

\caption{\label{cap:some-test}some-test}
\end{figure}

\end{document}

Sorry for the persistence, any help much apprieciated
Regards,
Dan
Morten Høgholm
2004-02-18 12:55:54 UTC
Permalink
Post by Dan Owen
now I can express the same (???) issue with floats/labels?
\caption{\label{cap:some-test}some-test}
\end{figure}
Put \label _after_ \caption.
Post by Dan Owen
\end{document}
Sorry for the persistence, any help much apprieciated
No problem.
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Donald Arseneau
2004-02-18 15:30:35 UTC
Permalink
Post by Morten Høgholm
Post by Dan Owen
\caption{\label{cap:some-test}some-test}
\end{figure}
Put \label _after_ \caption.
Which, if true, is a bug in whatever defined the caption, and should
be fixed.


Donald Arseneau ***@triumf.ca
Morten Høgholm
2004-02-18 16:32:22 UTC
Permalink
Post by Donald Arseneau
Post by Morten Høgholm
Post by Dan Owen
\caption{\label{cap:some-test}some-test}
\end{figure}
Put \label _after_ \caption.
Which, if true, is a bug in whatever defined the caption, and should
be fixed.
That would be the standard LaTeX definition of \caption, but I don't think
it is to blame this time around. Somewhere in ntheorem.sty you find the
definitions

\newskip\mysavskip
\gdef\@bbsphack{%
\ifvmode\else\mysavskip\lastskip
\unskip\fi}
\gdef\@eesphack{%
\ifdim\mysavskip>\z@
\vskip\mysavskip \else\fi}

I would think that a \vskip is not what you want as \mysavskip is only
Post by Donald Arseneau
0pt if it _wasn't_ in vertical mode. Changing it into \hskip fixes the
problem. Coincidently that makes it the second bug I find in ntheorem in
three days...
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Dan Owen
2004-02-18 16:37:56 UTC
Permalink
Post by Morten Høgholm
Coincidently that makes it the second bug I find in ntheorem in
three days...
Will these fixes be posted somewhere?
Dan
Morten Høgholm
2004-02-18 16:54:12 UTC
Permalink
Post by Dan Owen
Post by Morten Høgholm
Coincidently that makes it the second bug I find in ntheorem in
three days...
Will these fixes be posted somewhere?
Hopefully in an update of ntheorem! I wrote Wolfgang May on Monday but he
hasn't returned to me yet. The other bug is about the end-of-theorem
marker placement in the equation environment. The following fixes it:
%%%%%%%%%%%%%%%%%%%%%%%%5
\makeatletter
\def\SetOnlyEndMark{%
\global\***@true
\iftagsleft@
\gdef\***@tag{%
\hfuzz\displaywidth
\hbox to 1sp{%
\hbox to \displaywidth{\hss\PotEndMark{\maketag@@@}}}}%
\else
\gdef\***@tag{\PotEndMark{\maketag@@@}}%
\fi}
\def\SetTagPlusEndMark{%
\iftagsleft@
\gdef\maketag@@@##1{%
\hfuzz\displaywidth
\hbox to 1sp{%
\hbox to \displaywidth{%
\***@th\normalfont##1\hss\PotEndMark{\hss}}%
}%
}%
\else
\gdef\maketag@@@##1{%
\hbox{\***@th\normalfont##1%
\llap{\hss\PotEndMark{\raisebox{-1.3em}}}}}%
\fi}
\makeatother
%%%%%%%%%%%%%%%%%%%%%

But for really good---and I mean really, really good---end-of-theorem
marker placement then look at my empheq package. The new version is on its
way to ctan (I uploaded it today) but in the meanwhile you can get it at
my webpage: <URL:http://www.student.cbs.dk/moho01ab/empheq/>. There is a
section in the manual that describes how to use it with ntheorem.
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Dan Owen
2004-02-18 19:18:20 UTC
Permalink
Post by Morten Høgholm
Hopefully in an update of ntheorem! I wrote Wolfgang May on Monday but he
hasn't returned to me yet.
OK, will wait on, unless more things start to break!

One *last* question (honest) - is it possible to define the number, so that
thms/defn/etc numbers are preceeded by chapter numbers, such as

\newtheorem{thm}{Theorem}[chapter]

would get? \renewtheorem perhaps, but I am unsure as to the 'base' theorem
to 'redefine'!!!!

MANY MANY TIA
Regards, Dan
Dan Owen
2004-02-18 20:23:37 UTC
Permalink
Post by Dan Owen
One *last* question (honest) - is it possible to define the number, so that
thms/defn/etc numbers are preceeded by chapter numbers, such as
\newtheorem{thm}{Theorem}[chapter]
cracked it, with
\renewtheorem{Theorem}{Theorem}[chapter]

but now have to repeat this for each of Definition, Lemma, etc, whereas
before I just did:

\newtheorem{thm}{Theorem}[chapter]
\newtheorem{theorem}[thm]{Theorem}
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{corollary}[thm]{Corollary}
\newtheorem{Proof}{Proof}

Dan
Donald Arseneau
2004-02-18 17:33:28 UTC
Permalink
Post by Morten Høgholm
is to blame this time around. Somewhere in ntheorem.sty you find the
definitions
I would think that a \vskip is not what you want
This has been reported, I think, last May:
http://groups.google.com/groups?threadm=3ECFCF76.EE1E1005%40uni-mb.si
http://groups.google.com/groups?threadm=yfid6i3d9cb.fsf%40triumf.ca
Is there a repaired ntheorem in the works? Is it supported at all?


Donald Arseneau ***@triumf.ca
Morten Høgholm
2004-02-18 17:41:41 UTC
Permalink
Post by Donald Arseneau
http://groups.google.com/groups?threadm=3ECFCF76.EE1E1005%40uni-mb.si
http://groups.google.com/groups?threadm=yfid6i3d9cb.fsf%40triumf.ca
I see. And pretty much the same conclusion back then.
Post by Donald Arseneau
Is there a repaired ntheorem in the works? Is it supported at all?
I don't know and I think so. I found Wolfgang Mays homepage and it has a
ntheorem page as well:
<URL:http://user.informatik.uni-goettingen.de/~may/Ntheorem/>. The version
there is newer than the on on ctan but still has both of the errors
discussed in this thread. But as I said I wrote Wolfgang the other day and
I'm waiting for him to return. We'll see...
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Morten Høgholm
2004-02-18 17:41:34 UTC
Permalink
Post by Donald Arseneau
http://groups.google.com/groups?threadm=3ECFCF76.EE1E1005%40uni-mb.si
http://groups.google.com/groups?threadm=yfid6i3d9cb.fsf%40triumf.ca
I see. And pretty much the same conclusion back then.
Post by Donald Arseneau
Is there a repaired ntheorem in the works? Is it supported at all?
I don't know and I think so. I found Wolfgang Mays homepage and it has a
ntheorem page as well:
<URL:http://user.informatik.uni-goettingen.de/~may/Ntheorem/>. The version
there is newer than the on on ctan but still has both of the errors
discussed in this thread. But as I said I wrote Wolfgang the other day and
I'm waiting for him to return. We'll see...
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Dan Luecking
2004-02-18 19:29:41 UTC
Permalink
On Wed, 18 Feb 2004 17:32:22 +0100, Morten Høgholm
Post by Morten Høgholm
Somewhere in ntheorem.sty you find the
definitions
\newskip\mysavskip
\ifvmode\else\mysavskip\lastskip
\unskip\fi}
\vskip\mysavskip \else\fi}
I would think that a \vskip is not what you want as \mysavskip is only
Post by Donald Arseneau
0pt if it _wasn't_ in vertical mode. Changing it into \hskip fixes the
problem. Coincidently that makes it the second bug I find in ntheorem in
three days...
This particular bug was rather extensively discussed on c.t.t several
months ago. The problem with \label inside \caption is that ntheorem
redefines \label to take an optional argument, thus making it fragile.

I don't know if it is possible now, but I think ntheorem ought to try
keep \label unchanged or else make it robust. (Also \@bbsphack maybe
should save the space factor and \@eesphack maybe restore it.)


Dan
--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701
luecking at uark dot edu
David Kastrup
2004-02-18 19:52:57 UTC
Permalink
Post by Dan Luecking
On Wed, 18 Feb 2004 17:32:22 +0100, Morten Høgholm
This particular bug was rather extensively discussed on c.t.t several
months ago. The problem with \label inside \caption is that ntheorem
redefines \label to take an optional argument, thus making it fragile.
I don't know if it is possible now, but I think ntheorem ought to try
Here is a fun definition for making robust command variants (it needs
eTeX, and it is really not a good idea to adapt this for use without
it, since it could make your hash space grow rather uglily). Note
that this works even if the "suffix" is actually a macro. I am not
sure that the interface will remain in this form, so you better not
rely on it.

\def\DeclareSuffix{\@***@or@long\***@declare@suffix}

\def\***@declare@suffix#1{\def\***@next{#1}%
\afterassignment\***@decsuff\let\next= }

\def\***@decsuff{\ifcsname
***@suffix\expandafter\string\***@next\endcsname
\else
\expandafter\let\csname
***@suffix\expandafter\string\***@next
\expandafter\endcsname \***@next
\edef\***@a{\protected\def
\expandafter\noexpand\***@next{%
\noexpand\***@suffixcheck\expandafter\noexpand\***@next}}%
\***@a
\fi\***@ngrel@x\expandafter\def\csname ***@suffix\expandafter\string
\***@next @\meaning\next\endcsname}

\def\***@suffixcheck#1{\begingroup\def\***@next{#1}%
\futurelet\next\***@suffixcheckii}

\def\***@gobblenext{\let\next= }

\def\***@suffixcheckii{\ifcsname ***@suffix\expandafter\string
\***@next @\meaning\next\endcsname
\afterassignment\endgroup
\expandafter\aftergroup
\csname ***@suffix\expandafter\string\***@next
@\meaning\next\endcsname
\expandafter\***@gobblenext
\else
\expandafter\endgroup
\csname ***@suffix\expandafter\string\***@next
\expandafter\endcsname
\fi}


Usage: for example

\DeclareSuffix\=>{\ensuremath{\to}}

And now \=> will produce an arrow, while \=a will still produce
amacron.

\DeclareSuffix\<={\ensuremath{\gets}}
\DeclareSuffix\<\>{\ensuremath{\langle\rangle}}
\DeclareSuffix*\label[#1]#2{This is a label variant #1 of #2.}

The definition is robust, adding more suffixes does not slow down the
execution time, the original definition stays, and the whole stuff is
robust if its components are. You should only try not to use macros
with a long top-level expansion as a suffix: those will turn out to be
slow.

Like everything implemented with \futurelet, this will not distinguish
between things \let to each other, like { and \bgroup.

Probably it would be nicer to call the above "\SuffixDef", and then
add a variant "\SuffixCommand" that can be used like
\SuffixCommand{\newcommand*}\label[[1][]{whatever}
Hmmm. Not much of an improvement here.
or at least
\SuffixCommand\let\label[=\mydefinitionoflabelbracket
or using it on \edef.

Opinions about the naming? It's still easy to fix.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Wolfgang May
2004-02-18 21:34:11 UTC
Permalink
Post by Dan Luecking
On Wed, 18 Feb 2004 17:32:22 +0100, Morten Høgholm
Post by Morten Høgholm
Somewhere in ntheorem.sty you find the
definitions
\newskip\mysavskip
\ifvmode\else\mysavskip\lastskip
\unskip\fi}
\vskip\mysavskip \else\fi}
I would think that a \vskip is not what you want as \mysavskip is only
Post by Donald Arseneau
0pt if it _wasn't_ in vertical mode. Changing it into \hskip fixes the
problem. Coincidently that makes it the second bug I find in ntheorem in
three days...
there are probably many more ;)
Send it to me, when I find some time, I will integrate it.
Post by Dan Luecking
This particular bug was rather extensively discussed on c.t.t several
months ago. The problem with \label inside \caption is that ntheorem
redefines \label to take an optional argument, thus making it fragile.
I don't know if it is possible now, but I think ntheorem ought to try
Any idea how (I don't completely know what I/we did there some years ago)?

ntheorem is ... sometimes maintained.

Writing a package when being a student is one thing, maintaining it
later in professional life is another one. It is always hard to get
into the old code again for fixes, trying not to destroy other things.

Wolfgang

Dan Owen
2004-02-18 16:35:58 UTC
Permalink
Post by Morten Høgholm
Post by Dan Owen
\caption{\label{cap:some-test}some-test}
\end{figure}
Put \label _after_ \caption.
FYI - for those users using LyX, then putting the label after the caption
text is sufficient. This still exports to

\caption{some-test\label{cap:some-test}}


but seems fine for me

Thanks for again
Dan
Continue reading on narkive:
Loading...