add common theme options to themes/__init__.py

This commit is contained in:
Sina Atalay 2024-02-15 19:46:10 +01:00
parent 8eca448630
commit 54a39e59a3
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
from typing import Annotated
import pydantic
LaTeXDimension = Annotated[
str,
pydantic.Field(
pattern=r"\d+\.?\d* *(cm|in|pt|mm|ex|em)",
),
]
class PageMargins(pydantic.BaseModel):
top: LaTeXDimension = pydantic.Field(
default="2 cm",
title="Top Margin",
description="The top margin of the page with units.",
)
bottom: LaTeXDimension = pydantic.Field(
default="2 cm",
title="Bottom Margin",
description="The bottom margin of the page with units.",
)
left: LaTeXDimension = pydantic.Field(
default="1.24 cm",
title="Left Margin",
description="The left margin of the page with units.",
)
right: LaTeXDimension = pydantic.Field(
default="1.24 cm",
title="Right Margin",
description="The right margin of the page with units.",
)