add header margin options

This commit is contained in:
Sina Atalay 2023-11-22 19:18:50 +01:00
parent f64bc27ef6
commit 260e7ba4dd
5 changed files with 81 additions and 4 deletions

View File

@ -417,6 +417,26 @@ class ClassicThemeHighlightsAreaMargins(BaseModel):
)
class ClassicThemeHeaderMargins(BaseModel):
"""This class stores the margins of the header for the classic theme."""
vertical_between_name_and_connections: LaTeXDimension = Field(
default="0.2 cm",
title="Vertical Margin Between the Name and Connections",
description=(
"The vertical margin between the name of the person and the connections."
),
)
bottom: LaTeXDimension = Field(
default="0.2 cm",
title="Bottom Margin",
description=(
"The bottom margin of the header, i.e., the vertical margin between the"
" connections and the first section title."
),
)
class ClassicThemeMargins(BaseModel):
"""This class stores the margins for the classic theme."""
@ -440,6 +460,11 @@ class ClassicThemeMargins(BaseModel):
title="Highlights Area Margins",
description="Highlights area margins for the classic theme.",
)
header: ClassicThemeHeaderMargins = Field(
default=ClassicThemeHeaderMargins(),
title="Header Margins",
description="Header margins for the classic theme.",
)
class ClassicThemeOptions(BaseModel):
@ -463,7 +488,7 @@ class ClassicThemeOptions(BaseModel):
)
date_and_location_width: LaTeXDimension = Field(
default="3.6 cm",
default="4.1 cm",
title="Date and Location Column Width",
description="The width of the date and location column.",
)

View File

@ -135,6 +135,7 @@
((* endif *))
<<header(name=cv.name, connections=cv.connections)|indent(4)>>
((* if cv.summary is not none *))
\section{Summary}
{

View File

@ -4,6 +4,8 @@
\Huge
\textbf{<<name>>}
\vspace{<<theme_options.margins.header.vertical_between_name_and_connections>>}
\normalsize
((* for connection in connections *))
<<print_connections[connection.name|replace(" ", "")](connection.value, connection.url)>>
@ -12,4 +14,6 @@
((* endif *))
((* endfor *))
\end{header}
\vspace{<<theme_options.margins.header.bottom>>}
((* endmacro *))

View File

@ -21,6 +21,27 @@
"type": "object",
"additionalProperties": false
},
"ClassicThemeHeaderMargins": {
"properties": {
"vertical_between_name_and_connections": {
"default": "0.2 cm",
"description": "The vertical margin between the name of the person and the connections.",
"pattern": "\\d+\\.?\\d* *(cm|in|pt|mm|ex|em)",
"title": "Vertical Margin Between the Name and Connections",
"type": "string"
},
"bottom": {
"default": "0.2 cm",
"description": "The bottom margin of the header, i.e., the vertical margin between the connections and the first section title.",
"pattern": "\\d+\\.?\\d* *(cm|in|pt|mm|ex|em)",
"title": "Bottom Margin",
"type": "string"
}
},
"title": "ClassicThemeHeaderMargins",
"type": "object",
"additionalProperties": false
},
"ClassicThemeHighlightsAreaMargins": {
"properties": {
"top": {
@ -105,6 +126,19 @@
},
"description": "Highlights area margins for the classic theme.",
"title": "Highlights Area Margins"
},
"header": {
"allOf": [
{
"$ref": "#/$defs/ClassicThemeHeaderMargins"
}
],
"default": {
"bottom": "0.2 cm",
"vertical_between_name_and_connections": "0.2 cm"
},
"description": "Header margins for the classic theme.",
"title": "Header Margins"
}
},
"title": "ClassicThemeMargins",
@ -127,7 +161,7 @@
"type": "string"
},
"date_and_location_width": {
"default": "3.6 cm",
"default": "4.1 cm",
"description": "The width of the date and location column.",
"pattern": "\\d+\\.?\\d* *(cm|in|pt|mm|ex|em)",
"title": "Date and Location Column Width",
@ -169,6 +203,10 @@
"left_and_right": "0.2 cm",
"vertical_between": "0.12 cm"
},
"header": {
"bottom": "0.2 cm",
"vertical_between_name_and_connections": "0.2 cm"
},
"highlights_area": {
"left": "0.6 cm",
"top": "0.12 cm",
@ -1561,12 +1599,16 @@
"font": "SourceSans3",
"font_size": "10pt",
"options": {
"date_and_location_width": "3.6 cm",
"date_and_location_width": "4.1 cm",
"margins": {
"entry_area": {
"left_and_right": "0.2 cm",
"vertical_between": "0.12 cm"
},
"header": {
"bottom": "0.2 cm",
"vertical_between_name_and_connections": "0.2 cm"
},
"highlights_area": {
"left": "0.6 cm",
"top": "0.12 cm",

View File

@ -109,7 +109,7 @@
\LenToUnit{\paperwidth-1.35 cm-0.2 cm+0.05cm},
\LenToUnit{\paperheight-0.675 cm}
){\vtop{{\null}\makebox[0pt][c]{
\small\color{gray}\textit{Last updated on November 20, 2023}\hspace{\widthof{Last updated on November 20, 2023}}
\small\color{gray}\textit{Last updated on November 22, 2023}\hspace{\widthof{Last updated on November 22, 2023}}
}}}%
}%
}%
@ -126,6 +126,8 @@
\Huge
\textbf{John Doe}
\vspace{0.2 cm}
\normalsize
\mbox{{\small\faMapMarker*}\hspace{0.13cm}TX, USA}
\hspace{0.5cm}
@ -140,6 +142,9 @@
\mbox{\hrefWithoutArrow{https://www.linkedin.com/in/johndoe}{{\small\faLinkedinIn}\hspace{0.13cm}johndoe}}
\end{header}
\vspace{0.2 cm}
\section{Summary}
{
\raggedright