
テーマは気に入っているのですmoderncv
casual
が、写真の順番と名前・タイトルを変更したいです。
この質問に記載されている解決策を試しました:
! Undefined control sequence.
\maketitle ->{{\firstnamestyle
{\@firstname}~\familynamestyle {\@familyname}...
l.33 \maketitle
コード例:
\documentclass[11pt,a4paper]{moderncv}
% moderncv themes
\moderncvtheme[blue]{casual}
\AtBeginDocument
{
% reverse the name and photo
\makeatletter
% maketitle
\renewcommand*{\maketitle}{%
{%
{\firstnamestyle{\@firstname}~\familynamestyle{\@familyname}}}%
\hfill%
\ifthenelse{\isundefined{\@photo}}%
{}%
{{\color{firstnamecolor}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[-.35em]}%
{\color{firstnamecolor}\rule{\textwidth}{.25ex}\\[2.5em]}%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering{}\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\makeatother
}
\firstname{John}
\familyname{Doe}
\title{Curriculum Vitae}
\address{Example Street}{12345 Exampe Town}
\photo{picture}
\begin{document}
\maketitle
\end{document}
答え1
クラスが変更された問題を解決する 1 つの方法は、moderncv
次の MWE です。 の後の部分は、\AtBeginDocument
の元の定義を書き換えますmoderncv
。
覚えておいてください: クラスmoderncv
が再度変更された場合、修正内容を再度変更する必要がある可能性があります。 の作者に、名前と画像の位置を変更するオプションを組み込むように依頼するとよいかもしれませんmoderncv
。
変更された MWE:
\documentclass[11pt,a4paper]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\firstname{John}
\familyname{Doe}
\title{Resumé title}
\address{street and number}{postcode city}
\mobile{+1~(234)~567~890}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\makeatletter
%\AtBeginDocument
%{
% reverse the name and photo
\renewcommand*{\makecvtitle}{%
\recomputecvlengths%
\makecvfooter%
% define optional picture
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{
\@initializelength{\makecvtitlepicturewidth}% Damit Länge bekannt bei Name
\settowidth{\makecvtitlepicturewidth}{0pt}%
}%
{%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
{\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}
\@initializelength{\makecvtitlepicturewidth}% Damit Länge bekannt bei Name
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
}%
% end define optional picture
% name
% \parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
{ \raggedright\namefont{\color{color2!50}\@firstname} {\color{color2}\@familyname}}%\lastname -> error
\hfill\usebox{\makecvtitlepicturebox}%
% \parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
% \raggedleft\namefont{\color{color2!50}\@firstname} {\color{color2}\@lastname}}%\familyname
\\[-.35em]%
{\color{color2!50}\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\hfill\titlestyle{\@title}}\\[2.5em]%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
%}% AtBeginDocument ende
\makeatother
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{ \textit{Grade} }{Description} % arguments 3 to 6 can be left empty
\cvitem{title}{ \emph{Title} }
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvdoubleitem{category X}{XXX, YYY, ZZZ}{category Y}{XXX, YYY, ZZZ}
\cvlistitem{Item 1}
\cvlistdoubleitem{Item 2}{Item 3}
\end{document}
結果は次のとおりです。
2.0.0へのアップデートmoderncv
:
すでに述べたように、クラスmoderncv
は変更されているため、クラス バージョンを使用する次のコードが必要です2.0.0
。
現在のバージョンでは、この質問で希望されているように、名前を CV のタイトルの左側に、画像を右側に印刷する追加オプションを使用してmoderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter document class
スタイルを定義できます。casual
[left]
linkedin
電話番号などを定義したり、またはなどの新しい情報を追加したりするための新しいコマンドが利用可能になっていることを確認してくださいgithub
...
次の MWE を参照してください (新しいコードは でマークされています<======
)。
\documentclass[11pt,a4paper]{moderncv}
\moderncvstyle[left]{casual} % <========================================
\moderncvcolor{blue}
\name{John}{Doe} % <====================================================
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890} % <====================================
\phone[fixed]{+2~(345)~678~901} % <=====================================
\phone[fax]{+3~(456)~789~012} % <=======================================
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe} % <=========================================
\social[twitter]{jdoe} % <==============================================
\social[github]{jdoe} % <===============================================
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\setlength{\footskip}{84pt} % <=========================================
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{ \textit{Grade} }{Description} % arguments 3 to 6 can be left empty
\cvitem{title}{ \emph{Title} }
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvdoubleitem{category X}{XXX, YYY, ZZZ}{category Y}{XXX, YYY, ZZZ}
\cvlistitem{Item 1}
\cvlistdoubleitem{Item 2}{Item 3}
\end{document}
この行\setlength{\footskip}{84pt}
が必要なのは、フッターに個人情報を追加したためだけです。履歴書にはこの行を追加せず、コンパイルして警告がないか確認してください。*.log
警告footskip is too small.
には、履歴書に丸められた値が記載されています...
答え2
moderncv の更新バージョンでは、これは廃止されています。これを変更するためのオプションがパッケージに含まれています。\moderncvstyle をロードするときに、次のようにオプション [left] を含めます。
\moderncvstyle[left]{casual}