Differences Between Theorems Modules (AMS and non AMS)

Udicoudco udifoglle at gmail.com
Tue Sep 20 02:10:57 UTC 2022


Hello,

> > 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.
>
> And there is a NextNoIndent difference between the two that if probably
> wrong in one of the instances.

I think it is because theorems defined with plain latex suppress
paragraph indent after them. Currently LyX inserts a blank line after
theorem layouts which causes TeX  to see \par, and so there will be
paragraph indentation anyway.

> > 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
> >....

> It made sense when plain theorems did not use amsthm.

Makes sense.

> > 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 uses 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.".
>
> Could you give an example file for that issue?

The file theorems_unnumbered.lyx should demonstrate the bug.

> I wonder if we could get rid of theorems.module, and add a theorem-plain
> that use plain LaTeX commands as "theorems.module" used to do. Then
> files using "theorems.module" could be updated by lyx2lyx to use
> theorems-ams instead, and we would have the old functionality back.

In the zip file I've provided a new structure of all theorem modules.
All the non-AMS theorem modules in there are implemented with the
\newtheorem from the latex kernel, with slight modification for it to
resemble the look of the AMS variant. I've also tested these modules
with babel-hebrew (which has some clashes with amsthm), and it seems
to work (with correct parentheses and numbering).

Also, I think it would be better that all the definitions of the
theorems paragraph styles would be in one .inc file (two files with
the extended variant), it could be done by setting the preamble of a
theorem to something like \lyx at newtheorem{lem}{\protect\lemmaname},
and then in the module file itself to define this command in the
preamble of the  Theorem layout (for example
\newcommand\lyx at newcomman[2]{\newtheorem{#1}[thm]{#2}} should do the
trick for theorems-ams.module).

> > Just for clerification, all the modules files i've mentioned are the
> > ones that comes with LyX2.3.6.1.
>
> It would be nice to check the situation in master, as we are not going
> to fix this (except aybe proof) in 2.3.

I've checked the master, there are some changes (such as the format
and some new tags), but nothing that solves the problems mentioned (I
was not sure what is the purpose of the new tags, so i did not include
them).

I've provided the modifications in the zip file. Some files are not
included, such as theorems-starred, since I've included a starred
variant in the basic theorem module, and some .inc files were no
longer needed (except from the theorems-counters.inc that are needed
but not included in the zip file).

I'm not sure how lyx2lyx works, so I don't know if those changes are
problematic to configure for old versions of LyX.

Regards,
Udi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: theorems_unnumbered.lyx
Type: application/lyx
Size: 2489 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220920/c6703f9c/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Lyx Theorems.zip
Type: application/x-zip-compressed
Size: 21852 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220920/c6703f9c/attachment-0003.bin>


More information about the lyx-devel mailing list