Friggari 이력서/CV의 섹션에 다른 색상 추가

Friggari 이력서/CV의 섹션에 다른 색상 추가

그래서 저는 friggery CV 템플릿을 사용하여 이력서를 작성하고 있습니다. 다음과 같습니다.

여기에 이미지 설명을 입력하세요

여기에서 찾을 수 있습니다:

http://www.latextemplates.com/template/friggeri-resume-cv

보시다시피 섹션은 모두 멋진 색상의 처음 세 글자로 시작됩니다. 그러나 .cls파일에는 정의된 색상이 6개만 있습니다. 7개의 섹션을 갖고 싶고, 7번째 섹션에도 색상이 있었으면 좋겠습니다. 다음 코드를 사용하여 더 어두운 파란색을 추가해 보았습니다.

\definecolor{darkblue}{HTML}{0000FF}

처음에는 여기에 darkblue를 추가합니다.

\ifdefined\@cv@print
  \colorlet{green}{gray}
  \colorlet{orange}{gray}
  \colorlet{purple}{gray}
  \colorlet{brown}{gray}
  \colorlet{red}{gray}
  \colorlet{blue}{gray}
  \colorlet{darkblue}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}

여기에 darkblue도 추가합니다.

\newcounter{colorCounter}
\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        darkblue\or%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}

하지만 섹션을 추가하려고 하면 진한 파란색이 정의되지 않았다는 오류가 발생합니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까? 다른 색상은 그러한 방식 외에는 어디에도 언급되어 있지 않습니다.

답변1

색상 목록은 에 의해 제어 \@sectioncolor되며 이는 \ifcase; 원래 정의는 다음과 같습니다.

\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}

색상을 정의하고 목록에 추가하기만 하면 됩니다. 아래 예에서는 청록색과 노란색이라는 두 가지 새로운 색상을 정의했습니다.

\definecolor{teal}{HTML}{008080}
\definecolor{yellow}{HTML}{FFFF00}
\makeatletter
\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\or%
        teal\or%
        yellow\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}
\ifdefined\@cv@print
  \colorlet{green}{gray}
  \colorlet{orange}{gray}
  \colorlet{purple}{gray}
  \colorlet{brown}{gray}
  \colorlet{red}{gray}
  \colorlet{blue}{gray}
  \colorlet{teal}{gray}
  \colorlet{yellow}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}
\else
  \colorlet{fillheader}{gray}
  \colorlet{header}{white}
\fi
\makeatother

코드:

\documentclass[]{friggeri-cv} % Add 'print' as an option into the square bracket to remove colors from this template for printing

\addbibresource{bibliography.bib} % Specify the bibliography file to include publications

\definecolor{teal}{HTML}{008080}
\definecolor{yellow}{HTML}{FFFF00}

\makeatletter
\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\or%
        teal\or%
        yellow\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}
\ifdefined\@cv@print
  \colorlet{green}{gray}
  \colorlet{orange}{gray}
  \colorlet{purple}{gray}
  \colorlet{brown}{gray}
  \colorlet{red}{gray}
  \colorlet{blue}{gray}
  \colorlet{teal}{gray}
  \colorlet{yellow}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}
\else
  \colorlet{fillheader}{gray}
  \colorlet{header}{white}
\fi
\makeatother

\begin{document}

\header{john}{smith}{junior business analyst} % Your name and current job title/field

%----------------------------------------------------------------------------------------
%   SIDEBAR SECTION
%----------------------------------------------------------------------------------------

\begin{aside} % In the aside, each new line forces a line break
\section{contact}
123 Broadway
City, State 12345
Country
~
+0 (000) 111 1111
+0 (000) 111 1112
~
\href{mailto:[email protected]}{[email protected]}
\href{http://www.smith.com}{http://www.smith.com}
\href{http://facebook.com/johnsmith}{fb://jsmith}
\section{languages}
english mother tongue
spanish \& italian fluency
\section{programming}
{\color{red} $\varheartsuit$} JavaScript
Python, C++, PHP
CSS3 \& HTML5
\end{aside}

\section{education}

\section{experience}

\section{awards}

\section{communication skills}

\section{interests}

\section{publications}

\section{another section}

\section{yet another section}

\end{document}

출력:

여기에 이미지 설명을 입력하세요

에서 수정하려면 .cls file의 복사본을 만들고 friggeri-cv.cls다른 이름으로 저장한 myfiggeri-cv.cls다음 이 새 파일에서 다음 행을 변경하십시오.

\ProvidesClass{friggeri-cv}[2012/04/30 CV class]

에게

\ProvidesClass{myfriggeri-cv}[2012/04/30 CV class]

다음 변경

\ifdefined\@cv@print
  \colorlet{green}{gray}
  \colorlet{orange}{gray}
  \colorlet{purple}{gray}
  \colorlet{brown}{gray}
  \colorlet{red}{gray}
  \colorlet{blue}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}
\else
  \colorlet{fillheader}{gray}
  \colorlet{header}{white}
\fi

에게

\definecolor{teal}{HTML}{008080}
\definecolor{yellow}{HTML}{FFFF00}

\ifdefined\@cv@print
  \colorlet{green}{gray}
  \colorlet{orange}{gray}
  \colorlet{purple}{gray}
  \colorlet{brown}{gray}
  \colorlet{red}{gray}
  \colorlet{blue}{gray}
  \colorlet{teal}{gray}
  \colorlet{yellow}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}
\else
  \colorlet{fillheader}{gray}
  \colorlet{header}{white}
\fi

그리고 마지막으로 변화

\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}

에게

\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\or%
        teal\or%
        yellow\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}

변경 사항을 저장하고 myfriggeri-cv.clsTeX가 찾을 수 있는 곳에 놓습니다(가장 쉬운 것은 현재 작업 디렉토리입니다). .tex지금 당신의 문서에서 당신은 이렇게 말합니다.

\documentclass{myfriggeri-cv}

관련 정보