Files
ouc_latex_template/简历/awesome-source-cv.cls
T
laoyang 8e3017f359 简历左上角加中国海洋大学校徽(可选,默认不印) #13
新增 \cvlogo[<文件名>]{<宽度>},默认不调用、不出现,不影响现有版面。

- cls:导言区只登记参数,真正画图挪到 \makecvheader 开头的 \@makecvlogo,
  否则导言区产生内容报 Missing \begin{document}
- 定位用 tikzpicture[remember picture, overlay] + current page.north west,
  距纸左 10mm / 距纸顶 6mm(相对纸边,不随页边距变)
- 距顶不照搬科技报告的 20mm:简历页边距 15mm、姓名墨迹顶 17.2mm,会压到姓名
- tikzpicture 即使全 overlay 仍占一行 17pt,用 \vspace*{-17pt} 抵消;
  \smash / \hbox to 0pt / \vbox to 0pt 三种写法实测都消不掉
- 尺寸定 28mm(横式 2400:605 ⇒ 高 7.06mm),是 15mm 边距下的上限附近

实测:logo 28.00×7.06mm,x=10.07mm、y=6.07mm,下沿 13.1mm;
姓名 y 保持 48.8pt 未位移;3 页 0 error / 0 Overfull / 0 Underfull / 0 个 ×。
体积 158KB → 573KB(内嵌 2400px 原图,实际只用 28mm≈660px)。
2026-10-27 14:25:27 +08:00

