ImageTeX
ClassSource
ImageTeX(
equation: str,
template: str | TeXTemplate = "default",
font_size: int | str | ImageFontAbsSize | ImageFontSize = ImageFontSize.h2,
pad_size: int = 0,
color: str | tuple[float, ...] = "#FFFFFF",
)
A layer of TeX equation that can be rendered as an image.
The image will be rendered every time when it is accessed.
Arguments
Requires
| Name | Type | Required | |
|---|---|---|---|
equation | str | The LaTeX equation to be rendered. Do not add | |
template | str | TeXTemplate | The LaTeX template used for rendering the equation. If using The available templates can be found in | |
font_size | int | str | ImageFontAbsSize | ImageFontSize | The dynamic font size of the rendered text. | |
pad_size | int | The size used for padding on all sides of the text. | |
color | str | tuple[float, ...] | The text color. |
Methods
copy
v_1: Self = self.copy()
Get a copy of this instance.
Returns
| Name | Type | |
|---|---|---|
v_1 | Self | The copied text image. |
Properties
equation
equation: str = self.equation
The LaTeX equation. Equivalent to self.text.
height
height: int = self.height
The height of the text image.
img
img: Image = self.img
Render the text as an image, and get the pixel-based image.
size
size: tuple[int, int] = self.size
The (width, height) shape of the text image.
width
width: int = self.width
The width of the text image.