Switch Sphinx documentation theme to Furo

Switch html_theme in docs/source/conf.py from sphinx_rtd_theme to furo
and remove the sphinx_rtd_theme-specific jquery extension, pygments
style override, and MathJax scale override.

Update CMakeLists.txt, cmake/FindSphinx.cmake, docs/requirements.txt,
and docs/source/installation.rst to require and check for the furo
package.

Change-Id: Ib12acb102b40c85053ee758c940796cae4f82857
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a0b6fa..35890ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,7 +181,7 @@
 endif()
 
 find_package(METIS)
-find_package(Sphinx COMPONENTS sphinx_rtd_theme)
+find_package(Sphinx COMPONENTS furo)
 # Ubuntu 22.04 provides SuiteSparse 5.10.1, which remains supported.
 find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR
   OPTIONAL_COMPONENTS Partition)
diff --git a/cmake/FindSphinx.cmake b/cmake/FindSphinx.cmake
index 2fdf7e9..f19123f 100644
--- a/cmake/FindSphinx.cmake
+++ b/cmake/FindSphinx.cmake
@@ -85,18 +85,12 @@
   find_package (Python COMPONENTS Interpreter)
 
   if (Python_Interpreter_FOUND)
-    # Check for Sphinx theme dependency for documentation
+    # Check for Sphinx theme/extension dependencies for documentation
     foreach (component IN LISTS Sphinx_FIND_COMPONENTS)
-      string (REGEX MATCH "^(.+_theme)$" theme_component "${component}")
-
-      if (NOT theme_component STREQUAL component)
-        continue ()
-      endif (NOT theme_component STREQUAL component)
-
       execute_process (
         # Report only the reason of a failed import instead of a traceback.
         COMMAND ${Python_EXECUTABLE} -c
-          "import sys\ntry:\n  import ${theme_component}\nexcept ImportError as e:\n  sys.exit(str(e))"
+          "import sys\ntry:\n  import ${component}\nexcept ImportError as e:\n  sys.exit(str(e))"
         ERROR_STRIP_TRAILING_WHITESPACE
         ERROR_VARIABLE _Sphinx_BUILD_ERROR
         OUTPUT_QUIET
@@ -107,7 +101,7 @@
         set (Sphinx_${component}_FOUND TRUE)
       else (_Sphinx_BUILD_RESULT EQUAL 0)
         if (NOT Sphinx_FIND_QUIETLY)
-          message (STATUS "Sphinx component '${theme_component}' is not available: ${_Sphinx_BUILD_ERROR}")
+          message (STATUS "Sphinx component '${component}' is not available: ${_Sphinx_BUILD_ERROR}")
         endif (NOT Sphinx_FIND_QUIETLY)
         set (Sphinx_${component}_FOUND FALSE)
       endif (_Sphinx_BUILD_RESULT EQUAL 0)
@@ -115,8 +109,6 @@
       unset (_Sphinx_BUILD_ERROR)
       unset (_Sphinx_BUILD_RESULT)
     endforeach (component)
-
-    unset (theme_component)
   endif (Python_Interpreter_FOUND)
 endif (Sphinx_BUILD_EXECUTABLE)
 
diff --git a/docs/requirements.txt b/docs/requirements.txt
index dd9a35d..1750b45 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,2 +1,2 @@
-sphinx-rtd-theme>=3.0.2
+furo>=2024.8.6
 sphinx>=8.1.3
diff --git a/docs/source/conf.py b/docs/source/conf.py
index e74cfac..96d942c 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -50,12 +50,10 @@
     'sphinx.ext.todo',
     'sphinx.ext.mathjax',
     'sphinx.ext.ifconfig',
-    'sphinxcontrib.jquery',
 ]
 
 master_doc = 'index'
 exclude_patterns = []
-pygments_style = 'sphinx'
 nitpicky = True
 
 # Enum and typedef identifiers used in member/function declarations whose
@@ -83,7 +81,7 @@
     ('cpp:identifier', 'VisibilityClusteringType'),
 ]
 
-html_theme = 'sphinx_rtd_theme'
+html_theme = 'furo'
 html_title = 'Ceres Solver'
 html_domain_indices = True
 html_use_index = True
@@ -92,10 +90,3 @@
 html_show_sphinx = False
 html_show_copyright = True
 htmlhelp_basename = 'CeresSolverdoc'
-
-mathjax3_config = {
-    'HTML-CSS': {
-        'availableFonts': ['TeX'],
-        'scale': 90,
-    },
-}
diff --git a/docs/source/installation.rst b/docs/source/installation.rst
index 1a83214..3e0b438 100644
--- a/docs/source/installation.rst
+++ b/docs/source/installation.rst
@@ -623,8 +623,7 @@
 
 #. ``BUILD_DOCUMENTATION [Default: OFF]``: Use this to enable building
    the documentation. This requires `Sphinx <https://www.sphinx-doc.org/>`_ and
-   the `sphinx-rtd-theme
-   <https://pypi.org/project/sphinx-rtd-theme/>`_ package
+   the `furo <https://pypi.org/project/furo/>`_ package
    available from the Python package index. In addition, ``make ceres_docs``
    can be used to build only the documentation.