如何更改信件标题的颜色

如何更改信件标题的颜色

我正在使用moderncv它来创建一封信,我想更改信中的标题颜色。这是我第一次使用 LaTeX,即使我已经在其他moderncv部分这样做了,我也不知道如何在那部分做到这一点 :/。

\documentclass[11pt,a4paper,sans]{moderncv}        
\moderncvstyle{casual}                              
\moderncvcolor{green}                               


\usepackage[scale=0.80]{geometry}
\usepackage[utf8]{inputenc} 
\usepackage[ngerman]{babel} 
\usepackage[T1]{fontenc}    
\usepackage[ngerman, num]{isodate}
\usepackage{ragged2e}


\name{First}{Last} 
\makeatletter\name{First name\gdef\@firstname{}}{Last name\gdef\@lastname{}}\makeatother
\address{Street}{City}
\phone[mobile]{Number}                
\email{Mail}                              
\photo[80pt][0.4pt]{pb}                      
\usepackage{multibib}
\newcites{book,misc}{{Books},{Others}}

\begin{document}

\recipient{company}{adress}
\date{\today}
\opening{
\begin{center} 
 \vspace{-\baselineskip} 
 \bfseries \large I want to change the color of this text to moderncv green %or by use of RGB  
\end{center} Hallo to someone ,}
\closing{Thank you,\\ \hbox{\hspace{-0.0cm} \includegraphics[width=3cm]{cat}} \vspace{-1cm}}
\enclosure[Text]{Text}

\makelettertitle 

\justify

some Text  \vspace{1cm}

\makeletterclosing


\end{document}

答案1

使用

\textcolor{green}{text}

或者你可以使用 RGB 获得更可定制的版本

\definecolor{mygreen}{RGB}{10,200,50}  
\textcolor{mygreen}{text}

在您的文档中

\documentclass[11pt,a4paper,sans]{moderncv}        
\moderncvstyle{casual}                              
\moderncvcolor{green} 
\definecolor{mygreen}{RGB}{10,200,50}                              


\usepackage[scale=0.80]{geometry}
\usepackage[utf8]{inputenc} 
%\usepackage[ngerman]{babel} 
\usepackage[T1]{fontenc}    
\usepackage[ngerman, num]{isodate}
\usepackage{ragged2e}


\name{First}{Last} 
\makeatletter\name{First name\gdef\@firstname{}}{Last name\gdef\@lastname{}}\makeatother
\address{Street}{City}
\phone[mobile]{Number}                
\email{Mail}                              
\photo[80pt][0.4pt]{pb}                      
\usepackage{multibib}
\newcites{book,misc}{{Books},{Others}}

\begin{document}

\recipient{company}{adress}
\date{\today}
\opening{
\begin{center} 
 \vspace{-\baselineskip} 
 \bfseries \large \textcolor{green}{I want to change the color} \textcolor{mygreen}{of this text to moderncv green} %or by use of RGB  
\end{center} Hallo to someone ,}
\closing{Thank you,\\ \hbox{\hspace{-0.0cm} \includegraphics[width=3cm]{example-image-a}} \vspace{-1cm}}
\enclosure[Text]{Text}

\makelettertitle 

\justify

some Text  \vspace{1cm}

\makeletterclosing


\end{document}

在此处输入图片描述

相关内容