diff options
Diffstat (limited to 'rtemsspec/sphinxcontent.py')
-rw-r--r-- | rtemsspec/sphinxcontent.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rtemsspec/sphinxcontent.py b/rtemsspec/sphinxcontent.py index f9849fc1..abec5553 100644 --- a/rtemsspec/sphinxcontent.py +++ b/rtemsspec/sphinxcontent.py @@ -72,6 +72,7 @@ def _grid_row(row: Iterable[str], maxi: Iterable[int]) -> str: class SphinxContent(Content): """ This class builds Sphinx content. """ + # pylint: disable=too-many-public-methods def __init__(self, section_level: int = 2): super().__init__("CC-BY-SA-4.0", True) self._tab = " " @@ -195,6 +196,23 @@ class SphinxContent(Content): yield self.open_section(name, label_prefix, label) self.close_section() + def open_latex_tiny(self, size: str = "tiny") -> None: + """ Opens a LaTeX tiny environment. """ + with self.directive("raw", "latex"): + self.add(f"\\begin{{{size}}}") + + def close_latex_tiny(self, size: str = "tiny") -> None: + """ Closes a LaTeX tiny environment. """ + with self.directive("raw", "latex"): + self.add(f"\\end{{{size}}}") + + @contextmanager + def latex_tiny(self, size: str = "tiny") -> Iterator[None]: + """ Opens a LaTeX tiny environment. """ + self.open_latex_tiny(size) + yield + self.close_latex_tiny(size) + def add_licence_and_copyrights(self) -> None: """ Adds a licence and copyright block according to the registered licenses |