From f182ddaf15981b4de305bfdeb51f31fea5a0b4e2 Mon Sep 17 00:00:00 2001 From: Eduard Itrich Date: Sun, 19 May 2019 21:28:30 +0200 Subject: Added optional argument [] to \photo to either draw the photo circular or square --- README.md | 3 ++- yaac-another-awesome-cv.cls | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f9b1788..07364c5 100755 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ Outside of the `\socialinfo` wrapper you have to define the mandatory parameters \name{Christophe}{ROGER} % Define author's photo (optional) -% Usage \photo{}{} +% Usage: \photo[]{}{} +% The shape of the author's photo is circular by default. \photo{2.5cm}{darwiin} % Define author's tagline diff --git a/yaac-another-awesome-cv.cls b/yaac-another-awesome-cv.cls index ddac67a..f369a43 100755 --- a/yaac-another-awesome-cv.cls +++ b/yaac-another-awesome-cv.cls @@ -73,6 +73,7 @@ \RequirePackage{tikz} \RequirePackage[skins]{tcolorbox} \RequirePackage{fancyhdr} +\RequirePackage{ifthen} \DeclareUnicodeCharacter{00E9}{\'{e}} @@ -215,8 +216,9 @@ \newcommand*{\tagline}[1]{\def\@tagline{#1}} % Define author's photo -% Usage \photo{}{} -\newcommand{\photo}[2]{\def\@photo{#2}\def\@photodiameter{#1}} +% Usage: \photo[]{}{} +% The shape of the author's photo is circular by default. +\newcommand{\photo}[3][circular]{\def\@photo{#3}\def\@photodiameter{#2}\def\@photoshape{#1}} % Render author's address % Usage: \address{
} @@ -271,7 +273,13 @@ } \newcommand\idphoto{ - \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth]; + \ifthenelse{\equal{\@photoshape}{square}}{ + % Draw square photo + \tikz\path[fill overzoom image={\@photo}]rectangle(\linewidth,\linewidth); + }{ + % Draw circular photp + \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth]; + } } % Define social entries to print in header -- cgit v1.2.1 From 80da6bc4b66275933d7e85d55ecd0d75455adb54 Mon Sep 17 00:00:00 2001 From: Eduard Itrich Date: Mon, 20 May 2019 12:33:10 +0200 Subject: Added 'roundedsquare' and 'squircle' to the list of photo shapes. --- README.md | 2 +- yaac-another-awesome-cv.cls | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 07364c5..0fdefdf 100755 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Outside of the `\socialinfo` wrapper you have to define the mandatory parameters \name{Christophe}{ROGER} % Define author's photo (optional) -% Usage: \photo[]{}{} +% Usage: \photo[]{}{} % The shape of the author's photo is circular by default. \photo{2.5cm}{darwiin} diff --git a/yaac-another-awesome-cv.cls b/yaac-another-awesome-cv.cls index f369a43..dbbcfcb 100755 --- a/yaac-another-awesome-cv.cls +++ b/yaac-another-awesome-cv.cls @@ -216,7 +216,7 @@ \newcommand*{\tagline}[1]{\def\@tagline{#1}} % Define author's photo -% Usage: \photo[]{}{} +% Usage: \photo[]{}{} % The shape of the author's photo is circular by default. \newcommand{\photo}[3][circular]{\def\@photo{#3}\def\@photodiameter{#2}\def\@photoshape{#1}} @@ -277,8 +277,19 @@ % Draw square photo \tikz\path[fill overzoom image={\@photo}]rectangle(\linewidth,\linewidth); }{ - % Draw circular photp - \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth]; + \ifthenelse{\equal{\@photoshape}{roundedsquare}}{ + % Draw square photo with rounded corners + \tikz\path[fill overzoom image={\@photo}][rounded corners=2mm]rectangle(\linewidth,\linewidth); + }{ + \ifthenelse{\equal{\@photoshape}{squircle}}{ + % Draw squircle photo + \tikz\path[fill overzoom image={\@photo}][rounded corners=8mm]rectangle(\linewidth,\linewidth); + }{ + % Draw circular photo + \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth]; + } + } + } } -- cgit v1.2.1