From 3c661af49c457761ffde107a60c5f1317d54d781 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sat, 17 Feb 2024 18:46:19 +0100 Subject: [PATCH] improve templates --- rendercv/themes/classic/Preamble.j2.tex | 7 ++++++- rendercv/themes/sb2nov/Header.j2.tex | 6 +++++- rendercv/themes/sb2nov/Preamble.j2.tex | 26 +++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/rendercv/themes/classic/Preamble.j2.tex b/rendercv/themes/classic/Preamble.j2.tex index 57e1004..e946206 100644 --- a/rendercv/themes/classic/Preamble.j2.tex +++ b/rendercv/themes/classic/Preamble.j2.tex @@ -38,10 +38,15 @@ ((* if disable_page_numbering *)) \pagenumbering{gobble} % no page numbering ((* endif *)) +((* set page_numbering_style_placeholders = { + "NAME": cv.name, + "PAGE_NUMBER": "\thepage", + "TOTAL_PAGES": "\pageref*{LastPage}" +} *)) \makeatletter \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \patchcmd{\ps@customFooterStyle}{\thepage}{ - \color{gray}\textit{\small <> | Page \thepage{} of \pageref*{LastPage}} + \color{gray}\textit{\small <>} }{}{} % replace number by desired string \makeatother \pagestyle{customFooterStyle} diff --git a/rendercv/themes/sb2nov/Header.j2.tex b/rendercv/themes/sb2nov/Header.j2.tex index 7dcabfa..90f13c1 100644 --- a/rendercv/themes/sb2nov/Header.j2.tex +++ b/rendercv/themes/sb2nov/Header.j2.tex @@ -1,6 +1,10 @@ +((* if design.show_last_updated_date *)) +\placelastupdatedtext +((* endif *)) + { \centering - \textbf{\fontsize{<>}{<>}\scshape <>} \\ \vspace{3pt} + \textbf{\fontsize{<>}{<>}\selectfont <>} \\ \vspace{3pt} \small \vspace{<>} diff --git a/rendercv/themes/sb2nov/Preamble.j2.tex b/rendercv/themes/sb2nov/Preamble.j2.tex index f544191..6293a9f 100644 --- a/rendercv/themes/sb2nov/Preamble.j2.tex +++ b/rendercv/themes/sb2nov/Preamble.j2.tex @@ -16,7 +16,7 @@ % showframe % for debugging ]{geometry} % for adjusting page geometry \usepackage{latexsym} -\usepackage{titlesec} +\usepackage[nobottomtitles*]{titlesec} \usepackage{marvosym} \usepackage{verbatim} \usepackage{setspace} @@ -29,11 +29,22 @@ \usepackage{ifthen} \usepackage{fontawesome5} \usepackage{calc} % for calculating lengths +\usepackage[pscoord]{eso-pic} % for floating text on the page +\usepackage{lastpage} % for getting the total number of pages \input{glyphtounicode} \pagestyle{fancy} \fancyhf{} % clear all header and footer fields -\fancyfoot{} +((* if disable_page_numbering *)) +\pagenumbering{} % no page numbering +((* else *)) +((* set page_numbering_style_placeholders = { + "NAME": cv.name, + "PAGE_NUMBER": "\\thepage{}", + "TOTAL_PAGES": "\pageref*{LastPage}" +} *)) +\fancyfoot[CO]{\color{gray}\textit{\small <>}} +((* endif *)) \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} @@ -76,6 +87,17 @@ %------------------------- % Custom commands +\newcommand{\placelastupdatedtext}{% \placetextbox{}{}{} + \AddToShipoutPictureFG*{% Add to current page foreground + \put( + \LenToUnit{\paperwidth-<>-<>+0.05cm}, + \LenToUnit{\paperheight-<>} + ){\vtop{{\null}\makebox[0pt][c]{ + \small\color{gray}\textit{Last updated in <>}\hspace{\widthof{Last updated in <>}} + }}}% + }% +}% + \newcommand{\resumeItem}[2]{ \item\small{ \ifthenelse{\equal{#1}{}}{#2}{\textbf{#1}{: #2}}