From 4e97205c677eb4a5c7880fccf950250018cfaad8 Mon Sep 17 00:00:00 2001 From: Pedro Cabral Date: Tue, 24 Feb 2026 09:29:59 +0100 Subject: [PATCH 1/2] circular profile picture --- moderncv/.gitignore | 3 ++- moderncv/Pedro_Cabral_CV_moderncv.tex | 2 +- moderncv/pedro-moderncv.cls | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 moderncv/pedro-moderncv.cls diff --git a/moderncv/.gitignore b/moderncv/.gitignore index e04eef8..494d9d3 100644 --- a/moderncv/.gitignore +++ b/moderncv/.gitignore @@ -3,4 +3,5 @@ *.* !.gitignore !*.tex -!*.pdf \ No newline at end of file +!*.pdf +!*.cls \ No newline at end of file diff --git a/moderncv/Pedro_Cabral_CV_moderncv.tex b/moderncv/Pedro_Cabral_CV_moderncv.tex index 0fc7ec4..a5aa239 100644 --- a/moderncv/Pedro_Cabral_CV_moderncv.tex +++ b/moderncv/Pedro_Cabral_CV_moderncv.tex @@ -1,5 +1,5 @@ -\documentclass[11pt,a4paper,sans]{moderncv} +\documentclass[11pt,a4paper,sans]{pedro-moderncv} \moderncvstyle{classic} % Style options: 'casual', 'classic', 'oldstyle', 'banking' \moderncvcolor{blue} % Color options: 'blue', 'orange', 'green', 'red', 'purple', 'grey', 'black' diff --git a/moderncv/pedro-moderncv.cls b/moderncv/pedro-moderncv.cls new file mode 100644 index 0000000..205211e --- /dev/null +++ b/moderncv/pedro-moderncv.cls @@ -0,0 +1,22 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{pedro-moderncv}[2026/02/23 Custom moderncv wrapper] + +\LoadClassWithOptions{moderncv} + +\RequirePackage{tikz} +\RequirePackage{etoolbox} + +\AtBeginDocument{% + \makeatletter + \patchcmd{\makecvhead} + {\includegraphics[width=\@photowidth]{\@photo}} + {% + \begin{tikzpicture} + \clip (0,0) circle (\@photowidth/2); + \node at (0,0) + {\includegraphics[width=\@photowidth]{\@photo}}; + \end{tikzpicture} + } + {}{} + \makeatother +} From 753ac09b04ad3244fafaa3f690359e80572020f9 Mon Sep 17 00:00:00 2001 From: Pedro Cabral Date: Tue, 24 Feb 2026 10:26:37 +0100 Subject: [PATCH 2/2] centered profile picture --- moderncv/pedro-moderncv.cls | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/moderncv/pedro-moderncv.cls b/moderncv/pedro-moderncv.cls index 205211e..d4fae48 100644 --- a/moderncv/pedro-moderncv.cls +++ b/moderncv/pedro-moderncv.cls @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{pedro-moderncv}[2026/02/23 Custom moderncv wrapper] +\ProvidesClass{pedro-moderncv}[2026/02/24 Custom moderncv wrapper] \LoadClassWithOptions{moderncv} @@ -8,13 +8,23 @@ \AtBeginDocument{% \makeatletter + + % Safe scaled length + \newlength{\@photowidthscaled} + \patchcmd{\makecvhead} {\includegraphics[width=\@photowidth]{\@photo}} {% + % Copy original width + \setlength{\@photowidthscaled}{\@photowidth} + % Scale safely (no calc/dimexpr/TikZ parser issues) + \setlength{\@photowidthscaled}{1.2\@photowidthscaled} + \begin{tikzpicture} - \clip (0,0) circle (\@photowidth/2); - \node at (0,0) - {\includegraphics[width=\@photowidth]{\@photo}}; + \clip (0, 0) circle (\@photowidth/2); + \node at (-0.2cm, -0.3cm) { + \includegraphics[width=\@photowidthscaled]{\@photo} + }; \end{tikzpicture} } {}{}