%% moderncv-template.tex (compiled with pdfLaTeX)
%% Copyright 2021 Christine Chai
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at https://spdx.org/licenses/LPPL-1.3c.html.

% Customized ModernCV template developed by Christine Chai
% Built upon the moderncv package from Xavier Danaux

%----------------------------------------------------------------------------------------
%	PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[10pt,letterpaper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman

\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage{lastpage}
\rfoot{\addressfont\itshape\textcolor{gray}{Page \thepage}}

\usepackage{url}
\usepackage{multicol}
\usepackage[bottom]{footmisc} % enabling footnotes
\usepackage{amsmath}

%\setlength{\voffset}{-0.2in}
%\setlength{\textheight}{10.5in} % increase text height to fit resume on 1 page

\usepackage[scale=0.94, footskip=0.4cm]{geometry} % Reduce document margins
\setlength{\hintscolumnwidth}{0.5cm} % Uncomment to change the width of the dates column
%\setlength{\makecvtitlenamewidth}{10cm} % For the 'classic' style, uncomment to adjust the width of the space allocated to your name

%----------------------------------------------------------------------------------------
%	TABLE OF CONTENTS %----------------------------------------------------------------------------------------

% Created a Table of Contents in moderncv.
% https://tex.stackexchange.com/questions/158803/add-a-table-of-contents-into-a-moderncv-document

\makeatletter
%\setlength\columnsep{20pt}

\setcounter{tocdepth}{2}
\setlength\columnsep{20pt}
\newcommand\@pnumwidth{1.5em}

\newcommand\contentsname{Contents}
\newcommand\tableofcontents{%
	% One Column Version (complete)
	%\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
	%\section*{\contentsname}
	%\vspace{-20pt}
	%\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
	%\cvitem{}{\@starttoc{toc}}%

	% Two Column Version (complete)
	\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
	\section*{\contentsname}
	\vspace{-25pt}
	\cvitem{}{
		\begin{multicols}{2}[]
		\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
		\@starttoc{toc}%
		\end{multicols}
	}
	\vspace{-15pt}
}

\RenewDocumentCommand{\section}{sm}{%
  \par\addvspace{2.5ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addtocontents{toc}{\protect\vskip0pt}
  \addcontentsline{toc}{section}{#2}%
  \parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\color{color1}\rule{\hintscolumnwidth}{0.95ex}}}%
  \hspace{\separatorcolumnwidth}%
  \parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#2}}%
  \par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading

\newcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    %\addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode
      \advance\leftskip\@tempdima
      \hskip -\leftskip
	#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss\itshape #2}\par
      %#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss\itshape #2}\par
    \endgroup
  \fi}

%\newcommand*\l@section[2]{\\}
\newcommand*\l@subsection[2]{}
\makeatother

%----------------------------------------------------------------------------------------
%	NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

\firstname{Firstname} % Your first name
\familyname{Lastname} % Your last name

% All information in this block is optional, comment out any lines you don't need
\title{Updated on \today}
\address{P.O. Box xxxxx, City, State, Zip Code}{}
%\address{P.O. Box 25142, Arlington, VA 22202}{}
\mobile{(111) 111-1111}
\email{firstname.lastname@gmail.com}
\homepage{(put your url here)}

\extrainfo{%
\httplink{www.linkedin.com/in/yourname}\\
\httplink{github.com/yourGitHubID}
}

%\photo[70pt][0.4pt]{picture} % The first bracket is the picture height, the second is the thickness of the frame around the picture (0pt for no frame)
%\quote{"A witty and playful quotation" - John Smith}

%----------------------------------------------------------------------------------------

\begin{document}

\clearpage

\makecvtitle % Print the CV title

%\vspace{-35pt}
\vspace{-20pt}
%\vspace{-10pt}

% \tocless (toc-less) means section title not included in the table of contents.
\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}

\setcounter{tocdepth}{1}
\tableofcontents
%\tableofcontents % Create a table of contents

%----------------------------------------------------------------------------------------
%	SUMMARY SECTION
%----------------------------------------------------------------------------------------

\tocless\section{Summary}

\cvitem{$\bullet$}{This section is a summary of qualifications at the beginning.}

\cvitem{$\bullet$}{Research areas: field one, field two, and field three.}

\cvitem{$\bullet$}{\texttt{\textbackslash tocless} (toc-less) means the section title will not be included in the table of contents.}

%----------------------------------------------------------------------------------------
%	INTRODUCTION SECTION
%----------------------------------------------------------------------------------------

\section{Introduction}

