From 4e97205c677eb4a5c7880fccf950250018cfaad8 Mon Sep 17 00:00:00 2001 From: Pedro Cabral Date: Tue, 24 Feb 2026 09:29:59 +0100 Subject: [PATCH] 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 +}