Hello Lyx Developers, Recently I've been trying to understand more thoroughly how theorems modules are implemented in LyX, and I think I've come across some bugs, and some redundant modules (but I might have misunderstood a few things).
The first thing I've noticed is that all AMS theorems related modules load the packages amsmath and amsthm even if the use did not use any layout. I could not understand why, as amsthm does not depend on amsmath. I've tried to compile a lyx file containing all the layouts defined in Theorem (AMS), but i erased the line "Require amsmath,amsthm" from the module, and the file compiled (as amsthm is loaded by the layouts, there is no really a need to load the package if the user did not use any layout). The second thing I've noticed, there is no difference between the files theorems.inc and theorems-ams.inc. In the description of the file theorems-std.module, which uses theorems.inc it is said that the module "Defines some theorem environments for use with non-AMS classes", but the module uses amsthm, and he is compilable with AMS classes. The only difference I've found between theorems.inc and theorems-ams.inc, is the list of layouts the files provide at the beginning of the files (but they provide the same layouts, with the exact same definitions. I've used text comparison software to verify that). Because of that, I've concluded that the only differences between theorems-std.module and theorems-ams.module is that in theorems-std.module there are no unnumbered theorems (as theorems-ams.module includes theorems-starred.inc, but theorems-std.module does not), theorems-std.module does not load amsmath, and loads amsthm only if the user has used a layout that is not the proof layout, and the definition of the proof layout. I did not understand the purpose of the file theorems-proof-std.inc. This file is included in theorems-std.module, and it appears that this file is defining the proof environment (but the definition is quite different from the usual one), if it is not defined. Since amsthm defines the proof environment, if i will compile a file using Theorems module, the appearance of my proofs will depend if i used another layout provided by the module. Wont it be more reasonable to add to the proof layout defined in theorems-proof.inc the line "Require amsthm" and use this layout? if there is a theorems module that does not use amsthm (and currently i don't think there is one like that), it could include theorems-proof-std.inc. Another problem with the fact that the proof layout in theorems-proof.inc does not require amsthm, is with the module Theorems (Unnumbered). This module only loads amsthm if the user use one of the theorems layouts. if one would simply use the proof layout with this module, and no other layout from the module, with non-AMS class (as these classes also defines the proof environment), he will get the error "LaTeX Error: Environment proof undefined.". Another inquiry I have about the module Theorems (Unnumbered) is the file theorems-starred-equivalents.inc. This file only copies the starred theorems layouts but gives the new layout a name without a star, e.g., it defines a Theorem layout exactly as Theorem* layout (and this files misses the Fact layout). For all these reasons i believe that with a little bi of modification to the non AMS modules (which actually use amsthm), the AMS modules are redundent, and it is probably wise to add the line "Require amsthm" to the proof layout. If this suggestion seems reasonable to everybody, i could start work on the matter, and send the relevent files after editing them as mentioned. Just for clerification, all the modules files i've mentioned are the ones that comes with LyX2.3.6.1. Best Regards, Udi
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel