30 lines
671 B
Python
30 lines
671 B
Python
# -*- encoding: utf-8 -*-
|
|
|
|
from .element import element
|
|
|
|
|
|
class subfloat(element):
|
|
""" Class representing a latex subfloat. """
|
|
|
|
templates = {
|
|
"content": """\\subfloat[{caption}{label}]{{
|
|
{inner}
|
|
}}"""
|
|
}
|
|
|
|
autolabel = False
|
|
|
|
def __init__(self, caption, parent=None, childrens=None, label=None):
|
|
super().__init__(parent, childrens, label=label)
|
|
self.caption = caption
|
|
|
|
def content(self):
|
|
return self.fmt().format(
|
|
"content",
|
|
{
|
|
"caption": self.caption,
|
|
"label": self.format_label(self.label),
|
|
"inner": super().content(),
|
|
},
|
|
)
|