6

I'm using the De Gruyter template for the PETS conference, here is a direct link (ZIP). I'm getting a "Too deeply nested" error, and relevant searches only led to "reasonable" reasons why I could get this error (lists with more than 7 levels of nesting, or trailing open environments). Here is a minimal working example that shows that the problem must be elsewhere:

\documentclass{article}
\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{prop}{\protect\propositionname}

\usepackage[big]{dgruyter_NEW}
\usepackage{babel}
  \providecommand{\propositionname}{Proposition}

\begin{document}

\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}

\begin{prop}
woo prop
\begin{enumerate} % this is where it fails
\item woo item
\item woo other item
\end{enumerate}
\end{prop}

\end{document}

The weird thing is that deleting one of the dummy prop environments fixes the problem: I don't get the error anymore. Maybe the \end{prop} lines aren't taken into account or something?

Online, people suggest to add the lines:

\usepackage{enumitem}
\setlistdepth{9} % or some bigger number

This technically works (no more errors, if I set it to 30 for my article), but the placement and indentation of enumerate or itemize environments is all wrong:

bullet points on the right column end up in the left column, and indentation is wrong

Finally, I tried the debugging technique in this answer and added a \stop right before the \begin{enumerate}. The output seems correct, but not consistent with the "too deeply nested" error:

(\end occurred inside a group at level 1)
### semi simple group (level 1) entered at line 32 (\begingroup)
1
  • dgruyter_NEW file loads amsthm already
    – user31729
    Jun 15, 2017 at 9:22

3 Answers 3

6

You're unfortunately bound to using a buggy package. :-(

You can fix the error by loading the package before defining new theorems.

It's usually better first to load packages and then doing setup, in general. The style file loads amsthm and provides the dgthm and dgdef theorem styles.

\documentclass{article}
\usepackage[big]{dgruyter_NEW}

\theoremstyle{dgthm} % not plain
\newtheorem{prop}{\protect\propositionname}
\providecommand{\propositionname}{Proposition}

\begin{document}

\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}
\begin{prop}
woo prop
\end{prop}

\begin{prop}
woo prop
\begin{enumerate} % this is where it fails
\item woo item
\item woo other item
\end{enumerate}
\end{prop}

\end{document}
3
  • Thanks! This works, but unfortunately not for my workflow, since I'm using LyX and I can't easily add something before the part of the preamble that is automatically added by LyX. It seems I have to go create my own layout to avoid this =/
    – Ted
    Jun 15, 2017 at 9:29
  • 6
    @Ted I don't consider LyX as a good tool for writing in LaTeX, sorry.
    – egreg
    Jun 15, 2017 at 9:31
  • 1
    Additionally, it seems that even without the LyX shenanigans, loading dgruyter_NEW before amsmath or even not amsmath at all (like your example) isn't enough to make this bug go away. I've written another minimal example that raises the same error.
    – Ted
    Jun 15, 2017 at 11:16
4

the package doesn't work with amsthm lodaed first (it loads amsthm but modifies some definitions later).

But changing the three lines marked makes it more or less work (the first line is an unrelated problem that has come up before, the redefinition of \p@ used by this package completely breaks latex, I am surprised to see the package still being distributed with that in)

$ diff dgruyter_NEW.sty~ dgruyter_NEW.sty
22c22
< \p@=1bp
---
> %NO!!!!!!\p@=1bp
1379c1379,1380
<   \global\advance\@listdepth\@ne
---
> %NO  \global
>   \advance\@listdepth\@ne
1391c1392,1393
<   \global\advance\@listdepth\m@ne
---
> %NO  \global
>   \advance\@listdepth\m@ne
3
  • People at DG know better than you. ;-)
    – egreg
    Jun 15, 2017 at 9:30
  • Thanks David. Unfortunately, this works on my minimal example, but not on my article. I've created a second minimal example that fails even when I apply your changes.
    – Ted
    Jun 15, 2017 at 10:48
  • 1
    @Ted sorry but the package is a commercially supported package from De Gruyter and really it just breaks far too much stuff, I suggest you contact the maintainer listed in the comments in the file. But in any case for publication you should probably use the theorem forms provided by that package rather than use amsthm directly. Jun 15, 2017 at 10:59
1

My first guess is a bad interaction between dgruyter_NEW and amsthm packages. If you import the dgruyter_NEW first it should work.

You must log in to answer this question.

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