履歴書のヘッダーのフォーマットを修正

履歴書のヘッダーのフォーマットを修正

履歴書のヘッダーを再フォーマットして、電子メール、github、電話番号が重ならないように右側に重ねて表示したいです。

ヘッダ

ファイルcv.tex

\documentclass[letterpaper]{style} % Use US Letter paper, change to a4paper for A4 
\usepackage{fontawesome}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{array}
\usepackage{tikz}
\def\ci#1{\textcircled{\resizebox{.5em}{!}{#1}}}

\begin{document}

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------
%\lastupdated % Print the Last Updated text at the top right
\namesection{{Lolita}}{Nazarov}{
\href{mailto:[email protected]}{\ci{\faEnvelope}} {\fontsize{10}{10}\selectfont \href{mailto:[email protected]}{[email protected]}}}

{
\href{https://github.com/lolitanaz314}{\ci{\faGithub}} {\fontsize{10}{10}\selectfont \href{https://github.com/lolitanaz314}{github.com/lolitanaz314}}
}

{
\ci{\faPhone}  {\fontsize{10}{10}\selectfont 631-456-1964} 
}

\input{page1.tex}

\end{document}

Style.clsクラス:

%----------------------------------------------------------------------------------------
%   CLASS OPTIONS AND REQUIRED PACKAGES
%----------------------------------------------------------------------------------------

\ProvidesClass{style}[2014/04/30 CV class]
\NeedsTeXFormat{LaTeX2e}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass{article}
\usepackage[hmargin=1.25cm, vmargin=0.75cm]{geometry} % Specifies horizontal and vertical page margins
\usepackage{hyperref} % Required for links
\usepackage{enumitem} % for setting list indent

%----------------------------------------------------------------------------------------
%   COLORS
%----------------------------------------------------------------------------------------

\usepackage[usenames,dvipsnames]{xcolor} % Required for custom colors

\definecolor{primary}{HTML}{2b2b2b} % The primary document color for content text
\definecolor{headings}{HTML}{42b9f4} % The color of the large sections
\definecolor{subheadings}{HTML}{333333} % The color of subsections and places worked/studied
\definecolor{subsubheadings}{HTML}{6A6A6A} % The color of the large sections
\definecolor{date}{HTML}{666666} % The color used for the Last Updated text at the top right

%----------------------------------------------------------------------------------------
%   FONTS
%----------------------------------------------------------------------------------------

\usepackage{fontspec} % Required for specifying custom fonts in XeLaTeX

\setmainfont[Color=primary, Path = fonts/lato/,BoldItalicFont=Lato-RegIta,BoldFont=Lato-Reg,ItalicFont=Lato-LigIta]{Lato-Lig} % The primary font for content text; defines bold, italic and bold-italic as well

\setsansfont[Scale=MatchLowercase,Mapping=tex-text, Path = fonts/raleway/]{Raleway-ExtraLight} % The font used where \sfffamily is called

%----------------------------------------------------------------------------------------
%   MAIN HEADING COMMAND
%----------------------------------------------------------------------------------------

\newcommand{\namesection}[8]{ % Defines the command for the main heading
\color{headings}
% name
\begin{minipage}[t][.8cm][t]{.47\textwidth}
\raggedright{ % Center the name
\fontsize{40pt}{60pt} % Font size
\fontspec[Path = fonts/lato/]{Lato-Lig}\selectfont #1 % First name font
\color{black}
\fontspec[Path = fonts/lato/]{Lato-Hai}\selectfont #2 % Last name font
} %\\[5pt] % Whitespace between the name and contact information
\end{minipage}
% phone / email
\begin{minipage}[t][.8cm][t]{.22\textwidth}
\vspace{-28 pt} % Hacky fix for awkward extra vertical space
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#3 
\vspace{6 pt}
\\
#4
\end{minipage}
% phone / email
\begin{minipage}[t][.8cm][t]{.20\textwidth}
\vspace{-30 pt} % Hacky fix for awkward extra vertical space
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#5
\vspace{6 pt}
\\
#6
% Contact information font
\end{minipage}
\begin{minipage}[t][.8cm][t]{.1\textwidth}
\vspace{-27 pt} % Hacky fix for awkward extra vertical space
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#7
\vspace{6 pt}
\\
#8
% Contact information font
\end{minipage}

\noindent\makebox[\linewidth]{\color{subsubheadings}\rule{\paperwidth}{0.4pt}} % Horizontal rule
\vspace{-5pt} % Reduce whitespace after the rule slightly
}

%----------------------------------------------------------------------------------------
%   SECTION TITLE STYLING AND SPACING
%----------------------------------------------------------------------------------------

\usepackage{titlesec} % Required for customizing section/subsection/etc titles
\usepackage{textcase}
\titlespacing{\section}{0pt}{0pt}{0pt} % Removes the spacing around the main section titles
\titlespacing{\subsection}{0pt}{0pt}{0pt} % Removes the spacing around the subsections
\newcommand{\sectionspace}{\vspace{8pt}} % Defines a command to add a set amount of space after sections and subsections

\titleformat{\section}{ % Customize the large section titles
\color{headings}\scshape\fontspec[Path = fonts/lato/]{Lato-Lig}\fontsize{16pt}{24pt}\selectfont \raggedright \bfseries \lowercase}{}{0em}{} % chandan removed \uppercase

\titleformat{\subsection}{ % Customize the subsections and places worked/studied titles
\color{subheadings}\fontspec[Path = fonts/lato/]{Lato-Bol}\fontsize{12pt}{12pt}\selectfont\bfseries \lowercase}{}{0em}{} % removed \uppercase

\newcommand{\runsubsection}[1]{ % Used for creating subsections where a description is required on the same line
\color{subheadings}\fontspec[Path = fonts/lato/]{Lato-Bol}\fontsize{12pt}{12pt}\selectfont\bfseries\lowercase {#1} \normalfont} % removed \uppercase

\newcommand{\descript}[1]{ % Used for describing the subsection either on the same line or underneath
\color{subheadings}\raggedright\scshape\fontspec[Path = fonts/lato/]{Lato-Bol}\fontsize{11pt}{13pt}\selectfont\lowercase {#1 \\} \normalfont}

\newcommand{\location}[1]{ % Used for specifying a duration and/or location under a subsection
\color{subsubheadings}\raggedright\fontspec[Path = fonts/lato/]{Lato-Reg}\fontsize{10pt}{12pt}\selectfont\lowercase {#1\\} \normalfont}

%----------------------------------------------------------------------------------------
%   SECTION TITLE STYLING AND SPACING
%----------------------------------------------------------------------------------------

\newenvironment{tightitemize} % Defines the tightitemize environment which modifies the itemize environment to be more compact
{\vspace{-\topsep}\begin{itemize}[leftmargin=0.2in]\itemsep1pt \parskip0pt \parsep0pt }
{\end{itemize}\vspace{-\topsep}}

答え1

まあ、このテンプレートは最高のものではないので、可能であれば使用しないでください。

その理由は、次のとおりです...

このコマンドは\namesection、次のような8つのパラメータを持つように定義されています。

\namesection{firstname-1}{lastname-2}{mailsymbol-3}{mail-4}{githubsymbol-5}{github-6}{phonesymbol-7}{phone-8}

したがって、CV で次のコマンドを使用する必要があります。

    \namesection{Lolita}{Nazarov}% parameter 1 and 2
      {\href{mailto:[email protected]}{\ci{\faEnvelope}}}% 3
      {\fontsize{8}{8}\selectfont \href{mailto:[email protected]}{[email protected]}}%4
      {\href{https://github.com/lolitanaz314}{\ci{\faGithub}}} %5
      {\fontsize{8}{8}\selectfont \href{https://github.com/lolitanaz314}{github.com/lolitanaz314}}%6
      {\ci{\faPhone}}%7  
      {\fontsize{8}{8}\selectfont 631-456-1964} %8

利用可能な場所に情報を印刷するためにフォント サイズを縮小したことに注意してください。

メール、github、電話の情報を 1 行で取得するには、\namesection次のようにプリアンブルでコマンドを再定義する必要があります (変更されたコード、つまり でマークされた値を参照してください<=====)。

\renewcommand{\namesection}[8]{ % Defines the command for the main heading
\color{headings}
% name
\begin{minipage}[t][.8cm][t]{.47\textwidth}
\raggedright{ % Center the name
\fontsize{40pt}{60pt} % Font size
\fontspec[Path = fonts/lato/]{Lato-Lig}\selectfont #1 % First name font
\color{black}
\fontspec[Path = fonts/lato/]{Lato-Hai}\selectfont #2 % Last name font
} %\\[5pt] % Whitespace between the name and contact information
\end{minipage}
% phone / email
\begin{minipage}[t][.8cm][t]{.22\textwidth}
\vspace{-27 pt} % Hacky fix for awkward extra vertical space <==========
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#3 
\vspace{6 pt}
\\
#4
\end{minipage}
% phone / email
\begin{minipage}[t][.8cm][t]{.18\textwidth} % 20 <======================
\vspace{-30 pt} % Hacky fix for awkward extra vertical space <==========
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#5
\vspace{6 pt}
\\
#6
% Contact information font
\end{minipage}
\begin{minipage}[t][.8cm][t]{.1\textwidth}
\vspace{-30 pt} % Hacky fix for awkward extra vertical space <==========
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#7
\vspace{6 pt}
\\
#8
% Contact information font
\end{minipage}

\noindent\makebox[\linewidth]{\color{subsubheadings}\rule{\paperwidth}{0.4pt}} % Horizontal rule
\vspace{-5pt} % Reduce whitespace after the rule slightly
}

実際に使用したデータに応じて、CV の適切な印刷ヘッダーを取得するために、マークされたすべての値を調整する必要があります。この場合は、列の長さが可変のテーブルを使用する方がよいでしょう。

したがって、次の MWE を使用します (クラス ファイルに変更を加える必要はありません)。

\documentclass[letterpaper]{style} % Use US Letter paper, change to a4paper for A4 

\usepackage{fontawesome}
\usepackage{graphicx}
\usepackage{array}
\usepackage{tikz}

\usepackage{hyperref} % <=============================================== called last!!

\def\ci#1{\textcircled{\resizebox{.5em}{!}{#1}}}

\renewcommand{\namesection}[8]{ % Defines the command for the main heading
\color{headings}
% name
\begin{minipage}[t][.8cm][t]{.47\textwidth}
\raggedright{ % Center the name
\fontsize{40pt}{60pt} % Font size
\fontspec[Path = fonts/lato/]{Lato-Lig}\selectfont #1 % First name font
\color{black}
\fontspec[Path = fonts/lato/]{Lato-Hai}\selectfont #2 % Last name font
} %\\[5pt] % Whitespace between the name and contact information
\end{minipage}
% phone / email
\begin{minipage}[t][.8cm][t]{.22\textwidth}
\vspace{-27 pt} % Hacky fix for awkward extra vertical space <==========
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#3 
\vspace{6 pt}
\\
#4
\end{minipage}
% phone / email
\begin{minipage}[t][.8cm][t]{.18\textwidth} % 20 <======================
\vspace{-30 pt} % Hacky fix for awkward extra vertical space <==========
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#5
\vspace{6 pt}
\\
#6
% Contact information font
\end{minipage}
\begin{minipage}[t][.8cm][t]{.1\textwidth}
\vspace{-30 pt} % Hacky fix for awkward extra vertical space <==========
%\centering{ % Center the contact information
\color{subsubheadings} % Use the headings color
% \fontspec[Path = fonts/raleway/]{Raleway-Medium}
\fontspec[Path = fonts/lato/]{Lato-Bol}
\fontsize{22}{18}\selectfont 
#7
\vspace{6 pt}
\\
#8
% Contact information font
\end{minipage}

\noindent\makebox[\linewidth]{\color{subsubheadings}\rule{\paperwidth}{0.4pt}} % Horizontal rule
\vspace{-5pt} % Reduce whitespace after the rule slightly
}


\begin{document}

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------
%\lastupdated % Print the Last Updated text at the top right
%\namesection{firstname-1}{lastname-2}{mailsymbol-3}{mail-4}{githubsymbol-5}{github-6}{phonesymbol-7}{phone-8}
\namesection{Lolita}{Nazarov}%1 and 2
  {\href{mailto:[email protected]}{\ci{\faEnvelope}}}% 3
  {\fontsize{8}{8}\selectfont \href{mailto:[email protected]}{[email protected]}}%4
  {\href{https://github.com/lolitanaz314}{\ci{\faGithub}}} %5
  {\fontsize{8}{8}\selectfont \href{https://github.com/lolitanaz314}{github.com/lolitanaz314}}%6
  {\ci{\faPhone}}%7  
  {\fontsize{8}{8}\selectfont 631-456-1964} %8

\input{page1.tex}

\end{document}

次の結果が得られます。

結果のヘッダー

関連情報