diff --git a/Makefile b/Makefile
index c5e74f062c2d08c78903e7e38ad666e4b95f0006..2658a30dc59fb205b63552eaaaa56539af10f16c 100644
--- a/Makefile
+++ b/Makefile
@@ -123,8 +123,8 @@ doc/ffprobe.pod doc/ffprobe.html: doc/demuxers.texi doc/indevs.texi doc/protocol
 doc/libavfilter.html: doc/filters.texi
 
 doc/%.html: TAG = HTML
-doc/%.html: doc/%.texi
-	$(M)cd doc && texi2html -monolithic -number $(<:doc/%=%)
+doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
+	$(M)cd doc && texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init $(<:doc/%=%)
 
 doc/%.pod: TAG = POD
 doc/%.pod: doc/%.texi
diff --git a/doc/developer.texi b/doc/developer.texi
index 89bc3392e4cfd2965bb3663d39b7aacbe6f8075d..b9e246f21410309a88621d00c79162f6ad60344d 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -2,11 +2,12 @@
 
 @settitle Developer Documentation
 @titlepage
-@sp 7
 @center @titlefont{Developer Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
 
 @chapter Developers Guide
 
diff --git a/doc/faq.texi b/doc/faq.texi
index c03a2e1efea5db02dac9fedfa558730649e8eb81..100adff31220a4baf3728917fd0bda91215de137 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -2,11 +2,12 @@
 
 @settitle FFmpeg FAQ
 @titlepage
-@sp 7
 @center @titlefont{FFmpeg FAQ}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
 
 @chapter General Questions
 
diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 98f2031f75359aaddd41c94000374186c428013c..047444ab62d03087d0a508aa2602e25fd58ae027 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -2,11 +2,13 @@
 
 @settitle FFmpeg Documentation
 @titlepage
-@sp 7
 @center @titlefont{FFmpeg Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
+
 @chapter Synopsis
 
 The generic syntax is:
diff --git a/doc/ffplay.texi b/doc/ffplay.texi
index c03905c3e0bff2c2d653a0bc73d88058b08e3067..e0518b859e439f382c477f5d03a92bc28e3cbbf7 100644
--- a/doc/ffplay.texi
+++ b/doc/ffplay.texi
@@ -2,11 +2,13 @@
 
 @settitle FFplay Documentation
 @titlepage
-@sp 7
 @center @titlefont{FFplay Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
+
 @chapter Synopsis
 
 @example
diff --git a/doc/ffprobe.texi b/doc/ffprobe.texi
index bc96bd561e6fef58822a7394e37d7c2241aec489..de65eee66456b80741c05cf7d0cfc18c8069822f 100644
--- a/doc/ffprobe.texi
+++ b/doc/ffprobe.texi
@@ -2,11 +2,13 @@
 
 @settitle FFprobe Documentation
 @titlepage
-@sp 7
 @center @titlefont{FFprobe Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
+
 @chapter Synopsis
 
 The generic syntax is:
diff --git a/doc/ffserver.texi b/doc/ffserver.texi
index 77deb85317e46db961c6c487c8b358da6ef249eb..0cab3c8a98f29e81bf53e256b82759ea173a1a7d 100644
--- a/doc/ffserver.texi
+++ b/doc/ffserver.texi
@@ -2,11 +2,13 @@
 
 @settitle FFserver Documentation
 @titlepage
-@sp 7
 @center @titlefont{FFserver Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
+
 @chapter Synopsys
 
 The generic syntax is:
diff --git a/doc/general.texi b/doc/general.texi
index c1fecef580c1307df1c3483be8459588d7a2a596..950159f1b35c9ec8025a25f0c6e71117568d509e 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -2,11 +2,12 @@
 
 @settitle General Documentation
 @titlepage
-@sp 7
 @center @titlefont{General Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
 
 @chapter external libraries
 
diff --git a/doc/libavfilter.texi b/doc/libavfilter.texi
index 8745928d40aba9274e7e6cc69296e63655bffa24..f0b448259ad3c0f74b5f57589942ef96b174af73 100644
--- a/doc/libavfilter.texi
+++ b/doc/libavfilter.texi
@@ -2,11 +2,12 @@
 
 @settitle Libavfilter Documentation
 @titlepage
-@sp 7
 @center @titlefont{Libavfilter Documentation}
-@sp 3
 @end titlepage
 
+@top
+
+@contents
 
 @chapter Introduction
 
diff --git a/doc/t2h.init b/doc/t2h.init
new file mode 100644
index 0000000000000000000000000000000000000000..cd38a3ec9e0d159e0b5f3fbf0a406efa9becc032
--- /dev/null
+++ b/doc/t2h.init
@@ -0,0 +1,24 @@
+# no horiz rules between sections
+$end_section = \&FFMPEG_end_section;
+sub FFMPEG_end_section($$)
+{
+}
+
+$print_page_foot = \&FFMPEG_print_page_foot;
+sub FFMPEG_print_page_foot($$)
+{
+    my $fh = shift;
+    print $fh "$SMALL_RULE\n";
+    T2H_DEFAULT_print_page_foot($fh);
+}
+
+# no navigation elements
+$SECTION_NAVIGATION = 0;
+# the same for texi2html 5.0
+$HEADERS = 0;
+
+# TOC and Chapter headings link
+$TOC_LINKS = 1;
+
+# print the TOC where @contents is used
+$INLINE_CONTENTS = 1;