From f2086c23b03717ead05ca3a512091e302534c002 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 28 Dec 2009 21:16:07 +0000 Subject: LaTeX rendering fixes. --- docs/.static/note.png | Bin 0 -> 1562 bytes docs/conf.py | 60 ++++++++++++++++++++++++++++++++++++++++++++----- docs/copyright.rst | 2 +- docs/latexindex.rst | 13 ++++++----- docs/narr/install.rst | 10 +++++---- docs/narr/scanning.rst | 2 +- 6 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 docs/.static/note.png diff --git a/docs/.static/note.png b/docs/.static/note.png new file mode 100644 index 000000000..ff7b2fc84 Binary files /dev/null and b/docs/.static/note.png differ diff --git a/docs/conf.py b/docs/conf.py index 5c644ae0b..02fe587d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -194,10 +194,60 @@ latex_use_modindex = False ## \usepackage[bindingoffset=1cm,textheight=22cm,hdivide={2cm,*,2cm},vdivide={*,22cm,*}]{geometry} - -_PREAMBLE = r"""\usepackage[bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}]{geometry}""" +## _PREAMBLE = r"""\usepackage[bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}]{geometry}""" + +_PREAMBLE = r""" +\usepackage[]{geometry} +\geometry{bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}} +\hypersetup{ + colorlinks=true, + linkcolor=black, + citecolor=black, + filecolor=black, + urlcolor=black +} + +\pagestyle{fancy} + +\renewcommand{\chaptermark}[1]% +{\markboth{\MakeUppercase{\thechapter.\ #1}}{}} +\renewcommand{\sectionmark}[1]% +{\markright{\MakeUppercase{\thesection.\ #1}}} +\renewcommand{\headrulewidth}{0.5pt} +\renewcommand{\footrulewidth}{0pt} +\fancyhf{} +\fancyfoot[C]{\thepage} +\fancyhead[LO]{\rightmark} +\fancyhead[RE]{\leftmark} + +\fancypagestyle{plain}{ + \fancyhf{} % empty header and footer + \renewcommand{\headrulewidth}{0pt} % ho header line + \renewcommand{\footrulewidth}{0pt}% not footer line + \fancyfoot[C]{\thepage}% like fancy style +} +""" latex_elements = { - 'preamble':_PREAMBLE, # omit for letter size -# 'fncychap':r'\usepackage[Sonny]{fncychap}', - } + 'preamble': _PREAMBLE, + 'wrapperclass':'book', +} + +from docutils import nodes + +def frontmatter(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return [nodes.raw('', '\\frontmatter\n', format='latex')] + +def mainmatter(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return [nodes.raw('', '\\mainmatter\n', format='latex')] + +def backmatter(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return [nodes.raw('', '\\backmatter\n', format='latex')] + +def setup(app): + app.add_directive('frontmatter', frontmatter, 1, (0, 0, 0)) + app.add_directive('mainmatter', mainmatter, 1, (0, 0, 0)) + app.add_directive('backmatter', backmatter, 1, (0, 0, 0)) diff --git a/docs/copyright.rst b/docs/copyright.rst index 60c5f4793..0cdaab061 100644 --- a/docs/copyright.rst +++ b/docs/copyright.rst @@ -5,7 +5,7 @@ Copyright and Trademarks by Chris McDonough -Copyright ©2008-2010, Agendaless Consulting. +Copyright © 2008-2010, Agendaless Consulting. All rights reserved. This material may be copied or distributed only subject to the terms and conditions set forth in the `Creative Commons diff --git a/docs/latexindex.rst b/docs/latexindex.rst index 9a3ab1c95..653e3c918 100644 --- a/docs/latexindex.rst +++ b/docs/latexindex.rst @@ -4,8 +4,10 @@ The :mod:`repoze.bfg` Web Application Framework @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -Fore-matter -@@@@@@@@@@@ +.. frontmatter:: + +Front Matter +@@@@@@@@@@@@ .. toctree:: :maxdepth: 1 @@ -14,6 +16,8 @@ Fore-matter thanks.rst conventions.rst +.. mainmatter:: + Narrative Documentation @@@@@@@@@@@@@@@@@@@@@@@ @@ -93,6 +97,8 @@ ZCML Directives zcml +.. backmatter:: + Glossary and Index @@@@@@@@@@@@@@@@@@ @@ -100,6 +106,3 @@ Glossary and Index :maxdepth: 1 glossary - -* :ref:`genindex` - diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 667b08a7b..8f09ff13f 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -235,7 +235,8 @@ virtualenv (``bfgenv``) directory: .. code-block:: text - $ bin/easy_install -i http://dist.repoze.org/bfg/1.1/simple repoze.bfg + $ bin/easy_install -i http://dist.repoze.org/bfg/current/simple \ + repoze.bfg This command will take longer than the previous ones to complete, as it downloads and installs a number of dependencies. @@ -285,12 +286,13 @@ Installing :mod:`repoze.bfg` on a Windows System #. (Optional) Consider using ``bin\activate.bat`` to make your shell environment wired to use the virtualenv. -#. Use ``easy_install`` and point to the BFG "1.1" index to get BFG - and its direct dependencies installed: +#. Use ``easy_install`` and point to the :mod:`repoze.bfg` "current" + index to get BFG and its direct dependencies installed: .. code-block:: text - c:\bfgenv> Scripts\easy_install -i http://dist.repoze.org/bfg/1.1/simple repoze.bfg + c:\bfgenv> Scripts\easy_install -i \ + http://dist.repoze.org/bfg/current/simple repoze.bfg .. index:: pair: installing; Google App Engine diff --git a/docs/narr/scanning.rst b/docs/narr/scanning.rst index 4aceb926b..83908540e 100644 --- a/docs/narr/scanning.rst +++ b/docs/narr/scanning.rst @@ -74,7 +74,7 @@ found by the scanner, a set of calls are made to a :term:`Configurator` on behalf of the developer: these calls represent the intent of the configuration decoration. In the example above, this is best represented as the scanner translating the arguments to -:class:`repoze.bfg.view..bfg_view` into a call to the +:class:`repoze.bfg.view.bfg_view` into a call to the :meth:`repoze.bfg.configuration.Configurator.add_view` method, effectively: -- cgit v1.2.3