24 lines
600 B
Python
24 lines
600 B
Python
# -*- encoding: utf-8
|
|
|
|
from ..element import element
|
|
|
|
|
|
class tikzpicture(element):
|
|
""" Class representing a latex tikzfigure. """
|
|
|
|
templates = {
|
|
"options": "[{content}]",
|
|
"content": """\\begin{{tikzpicture}}{options}
|
|
{inner}
|
|
\\end{{tikzpicture}}""",
|
|
}
|
|
|
|
def __init__(self, childrens=None, parent=None, label=None, **kargs):
|
|
super().__init__(parent, childrens, label=label, **kargs)
|
|
|
|
def content(self):
|
|
return self.fmt().format(
|
|
"content",
|
|
{"inner": super().content(), "options": self.format_options(self.options)},
|
|
)
|