diff --git a/doc/do_sphinx.py b/doc/do_sphinx.py index 543d81f..77d7481 100644 --- a/doc/do_sphinx.py +++ b/doc/do_sphinx.py @@ -1,13 +1,24 @@ -import os,sys +import fileinput,os,sys def oscmd(c): os.system(c) +# html manual. oscmd('sphinx-build -d build/doctrees source build/html') if sys.platform != 'win32': + # LaTeX format. oscmd('sphinx-build -b latex -d build/doctrees source build/latex') + + # Produce pdf. os.chdir('build/latex') + + # Change chapter style to section style: allows chapters to start on the current page. Works much better for the short chapters we have. + for line in fileinput.FileInput('manual.cls',inplace=1): + line=line.replace('py@OldChapter=\chapter','py@OldChapter=\section') + print line, + + # Copying the makefile produced by sphinx... oscmd('pdflatex ipython.tex') oscmd('pdflatex ipython.tex') oscmd('pdflatex ipython.tex') @@ -15,4 +26,5 @@ if sys.platform != 'win32': oscmd('makeindex -s python.ist modipython.idx') oscmd('pdflatex ipython.tex') oscmd('pdflatex ipython.tex') + os.chdir('../..') diff --git a/doc/source/conf.py b/doc/source/conf.py index 2a93e2b..24ac6de 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -120,10 +120,10 @@ latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class [howto/manual]). -latex_documents = [('ipython','ipython.tex','IPython Documentation','Authors','manual')] +latex_documents = [('ipython','ipython.tex','IPython Documentation','IPython developers','manual')] # Additional stuff for the LaTeX preamble. -#latex_preamble = '' +latex_preamble = '\\def\\thesection{\\arabic{section}}' # Documents to append as an appendix to all manuals. #latex_appendices = []