From 1b06b5fc5fd471b7b29fc7271aaf5b9dd39fa9b3 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Fri, 23 Sep 2016 15:38:13 +0200
Subject: [PATCH] DOC: trick to generate CB pdf with one chapter per file

---
 Documentation/Cookbook/rst/conf.py.in    |  4 ++--
 Documentation/Cookbook/rst/index.rst     | 16 ----------------
 Documentation/Cookbook/rst/index_TOC.rst | 12 ++++++++++++
 3 files changed, 14 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/Cookbook/rst/index_TOC.rst

diff --git a/Documentation/Cookbook/rst/conf.py.in b/Documentation/Cookbook/rst/conf.py.in
index e063c8f5ef..4c927cc356 100644
--- a/Documentation/Cookbook/rst/conf.py.in
+++ b/Documentation/Cookbook/rst/conf.py.in
@@ -45,7 +45,7 @@ source_suffix = '.rst'
 #source_encoding = 'utf-8-sig'
 
 # The master toctree document.
-master_doc = 'index'
+master_doc = 'index_TOC'
 
 # General information about the project.
 project = u'OTB CookBook'
@@ -202,7 +202,7 @@ latex_elements = {
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-  ('index', 'OTBCookBook.tex', u'OTB CookBook Documentation',
+  ('index_TOC', 'CookBook-@OTB_VERSION_MAJOR@.@OTB_VERSION_MINOR@.tex', u'OTB CookBook Documentation',
    u'OTB Team', 'manual'),
 ]
 
diff --git a/Documentation/Cookbook/rst/index.rst b/Documentation/Cookbook/rst/index.rst
index e42246e420..ad0c312913 100644
--- a/Documentation/Cookbook/rst/index.rst
+++ b/Documentation/Cookbook/rst/index.rst
@@ -36,22 +36,6 @@ For other documentation, be sure to read:
 - `Doxygen <http://orfeo-toolbox.org/doxygen/>`_, for exhaustive documentation
   of the C++ API.
 
-Contents
-========
-
-.. toctree::
-   :maxdepth: 3
-
-   Installation
-   OTB-Applications
-   Monteverdi
-   Recipes
-   Applications
-
-Indices and tables
-==================
-
 * :ref:`genindex`
 * :ref:`modindex`
 * :ref:`search`
-
diff --git a/Documentation/Cookbook/rst/index_TOC.rst b/Documentation/Cookbook/rst/index_TOC.rst
new file mode 100644
index 0000000000..ae26c9ee24
--- /dev/null
+++ b/Documentation/Cookbook/rst/index_TOC.rst
@@ -0,0 +1,12 @@
+Table of Contents
+=================
+
+.. toctree::
+   :maxdepth: 3
+
+   index
+   Installation
+   OTB-Applications
+   Monteverdi
+   Recipes
+   Applications
-- 
GitLab