我想将顶部名称和标题的颜色更改rSection
为“浅灰色”。我该怎么做?
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style
%------------------------------------------------------------------------------------------------------
% USED PACKAGES
%------------------------------------------------------------------------------------------------------
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum,textcomp}
\usepackage[scale=0.75]{geometry}
\usepackage[dvipsnames]{xcolor}
\name{firstName Name}% Your name
\address{Adress \\ City, country} % Your address
\address{(+49)~$\cdot$~(0)1111~$\cdot$~11111111 \\ [email protected]} % Your phone number and email
\begin{document}
%----------------------------------------------------------------------------------------
% PERSONAL DATA
%----------------------------------------------------------------------------------------
\begin{rSection}{Personal Data}
{\bf Born in City, Country.} \hfill {\em Date, year}
\end{rSection}
\end{document}
答案1
一个简单的方法就是重新定义环境
rSection
:\renewenvironment{rSection}[1]{ \sectionskip \textcolor{lightgray}{\MakeUppercase{#1}} \sectionlineskip \hrule \begin{list}{}{ \setlength{\leftmargin}{1.5em} } \item[] }{ \end{list} }
得出的结果是:
上述方法的一个缺点是,如果文件
resume.cls
对环境进行了更改,rSection
您将看不到它们。另一种方法是\MakeUppercase
在我们之内环境rSection
。\let\OrigRSection\rSection \let\OrigEndRSection\endrSection \let\OrigMakeUppercase\MakeUppercase \renewenvironment{rSection}[1]{ \renewcommand{\MakeUppercase}[1]{\textcolor{lightgray}{\OrigMakeUppercase{##1}}}% \OrigRSection{#1}% }{% \OrigEndRSection% }
笔记:
我
resume.cls
从https://github.com/treyhunner/resume/blob/master/resume.cls。但我不确定这是否正确。我已将和替换为
\bf
。请参阅\bfseries
\em
\emph{}
我使用 \textit 或 \it、\bfseries 或 \bf 等有关系吗, 和\em 和 \emph 之间有什么区别?。
代码:重新定义rSection
环境
\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style
%------------------------------------------------------------------------------------------------------
% USED PACKAGES
%------------------------------------------------------------------------------------------------------
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum,textcomp}
\usepackage[scale=0.75]{geometry}
\usepackage[dvipsnames]{xcolor}
\renewenvironment{rSection}[1]{
\sectionskip
\textcolor{lightgray}{\MakeUppercase{#1}}
\sectionlineskip
\hrule
\begin{list}{}{
\setlength{\leftmargin}{1.5em}
}
\item[]
}{
\end{list}
}
\name{firstName Name}% Your name
\address{Address \\ City, country} % Your address
\address{(+49)~$\cdot$~(0)1111~$\cdot$~11111111 \\ [email protected]} % Your phone number and email
\begin{document}
%----------------------------------------------------------------------------------------
% PERSONAL DATA
%----------------------------------------------------------------------------------------
\begin{rSection}{Personal Data}
{\bfseries Born in City, Country.} \hfill {\emph{Date, year}}
\end{rSection}
\end{document}
代码:重新定义\MakeUppercase
之内 rSection
:
\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style
%------------------------------------------------------------------------------------------------------
% USED PACKAGES
%------------------------------------------------------------------------------------------------------
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum,textcomp}
\usepackage[scale=0.75]{geometry}
\usepackage[dvipsnames]{xcolor}
\let\OrigRSection\rSection
\let\OrigEndRSection\endrSection
\let\OrigMakeUppercase\MakeUppercase
\renewenvironment{rSection}[1]{
\renewcommand{\MakeUppercase}[1]{\textcolor{lightgray}{\OrigMakeUppercase{##1}}}%
\OrigRSection{#1}%
}{%
\OrigEndRSection%
}
\name{firstName Name}% Your name
\address{Address \\ City, country} % Your address
\address{(+49)~$\cdot$~(0)1111~$\cdot$~11111111 \\ [email protected]} % Your phone number and email
\begin{document}
%----------------------------------------------------------------------------------------
% PERSONAL DATA
%----------------------------------------------------------------------------------------
\begin{rSection}{Personal Data}
{\bfseries Born in City, Country.} \hfill {\emph{Date, year}}
\end{rSection}
\end{document}