\cvitem{$\bullet$}{This CV template is created by Christine P. Chai (\texttt{cpchai21@gmail.com}) from the ModernCV template (Xavier Danaux).
\newline{The ModernCV package in LaTeX can be downloaded on \href{https://github.com/moderncv/moderncv}{\textit{GitHub}} or \href{https://www.overleaf.com/latex/templates/modern-cv-and-cover-letter-2015-version/sttkgjcysttn}{\textit{Overleaf}}.}}

\vspace{10pt}

\cvitem{$\bullet$}{The original ModernCV template is awesome, and I use it for a wide variety of documents, such as resume/CV, cover letter, and even project descriptions. Therefore, many settings need to be customized to meet my needs. I would like to share this CV template, which includes the modifications I frequently use.}

\vspace{10pt}

\cvitem{$\bullet$}{Here is a list of what I modified:
\begin{itemize}
	\item Use the \texttt{today} command to show the date when I last modified this document.
	\item Put the dates on the right hand side, instead of at the beginning of each row.
	\item Add the table of contents section. This is recommended for a document with more than 10 pages.
	\item Show (default) or hide each section in the table of contents. 
	\item Add the page number at the bottom right of each page.
	% This does not contain the input files.
\end{itemize}}

\vspace{-10pt}


%----------------------------------------------------------------------------------------
%	DISCLAIMER SECTION
%----------------------------------------------------------------------------------------

\section{Disclaimer}

\cvitem{$\bullet$}{This template works best for long documents, such as a full CV or a file for all project descriptions. \newline{For industry job applications, it is still recommended to submit a one-page resume and be concise.}}

%----------------------------------------------------------------------------------------
%	EDUCATION SECTION
%----------------------------------------------------------------------------------------

\section{Education}
% Arguments not required can be left empty

\cventry{$\bullet$}{Ph.D. in Subject}{University of Elsewhere}{Country CC}{2016 -- 2021. GPA: 4.0/4.0}{Dissertation title: Something about this Subject. Advisor: Test G. Sample.}

\cventry{$\bullet$}{B.S. in Subject}{University of Somewhere}{Country AB}{2012 -- 2016. GPA: 3.88/4.0}{Minor in another subject.}

%\vspace{-10pt}

%----------------------------------------------------------------------------------------
%	WORK EXPERIENCE SECTION
%----------------------------------------------------------------------------------------

\section{Work Experience}

\subsection{Postdoctoral Fellow, Subject, Random University}

\cventry{$\bullet$}{New Start}{}{January 2022 -- Present}{}{First line of description.
\newline{Second line of description.}}

\subsection{Research Assistant, Subject, University of Elsewhere}

\cventry{$\bullet$}{Final Research Project}{}{July 2020 -- December 2021}{}{First line of description.
\newline{Second line of description.}}

\cventry{$\bullet$}{Another Research Project}{}{July 2018 -- June 2020}{}{First line of description.
\newline{Second line of description.}}

\cventry{$\bullet$}{Research Project Name}{}{January 2017 -- June 2018}{}{First line of description.
\newline{Second line of description.}}

\subsection{Summer Intern, Division X, Company ABCDE}

\cventry{$\bullet$}{Project Name}{}{May 2016 -- August 2016}{}{First line of description.
\newline{Second line of description.}}


%\newpage

%----------------------------------------------------------------------------------------
%	COMPUTER SKILLS SECTION
%----------------------------------------------------------------------------------------

\section{Computer Skills}
% Just three lines
\cvitem{}{Proficient in $\mathsf{R}$, Python, C++}
\cvitem{}{Familiar with SAS, MATLAB, SQL, Java}


%----------------------------------------------------------------------------------------
%	PUBLICATIONS SECTION
%----------------------------------------------------------------------------------------

\section{Publications}

\cvitem {$\bullet$}{\textbf{Lastname, F.}, Sample, T.G. Main Paper for Job Market. Journal Name, October 2021.}

\cvitem {$\bullet$}{Labmate, S., \textbf{Lastname, F.}, Student, K., Sample, T.G. Joint Paper Title. Random Journal, June 2019.}

\cvitem {$\bullet$}{\textbf{Lastname, F.}, Someone, E., Another, O. Paper Title is Something. Journal ABC, August 2017.}

\cvitem {$\bullet$}{Author, W., Collaborator, A., \textbf{Lastname, F.} Another Paper Title. XYZ Journal, December 2015.}


%----------------------------------------------------------------------------------------
%	PRESENTATIONS SECTION
%----------------------------------------------------------------------------------------

\section{Presentations}

\cvitem{$\bullet$}{\textbf{Job Talk Title:} Description here. One sentence summary. Random University, September 2021.}

\cvitem{$\bullet$}{\textbf{Another Presentation Title:} Description here. Is it a poster, contributed talk, or an invited talk? Conference AAA, July 2020.}

\cvitem{$\bullet$}{\textbf{Presentation Title:} Description here. Is it a poster, contributed talk, or an invited talk? Conference ZZZ, January 2018.}

\cvitem{$\bullet$}{\textbf{Undergraduate Presentation:} Description here. What is this presentation about? University of Somewhere, April 2016.}









\end{document}
