0

I am using LyX to write lecture notes, with most of the text in Hebrew. I have many theorems and definitions, and they are defined using the theorems-ams module (Document > Settings > Modules).

Up until now it's all good, document compiles perfectly and without any error.

Now I want to add a list of theorems and definitions, but am unable to due to some weird problem: I have added \usepackage{thmtools} to my document's preamble settings and at the bottom of the document ERT with \listoftheorems. It looks like this: lyx screenshot

However, for some reason I get a pile of errors:

error list

Most of them about an extra }. when digging into the log file, I get this message (corresponding the error in the above screenshot):

! Argument of \@dottedtocline has an extra }.
<inserted text> 
                \par 
l.3218 \end
           {document}
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

However the output .tex file looks perfectly normal: tex file end

So it has come to the point where I've got no clue what's wrong. Any ideas?


LyX version 2.3.6.1, thmtools 63477 (73)

My whole preamble:

\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{listofitems}
\usepackage{xcolor}
\usepackage[outline]{contour}
\usepackage{thmtools}
\usetikzlibrary{patterns}
\usetikzlibrary{automata, arrows.meta, positioning}
1
  • By the way, If most of your text is in Hebrew, why the main language of the file is not Hebrew?
    – Udi Fogiel
    Jan 24 at 20:27

1 Answer 1

2

I think this error was already fixed in newer versions of thmtools, but even if you will update you won't be able to produce a list of theorems with your configuration.

The module Theorems (AMS) define the theorems environments via \newtheorem, but, only environments defined with \declaretheorem will be included in thmtools \listoftheorems.

I wrote a module to support thmtools in LyX, you can find it here. To install the module, open LyX and go to Help->About LyX, open the directory called User Directory, download the file theorems-thmtools.module to that directory and in LyX go to Tools->Reconfigue. When LyX finish, restart it. Now you should the the new module in your list of available modules.

Currently there is only a Number within section and by type variation, if you need another one and don't know how to modify the module file to get the type you need, let me know in the comments and I will load a new module to the repo.

Edit

I just remembered that I encountered this error before, it happens when using \listoftheorems without defining any theorem with \declaretheorem.

For example the following document will produce the same error

\documentclass{article}
\usepackage{thmtools}

% \declaretheorem{thm} % uncomment this line to remove the error 

\begin{document}

\listoftheorems

\end{document}

But with the module I mentioned before it shouldn't be a problem

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .