@@ -1592,19 +1592,24 @@ def config_inited(app, config):
15921592 # this only works if mathjax_config or mathjax2_config is specified.
15931593 if config .mathjax3_config is None :
15941594 config .mathjax3_config = {}
1595- mathjax3_config = config .mathjax3_config
1595+ mathjax_config = config .mathjax3_config
1596+ if not mathjax_config and hasattr (config , 'mathjax4_config' ):
1597+ # mathjax4_config was added in Sphinx 8.?
1598+ if config .mathjax4_config is None :
1599+ config .mathjax4_config = {}
1600+ mathjax_config = config .mathjax4_config
15961601 tex = {
15971602 'inlineMath' : mathjax_inline_math ,
15981603 'processEscapes' : True ,
15991604 }
1600- tex .update (mathjax3_config .get ('tex' , {}))
1601- mathjax3_config ['tex' ] = tex
1605+ tex .update (mathjax_config .get ('tex' , {}))
1606+ mathjax_config ['tex' ] = tex
16021607 options = {
16031608 'ignoreHtmlClass' : mathjax_ignore_class ,
16041609 'processHtmlClass' : mathjax_process_class ,
16051610 }
1606- options .update (mathjax3_config .get ('options' , {}))
1607- mathjax3_config ['options' ] = options
1611+ options .update (mathjax_config .get ('options' , {}))
1612+ mathjax_config ['options' ] = options
16081613 else :
16091614 if hasattr (config , 'mathjax2_config' ):
16101615 # Sphinx >= 4.0
0 commit comments