Closed alanlivio closed 2 years ago
I resolve the issue using the following code from internet[1].
% For issuing \makecvtitle more than once
\patchcmd{\makecvtitle}{\newlength{\makecvtitledetailswidth}}{\let\makecvtitledetailswidth\relax\newlength{\makecvtitledetailswidth}}{}{}
\patchcmd{\makecvtitle}{\newlength{\makecvtitlepicturewidth}}{\let\makecvtitlepicturewidth\relax\newlength{\makecvtitlepicturewidth}}{}{}
\newcommand{\part}[1]{%
% \phantomsection%
\addcontentsline{toc}{part}{#1}%
}
\makeatletter
\newcommand\@pnumwidth{1.55em}
\newcommand\@tocrmarg{2.55em}
\newcommand\@dotsep{8}
\newcommand\contentsname{Contents}
\setlength\columnsep{20pt}
\setcounter{tocdepth}{0}
\newcommand\tableofcontents{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
\newbox{\makecvtitlenamebox}
\savebox{\makecvtitlenamebox}{%
\namestyle{\@firstname\ \@lastname}%
}
\section*{\contentsname}
\@starttoc{toc}%
}
\usepackage{titletoc}
\titlecontents*{section}[0pt]
{}{}{\textbullet}
{\ \thecontentspage}[\\][]
\titlecontents{part}[0pt]
{}{}{
% \hspace*{5em}\normalsize
}
{\leaders\hbox{\normalfont$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill\normalsize\thecontentspage
% \hspace*{2em}
}[]
\renewcommand\l@subsection[2]{}
\makeatother
closed in favor https://github.com/moderncv/moderncv/issues/93
How add a table of contents at the beginning of a moderncv document? The \tableofcontents command is not recognized by the class.