Opened 11 months ago
Closed 11 months ago
#31397 closed defect (fixed)
Work around LaTeX bug for building pdf documentation
Reported by:  jhpalmieri  Owned by:  

Priority:  critical  Milestone:  sage9.3 
Component:  documentation  Keywords:  
Cc:  Merged in:  
Authors:  John Palmieri  Reviewers:  Dave Morris 
Report Upstream:  Fixed upstream, in a later stable release.  Work issues:  
Branch:  be98648 (Commits, GitHub, GitLab)  Commit:  be986486a526fc52606182f79353457e9e6a90cf 
Dependencies:  Stopgaps: 
Description (last modified by )
Very recent versions of LaTeX won't build the PDF documentation for en/reference/stats/
, instead yielding an error:
Chapter 8. ! TeX capacity exceeded, sorry [input stack size=5000]. \non@alpherr #1>\@latex@error {\string #1 allowed only in math mode}\@ehd l.2922 ...Samplers for \protect\(\ZZ[x]\protect\)}
We should find a workaround.
(Split off from #31387 — some more discussion there.)
LaTeX bug is fixed at https://github.com/latex3/latex2e/pull/503.
Change History (8)
comment:1 Changed 11 months ago by
comment:2 Changed 11 months ago by
 Description modified (diff)
comment:3 Changed 11 months ago by
 Branch set to u/jhpalmieri/pdfdocbuildfix
comment:4 Changed 11 months ago by
 Commit set to be986486a526fc52606182f79353457e9e6a90cf
 Status changed from new to needs_review
This works for me (taken from one of the answers at tex.stackexchange.com).
New commits:
be98648  trac 31397: workaround for LaTeX bug when building PDF documentation

comment:5 Changed 11 months ago by
 Description modified (diff)
 Report Upstream changed from N/A to Fixed upstream, in a later stable release.
comment:6 Changed 11 months ago by
 Reviewers set to Dave Morris
 Status changed from needs_review to positive_review
Works for me, too. Thanks for fixing this.
By the way, I don't think \makeatletter
and \makeatother
are necessary, because the definition of \pdfstringdefDisableCommands
in hyperref.sty already includes \makeatletter
:
\def\pdfstringdefDisableCommands{% \begingroup \makeatletter \HyPsd@DisableCommands }
However, I don't see any harm in adding the extra lines, and it seems possible that old versions of hyperref might not have this, so the extra lines may be safer.
comment:7 Changed 11 months ago by
Great, thank you!
comment:8 Changed 11 months ago by
 Branch changed from u/jhpalmieri/pdfdocbuildfix to be986486a526fc52606182f79353457e9e6a90cf
 Resolution set to fixed
 Status changed from positive_review to closed
This is under discussion at https://tex.stackexchange.com/questions/583391/mactex2020errorwithreporthyperrefmathbfinchapter and has been proposed as a bug at https://github.com/latex3/latex2e/issues/501.