aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2024-12-05 10:44:59 +0800
committerAaron LI <aly@aaronly.me>2024-12-05 10:44:59 +0800
commit6734b35583ea06f5e2f79e2db00a65a1d6cdbc20 (patch)
tree94926545ad3ca7c4f1c9f51c785e88bd275f7e79
parented3326b9df2ee5a02d03c2d9ed0fc1be57c02199 (diff)
downloadresume-6734b35583ea06f5e2f79e2db00a65a1d6cdbc20.tar.bz2
class: Fix icon size inconsistency in tagline by relative scaling
-rw-r--r--resume.cls17
1 files changed, 10 insertions, 7 deletions
diff --git a/resume.cls b/resume.cls
index 176fd0d..2dba6f8 100644
--- a/resume.cls
+++ b/resume.cls
@@ -12,7 +12,7 @@
%% https://www.latextemplates.com/template/plasmati-graduate-cv
%%
-\ProvidesClass{resume}[2024/12/05 v2.5.7 Resume Class]
+\ProvidesClass{resume}[2024/12/05 v2.5.8 Resume Class]
\LoadClass{article}
%%
@@ -49,6 +49,7 @@
\RequirePackage{tikz}
\RequirePackage[skins]{tcolorbox} % required by tikz to make the header
\RequirePackage{csquotes}
+\RequirePackage{relsize} % relatively scale the icons
\ifdef{\@zh}{
\RequirePackage{xeCJK}
}{}
@@ -184,13 +185,15 @@
\newcommand*{\link}[2]{\textcolor{linkcolor}{\href{#1}{#2}}}
-% Enlarge the icon size.
-% Use "\iconsize{\normalsize}" to make icon the same size as text.
-\def\@iconsize{\Large}
-\newcommand*{\iconsize}[1]{\def\@iconsize{#1}}
+% The scale step for icons.
+% A positive step to enlarge icons, and a negative step to reduce them.
+\def\@iconscale{1}
+\newcommand*{\iconscale}[1]{\def\@iconscale{#1}}
-\newcommand*{\icon}[1]{%
- {\@iconsize\makebox[1em][c]{\textcolor{symbolcolor}{#1}}}%
+% Icon: \icon[size]{\faICON}
+\NewDocumentCommand{\icon}{om}{
+ {\IfValueTF{#1}{#1}{\relsize{\@iconscale}}%
+ \makebox[1em][c]{\textcolor{symbolcolor}{#2}}}%
\hspace{0.2em}\strut%
}