summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xREADME.md3
-rwxr-xr-xyaac-another-awesome-cv.cls25
2 files changed, 24 insertions, 4 deletions
diff --git a/README.md b/README.md
index 2c1ab09..8585a61 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{<diameter>}{<photo>}
+% Usage: \photo[<shape: circular, square, roundedsquare, squircle>]{<diameter>}{<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 546841a..66daa59 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}}
@@ -217,8 +218,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, roundedsquare, squircle>]{<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>}
@@ -281,7 +283,24 @@
}
\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);
+ }{
+ \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];
+ }
+ }
+
+ }
}
% Define social entries to print in header