Skip to content

gh-139588: Docs: PDF/LaTeX: bump max list depth#140709

Merged
AA-Turner merged 3 commits intopython:mainfrom
m-aciek:docs/pdf/fix-too-deeply-nested/maxlistdepth
Oct 28, 2025
Merged

gh-139588: Docs: PDF/LaTeX: bump max list depth#140709
AA-Turner merged 3 commits intopython:mainfrom
m-aciek:docs/pdf/fix-too-deeply-nested/maxlistdepth

Conversation

@m-aciek
Copy link
Contributor

@m-aciek m-aciek commented Oct 28, 2025

Prevents LaTeX PDF build error Too deeply nested. (Regression from #135945.)

Thanks @jfbu for the fix suggestion.

Zrzut ekranu 2025-10-28 o 15 45 51

Better alternative to #140445.

Could it be labeled for backport on 3.13-3.15 please?


📚 Documentation preview 📚: https://cpython-previews--140709.org.readthedocs.build/

Prevents LaTeX PDF build error `Too deeply nested`. (Regression from python#139509.)
Prevents LaTeX PDF build error `Too deeply nested`. (Regression from python#139509.)
@AA-Turner AA-Turner enabled auto-merge (squash) October 28, 2025 19:51
@AA-Turner
Copy link
Member

Thanks, I've also increased it to 8 per Jean-François' suggestion.

A

@AA-Turner AA-Turner merged commit ce4b0ed into python:main Oct 28, 2025
32 checks passed
@miss-islington-app
Copy link

Thanks @m-aciek for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 28, 2025
(cherry picked from commit ce4b0ed)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 28, 2025
(cherry picked from commit ce4b0ed)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Oct 28, 2025

GH-140724 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Oct 28, 2025
@bedevere-app
Copy link

bedevere-app bot commented Oct 28, 2025

GH-140725 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 28, 2025
AA-Turner added a commit that referenced this pull request Oct 28, 2025
)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
AA-Turner added a commit that referenced this pull request Oct 28, 2025
)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@m-aciek m-aciek deleted the docs/pdf/fix-too-deeply-nested/maxlistdepth branch October 28, 2025 20:20
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@m-aciek
Copy link
Contributor Author

m-aciek commented Mar 4, 2026

FYI I discovered yesterday that this PR didn't fully fixed the PDF build issue. Now make all-pdf command in latex build directory still returns non-zero exit code and prevents next PDF file (whatsnew.pdf) to be build when there's no flag --keep-going used, despite the fact that the PDF is rendered correctly.

The error from make all-pdf can be silenced with:

Index: Doc/conf.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Doc/conf.py b/Doc/conf.py
--- a/Doc/conf.py	(revision 8255901127193a0b5e82034e730f7749b68c460f)
+++ b/Doc/conf.py	(revision a93073936f4ea1cd3fa62e0a478b1b3aa1f40a98)
@@ -355,6 +355,7 @@
 \let\Verbatim=\OriginalVerbatim
 \let\endVerbatim=\endOriginalVerbatim
 \setcounter{tocdepth}{2}
+\makeatletter\let\@toodeep\relax\makeatother
 ''',
     # The paper size ('letterpaper' or 'a4paper').
     'papersize': 'a4paper',

I plan to prepare a follow-up PR soon.

@jfbu
Copy link
Contributor

jfbu commented Mar 4, 2026 via email

@m-aciek
Copy link
Contributor Author

m-aciek commented Mar 4, 2026

Hi, I guess setting 'maxlistdepth' to a higher value '10' or '12' did not help?

I will try it later.

It would be nice to fetch the actual reported LaTeX error for analysis, if at all possible.

The logs are available here: https://github.com/m-aciek/python-docs-offline/actions/runs/22630330823. There is pdf-logs.zip artifact with .tex and .log files.

@jfbu
Copy link
Contributor

jfbu commented Mar 4, 2026

In reference.log:

[73]

! LaTeX Error: Too deeply nested.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8582 \begin{DUlineblock}{\DUlineblockindent}
                                              
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

[74] [75] [76

Try increasing the setting of 'maxlistdepth'.

@m-aciek
Copy link
Contributor Author

m-aciek commented Mar 4, 2026

I am sorry for confusion, I was wrong! I was working on an old checkout from repository 🤦 and didn't have above changes locally. Sorry for the noise, and thank you for the help @jfbu!

@jfbu
Copy link
Contributor

jfbu commented Mar 4, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants