pyltk/pyltk/inlines.py

30 lines
616 B
Python

# -*- encoding: utf-8 -*-
from .element import element
class inline_element(element):
""" Class representing simple latex inline elements such as bf,
it, math. """
def __init__(self, content, parent=None):
super().__init__(parent=parent)
self.value = content
self.templates = {"wrapper": self.wrapper}
def content(self):
return self.fmt().format("wrapper", {"value": self.value})
class it(inline_element):
wrapper = "\\textit{{{value}}}"
class bf(inline_element):
wrapper = "\\textbf{{{value}}}"
class mt(inline_element):
wrapper = "${value}$"