From 2fbb7c88cd828dcc06404b53e15e137afc3a6c40 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Wed, 27 Mar 2024 23:15:30 +0100 Subject: [PATCH] classic: add a new text_alignment type, justified-with-no-hyphenation (#34) --- rendercv/themes/__init__.py | 2 +- rendercv/themes/classic/Preamble.j2.tex | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rendercv/themes/__init__.py b/rendercv/themes/__init__.py index 0d7618c..8947286 100644 --- a/rendercv/themes/__init__.py +++ b/rendercv/themes/__init__.py @@ -243,7 +243,7 @@ class ThemeOptions(pydantic.BaseModel): " 30 pt." ), ) - text_alignment: Literal["left-aligned", "justified"] = pydantic.Field( + text_alignment: Literal["left-aligned", "justified", "justified-with-no-hyphenation"] = pydantic.Field( default="justified", title="Text Alignment", description="The alignment of the text. The default value is justified.", diff --git a/rendercv/themes/classic/Preamble.j2.tex b/rendercv/themes/classic/Preamble.j2.tex index 0c0666e..81a0500 100644 --- a/rendercv/themes/classic/Preamble.j2.tex +++ b/rendercv/themes/classic/Preamble.j2.tex @@ -85,6 +85,8 @@ \newcolumntype{K}[1]{ >{\let\newline\\\arraybackslash\hspace{0pt}}X } % justified flexible width column type +((* elif design.text_alignment == "justified-with-no-hyphenation" *)) +\usepackage[none]{hyphenat} % for disabling hyphenation ((* elif design.text_alignment == "left-aligned" *)) \newcolumntype{K}[1]{ >{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}X