From a818f055b51e2b16aa160976b9ac44040d622333 Mon Sep 17 00:00:00 2001
From: Christoph Groth <christoph.groth@cea.fr>
Date: Wed, 28 Aug 2013 23:00:43 +0200
Subject: [PATCH] make the kwant version a part of the documentation title

---
 doc/source/conf.py   | 29 +++++++++++++++++++----------
 doc/source/index.rst |  6 +++---
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/doc/source/conf.py b/doc/source/conf.py
index d44ee114..87a93c1c 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -46,7 +46,7 @@ copyright = u'2011-2013, C. W. Groth, M. Wimmer, A. R. Akhmerov, X. Waintal, and
 # built documents.
 #
 # The full version, including alpha/beta/rc tags.
-release = kwant.version.version[:]
+release = kwant.__version__
 
 for i, s in enumerate(release):
     if s not in '0123456790.':
@@ -175,17 +175,29 @@ htmlhelp_basename = 'kwantdoc'
 
 # -- Options for LaTeX output --------------------------------------------------
 
-# The paper size ('letter' or 'a4').
-latex_paper_size = 'a4'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
+# http://thread.gmane.org/gmane.comp.python.sphinx.devel/4220/focus=4238
+latex_elements = {'papersize': 'a4paper',
+                  'release': '',
+                  'releasename': '',
+                  'preamble':
+r"""\makeatletter
+  \fancypagestyle{normal}{
+    \fancyhf{}
+    \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
+    \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
+    \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
+    \fancyhead[LE,RO]{{\py@HeaderFamily \@title}}
+    \renewcommand{\headrulewidth}{0.4pt}
+    \renewcommand{\footrulewidth}{0.4pt}
+  }
+\makeatother
+"""}
 
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, documentclass [howto/manual]).
 # We use "et al." as it is shorter and there's not much space left horizontally.
 latex_documents = [
-  ('index', 'kwant.tex', u'Kwant Documentation',
+  ('index', 'kwant.tex', 'Kwant {0} documentation'.format(release),
    u'C. W. Groth, M. Wimmer, A. R. Akhmerov, X. Waintal, et al.',
    'manual'),
 ]
@@ -198,9 +210,6 @@ latex_documents = [
 # not chapters.
 #latex_use_parts = False
 
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
 # Documents to append as an appendix to all manuals.
 #latex_appendices = []
 
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 40a4e1b4..861dbfb3 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1,6 +1,6 @@
-===================
-Kwant documentation
-===================
+=============================
+Kwant |release| documentation
+=============================
 
 .. toctree::
    :maxdepth: 2
-- 
GitLab