我刚刚下载了学术研究人员 moderncv,但由于以下错误无法编译它
ERROR: Undefined control sequence.
--- TeX said ---
l.16 \@initializecommand
{\moderncvstyleheadoptions}{}
该文件来自https://fr.sharelatex.com/templates/cv-or-resume/academic-researcher-cv,我毫无改变地编译了这个。
我对 TeX 不太熟悉,也许只是缺少一个包。谢谢。
答案1
我编辑了该包的 main.tex。它似乎非常混乱,并且使用了未声明的命令。我注释掉了相关行并做了一些更正,尤其是对被赋予了双重(?!)的 documentclass 参数。用此代码替换 main.tex 中的代码。它应该适用于最新的 latex 版本。
%% start of file `main.tex'.
%% Copyright 2014 Francois Mouton ([email protected]).
%
% This template is adapted from the work performed by Xavier Danaux ([email protected]).
% This template further extends the functionality by integrating the moderntimeline package.
% This template also includes custom Biblatex style to print bibliography items with the moderntimeline package.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
\documentclass[11pt,a4paper,sans]{moderncv} % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')
% moderncv themes
\moderncvstyle{classic} % Only the 'classic' style is fully functional with the modifications made. The other options, 'casual' (default), 'oldstyle' and 'banking' has minor typesetting problems with the current modifications.
\moderncvcolor{blue} % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
%\renewcommand{\familydefault}{\sfdefault} % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
% character encoding
\usepackage[utf8]{inputenc} % if you are not using xelatex ou lualatex, replace by the encoding you are using
% adjust the page margins
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column of the timeline
%\setlength{\makecvtitlenamewidth}{10cm} % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. Be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks.
%-------------------Inlcuding pdfpages package-------------------------------------------------------------
\usepackage{pdfpages/pdfpages}
%-------------------Including moderntimeline package-------------------------------------------------------
\usepackage{moderntimeline/moderntimeline}
\tlmaxdates{2004}{2014} % Set the scale of the timeline. \tlmaxdates{startDate}{endDate}
%-------------------Including xpatch package---------------------------------------------------------------
\usepackage{xpatch/xpatch}
%-------------------Including Biblatex package-------------------------------------------------------------
\usepackage[url=false,
backend=biber, % This can be set to either biber or bibtex. If references are missing just change back and forth between biber and bibtex..
style=authoryear,
doi=false,
isbn=false,
backref=false,
dashed=false, % Do not add a dash out authors for subsequent articles with the same authors.
maxnames=99, % Amount of authors to include before abbreviating.
sorting=ydnt]{biblatex} % Sorting in reverse order
\addbibresource{cvreferences.bib} % Include your bibtex file here. Format: fileName.bib
\input{biblatex_modifications/standard_modification.tex} % Modifying the default standard.tex style of Biblatex. This modification is performed to include the moderntimeline package.
%-------------------Defining a CV Reference column style and a CV reference entry block-------------------
% Adapted from the solution provided in: http://tex.stackexchange.com/questions/34881/references-section-in-a-cv
% usage: \cvreference{name}{address line 1}{address line 2}{address line 3}{address line 4}{e-mail address}{phone number}{mobile phone number}
% Everything but the name is optional
% If \addresssymbol, \emailsymbol or \phonesymbol are specified, they will be used.
% (Per default, \addresssymbol isn't specified, the other two are specified.)
% If you don't like the symbols, remove them from the following code, including the tilde ~ (e.g. \phonesymbol~).
\newcommand{\cvreferencecolumn}[2]{%
\cvitem[0.75em]{}{%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
\hfill%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
}%
}
\newcommand{\cvreference}[8]{%
\textbf{#1}\newline% Name
\ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
\ifthenelse{\equal{#3}{}}{}{#3\newline}%
\ifthenelse{\equal{#4}{}}{}{#4\newline}%
\ifthenelse{\equal{#5}{}}{}{#5\newline}%
\ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{\href{mailto:#6}{\nolinkurl{#6}}}\newline}%
\ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7\newline}
\ifthenelse{\equal{#8}{}}{}{\mobilephonesymbol~#8}}
%-------------------Personal Data for CV title-----------------------------------------------------------
% Example:
\name{John}{Doe}
\title{Resumé title} % optional, remove / comment the line if not wanted
\address{street and number}{postcode city}{country}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{+1~(234)~567~890} % optional, remove / comment the line if not wanted
\phone[fixed]{+2~(345)~678~901} % optional, remove / comment the line if not wanted
\phone[fax]{+3~(456)~789~012} % optional, remove / comment the line if not wanted
\email{[email protected]} % optional, remove / comment the line if not wanted
\homepage{www.johndoe.com} % optional, remove / comment the line if not wanted
\extrainfo{additional information} % optional, remove / comment the line if not wanted
\photo[64pt][0.4pt]{images/picture} % optional, remove / comment the line if not wanted; '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file stored
\quote{Some quote} % optional, remove / comment the line if not wanted
%-------------------------------------------------------------------------------------------------------
% Content
%-------------------------------------------------------------------------------------------------------
\begin{document}
%-------------------Resume------------------------------------------------------------------------------
\makecvtitle
%-------------------Education Section-------------------------------------------------------------------
\section{Education}
% For a date range: (To indicate 'up to present', set EndYear to 0)
% Format: \tlcventry{StartYear}{EndYear}{Degree}{Institution}{City}{\textit{Grade}}{Description} % Arguments 3 (Degree) to 6 (Grade) can be left empty.
% Example: \tlcventry{2012}{0}{BSc Computer Science}{University of MyCity}{MyCity}{}{Also completed several random courses}
\tlcventry{2012}{0}{BSc Computer Science}{University of MyCity}{MyCity}{}{Also completed several random courses}
% For a single year:
% Format: \tldatecventry{StartYear}{Degree}{Institution}{City}{\textit{Grade}}{Description}
% Example: \tldatecventry{2008}{Senior Certificate}{High School MyCity}{MyCity}{\textit{80\%}}{Passed with distinction}
\tldatecventry{2008}{Senior Certificate}{High School MyCity}{MyCity}{\textit{80\%}}{Passed with distinction}
%-------------------PhD Thesis Section------------------------------------------------------------------
\section{PhD thesis}
% Format: \cvitem{Section Name}{Description}
% Example: \cvitem{title}{\emph{The title of my PhD goes here}}
% Example: \cvitem{supervisors}{My supervisors' names go here}
% Example: \cvitem{description}{Short thesis abstract}
\cvitem{title}{\emph{The title of my PhD goes here}}
\cvitem{supervisors}{My supervisors' names go here}
\cvitem{description}{Short thesis abstract}
%-------------------Masters Thesis Section--------------------------------------------------------------
\section{Master thesis}
% Format: \cvitem{Section Name}{Description}
% Example: \cvitem{title}{\emph{The title of my Masters goes here}}
% Example: \cvitem{supervisors}{My supervisors' names go here}
% Example: \cvitem{description}{Short thesis abstract}
\cvitem{title}{\emph{The title of my Masters goes here}}
\cvitem{supervisors}{My supervisors' names go here}
\cvitem{description}{Short thesis abstract}
%-------------------Achievements Section----------------------------------------------------------------
\section{Achievements}
% Format: \cvlistitem{Achievement}
% Example: \cvlistitem{Received best student award}
% Example: \cvlistitem{Another achievement. This achievement is particularly long and therefore normally spans over several lines. Did you notice the indentation when the line wraps?}
\cvlistitem{Received best student award}
\cvlistitem{Another achievement. This achievement is particularly long and therefore normally spans over several lines. Did you notice the indentation when the line wraps?}
%-------------------Languages Section-------------------------------------------------------------------
\section{Languages}
% Format: \cvitemwithcomment{Language}{Skill level}{Comment}
% Example: \cvitemwithcomment{English}{Native}{Mother Tongue}
% Example: \cvitemwithcomment{French}{Fluent}{Daily practice, all work performed in English}
\cvitemwithcomment{English}{Native}{Mother Tongue}
\cvitemwithcomment{French}{Fluent}{Daily practice, all work performed in English}
%-------------------Interests Section-------------------------------------------------------------------
\section{Interests}
% Format: \cvitem{Hobby}{Description}
% Example: \cvitem{Gaming}{Computer Games}
% Example: \cvitem{Sport}{Golf, Tennis}
\cvitem{Gaming}{Computer Games}
\cvitem{Sport}{Golf, Tennis}
%-------------------Experience Section------------------------------------------------------------------
\section{Experience}
%-------------------Vocational Experience---------------------------------------------------------------
\subsection{Vocational}
% Format: \tlcventry{StartYear}{EndYear}{Job title}{Employer}{City}{Country (optional)}{General description no longer than 1--2 lines.\newline{}%
% Example:
% \tlcventry{2008}{2011}{System Administrator}{Simple Solutions}{MyCity}{}{Did system administrative work.\newline{}%
% Main Duties:%
% \begin{itemize}%
% \item Administrate the servers;
% \item Administrate employee computers
% \begin{itemize}%
% \item All employee's computers had to be up to date;
% \end{itemize}
% \item Did some more administrating
% \end{itemize}}
\tlcventry{2008}{2011}{System Administrator}{Simple Solutions}{MyCity}{}{Did system administrative work.\newline{}%
Main Duties:%
\begin{itemize}%
\item Administrate the servers;
\item Administrate employee computers
\begin{itemize}%
\item All employee's computers had to be up to date;
\end{itemize}
\item Did some more administrating
\end{itemize}}
%-------------------Skills Matrix Section----------------------------------------------------------------
\section{Skills}
% For items with categories:
% Format: \cvdoubleitem{Category}{List of skills}{Category Name}{List of skills}
% Note: It looks better if the category is bold with \textbf{}
% Example:
% \subsection{Development}
% \cvdoubleitem{\textbf{Languages}}{C\#, C\+\+, Java}{\textbf{Databases}}{MSSQL, MySQL}
%
% For a bullet list without categories:
% Format: \cvlistdoubleitem{Skill 1}{Skill 2}
% Example:
% \subsection{Development}
% \cvlistdoubleitem{C\#, Java, Ruby}{MSSQL, MySQL}
% \cvlistdoubleitem{Photoshop}{Windows, Linux. In the single column list, this item is particularly long to wrap over several lines.}
\subsection{Development}
\cvdoubleitem{\textbf{Languages}}{C\#, Java, Ruby}{\textbf{Databases}}{MSSQL, MySQL}
%-------------------Publications Section----------------------------------------------------------------
% The cvitem commands needs to be altered to correctly print all publications with the moderntime package.
% The cvitem command is edited to remove all forced punctuation within the command.
% All the typesetting of the text is handled by the modified Biblatex style.
\input{cvitem_modifications/cvitem_modified} % Removing forced punctuation from cvitem
\nocite{*} % Print all publications.
% Format: \printbibliography[type=Biblatex type,title={Title of publication}]
% Example: \printbibliography[type=article,title={Journal Publications}]
% Example: \printbibliography[type=inproceedings,title={Conference Publications}]
% Example: \printbibliography[type=thesis,title={Thesis}]
\printbibliography[type=article,title={Journal Publications}]
\printbibliography[type=inproceedings,title={Conference Publications}]
\printbibliography[type=thesis,title={Thesis}]
\input{cvitem_modifications/cvitem_moderncvclassic} % Reverting changes to cvitem.
%-------------------References Section------------------------------------------------------------------
\section{References}
% Format: \cvreferencecolumn{\cvreference{Name Surname}{Position}{Department}{Company}{City}{Email}{Home Phone}{Cell Phone}}{\cvreference{Name Surname}{Position}{Department}{Company}{City}{Email}{Home Phone}{Cell Phone}}
% Example:
% \subsection{Simple Solutions}
% \cvreferencecolumn{\cvreference{John Doe}{Developer}{HR}{Simple Solutions}{MyCity}{[email protected]}{+12 (34) 567 8901}{+23 (45) 678 9012}}{\cvreference{Jane Doe}{Accountant}{HR}{Simple Solutions}{MyCity}{[email protected]}{+34 (56) 789 0123}{+45 (67) 890 1234}}
% \subsection{Monster Inc}
% \cvreferencecolumn{\cvreference{Alice Doe}{Manager}{HR}{Monster Inc}{ThatCity}{[email protected]}{+12 (34) 567 8901}{+23 (45) 678 9012}}{}
%\subsection{Simple Solutions}
%\cvreferencecolumn{\cvreference{John Doe}{Developer}{HR}{Simple Solutions}{MyCity}{[email protected]}{+12 (34) 567 8901}{+23 (45) 678 9012}}{\cvreference{Jane Doe}{Accountant}{HR}{Simple Solutions}{MyCity}{[email protected]}{+34 (56) 789 0123}{+45 (67) 890 1234}} \subsection{Monster Inc}
%\cvreferencecolumn{\cvreference{Alice Doe}{Manager}{HR}{Monster Inc}{ThatCity}{[email protected]}{+12 (34) 567 8901}{+23 (45) 678 9012}}{}
\clearpage
%-------------------Appendix----------------------------------------------------------------------------
% This section is added to append any additional documents to the cv.
% The appended documents are added to the table of contents for easier navigation of the document.
% Usage: (section)
% \phantomsection
% \addcontentsline{toc}{section}{title}
%
% Format: (subsection)
% \phantomsection\addcontentsline{toc}{subsection}{title}
% \includepdf[pages=-]{appendix/filename.pdf}
%
% Example:
% \phantomsection
% \addcontentsline{toc}{section}{Certificates}
%
% \phantomsection
% \addcontentsline{toc}{subsection}{Landscape}
% \includepdf[pages=-]{appendix/CertificateLandscape.pdf}
%
% \phantomsection
% \addcontentsline{toc}{subsection}{Portrait}
% \includepdf[pages=-]{appendix/CertificatePortrait.pdf}
%\phantomsection
%\addcontentsline{toc}{section}{Certificates}
%
%\phantomsection
%\addcontentsline{toc}{subsection}{Landscape}
%\includepdf[pages=-]{appendix/CertificateLandscape.pdf}
%
%\phantomsection
%\addcontentsline{toc}{subsection}{Portrait}
%\includepdf[pages=-]{appendix/CertificatePortrait.pdf}
%-------------------Cover letter------------------------------------------------------------------------
\input{coverletter.tex} % Include cover letter from coverletter.tex
%-------------------Document End------------------------------------------------------------------------
\end{document}
%% end of file `main.tex'.