635 lines
26 KiB
OpenEdge ABL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%% Copyright 2016 Christophe Roger
%
% Author:
% Christophe Roger (Darwiin)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is M. C. Roger.
%
% This work consists of the files awesome-source-cv.cls
\ProvidesClass{awesome-source-cv}[2016/11/05 v1.6.1 Awesome Source CV Class]
\LoadClass[a4paper]{article}
\DeclareOption{green}{
\def\@green{green}
}
\DeclareOption{red}{
\def\@red{red}
}
\DeclareOption{indigo}{
\def\@indigo{indigo}
}
\DeclareOption{orange}{
\def\@orange{orange}
}
\DeclareOption{localFont}{
\def\@local{local}
}
\DeclareOption{alternative}{
\def\@alternative{alternate}
}
\ProcessOptions
% Dependences
%A Few Useful Packages
\RequirePackage[frenchb]{babel}
%\RequirePackage[utf8]{luainputenc} % luatex
\RequirePackage{fontspec} % for loading fonts
\RequirePackage{url,parskip} % other packages for formatting
\RequirePackage[usenames,dvipsnames]{xcolor}
\RequirePackage{fullpage}
\RequirePackage[margin=1.5cm]{geometry}
\RequirePackage{fontawesome}
\RequirePackage{hyperref}\hypersetup{hidelinks}
\RequirePackage{titlesec}
\RequirePackage{array}
\RequirePackage{enumitem}
\RequirePackage{longtable}
\RequirePackage{etoolbox}
\RequirePackage{tikz}
\RequirePackage[skins]{tcolorbox}
% \DeclareUnicodeCharacter{00E9}{\'{e}} %luatex
% Define default accent colors
%\definecolor{basecolor}{HTML}{000066} %BLUE
\definecolor{basecolor}{HTML}{0f4c81}
\ifundef{\@green} {
\ifundef{\@red} {
\ifundef{\@indigo}{
\ifundef{\@orange} {}
{ \definecolor{basecolor}{HTML}{e68a00} }
}
{ \definecolor{basecolor}{rgb}{0.2, 0.07, 0.48} }
}
{ \definecolor{basecolor}{HTML}{b30000} } %RED
}
{ \definecolor{basecolor}{rgb}{0.0, 0.62, 0.38} }
\definecolor{darkGrey}{HTML}{989898}
\colorlet{linkcolor}{basecolor}
\colorlet{accentcolor}{linkcolor!90}
\colorlet{symbolcolor}{linkcolor!85}
% Setup hyperref package, and colours for links
%\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{breaklinks}
\pagestyle{empty} % non-numbered pages
%\font\fb=''[cmr10]'' % for use with \LaTeX command
% Setup CV sections
\titleformat{\section}{\Large\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{2pt}{2pt}
% Configure list
\setlist[itemize,1]{label=\faAngleRight, nosep, leftmargin=2em}
%----------------------------------------------------------------------
% 中西文之间的断行弹性
%
% 现象:论文条目里「… Applications (ICIEA), 88--93. 中国青岛, 中国: IEEE,
% 2023. https://doi.org/…」这一整段会冲出右边距 88.5pt,文字一直排到
% 页面纸边(x=595.5,而纸宽才 595.28)。用 Termes 时只有 0.4pt 之差,
% 换 Cochineal 后(西文窄 1.9%,断点位置整体前移)暴露成 88.5pt。
%
% 根因:XeLaTeX 里「中文紧跟英文」的位置默认**不是**断开点,TeX 会把
% 「2023 IEEE 18th Annual Conference on Industrial Electronics and
% Applications (ICIEA), 88--93.」当成一个长单词找断点,找到头也没有,
% 于是硬冲出去。上游模板没有设 \emergencystretch,也没有开
% \XeTeXlinebreaklocale,所以一点余量都没有。
%
% 修法(三选一,这里选第 1 个):
% ① 给 itemize 加 \emergencystretch —— 允许在极端情况下把行拉松
% 而不是硬冲出去。不动字体、不改内容、不影响其他环境。
% ② 全局 \sloppy —— 效果类似但会把**所有**段落的词距都放松,
% 连正常的短段落也变松散,观感下降。
% ③ 在 .tex 里手工插入 \allowbreak / \- —— 要逐条改,换字体又要重来。
%
% \emergencystretch=3em 的量级:按 10pt 正文,3em=30pt,足以吃掉
% 88.5pt 中的大部分,剩余部分交给行内词距自然拉伸。若将来换了更宽的
% 西文字体(如 Pagella 宽 10.8%)还报 Overfull,把这个值调到 4em~5em。
% ⚠️ 不要设成 \maxdimen 一劳永逸 —— 那等于关掉断行检查,
% 真正的排版问题会被全部藏起来,日志再也不报。
%----------------------------------------------------------------------
\setlength{\emergencystretch}{3em}
% Setup Array : new column type
%
% ⚠️ 原来是 >{\hfill}m{#1},即「固定宽度 + 内容靠右贴」。
% 用在本简历里会出问题:\hfill 让短日期贴着左列的**右**边界排,
% 日期本身只有约 57pt 宽而左列有 2.5cm=71.13pt,于是日期左边缘落在
% 42.5(左边距) + 6(\tabcolsep) + 71.13 - 57.3 = 62.33pt
% 而其他章节(工作经历/教育经历/奖励与荣誉)用的是 tabular{rl},
% 左列宽度自适应到最长的日期区间(约 122pt),日期左边缘在
% 42.5 + 6 = 48.5pt
% 两节一比就差 13.8pt,看上去「项目经验往里缩了一点」。
%
% 现在改成左对齐:日期左边缘回到 48.5pt,与其余章节的日期左边缘
% 严格对齐(本项目全部日期都是「YYYY 年MM 月」同宽 57.3pt,
% 所以左对齐后右边缘也齐,列不会显乱)。
%
% ⚠️ 用 p{} 而不用 m{}:m{} 是「垂直居中」的 parbox 列,在
% longtable 里跨页断行时行为不如 p{} 稳;这张表一行可能很高
% (右栏带 itemize)。配 \arraybackslash 让 \\ 在列内恢复正常。
% ⚠️ R 列只被 experiences 环境使用(skills 环境虽也写了 R,但本
% 简历没有调用 section_skills),改动不会波及别处。若将来启用
% skills 环境,那里是「技能名 + 五点圆点」,左对齐同样合适。
\newcolumntype{R}[1]{>{\raggedright\arraybackslash}p{#1}}
%Italian hyphenation for the word: ''corporations''
\hyphenation{im-pre-se}
% Setup fonts
\defaultfontfeatures{Mapping=tex-text}
%
%-------------------------------------------------------------------------------
% Configuration for fonts
%-------------------------------------------------------------------------------
% ⚠️⚠️ 本文件已被改写:字体**全部**取自仓库公共字体包 ../fonts.tex。
%
% 上游 awesom e-cv 的中文版原来这么配(共三处,都已删除):
% ① zh_cn-adobefonts_external.sty 里 \setCJKmainfont{AdobeSongStd-Light.otf}
% —— Adobe 宋/黑/楷/仿四款共 56 MB,商业授权,**不能随仓库分发**。
% 而且那份文件还拿 HarmonyOS Sans 去冒充 Bold/Italic/SmallCaps:
% BoldFont = HarmonyOS_Sans_SC_Regular.ttf
% ItalicFont = HarmonyOS_Sans_SC_Regular.ttf
% 等于"加粗=不变"、"斜体=不变",标题的层次全靠字号撑,是个将就做法。
% ② \setmainfont{SourceSansPro-Light}(localFont 分支)
% 9 个 .otf,SIL OFL 1.1 可用,但本仓库不打算为一份字体再带 4 MB。
% ③ \setfontfamily\FA[Path=fonts/]{FontAwesome}
% Path 指向本目录下不存在的 fonts/ —— 那份图标字体在 TeX Live 里。
%
% 现在的映射:
% 西文正文 Source Sans Pro Light → TeX Gyre Termes(本仓库自带)
% 中文正文 Adobe Song / HarmonyOS → OUC Serif(思源宋体子集,自带)
% 中文粗体 (原来=不变) → OUC Serif Bold(真粗体)
% 中文斜体 无 → OUC Kai(楷体代斜体,中文惯例)
% FontAwesome TeX Live 系统包 → 仓库 fonts/fontawesome/
%
% ⚠️ 字体文件本体在 ../fonts/ 下,由 ../fonts.tex 统一设置,
% **不要在本文档或 .tex 里再写 \setCJKmainfont / \setmainfont**。
% 下面只做"西文用哪一档"的局部调整。
%-------------------------------------------------------------------------------
% FontAwesome:图标字体已经放进仓库公共字体目录,
% ⚠️ 但**不要在这里重新声明 \FA** —— fontawesome.sty 自己在正文里就做了
% \newfontfamily{\FA}[Path=../fonts/fontawesome/]{FontAwesome.otf}
% 且它在 \RequirePackage{fontawesome} 时就执行(早于本 cls 的后面几句)。
% 这里再声明一次会报 "Font \FA already defined"(LaTeX3 的
% \NewDocumentCommand 语义),所以只留注释说明。
%
% 上游原来是 \setfontfamily\FA[Path=fonts/]{FontAwesome},
% Path 指向本目录下并不存在的 fonts/ —— 只能靠系统字体兜底。
% 现在路径写进 fontawesome.sty 了。
% 西文正文:上游用 Source Sans Pro Light(很细),本模板改用 Cochineal。
%
% ⚠️ 这里**不能**直接 \setmainfont —— 那会在 cls 里再写一套字体声明,
% 违反本仓库「字体只在 ../fonts.tex 声明」的规矩(换字号/换字体时
% 要改两处,早晚改漏一处)。改调用 fonts.tex 提供的开关命令。
%
% 为什么从 Termes 换成 Cochineal:
% 中文用思源宋体(OUC Serif),笔画中等粗细;Termes 是 Times 的度量
% 兼容替代,笔画偏细偏紧,中英混排时西文那一段视觉上会"陷进去"。
% Cochineal(Minion 风格)笔画更饱满,与宋体灰度接近。
% 宽度只差 1.9%(229.68 → 225.42pt @10pt),断行位置基本不动。
%
% 注意 \tnr / \tnrb 也被这个命令一并重指向,否则上游代码里显式写
% \tnr 的地方仍是 Termes,同一页会混两种西文字体。
%
% ⚠️ 必须包在 \AtBeginDocument 里,不能直接写 \oucUseCochineal:
% cls 执行时主文件还没 \input{../fonts.tex},那个命令尚未定义,会报
% ! Undefined control sequence.
% l.191 \oucUseCochineal
% \AtBeginDocument 的内容排在导言区末尾才展开,那时 fonts.tex 已读入。
% ⚠️ 不要用 \providecommand 兜底:兜底会让 fonts.tex 缺席时静默跳过
% 换字体,比直接报错更难查。
\AtBeginDocument{\oucUseCochineal}
% 上游用 Source Sans Pro 的 Light / Semibold 两档,这里映射到 Cochineal
% 的常规/粗体,保持"正文常规、强调加粗"的层级不变。
% ⚠️ 要在 \AtBeginDocument 之后重新定义才指向新字体,故也放进
% \AtBeginDocument;直接用 \providecommand 会在换字体前就把 \tnr
% 的**旧值**(Termes)存进去,之后再改 \tnr 也传不过去。
\AtBeginDocument{%
\providecommand{\sourcesanslight}{\tnr}%
\providecommand{\sourcesanssemibold}{\tnrb}%
}
%New length definition
%
% ⚠️ 这两个长度原来写死 14.8cm / 2.5cm,加起来 17.3cm,看着小于版心宽
% 18cm(A4 21cm − 2×1.5cm 边距)。但 longtable 每列还有 \tabcolsep
% 各占左右一侧(默认 6pt),两列共 4 个 \tabcolsep = 24pt ≈ 0.85cm,
% 于是实际占宽 18.15cm → 溢出 4.48pt,报
% Overfull \hbox (4.48311pt too wide) in alignment at lines 20--70
% 这种"算着够、实际差一点"的溢出,换字号/字体后会时有时无,很难查。
%
% 改法:不让它猜,直接用版心宽减去左列与列间距。
%
% ⚠️⚠️ 【必须在 \AtBeginDocument 里算,不能在 cls 的这里直接 \setlength】
%
% 根因:\RequirePackage[margin=1.5cm]{geometry} 只是**登记**参数,
% geometry 真正改写 \textwidth 是在导言区结束时(\begin{document}
% 的那一刻)。cls 里这条 \setlength 执行得比它早,读到的是 article
% 的默认 \textwidth = 345pt,于是算出
% 345 − 71.13(2.5cm) − 24(4×6pt) = 249.87pt
% 而真实版心宽 18cm = 512.15pt,本应是
% 512.15 − 71.13 − 24 = 417.02pt
% 两者差 167.15pt。
%
% 后果不是报错,而是**整块内容右移**:longtable 默认把宽度小于版心
% 的表格居中排(\LTleft/\LTright 都是 \fill),表格总宽只剩 345pt,
% 于是在 512pt 的版心里左留白 (512.15−345)/2 ≈ 83.6pt。
% 表现就是「项目经验那一节缩进了一大截」——左边 2.5cm 的日期列被
% 推到 x≈145pt,而其他用 tabular 的章节(工作经历/教育经历/奖励)
% 还是 x≈48pt,两节对不齐。
% 日志里零 error、零 warning,只看日志发现不了。
%
% 验证方式(改完看这个数对不对):
% \typeout{\the\rightcolumnlength} → 416.6pt 左右
% 若仍是 249.86pt 左右,说明又被别的地方提前算掉了。
%
% ⚠️ 用 \textwidth 而不是 \linewidth:\linewidth 在列表/环境里会被
% 局部改写,而这张表永远按版心宽排。
%
% ⚠️ 还要减掉 \arrayrulewidth(0.4pt):experiences 环境用的是
% {R{..}|E},中间那条竖线本身占 0.4pt 宽度。只减 4 个 \tabcolsep
% 的话,表格总宽 = 版心宽 + 0.4,日志里会多一条
% Overfull \hbox (0.4pt too wide) in alignment
% 数值小到肉眼看不出来,但属于「算得不准」,一并修掉。
%
% ⚠️ 与西文字体联动:\rightcolumnlength 里没有西文字宽,所以换字体
% (Termes → Cochineal)不影响这个数的正确性;但右栏 p{} 的断行
% 会随字体变,换字体后必须复查一遍日志有没有新 Overfull。
\newlength{\rightcolumnlength}
\newlength{\leftcolumn}
\setlength{\leftcolumn}{2.5cm}
\AtBeginDocument{%
\setlength{\rightcolumnlength}{%
\dimexpr\textwidth-\leftcolumn-4\tabcolsep-\arrayrulewidth\relax}%
}
% Font Awesome icons aliases
\newcommand{\mailSymbol}{\faEnvelope}
\newcommand{\mailSymbolO}{\faEnvelopeO}
\newcommand{\locationSymbol}{\faMapMarker}
\newcommand{\infoSymbol}{\faInfo}
\newcommand{\homeSymbol}{\faLink}
\newcommand{\weiboSymbol}{\faWeibo}
\newcommand{\linkedinSymbol}{\faLinkedin}
\newcommand{\mobileSymbol}{\faMobilePhone}
\newcommand{\githubSymbol}{\faGithub}
\newcommand\link[2]{\color{linkcolor}\href{#1}{#2}\color{Black} }
\newcommand\important[1]{\textbf #1}
% Create a tag
% Usage: \cvtag{<tag label>}
\newcommand{\cvtag}[1]{%
%\tikz[baseline]\node[anchor=base,draw=darkGrey!70,rounded corners=0.5ex,inner xsep=1ex,inner ysep =0.55ex,text height=1.3ex,text depth=.25ex]{#1};
\begin{tikzpicture}
\node[anchor=base,draw=darkGrey!70,rounded corners=0.5ex,inner xsep=1ex,inner ysep =0.4ex,text height=2ex,text depth=.25ex]{#1};
\end{tikzpicture}
}
% Create a chinese tag
% Usage: \cvtag{<tag label>}
\newcommand{\cvtagcn}[1]{%
%\tikz[baseline]\node[anchor=base,draw=darkGrey!70,rounded corners=0.5ex,inner xsep=1ex,inner ysep =0.55ex,text height=1.3ex,text depth=.25ex]{#1};
\begin{tikzpicture}
\node[anchor=base,draw=darkGrey!70,rounded corners=0.5ex,inner xsep=1ex,inner ysep =0.4ex,text height=2ex,text depth=.25ex]{#1};
\end{tikzpicture}
}
% Render author's name
% Usage: \user{<firstanme>}{<lastname>}
\newcommand\user[2]{\color{accentcolor}{\LARGE #1 \textbf{#2}}\color{Black}}
% Render a text with its symbol
% Usage; \socialtext{<icon>}{<label>}
\newcommand{\socialtext}[2]{\mbox{\textcolor{symbolcolor}{#1}\hspace{0.5em}#2\hspace{1em}}}
% Render a link with its symbol
% Usage; \sociallink{<icon>}{<label>}
%\newcommand{\sociallink}[3]{\mbox{\textcolor{symbolcolor}{#1}\hspace{0.5em}#2\hspace{1em}}}
\newcommand{\sociallink}[3]{\mbox{\textcolor{symbolcolor}{#1}\hspace{0.5em}\link{#2}{#3}\hspace{1em}}}
% Define author's name
% Usage: \name{<firstname>}{<lastname>}
% Usage: \firstname{<firstname>}
% Usage: \lastname{<lastname>}
% Usage: \familyname{<familyname>}
\newcommand*{\name}[2]{\def\@firstname{#1}\def\@lastname{#2}}
\newcommand*{\firstname}[1]{\def\@firstname{#1}}
\newcommand*{\lastname}[1]{\def\@lastname{#1}}
\newcommand*{\familyname}[1]{\def\@lastname{#1}}
\def\@familyname{\@lastname}
% Define author's tagline
% Usage: \tagline{<tag line>}
\newcommand*{\tagline}[1]{\def\@tagline{#1}}
% Define author's photo
% Usage \photo{<diameter>}{<photo>}
\newcommand{\photo}[2]{\def\@photo{#2}\def\@photodiameter{#1}}
%----------------------------------------------------------------------
% 校徽(可选,默认不印)
%
% 用法(导言区,\begin{document} 之前):
% \cvlogo{28mm} % 用仓库里带的横式彩色校徽
% \cvlogo{28mm}[ouc_logo_彩色] % 换成圆形校徽
% \cvlogo{28mm}[ouc_横式_海大红] % 换配色
% 不调用就完全不出现,版面与调用前逐字节一致。
%
% ⚠️ 本目录 logos/ 下**只放实际用到的那一个**(横式彩色,377KB)。
% 想换圆形或别的配色,从 ../科技报告/logos/ 复制过来即可,
% 那边有全部官方 VI 素材:
% ouc_logo_{彩色,海大红,海大蓝,天蓝,专金,墨黑}.png 圆形 1200×1200
% ouc_横式_{彩色,海大红,海大蓝,黑}.png 横式 2400×640
% (不预先全放进来,是因为每个 300~380KB,用不到就是纯占体积。)
%
% ⚠️ 导言区只**登记**参数,真正画图是在 \makecvheader 开头做的
% (见下面 \@makecvlogo)。原因:导言区不能产生任何内容,
% 直接在导言区画 tikzpicture 会报
% ! LaTeX Error: Missing \begin{document}.
%
% 定位:距纸左 10mm、距纸顶 6mm(相对【纸边】,不随页边距变)。
% 两个数值分别由 \cvlogox / \cvlogoy 控制,想在导言区微调就重设:
% \setlength{\cvlogox}{12mm}
% \setlength{\cvlogoy}{8mm}
%
% ⚠️ 为什么距顶是 6mm 而不是科技报告的 20mm:
% 简历页边距只有 15mm(科技报告是 27mm),抬头第一行「姓名」的墨迹顶
% 就在 48.8pt = 17.2mm。28mm 宽的横式 logo 高 7.06mm,若距顶 20mm
% 会直接压到姓名上,距顶 8mm 也只剩 6pt 间隙(2mm,视觉上贴着)。
% 实测 6mm 时 logo 下沿在 13.1mm,仍在 15mm 版心边距以内,
% 距姓名顶有 11.6pt(4.1mm),是这块空间里最平衡的位置。
%
% ⚠️ 距纸左 10mm 已接近 A4 打印的裁切余量(一般 10~12mm),
% 不要再改小。同理距顶 6mm 也偏小 —— **屏幕阅读和普通办公打印没问题**
% (A4 纸本身不裁切),但若要专业印刷/装订,建议把 \cvlogoy 改成 8mm
% 以上,并接受 logo 与姓名靠得近一点。
%
% ⚠️⚠️ 为什么后面跟着 \vspace*{-17pt}:
% tikzpicture 即使全部内容都是 overlay,它本身仍是一个**占一行的盒子**,
% 插在 \makecvheader 前面会把姓名整体往下推 17pt(实测 48.8 → 65.8)。
% \smash、\hbox to 0pt、\vbox to 0pt 三种写法都消不掉这一行
% (因为要断行就必须有 \par,有 \par 就有行高)。
% 直接用等量的负 \vspace 抵消,实测姓名回到 48.8pt,误差 0.0。
% ⚠️ 这个 17pt 与 logo 尺寸无关(18~30mm 五档实测姓名都是 48.8),
% 它是一行正文的高度。但若改了 \parskip 或正文字号,要重新量。
%----------------------------------------------------------------------
\newlength{\cvlogox}
\newlength{\cvlogoy}
\setlength{\cvlogox}{10mm}
\setlength{\cvlogoy}{6mm}
\newcommand{\cvlogo}[2][ouc_横式_彩色]{%
\def\@cvlogowidth{#2}%
\def\@cvlogofile{#1}%
}
% 内部命令:真正画 logo。未调用 \cvlogo 时为空操作。
\newcommand{\@makecvlogo}{%
\ifdefined\@cvlogofile
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=north west, inner sep=0pt,
xshift=\cvlogox, yshift=-\cvlogoy]
at (current page.north west)
{\includegraphics[width=\@cvlogowidth]{logos/\@cvlogofile.png}};
\end{tikzpicture}%
\par\vspace*{-17pt}%
\fi
}
% Render author's address
% Usage: \address{<address>}
\newcommand*{\address}[1]{\socialtext{\locationSymbol}{#1}}
% Render author's infos
% Usage: \infos{<infos>}
\newcommand*{\infos}[1]{\socialtext{\infoSymbol}{#1}}
% Render author's homepage
% Usage: \homepage{<homepage>}
\newcommand*{\homepage}[1]{\sociallink{\homeSymbol}{http://#1}{#1}}
% Render author's homepage
% Usage: \weibo{<weibo>}
\newcommand*{\weibo}[1]{\sociallink{\weiboSymbol}{http://www.weibo.com/#1}{weibo.com/#1}}
% Render author's linked-in (optional)
% Usage: \linkedin{<linked-in-nick>}
\newcommand*{\linkedin}[1]{\sociallink{\linkedinSymbol}{http://www.linkedin.com/in/#1}{linkedin.com/in/#1}}
% Render author's viadeo(optional)
% Usage: \viadeo{<viadeo-nick>}
\newcommand*{\viadeo}[1]{\sociallink{\viadeoSymbol}{http://www.viadeo.com/fr/profile/#1}{viadeo.com/fr/profile/#1}}
% Render author's github (optional)
% Usage: \github{<github-nick>}
\newcommand*{\github}[1]{\sociallink{\githubSymbol}{https://www.github.com/#1}{github.com/#1}} % Github icon + URL
% Render author's email (optional)
% Usage: \email{<email adress>}
\newcommand*{\email}[1]{\sociallink{\mailSymbol}{mailto:#1}{#1}}
\newcommand*{\emailO}[1]{\sociallink{\mailSymbolO}{mailto:#1}{#1}}
% Render author's mobile phone (optional)
% Usage: \smartphone{<mobile phone number>}
\newcommand*\smartphone[1]{\socialtext{\mobileSymbol}{#1}}
% Render author's tagline
\newcommand\resumetitle[1]{
\ifundef{\@
}{
\par{
\bigskip\center{\Large \color{accentcolor}\textsc{#1}\color{Black}}\par
}
\bigskip
}{
% \color{accentcolor}\textsc{\large{#1}}\color{black}
\par{
\bigskip\center{\Large \color{accentcolor}\textsc{#1}\color{Black}}\par
}
\bigskip
}
}
% Define social entries to print in header
\newcommand{\socialinfo}[1]{\def\@socialinfo{#1}}
% Render CV header
% Needs \@firstname, \@lastname and \@tagline to be defined
\newcommand*{\makecvheader}{
\@makecvlogo% 校徽(未调用 \cvlogo 时为空操作,不占位)
\ifundef{\@alternative}{
\ifundef{\@photodiameter}{
\begin{minipage}{\linewidth}
}{
\begin{minipage}{\dimexpr\linewidth-\@photodiameter-2em}
}
% ⚠️ 原文是 \vspace*{0.3cm}\\ —— \vspace 后面紧跟 \\ 会在
% 换行前多出一个**空的 hbox**,日志每条都刷
% Underfull \hbox (badness 10000) in paragraph at lines 75--75
% 改用 \\[0.3cm](换行并附垂直间距,LaTeX 标准写法),
% 间距效果完全一样,但不产生空盒。下面的 \smallskip\\
% 同理改成 \\[\smallskipamount]。
\color{accentcolor}\user{\@firstname}{\@lastname}\color{black}\\[0.3cm]
\small{\@socialinfo}
\end{minipage}
\ifdef{\@photodiameter}{
\begin{minipage}{\@photodiameter}
\begin{tikzpicture}%
\node[circle, text=white, minimum size=2.5cm,
path picture={\node at (path picture bounding box.center){
\includegraphics[width=2.5cm]{\@photo}
};
}]{ };
\end{tikzpicture}
\end{minipage}
}{}
\resumetitle{\@tagline}
}{
\ifundef{\@photodiameter}{
\begin{minipage}{\linewidth}
}{
\begin{minipage} {\dimexpr\linewidth-\@photodiameter-2em}
}
\user{\@firstname}{\@lastname}\\[0.3cm]
\resumetitle{\@tagline}
\\[\smallskipamount]
\small{\@socialinfo}
\end{minipage}
\ifdef{\@photodiameter}{
\begin{minipage}{\@photodiameter}
\begin{tikzpicture}%
\node[circle, text=white, minimum size=2.5cm,
path picture={\node at (path picture bounding box.center){
\includegraphics[width=2.5cm]{\@photo}
};
}]{ };
\end{tikzpicture}
\end{minipage}
% \begin{minipage}{\@photodiameter}
% \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
% \end{minipage}
}{}
\bigskip
}
}
% Resume part title definition
\newcommand\sectionTitle[2]{\section{\texorpdfstring{\color{accentcolor}#2\enspace \textbf{#1}}{#1}}}
% Define a new column type for the scholarship environment
\newcolumntype{Y}{>{\raggedleft}p{\leftcolumn}}
% Define the 'scholarship' environment
\newenvironment{scholarship}{%
\begin{tabular}{Y p{\rightcolumnlength}}
}{%
\end{tabular}
}
% Render a scholarshipentry in the scolarship environment
% Usage: \scholarshipentry{<date>}{<description>}
\newcommand\scholarshipentry[2]{
#1 & #2 \\
}
% Define the 'skills' environment
\newenvironment{skills}{%
\begin{longtable}{R{\leftcolumn}p{\rightcolumnlength}}
}{%
\end{longtable}
}
% Render a skill in the skills environment
% Usage: \skill{<skill>}{<level>}
\newcommand\skill[2]{
\textsc{#1} & \foreach \x in {1,...,5}{{\color{accentcolor!80} \ifnumgreater{\x}{#2}{\faCircleO}{\faCircle}}\enspace }
}
\newcolumntype{E}{>{\raggedright\arraybackslash}p{\rightcolumnlength}}
% Define the 'experiences' environment
\newenvironment{experiences}{%
\begin{longtable}{R{\leftcolumn}|E}
}{%
\end{longtable}
}
% Render an experience in the experiences environment
% Usage:
% \tags {<Technology list>}
\newcommand\tags[1]{
\foreach \n in {#1}{\cvtagcn{\n}}
}
% Render an experience in the experiences environment
% Usage:
% \experience
% {<End date>} {<Title>}{<Enterprise>}{<Country>}
% {<Start date} {
% <Experience description (Could be a list)>
% }
% {<Technology list>}
\newcommand\experience[7]{
\textsc{#1} & \textsc{#2, #3, #4} \\*
\textsc{#5} & \begin{minipage}[t]{\rightcolumnlength}
#6
\end{minipage} \\*
& \footnotesize{\foreach \n in {#7}{\cvtag{\n}}} \\
}
% Render a consultant experience in the experiences environment
% Usage:
% \consultantexperience
% {<End date>} {<Consultant title>}{<Consulting Enterprise>}{<Country>}
% {<Start date} {<Client title>}{<Client business unit>}
% {
% <Experience description (Could be a list)>
% }
% {<Technology list>}
\newcommand\consultantexperience[9]{
\textsc{#1} & \textsc{#2, #3, #4} \\*
\textsc{#5} & \emph{#6} pour #7 \\*
& \begin{minipage}[t]{\rightcolumnlength}
#8
\end{minipage} \\*
& \footnotesize{\foreach \n in {#9}{\cvtag{\n}}} \\
}
\newcommand\emptySeparator{\multicolumn{2}{c}{}\\}