New Theorems Module
Paul A. Rubin
parubin73 at gmail.com
Thu Sep 15 18:54:25 UTC 2022
On 9/13/22 18:48, Udicoudco wrote:
> On Tue, Aug 30, 2022 at 10:27 AM Jürgen Spitzmüller<jspitzm at gmail.com> wrote:
>> Am Donnerstag, dem 14.07.2022 um 14:17 +0300 schrieb Udicoudco:
>>> Hello again,
>> Hi,
> Hi Jürgen,
> Thank you for the reply.
>
>> Thanks for this and sorry for the late reply. Most people are busy with
>> their real lifes.
> No apologies needed, thank you all for developing great software.
>
>>> I had some mistakes in the .inc file and the .lyx file. The updated
>>> files are attached.
>> As I do not use theorems myself, I cannot comment on the usage and
>> usefulness of thmtools and the need for a module. So you probably have
>> to be even more patient until the math users are back.
> Well, the matter is not urgent, and I have patience :).
>
>> One remark on the layout:
>>
>> AddToPreamble
>> \usepackage{amsthm}
>> \usepackage{thmtools}
>> EndPreamble
>>
>> At least for amsthm, this should rather be
>>
>> Require amsthm
> I've fixed this issue (see the attached file). I'v also used the
> DependsOn key so that the module will call thmtools only once.
>
>> I think also thmtools should be added to the packages LyX knows and
>> loaded that way.
> I don't know how to do that.
>
> Regards,
> Udi
>
Hi Udi,
I've been playing a bit with your module, and I've encountered a couple
of non-fatal issues. The first may sound a bit silly. If you have a list
of theorems but do not have any theorem-like environments (either
because you put in the list of theorems code first or because you
deleted all the things that would have been listed and have not yet
added new ones), the document will not compile because the thm-tools
package has not been loaded. Either requiring thm-tools in the list of
theorems environment or making it depend on theorems (the way claim,
lemma etc. do) should cure that.
The second one is perhaps a bug in the thm-tools package itself. To
reproduce it, you can follow these steps.
1. Open your test_thmtools_module.lyx file and compile it (which works,
of course).
2. Delete the claims in section 2 (so that section 2 begins with
Conjecture 2.1) and recompile. When I do this, I get four undefined
control sequence errors, at least three of which contain the macro
\claimname. If I select "view output anyway", the document seems to
display correctly.
3. Now it gets goofier. If I make some trivial text edit (just to force
a recompilation), say adding a character to the section heading, and
recompile, the document compiles correctly without the error messages.
Something similar happens if, in step 2, I delete all the definitions
rather than all the claims, except that the errors now refer to
\definitionname. It's important to note that this only happens if I
compile the original document first. If I open the document, delete
claims or definitions, and then compile for the first time, there is no
error. So something is carrying over (in the buffer directory) from the
initial compilation that maybe ought not carry over. Also, it only seems
to happen when I delete all of one type of environment (all claims, all
definitions, ...). As long as I leave one claim or one definition
intact, the error does not occur.
I did a little digging. It turns out that compilation creates both a
.aux file and a .loe file in the buffer directory. After compiling the
full document, both contain instances of \claimname. After deleting all
claims and recompiling (producing the error messages), both are rebuilt
with no references to \claimname. If, however, I delete either one after
compiling the full document and before compiling the edited version, the
edited version generates no error messages. So I suspect there is some
sort of timing issue here, in which the first compilation of the edited
document inherits some undefined instances of \claimname (missing from
both .aux and .loe after they were rebuilt) whereas a recompilation does
not inherit \claimname. Deleting either the .aux or .loe file may force
them to rebuilt before \claimname leaks into the main document. I hope
that makes sense. (If it does, please explain to me what I just wrote. :-))
Cheers,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220915/d418cde4/attachment-0001.html>
More information about the lyx-devel
mailing list