Hi, (This post actually belongs to dev-context, but I do not know if everyone interested in this reads dev-context, so I am posting it to this list). I have been looking at what is the best way to do theorems etc with ConTeXt. There are ways to handle most of the requirements, but some of them are not possible out of the box with ConTeXt. I have searched the archives and this questions about theorems and proofs keep on coming on and off. I want to see what is the requirements for theorems, what all is possible right now, and what needs to be done. Below I am writing my requirements of theorem. Does anyone have anything more to add? 1. They should be numbered, it should be possible to control the numbering mechanism, for example way=bysection, bychapter, etc.
Can be done using enumerations.
2. It should be possible to have two different types of theorems have the same number. For example, \definetheorem[theorem] \definetheorem[lemma][number=theorem] should follow the same number as theorems.
Is possible using enumerations
3. It should be possible to get a list of theorems. It should be possible to say which types of theorems go to the list and which do not.
Is possible using enumerations
4. The theorem should have a title. The title should be optional.
Is partially implemented
5. There should be a mechanism to do end-of-proof marks. The end-of-proof marks should also work with itemizations, and formulas.
Not implemented at all.
6. Anything more...? Requirement 4 is not completely implemented. With \defineenumeration[theorem][title=yes] I always have to give a title. Normally, while writings theorems, there are only a few theorems that have a title. The rest of them do not. Right now, I can work around this restriction, by either having two different theorems (titledtheorem and nontitledtheorem) or always adding {} at the beginning of each theorem. I want the behaviour closer to title=maybe. I do not understand why \@@startdescription contains \dowithwargument{\@@startsomedescription{#1}[#2]} I would prefer it to contain \dosinglegroupempty{\@@startsomedescription{#1}[#2]} (well this will of course not work, but I hope the idea is clear) So that I can do \defineenumeration[theorem][title=yes] \starttheorem A silly theorem not worth a title \stoptheorem as well \starttheorem {My Fancy Theorem} A fancy theorem that needs to be given a title \stoptheorem I do not think that changing this will break anything. I am not even sure why dowithwargument is there. I cannot imagine anyone writing \startthoerem Title this is a theorem \stoptheorem instead of \starttheorem {Title} this is a theorem \stoptheorem The title also needs some more attributes. Right now, only titlestyle, titlecolor and titledistance are there. To be more flexible, you would also need something like titleleft, and titleright, which should not be too difficult. The last things, that is the end of proof marker, is right now not possible in ConTeXt. There are a lot of things that need to be taken care of while having a end-of-proof marker: basically, you need to ensure that there is no page break between the proof and the marker. Also the marker needs to be moved up or down, depending on how the proof ends. At the very least, ConTeXt should have something that ensures that the end of proof marker does not go onto a page of its own. Finally, my question is: Does it make sense to include all these functionality into enumerations, or have them in a separate module? Aditya
Hi Aditya, Aditya Mahajan wrote:
4. The theorem should have a title. The title should be optional.
Is partially implemented
I used to work around that by defining a layer on top of the enumerations that always define the enumeration's settings on the fly. Quite inefficient, but it worked OK. Support in the core would be much nicer, though.
The last things, that is the end of proof marker, is right now not possible in ConTeXt. There are a lot of things that need to be taken care of while having a end-of-proof marker: basically, you need to ensure that there is no page break between the proof and the marker. Also the marker needs to be moved up or down, depending on how the proof ends. At the very least, ConTeXt should have something that ensures that the end of proof marker does not go onto a page of its own.
End of proof markers are a pain, and I see no easy solution. Taco
On Fri, 19 Jan 2007, Taco Hoekwater wrote:
Hi Aditya,
Aditya Mahajan wrote:
4. The theorem should have a title. The title should be optional.
Is partially implemented
I used to work around that by defining a layer on top of the enumerations that always define the enumeration's settings on the fly. Quite inefficient, but it worked OK. Support in the core would be much nicer, though.
I will try to add this to as a patch to enumerations, and see how it works.
The last things, that is the end of proof marker, is right now not possible in ConTeXt. There are a lot of things that need to be taken care of while having a end-of-proof marker: basically, you need to ensure that there is no page break between the proof and the marker. Also the marker needs to be moved up or down, depending on how the proof ends. At the very least, ConTeXt should have something that ensures that the end of proof marker does not go onto a page of its own.
End of proof markers are a pain, and I see no easy solution.
I saw a proof.tex for plain tex, which ensured that the end of the line marker stayed on the same page. No support for correct spacing for itemize and formula. The ntheorem package does that, but I do not fully understand the algorithm, so it may be harder to port. I will try a port of proof.tex if I can find it again. Aditya
Hi Aditya, hi Taco, I would really love to see built-in support for theorems in ConTeXt! I have been typesetting my diploma thesis (in mathematical physics) with ConTeXt and my experience has been that in some areas ConTeXt still needs to catch up a bit on LaTeX (especially on the AMS packages), although it has definitely come along way already ... So far I have constructed my theorems etc. as enumerations on an adhoc basis and - surprise - noted a few glitches here and there. 1. For some environments I chose style=\it but this resulted in italic equation numbers as well. However, these numbers should always be typeset upright. 2. There is some odd behaviour concerning the options "right" and "stopper" which I mentioned on the list a while ago. I believe this is more an issue of descriptions/enumerations than anything else but it would affect any theorem mechanism based on enumerations. Perhaps this can be looked into at the same time as you're trying to cook up generic theorems. Have you found out anything about the end of proof markers yet? I haven't tried it out but how do the AMS folks handle this issue? Unfortunately, I don't have the TeX programming experience (yet) to start digging myself ... Oliver
Hi Aditya,
Aditya Mahajan wrote:
4. The theorem should have a title. The title should be optional.
Is partially implemented
I used to work around that by defining a layer on top of the enumerations that always define the enumeration's settings on the fly. Quite inefficient, but it worked OK. Support in the core would be much nicer, though.
I will try to add this to as a patch to enumerations, and see how it works.
The last things, that is the end of proof marker, is right now not possible in ConTeXt. There are a lot of things that need to be taken care of while having a end-of-proof marker: basically, you need to ensure that there is no page break between the proof and the marker. Also the marker needs to be moved up or down, depending on how the proof ends. At the very least, ConTeXt should have something that ensures that the end of proof marker does not go onto a page of its own.
End of proof markers are a pain, and I see no easy solution.
I saw a proof.tex for plain tex, which ensured that the end of the line marker stayed on the same page. No support for correct spacing for itemize and formula. The ntheorem package does that, but I do not fully understand the algorithm, so it may be harder to port. I will try a port of proof.tex if I can find it again.
Aditya
On Mon, 29 Jan 2007, Oliver Buerschaper wrote:
Hi Aditya, hi Taco,
I would really love to see built-in support for theorems in ConTeXt!
I have been typesetting my diploma thesis (in mathematical physics) with ConTeXt and my experience has been that in some areas ConTeXt still needs to catch up a bit on LaTeX (especially on the AMS packages), although it has definitely come along way already ...
So far I have constructed my theorems etc. as enumerations on an adhoc basis and - surprise - noted a few glitches here and there.
1. For some environments I chose style=\it but this resulted in italic equation numbers as well. However, these numbers should always be typeset upright.
This was the first thing I noticed when I started with ConTeXt, see http://archive.contextgarden.net/message/20050526.134831.21522839.en.html ;) Now, I use \setupformulas[numberstyle=normal] in my local setup.
2. There is some odd behaviour concerning the options "right" and "stopper" which I mentioned on the list a while ago. I believe this is more an issue of descriptions/enumerations than anything else but it would affect any theorem mechanism based on enumerations. Perhaps this can be looked into at the same time as you're trying to cook up generic theorems.
I will see if I can do anything about it.
Have you found out anything about the end of proof markers yet?
Not yet. It is possible to have a simple solution that will work in 90% of the case. Coming up with something that works for 98% of the cases is very hard. I do not understand the working of TeX to do that. The idea is to make sure the problem is well defined so that Hans and Taco can solve it :)
I haven't tried it out but how do the AMS folks handle this issue?
The end-of-proof handling in amsthm is not correct. It requires you to manually put \qedhere and does not work correctly if the proof ends with a equation. Look at ntheorem.sty for the correct behaviour.
Unfortunately, I don't have the TeX programming experience (yet) to start digging myself ...
Even a description of the expected features and how the output should look like will be useful. This is going to be slow progress due to other time constraints, but I should have something working in a month or two. Aditya
Hi Aditya,
Aditya Mahajan wrote:
4. The theorem should have a title. The title should be optional.
Is partially implemented
I used to work around that by defining a layer on top of the enumerations that always define the enumeration's settings on the fly. Quite inefficient, but it worked OK. Support in the core would be much nicer, though.
I will try to add this to as a patch to enumerations, and see how it works.
The last things, that is the end of proof marker, is right now not possible in ConTeXt. There are a lot of things that need to be taken care of while having a end-of-proof marker: basically, you need to ensure that there is no page break between the proof and the marker. Also the marker needs to be moved up or down, depending on how the proof ends. At the very least, ConTeXt should have something that ensures that the end of proof marker does not go onto a page of its own.
End of proof markers are a pain, and I see no easy solution.
I saw a proof.tex for plain tex, which ensured that the end of the line marker stayed on the same page. No support for correct spacing for itemize and formula. The ntheorem package does that, but I do not fully understand the algorithm, so it may be harder to port. I will try a port of proof.tex if I can find it again.
Aditya
ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Aditya Mahajan | EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam | Ph: 734.262.4008
Hi Oliver, On Mon, 29 Jan 2007, Oliver Buerschaper wrote:
Hi Aditya, hi Taco,
I would really love to see built-in support for theorems in ConTeXt!
I have rudimentary support for titled theorems and end of proof markers working. It also takes care of your bug-report.
I have been typesetting my diploma thesis (in mathematical physics) with ConTeXt and my experience has been that in some areas ConTeXt still needs to catch up a bit on LaTeX (especially on the AMS packages), although it has definitely come along way already ...
So far I have constructed my theorems etc. as enumerations on an adhoc basis and - surprise - noted a few glitches here and there.
2. There is some odd behaviour concerning the options "right" and "stopper" which I mentioned on the list a while ago. I believe this is more an issue of descriptions/enumerations than anything else but it would affect any theorem mechanism based on enumerations. Perhaps this can be looked into at the same time as you're trying to cook up generic theorems.
I have patched core-des so that stopper is also honored when number=no is set.
Have you found out anything about the end of proof markers yet? I haven't tried it out but how do the AMS folks handle this issue? Unfortunately, I don't have the TeX programming experience (yet) to start digging myself ...
I have a very basic end of proof marker working. Basically, it will handle the marker correctly for proofs that end with paragraphs, and works hard to avoid a page break when the proof ends with a formula or an itemize (in this case, the end of proof marker is in a line of its own). The main macro for putting the proof marker on the right is from Paul Taylor's qed.sty. If you want to test this, I can send you the file offlist. This file is not in a state to be merged into the core right now. Hans, why does core-des.tex define description parameter as: \def\descriptionparameter#1{\csname\??dd\currentdescription#1\endcsname} while in some other files, you had \def\....parameter#1{\executeifdefinedelse{\??..\current....#1}{\executeifdefined{\??..#1}} which prevents a lot of copying of parameters. Is core-des yet to be cleaned up? Aditya
Hi Aditya,
I have rudimentary support for titled theorems and end of proof markers working. It also takes care of your bug-report.
That's great news! My fingers are itching to test it ;-)
I have patched core-des so that stopper is also honored when number=no is set.
Does this mean that your patch has already been merged with the official release?
I have a very basic end of proof marker working. Basically, it will handle the marker correctly for proofs that end with paragraphs, and works hard to avoid a page break when the proof ends with a formula or an itemize (in this case, the end of proof marker is in a line of its own). The main macro for putting the proof marker on the right is from Paul Taylor's qed.sty. If you want to test this, I can send you the file offlist. This file is not in a state to be merged into the core right now.
Please send it to me ... Thanks, Oliver
On Tue, 6 Mar 2007, Oliver Buerschaper wrote:
Hi Aditya,
I have rudimentary support for titled theorems and end of proof markers working. It also takes care of your bug-report.
That's great news! My fingers are itching to test it ;-)
I have patched core-des so that stopper is also honored when number=no is set.
Does this mean that your patch has already been merged with the official release?
No, it will be a while before it will be merged in the official release. I will make all changes that I want and then ask Hans to look at it --- don't want to waste Hans time for including each different thing individually.
I have a very basic end of proof marker working. Basically, it will handle the marker correctly for proofs that end with paragraphs, and works hard to avoid a page break when the proof ends with a formula or an itemize (in this case, the end of proof marker is in a line of its own). The main macro for putting the proof marker on the right is from Paul Taylor's qed.sty. If you want to test this, I can send you the file offlist. This file is not in a state to be merged into the core right now.
Please send it to me ...
Will do. Aditya
On Fri, 19 Jan 2007, Taco Hoekwater wrote:
Aditya Mahajan wrote:
4. The theorem should have a title. The title should be optional.
Is partially implemented
I used to work around that by defining a layer on top of the enumerations that always define the enumeration's settings on the fly. Quite inefficient, but it worked OK. Support in the core would be much nicer, though.
Here is my first attempt. I added new keys titleleft, titleright, and titlecommand to provide more customization. The solution is not pretty, mainly because title was an afterthought, rather than being there from the beginning. % This is the usual visual output \defineenumeration [lemma] [ title=yes, text=Lemma, titledistance=.5em, textdistance=1em, titlestyle=bold, titleleft=(, titleright=), stopper=., location=hanging, style=italic, ] \startlemma {with a title of a certain length} \input tufte \stoplemma \startlemma With no title \input tufte \stoplemma Basically, works with and without any title. The list of enumerations does not look good, and I do not know how to configure it.
The last things, that is the end of proof marker, is right now not possible in ConTeXt. There are a lot of things that need to be taken care of while having a end-of-proof marker: basically, you need to ensure that there is no page break between the proof and the marker. Also the marker needs to be moved up or down, depending on how the proof ends. At the very least, ConTeXt should have something that ensures that the end of proof marker does not go onto a page of its own.
End of proof markers are a pain, and I see no easy solution.
I will try to implement a rudimetary support for end of proof markers, something similar to what amsthm does. The right way to do it is too complicated for me to understand :-( The code is attached and suggestions for improvement are welcome. Aditya
participants (3)
-
Aditya Mahajan
-
Oliver Buerschaper
-
Taco Hoekwater