summaryrefslogtreecommitdiffstats
path: root/yaac-another-awesome-cv.cls
diff options
context:
space:
mode:
authorChristophe ROGER <darwiin@users.noreply.github.com>2019-05-27 20:17:30 +1100
committerGitHub <noreply@github.com>2019-05-27 20:17:30 +1100
commit87a1c40d729bae60ef5e392458d715ef37dd174d (patch)
treeaf0d52bf5e37dbb507db96593c3fbe072cf6e3ff /yaac-another-awesome-cv.cls
parent4fcd3b51eb34ec59c2759411d2dde9ffd8427fb8 (diff)
parent80da6bc4b66275933d7e85d55ecd0d75455adb54 (diff)
downloadcv-87a1c40d729bae60ef5e392458d715ef37dd174d.tar.gz
cv-87a1c40d729bae60ef5e392458d715ef37dd174d.tar.bz2
cv-87a1c40d729bae60ef5e392458d715ef37dd174d.tar.xz
cv-87a1c40d729bae60ef5e392458d715ef37dd174d.zip
Merge pull request #35 from itrich/square-photo
resolves #19 Photo can now be drawn in different shapes
Diffstat (limited to 'yaac-another-awesome-cv.cls')
-rwxr-xr-xyaac-another-awesome-cv.cls25
1 files changed, 22 insertions, 3 deletions
diff --git a/yaac-another-awesome-cv.cls b/yaac-another-awesome-cv.cls
index ddac67a..dbbcfcb 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, 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>}
@@ -271,7 +273,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