Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ham <David.Ham@imperial.ac.uk>2021-05-03 23:50:22 +0300
committerDavid Ham <David.Ham@imperial.ac.uk>2021-05-03 23:50:22 +0300
commit31f7eae82272026571fd8e55292a1498e6b8f31f (patch)
tree22c71239f124ffd990e8ab430bd9bf44934098dd /sphinx/writers
parentf31af4b8158e6142d918366aa0026e40575af914 (diff)
Support containers in LaTeX output.
Support containers in the LaTeX writer by outputting the start and end of a LaTeX group, wrapping the beginning and end of a LaTeX environment. The class name(s) are passed as an argument to the environment.
Diffstat (limited to 'sphinx/writers')
-rw-r--r--sphinx/writers/latex.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 546db9e31..4db75d1ef 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -1975,10 +1975,12 @@ class LaTeXTranslator(SphinxTranslator):
pass
def visit_container(self, node: Element) -> None:
- pass
+ classes = node.get('classes', [])
+ self.body.append(
+ '\n\\bgroup\\begin{sphinxcontainer}{%s}' % ' '.join(classes))
def depart_container(self, node: Element) -> None:
- pass
+ self.body.append('\n\\end{sphinxcontainer}\\egroup')
def visit_decoration(self, node: Element) -> None:
pass