25 lines
600 B
Python
25 lines
600 B
Python
# -*- encoding: utf-8 -*-
|
|
|
|
from .element import element
|
|
|
|
|
|
class includegraphics(element):
|
|
""" Class representing a latex includegrahics. """
|
|
|
|
templates = {
|
|
"options": "[{content}]",
|
|
"element": "\\includegraphics{options}{{{filename}}}",
|
|
}
|
|
|
|
autolabel = False
|
|
|
|
def __init__(self, filename, parent=None, **kargs):
|
|
super().__init__(parent, **kargs)
|
|
self.filename = filename
|
|
|
|
def content(self):
|
|
return self.fmt().format(
|
|
"element",
|
|
{"filename": self.filename, "options": self.format_options(self.options)},
|
|
)
|