From b2c79111f88851cebd9bb8403d7135cfe26b0f53 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 19 Feb 2010 10:45:04 +0100 Subject: [PATCH 1/3] #331: Fix output for enumerated lists with start values in LaTeX. --- CHANGES | 2 ++ sphinx/writers/latex.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 2db62edb4..6ee492305 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Release 0.6.5 (in development) ============================== +* #331: Fix output for enumerated lists with start values in LaTeX. + * Make the ``start-after`` and ``end-before`` options to the ``literalinclude`` directive work correctly if not used together. diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 14e9bc059..517d8d86d 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -734,6 +734,8 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_enumerated_list(self, node): self.body.append('\\begin{enumerate}\n' ) + if 'start' in node: + self.body.append('\\setcounter{enumi}{%d}\n' % (node['start'] - 1)) def depart_enumerated_list(self, node): self.body.append('\\end{enumerate}\n' ) From b9dd04176f074e097a6b61e2da5776287e189859 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 19 Feb 2010 19:58:35 +0100 Subject: [PATCH 2/3] pygments_style for HTML is selected by the theme. --- doc/config.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index 2e96a749c..7c5256146 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -271,9 +271,8 @@ Project information .. confval:: pygments_style - The style name to use for Pygments highlighting of source code. Default is - ``'sphinx'``, which is a builtin style designed to match Sphinx' default - style. + The style name to use for Pygments highlighting of source code. The default + style is selected by the theme for HTML output, and ``'sphinx'`` otherwise. .. versionchanged:: 0.3 If the value is a fully-qualified name of a custom Pygments style class, From b81b7a046328dff1cac28b9b35920f4636a8465f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 21 Feb 2010 21:46:07 +0100 Subject: [PATCH 3/3] Remove docs for autosummary features that are not actually in 0.6. --- doc/ext/autosummary.rst | 98 ----------------------------------------- 1 file changed, 98 deletions(-) diff --git a/doc/ext/autosummary.rst b/doc/ext/autosummary.rst index 9d75cb0cb..7b5e5b6b9 100644 --- a/doc/ext/autosummary.rst +++ b/doc/ext/autosummary.rst @@ -85,18 +85,6 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts: sphinx.environment.BuildEnvironment sphinx.util.relative_uri - * You can specify a custom template with the ``template`` option. - For example, :: - - .. autosummary:: - :template: mytemplate.rst - - sphinx.environment.BuildEnvironment - - would use the template :file:`mytemplate.rst` in your - :confval:`templates_path` to generate the pages for all entries - listed. See `Customizing templates`_ below. - :program:`sphinx-autogen` -- generate autodoc stub pages -------------------------------------------------------- @@ -134,89 +122,3 @@ also use this new config value: The new files will be placed in the directories specified in the ``:toctree:`` options of the directives. - - -Customizing templates ---------------------- - -You can customize the stub page templates, in a similar way as the HTML Jinja -templates, see :ref:`templating`. (:class:`~sphinx.application.TemplateBridge` -is not supported.) - -.. note:: - - If you find yourself spending much time tailoring the stub templates, this - may indicate that it's a better idea to write custom narrative documentation - instead. - -Autosummary uses the following template files: - -- :file:`autosummary/base.rst` -- fallback template -- :file:`autosummary/module.rst` -- template for modules -- :file:`autosummary/class.rst` -- template for classes -- :file:`autosummary/function.rst` -- template for functions -- :file:`autosummary/attribute.rst` -- template for class attributes -- :file:`autosummary/method.rst` -- template for class methods - -The following variables available in the templates: - -.. data:: name - - Name of the documented object, excluding the module and class parts. - -.. data:: objname - - Name of the documented object, excluding the module parts. - -.. data:: fullname - - Full name of the documented object, including module and class parts. - -.. data:: module - - Name of the module the documented object belongs to. - -.. data:: class - - Name of the class the documented object belongs to. Only available for - methods and attributes. - -.. data:: underline - - A string containing ``len(full_name) * '='``. - -.. data:: members - - List containing names of all members of the module or class. Only available - for modules and classes. - -.. data:: functions - - List containing names of "public" functions in the module. Here, "public" - here means that the name does not start with an underscore. Only available - for modules. - -.. data:: classes - - List containing names of "public" classes in the module. Only available for - modules. - -.. data:: exceptions - - List containing names of "public" exceptions in the module. Only available - for modules. - -.. data:: methods - - List containing names of "public" methods in the class. Only available for - classes. - -.. data:: attributes - - List containing names of "public" attributes in the class. Only available - for classes. - -.. note:: - - You can use the :dir:`autosummary` directive in the stub pages. - Stub pages are generated also based on these directives.