diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index cd6cce9b4..b465a2f8c 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -167,6 +167,9 @@ class LaTeXTranslator(nodes.NodeVisitor): 'transition': '\n\n\\bigskip\\hrule{}\\bigskip\n\n', } + # sphinx specific document classes + docclasses = ('howto', 'manual') + def __init__(self, document, builder): nodes.NodeVisitor.__init__(self, document) self.builder = builder @@ -179,7 +182,7 @@ class LaTeXTranslator(nodes.NodeVisitor): self.elements = self.default_elements.copy() self.elements.update({ - 'wrapperclass': document.settings.docclass, + 'wrapperclass': self.format_docclass(document.settings.docclass), 'papersize': papersize, 'pointsize': builder.config.latex_font_size, # if empty, the title is set to the first section title @@ -276,6 +279,13 @@ class LaTeXTranslator(nodes.NodeVisitor): self.previous_spanning_column = 0 self.remember_multirow = {} + def format_docclass(self, docclass): + """ prepends prefix to sphinx document classes + """ + if docclass in self.docclasses: + docclass = 'sphinx' + docclass + return docclass + def astext(self): return (HEADER % self.elements + self.highlighter.get_stylesheet() +