diff --git a/sphinx/latexwriter.py b/sphinx/latexwriter.py index bd2e1bc73..310caa4e6 100644 --- a/sphinx/latexwriter.py +++ b/sphinx/latexwriter.py @@ -358,6 +358,15 @@ class LaTeXTranslator(nodes.NodeVisitor): self.in_title = 0 self.body.append(self.context.pop()) + def visit_subtitle(self, node): + if isinstance(node.parent, nodes.sidebar): + self.body.append('~\\\\\n\\textbf{') + self.context.append('}\n\\smallskip\n') + else: + self.context.append('') + def depart_subtitle(self, node): + self.body.append(self.context.pop()) + desc_map = { 'function' : 'funcdesc', 'class': 'classdesc', diff --git a/sphinx/textwriter.py b/sphinx/textwriter.py index 0a418e6cd..887389f46 100644 --- a/sphinx/textwriter.py +++ b/sphinx/textwriter.py @@ -126,6 +126,16 @@ class TextTranslator(nodes.NodeVisitor): self.add_text(' ]-') self.end_state() + def visit_sidebar(self, node): + pass + def depart_sidebar(self, node): + pass + + def visit_compound(self, node): + pass + def depart_compound(self, node): + pass + def visit_glossary(self, node): pass def depart_glossary(self, node): @@ -145,6 +155,16 @@ class TextTranslator(nodes.NodeVisitor): self.stateindent.pop() self.states[-1].append((0, ['', text, '%s' % (char * len(text)), ''])) + def visit_subtitle(self, node): + pass + def depart_subtitle(self, node): + pass + + def visit_attribution(self, node): + self.add_text('-- ') + def depart_attribution(self, node): + pass + def visit_module(self, node): if node.has_key('platform'): self.new_state(0) diff --git a/tests/root/markup.txt b/tests/root/markup.txt index ceb74f63e..c11b531e7 100644 --- a/tests/root/markup.txt +++ b/tests/root/markup.txt @@ -31,6 +31,41 @@ Admonitions Tip text. +Body directives +--------------- + +.. topic:: Title + + Topic body. + +.. sidebar:: Sidebar + :subtitle: Sidebar subtitle + + Sidebar body. + +.. rubric:: Test rubric + +.. epigraph:: Epigraph title + + Epigraph body. + + -- Author + +.. highlights:: Highlights + + Highlights body. + +.. pull-quote:: Pull-quote + + Pull quote body. + +.. compound:: + + a + + b + + Tables ------