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..d4fae48 --- /dev/null +++ b/moderncv/pedro-moderncv.cls @@ -0,0 +1,32 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{pedro-moderncv}[2026/02/24 Custom moderncv wrapper] + +\LoadClassWithOptions{moderncv} + +\RequirePackage{tikz} +\RequirePackage{etoolbox} + +\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.2cm, -0.3cm) { + \includegraphics[width=\@photowidthscaled]{\@photo} + }; + \end{tikzpicture} + } + {}{} + \makeatother +}