私の大学には、履歴書を1つだけアップロードできる就職活動用のプラットフォームがあります。しかし、私は複数のカリキュラムをアップロードしたいのですが、それぞれ言語が異なります(私はヨーロッパに住んでいて、3つの言語を話しますが、それぞれカリキュラムの慣習が異なります)。そこで、3つのカリキュラムが埋め込まれた大きなファイル(実際にはマスターファイルと、スタンドアロンでコンパイルできる3つのファイル)を作成しました 。docmute
これには、目次エントリを生成するための非表示のコマンドが含まれています\part
。
この答えをいじってみたところtitletoc
、典型的なLaTeXの目次のようなものができました。これは、パートタイトルにはハイパーリンクがありますが、ページ番号にはハイパーリンクがありません。
しかし、私は次のような目次が欲しいです。
\section{Contents}
\cvitem{Page}{Language}
\cvitem{2}{Afrikaans}
\cvitem{3}{Zulu}
(もちろんフォーマットは必要ですが、しばらくお待ちください)両方テキストとページ番号がハイパーリンクされています。
これまでのコードは (多かれ少なかれ最小限の WE) です。
\documentclass[a4paper,11pt,sans]{moderncv}
\usepackage{etoolbox}
\name{John}{Doe}
\title{Bank magician}
\moderncvstyle{classic}
\moderncvcolor{blue}
% 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]{%
\clearpage%
\phantomsection%
\addcontentsline{toc}{part}{#1}%
}
\makeatletter % Table of Contents definition from Gonzalo Medina's answer
\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}%
}
\usebox{\makecvtitlenamebox}%
\par\nobreak % don't break a page here
\kern\the\prevdepth % don't take into account the depth of the preceding line
\kern 4pt % space before the rule
{ \color{gray!50}\hrule height 0.4ex width \textwidth } %1.05\wd\makecvtitlenamebox} % the rule
\kern 0.75em % space after the rule
\nointerlineskip % no additional space after the rule\hrule height 1ex width \wd\makecvtitlenamebox %
\ifthenelse{\equal{\@title}{}}{}{\titlestyle{\@title}}%
\vspace*{2\baselineskip}
\section*{\contentsname}
%\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
\@starttoc{toc}%
\clearpage
}
\usepackage{titletoc}
\titlecontents*{section}[0pt]
{}{}{\textbullet}
{\ \thecontentspage}[\\][]
\titlecontents{part}[0pt]
{}{}{\hspace*{5em}\Large}
{\leaders\hbox{\normalfont$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill\Large\thecontentspage\hspace*{2em}}[]
\renewcommand\l@subsection[2]{}
\makeatother
\begin{document}
\tableofcontents
\part{Language 1}
\makecvtitle
\section{Section 1}
Some text
\part{Language 2}
\makecvtitle
\section{Section 1}
Some text
\end{document}
答え1
見つけた
\newcommand\l@part[2]{\cvitem{\tocpagefont #2}{\tocentryfont #1}}
\newcommand\l@section[2]{}
\newcommand\l@subsection[2]{}
適切なフォーマットコマンドを使用して\tocpagefont
、\tocentryfont
ロードせずに作業を実行しますtitletoc
。
次回はもっとうまく読めるようにしたいと思いますbook.cls
:-)
タイトルと番号の両方をハイパーリンクするには、linktoc=all
を渡すだけです。moderncv
は に渡されますhyperref
。