Opened 7 months ago

Closed 7 months ago

#31397 closed defect (fixed)

Work around LaTeX bug for building pdf documentation

Reported by: jhpalmieri Owned by:
Priority: critical Milestone: sage-9.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:

Status badges

Description (last modified by jhpalmieri)

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:2 Changed 7 months ago by jhpalmieri

  • Description modified (diff)

comment:3 Changed 7 months ago by jhpalmieri

  • Branch set to u/jhpalmieri/pdf-docbuild-fix

comment:4 Changed 7 months ago by jhpalmieri

  • Authors set to John Palmieri
  • 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:

be98648trac 31397: workaround for LaTeX bug when building PDF documentation

comment:5 Changed 7 months ago by jhpalmieri

  • Description modified (diff)
  • Report Upstream changed from N/A to Fixed upstream, in a later stable release.

comment:6 Changed 7 months ago by gh-DaveWitteMorris

  • 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 7 months ago by jhpalmieri

Great, thank you!

comment:8 Changed 7 months ago by vbraun

  • Branch changed from u/jhpalmieri/pdf-docbuild-fix to be986486a526fc52606182f79353457e9e6a90cf
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.