From f182ddaf15981b4de305bfdeb51f31fea5a0b4e2 Mon Sep 17 00:00:00 2001
From: Eduard Itrich <eduard@itrich.net>
Date: Sun, 19 May 2019 21:28:30 +0200
Subject: Added optional argument [<shape>] to \photo to either draw the photo
 circular or square

---
 yaac-another-awesome-cv.cls | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'yaac-another-awesome-cv.cls')

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{<diameter>}{<photo>}
-\newcommand{\photo}[2]{\def\@photo{#2}\def\@photodiameter{#1}}
+% Usage: \photo[<shape: circular, square>]{<diameter>}{<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{<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.3

