diff --git a/debian/control b/debian/control
index 640e4ad0c461c805e8206e2667583ed8279431cd..0e99c0ce1c6e584cfdcfa8d88cf6597acb82166f 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-all,
                python3-setuptools,
                python3-pytest,
+               python3-sphinx,
 Standards-Version: 4.6.2
 Rules-Requires-Root: no
 Homepage: https://gitlab.inria.fr/bleuse/procset.py
@@ -16,6 +17,7 @@ Vcs-Browser: https://gitlab.inria.fr/bleuse/procset.py
 
 Package: python3-procset
 Architecture: all
+Suggests: python-procset-doc,
 Depends: ${misc:Depends},
          ${python3:Depends},
 Description: Pure Python implementation of the interval set data structure
@@ -29,3 +31,22 @@ Description: Pure Python implementation of the interval set data structure
  additional ability to access its elements by position.
  .
  This is the Python 3 package.
+
+Package: python-procset-doc
+Architecture: all
+Multi-Arch: foreign
+Depends: ${misc:Depends},
+         ${sphinxdoc:Depends},
+	 libjs-mathjax,
+Section: doc
+Description: Pure Python implementation of the interval set data structure (doc)
+ An interval set (provided as the ProcSet class) is a memory-efficient
+ representation of closed-interval sets.
+ A ProcSet is an hybrid between a set and a list of indexes.
+ More precisely, a ProcSet object is an ordered collection of unique
+ non-negative int.
+ It supports most of set operations: notably membership testing, mathematical
+ operations such as intersection, union, and (symmetric) difference; with the
+ additional ability to access its elements by position.
+ .
+ This package contains the HTML documentation.
diff --git a/debian/patches/force-local-mathjax.patch b/debian/patches/force-local-mathjax.patch
new file mode 100644
index 0000000000000000000000000000000000000000..160b2a1237e62c42af38c226dd1612096f5387a0
--- /dev/null
+++ b/debian/patches/force-local-mathjax.patch
@@ -0,0 +1,19 @@
+Description: Force use of local MathJax instead of CDN
+Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989649
+Last-Update: 2023-05-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: procset.git/docs/conf.py
+===================================================================
+--- procset.git.orig/docs/conf.py
++++ procset.git/docs/conf.py
+@@ -201,3 +201,9 @@ autoclass_content = 'both'
+ # -- Options for intersphinx extension ---------------------------------------
+ 
+ intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
++
++
++# -- Options for mathjax extension -------------------------------------------
++
++# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989649
++mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
diff --git a/debian/patches/remove-badges-from-documentation.patch b/debian/patches/remove-badges-from-documentation.patch
new file mode 100644
index 0000000000000000000000000000000000000000..38d9803a91336356f2a9c858718231f183284fd0
--- /dev/null
+++ b/debian/patches/remove-badges-from-documentation.patch
@@ -0,0 +1,31 @@
+Description: Remove badges from documentation
+Author: Raphaël Bleuse <cs@research.bleuse.net>
+Forwarded: no
+Last-Update: 2023-05-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: procset.git/docs/_templates/badges.html
+===================================================================
+--- procset.git.orig/docs/_templates/badges.html
++++ /dev/null
+@@ -1,8 +0,0 @@
+-<ul>
+-	<li>
+-		<a href="https://pypi.org/project/procset/"><img alt="PyPI project page" src="https://img.shields.io/pypi/v/procset.svg?style=flat-square"></a>
+-	</li>
+-	<li>
+-		<a href="https://gitlab.inria.fr/bleuse/procset.py"><img alt="git repository" src="https://img.shields.io/badge/src-procset-blue.svg?style=flat-square"></a>
+-	</li>
+-</ul>
+Index: procset.git/docs/conf.py
+===================================================================
+--- procset.git.orig/docs/conf.py
++++ procset.git/docs/conf.py
+@@ -108,7 +108,6 @@ html_static_path = ['_static']
+ html_sidebars = {
+     '**': [
+         'about.html',
+-        'badges.html',
+         'navigation.html',
+         'relations.html',
+         'searchbox.html',
diff --git a/debian/patches/series b/debian/patches/series
index 0c2d7eb9025f3c5b091ff7fb39b3b46267a14212..c3dccea9fc629dc54360166e347907f69786e8e6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 drop-code-coverage.patch
 remove-deprecated-code.patch
+remove-badges-from-documentation.patch
+force-local-mathjax.patch
diff --git a/debian/python-procset-doc.doc-base b/debian/python-procset-doc.doc-base
new file mode 100644
index 0000000000000000000000000000000000000000..18b4bbdcb0f5d539a4964ce019695e5ce2f85bbe
--- /dev/null
+++ b/debian/python-procset-doc.doc-base
@@ -0,0 +1,12 @@
+Document: python-procset-doc
+Title: procset User Documentation
+Author: Raphaël Bleuse
+Abstract: A pure Python implementation of the interval set data structure.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/python3-procset/html/index.html
+Files: /usr/share/doc/python3-procset/html/*
+
+Format: Text
+Files: /usr/share/doc/python3-procset/rst/*
diff --git a/debian/python-procset-doc.docs b/debian/python-procset-doc.docs
new file mode 100644
index 0000000000000000000000000000000000000000..dd2636a1b3bd9d1d1ed854dfa885da69c30ca509
--- /dev/null
+++ b/debian/python-procset-doc.docs
@@ -0,0 +1 @@
+docs/_build/html/
diff --git a/debian/python-procset-doc.links b/debian/python-procset-doc.links
new file mode 100644
index 0000000000000000000000000000000000000000..5503c267ea93af83f9fb004fcbb807e29c49e36a
--- /dev/null
+++ b/debian/python-procset-doc.links
@@ -0,0 +1 @@
+usr/share/doc/python3-procset/html/_sources usr/share/doc/python3-procset/rst
diff --git a/debian/rules b/debian/rules
index 88437dc1c20be92a05f2067a3eab92282f4090af..9c75cc629a6562af3d9ff49e76086281d99e80e7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,15 @@ export PYBUILD_NAME=procset
 export PYBUILD_TEST_PYTEST=1
 
 %:
-	dh $@ --with python3 --buildsystem=pybuild
+	dh $@ --with python3,sphinxdoc --buildsystem=pybuild
+
+execute_after_dh_auto_build:
+	$(MAKE) --directory=docs html
+
+override_dh_installdocs:
+	dh_installdocs --package=python-procset-doc --doc-main-package=python3-procset
+	dh_installdocs --remaining-packages
 
 execute_after_dh_auto_clean:
+	$(MAKE) --directory=docs clean
 	$(RM) --recursive -- src/procset.egg-info/