Latex 乳胶def的说明
我在很棒的简历文档课上遇到了这一行Latex 乳胶def的说明,latex,xelatex,Latex,Xelatex,我在很棒的简历文档课上遇到了这一行 \def\@sectioncolor#1#2#3{% \ifbool{acvSectionColorHighlight}{{\color{awesome}#1#2#3}}{#1#2#3}% } \newcommand*{\sectionstyle}[1]{{\fontsize{16pt} {1em}\bodyfont\bfseries\color{text}\@sectioncolor #1}} 它的作用是你给它一个单词,它会改变单词前三个字母
\def\@sectioncolor#1#2#3{%
\ifbool{acvSectionColorHighlight}{{\color{awesome}#1#2#3}}{#1#2#3}%
}
\newcommand*{\sectionstyle}[1]{{\fontsize{16pt}
{1em}\bodyfont\bfseries\color{text}\@sectioncolor #1}}
它的作用是你给它一个单词,它会改变单词前三个字母的颜色
然而,我不明白它是如何工作的。有人能给我描述一下吗?在不考虑全部定义的情况下,请关注以下内容:
\def\@sectioncolor#1#2#3{%
% <some definition>
}
\newcommand*{\sectionstyle}[1]{{%
% <some definition>
\@sectioncolor #1}}
但是,请注意,\1
周围没有大括号,因为\@sectioncolor
需要三个强制参数。为此,像\sectionstyle{Education}
这样的调用转换为
\@sectioncolor Education
其中,\@sectioncolor
将前三个标记作为其强制参数。也就是说,几乎可以假设以下传输输入:
\@sectioncolor {E}{d}{u}cation
在
\@sectioncolor
的定义中,E
将是#1
,d
将是#2
,u
将是#3
。如果您不想用颜色突出显示部分,则按顺序设置它们。如果您想用颜色突出显示部分,则按顺序设置。在不考虑全部定义的情况下,请关注以下内容:
\def\@sectioncolor#1#2#3{%
% <some definition>
}
\newcommand*{\sectionstyle}[1]{{%
% <some definition>
\@sectioncolor #1}}
但是,请注意,\1
周围没有大括号,因为\@sectioncolor
需要三个强制参数。为此,像\sectionstyle{Education}
这样的调用转换为
\@sectioncolor Education
其中,\@sectioncolor
将前三个标记作为其强制参数。也就是说,几乎可以假设以下传输输入:
\@sectioncolor {E}{d}{u}cation
在
\@sectioncolor
的定义中,E
将是#1
,d
将是#2
,u
将是#3
。如果您不想用颜色突出显示部分,则按顺序设置它们。如果您想用颜色突出显示部分,则按顺序设置它们。谢谢您的解释。此行为仅适用于def还是适用于newcommand?@Ashkan:同样的情况也适用于\newcommand{\\@sectioncolor}[3]{…}
。感谢您的解释。这是仅针对def的行为,还是同样的情况发生在newcommand上?@Ashkan:同样的情况也会发生在\newcommand{\@sectioncolor}[3]{…}
上。