mirror of https://github.com/eyhc1/rendercv.git
add moderncv theme
This commit is contained in:
parent
5825abf908
commit
a742e03c30
|
@ -0,0 +1,4 @@
|
|||
\cventry{((* if design.show_only_years *))<<entry.date_string_only_years>>((* else *))<<entry.date_string>>((* endif *))}{((* if entry.degree != "" *))<<entry.degree>>, ((* endif *))<<entry.area>>}{<<entry.institution>>}{<<entry.location>>}{}{}
|
||||
((* for item in entry.highlights *))
|
||||
\cvline{}{\small <<item>>}
|
||||
((* endfor *))
|
|
@ -0,0 +1,4 @@
|
|||
\cventry{((* if design.show_only_years *))<<entry.date_string_only_years>>((* else *))<<entry.date_string>>((* endif *))}{<<entry.position>>}{<<entry.company>>}{<<entry.location>>}{}{}
|
||||
((* for item in entry.highlights *))
|
||||
\cvline{}{\small <<item>>}
|
||||
((* endfor *))
|
|
@ -0,0 +1,6 @@
|
|||
\maketitle
|
||||
|
||||
% save the original href command in a new command:
|
||||
\let\hrefWithoutArrow\href
|
||||
% new command for external links:
|
||||
\renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\mbox{\color{color1} #2 \raisebox{.15ex}{\footnotesize \faExternalLink*}}}}
|
|
@ -0,0 +1,4 @@
|
|||
\cventry{((* if design.show_only_years *))<<entry.date_string_only_years>>((* else *))<<entry.date_string>>((* endif *))}{<<entry.name>>}{}{<<entry.location>>}{}{}
|
||||
((* for item in entry.highlights *))
|
||||
\cvline{}{\small <<item>>}
|
||||
((* endfor *))
|
|
@ -0,0 +1 @@
|
|||
\cvline{<<entry.name>>}{<<entry.details>>}
|
|
@ -0,0 +1,85 @@
|
|||
%% start of file `template.tex'.
|
||||
%% Copyright 2006-2015 Xavier Danaux (xdanaux@gmail.com), 2020-2022 moderncv maintainers (github.com/moderncv).
|
||||
%
|
||||
% This work may be distributed and/or modified under the
|
||||
% conditions of the LaTeX Project Public License version 1.3c,
|
||||
% available at http://www.latex-project.org/lppl/.
|
||||
|
||||
\documentclass[<<design.font_size>>,<<design.page_size>>,sans]{moderncv} % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')
|
||||
|
||||
% moderncv themes
|
||||
\moderncvstyle{classic} % style options are 'casual' (default), 'classic', 'banking', 'oldstyle' and 'fancy'
|
||||
\moderncvcolor{<<design.color>>} % color options 'black', 'blue' (default), 'burgundy', 'green', 'grey', 'orange', 'purple' and 'red'
|
||||
%\renewcommand{\familydefault}{\sfdefault} % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
|
||||
((* if design.disable_page_numbers *))
|
||||
\nopagenumbers{}
|
||||
((* endif *))
|
||||
|
||||
% adjust the page margins
|
||||
\usepackage[scale=<<design.content_scale>>]{geometry}
|
||||
\setlength{\hintscolumnwidth}{<<design.date_width>>} % if you want to change the width of the column with the dates
|
||||
%\setlength{\makecvheadnamewidth}{10cm} % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...
|
||||
|
||||
% font loading
|
||||
% for luatex and xetex, do not use inputenc and fontenc
|
||||
% see https://tex.stackexchange.com/a/496643
|
||||
\ifxetexorluatex
|
||||
\usepackage{fontspec}
|
||||
\usepackage{unicode-math}
|
||||
\defaultfontfeatures{Ligatures=TeX}
|
||||
\setmainfont{Latin Modern Roman}
|
||||
\setsansfont{Latin Modern Sans}
|
||||
\setmonofont{Latin Modern Mono}
|
||||
\setmathfont{Latin Modern Math}
|
||||
\else
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{lmodern}
|
||||
\fi
|
||||
|
||||
% document language
|
||||
\usepackage[english]{babel} % FIXME: using spanish breaks moderncv
|
||||
|
||||
% personal data
|
||||
\name{<<cv.name>>}{}
|
||||
((* if cv.label *))
|
||||
\title{<<cv.label>>} % optional, remove / comment the line if not wanted
|
||||
((* endif *))
|
||||
% \familyname{}
|
||||
((* if cv.location *))
|
||||
\address{<<cv.location>>}{}
|
||||
((* endif *))
|
||||
((* if cv.phone *))
|
||||
\phone[mobile]{<<cv.phone|replace("tel:", "")|replace("-"," ")>>}
|
||||
((* endif *))
|
||||
((* if cv.email *))
|
||||
\email{<<cv.email>>}
|
||||
((* endif *))
|
||||
((* if cv.website *))
|
||||
\homepage{<<cv.website>>}
|
||||
((* endif *))
|
||||
|
||||
((* set available_social_networks = ["LinkedIn", "GitHub", "Orcid" ]*))
|
||||
((* if cv.social_networks *))
|
||||
((* for network in cv.social_networks *))
|
||||
((* if network.network in available_social_networks *))
|
||||
\social[<<network.network|lower()>>]{<<network.username>>}
|
||||
((* endif *))
|
||||
((* endfor *))
|
||||
((* endif *))
|
||||
% Social icons
|
||||
% \social[linkedin]{john.doe} % optional, remove / comment the line if not wanted
|
||||
% \social[xing]{john\_doe} % optional, remove / comment the line if not wanted
|
||||
% \social[twitter]{ji\_doe} % optional, remove / comment the line if not wanted
|
||||
% \social[github]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[gitlab]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[stackoverflow]{0000000/johndoe} % optional, remove / comment the line if not wanted
|
||||
% \social[bitbucket]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[skype]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[orcid]{0000-0000-000-000} % optional, remove / comment the line if not wanted
|
||||
% \social[researchgate]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[researcherid]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[telegram]{jdoe} % optional, remove / comment the line if not wanted
|
||||
% \social[whatsapp]{12345678901} % optional, remove / comment the line if not wanted
|
||||
% \social[signal]{12345678901} % optional, remove / comment the line if not wanted
|
||||
% \social[matrix]{@johndoe:matrix.org} % optional, remove / comment the line if not wanted
|
||||
% \social[googlescholar]{googlescholarid} % optional, remove / comment the line if not wanted
|
|
@ -0,0 +1,2 @@
|
|||
\cventry{<<entry.date_string>>}{<<entry.title>>}{<<entry.journal>>}{\href{<<entry.doi_url>>}{<<entry.doi>>}}{}{}
|
||||
\cvline{}{\small <<entry.authors|map("abbreviate_name")|map("make_it_nolinebreak")|join(", ")|make_it_bold(cv.name|abbreviate_name)|make_it_italic(cv.name|abbreviate_name)>>}
|
|
@ -0,0 +1 @@
|
|||
\section{<<section_title>>}
|
|
@ -0,0 +1 @@
|
|||
<<entry>>
|
|
@ -0,0 +1,96 @@
|
|||
from typing import Literal, Annotated
|
||||
|
||||
import pydantic
|
||||
|
||||
|
||||
LaTeXDimension = Annotated[
|
||||
str,
|
||||
pydantic.Field(
|
||||
pattern=r"\d+\.?\d* *(cm|in|pt|mm|ex|em)",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ModerncvThemeOptions(pydantic.BaseModel):
|
||||
""" """
|
||||
|
||||
theme: Literal["moderncv"]
|
||||
font_size: Literal["10pt", "11pt", "12pt"] = pydantic.Field(
|
||||
default="10pt",
|
||||
title="Font Size",
|
||||
description='The font size of the CV. The default value is "10pt".',
|
||||
examples=["10pt", "11pt", "12pt"],
|
||||
)
|
||||
page_size: Literal["a4paper", "letterpaper"] = pydantic.Field(
|
||||
default="a4paper",
|
||||
title="Page Size",
|
||||
description='The page size of the CV. The default value is "a4paper".',
|
||||
examples=["a4paper", "letterpaper"],
|
||||
)
|
||||
moderncv_style: (
|
||||
Literal["casual"]
|
||||
| Literal["classic"]
|
||||
| Literal["banking"]
|
||||
| Literal["oldstyle"]
|
||||
| Literal["fancy"]
|
||||
) = pydantic.Field(
|
||||
default="classic",
|
||||
title="ModernCV Style",
|
||||
description='The style of the moderncv theme. The default value is "classic".',
|
||||
examples=["casual", "classic", "banking", "oldstyle", "fancy"],
|
||||
)
|
||||
color: (
|
||||
Literal["blue"]
|
||||
| Literal["black"]
|
||||
| Literal["burgundy"]
|
||||
| Literal["green"]
|
||||
| Literal["grey"]
|
||||
| Literal["orange"]
|
||||
| Literal["purple"]
|
||||
| Literal["red"]
|
||||
) = pydantic.Field(
|
||||
default="blue",
|
||||
validate_default=True,
|
||||
title="Primary Color",
|
||||
description='The primary color of the CV. The default value is "blue".',
|
||||
examples=[
|
||||
"blue",
|
||||
"black",
|
||||
"burgundy",
|
||||
"green",
|
||||
"grey",
|
||||
"orange",
|
||||
"purple",
|
||||
"red",
|
||||
],
|
||||
)
|
||||
date_width: LaTeXDimension = pydantic.Field(
|
||||
default="3.8 cm",
|
||||
validate_default=True,
|
||||
title="Date and Location Column Width",
|
||||
description='The width of the date column. The default value is "3.8 cm".',
|
||||
)
|
||||
content_scale: float = pydantic.Field(
|
||||
default=0.75,
|
||||
title="Content Scale",
|
||||
description=(
|
||||
"The scale of the content with respect to the page size. The default value"
|
||||
' is "0.75".'
|
||||
),
|
||||
)
|
||||
show_only_years: bool = pydantic.Field(
|
||||
default=False,
|
||||
title="Show Only Years",
|
||||
description=(
|
||||
'If "True", only the years will be shown in the date column. The default'
|
||||
' value is "False".'
|
||||
),
|
||||
)
|
||||
disable_page_numbers: bool = pydantic.Field(
|
||||
default=False,
|
||||
title="Disable Page Numbers",
|
||||
description=(
|
||||
'If "True", the page numbers will be disabled. The default value is'
|
||||
' "False".'
|
||||
),
|
||||
)
|
Loading…
Reference in New Issue