在 moderncv 经典格式中向 \title{} 命令添加附加参数

在 moderncv 经典格式中向 \title{} 命令添加附加参数

我想在 moderncv 中的 \title{} 命令中添加一个额外的参数,这样我就可以将“上次更新”......带到十字标记处,标题应该像我所示的那样位于右上角。我使用的是经典格式。我尝试了很多次,但都徒劳无功。任何这方面的帮助都将不胜感激。这是示例代码及其输出。这是我的文档序言的代码。


代码

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{red} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\usepackage{ leftidx}
\definecolor{orange}{RGB}{255,127,0}

\newcommand*{\skypesymbol} {%
  \protect\raisebox{-0.085em}{%
\protect\begin{tikzpicture}[y=0.08em,x=0.08em,xscale=0.022,yscale=-0.022, inner sep=0pt, outer sep=0pt]
\protect\path[fill=orange,even odd rule] (487.6550,288.9690) .. controls (489.0610,278.5690) and
  (489.8700,267.9960) .. (489.8700,257.2330) .. controls (489.8700,128.0770) and
  (384.5990,23.3610) .. (254.7670,23.3610) .. controls (241.8630,23.3610) and
  (229.2120,24.4210) .. (216.9010,26.4410) .. controls (194.8280,12.0570) and
  (168.5590,3.6740) .. (140.2880,3.6740) .. controls (62.7660,3.6740) and
  (0.0000,66.4820) .. (0.0000,143.9800) .. controls (0.0000,172.1780) and
  (8.2990,198.3740) .. (22.5900,220.3690) .. controls (20.6650,232.3860) and
  (19.6810,244.6920) .. (19.6810,257.2290) .. controls (19.6810,386.4050) and
  (124.8980,491.1100) .. (254.7660,491.1100) .. controls (269.4230,491.1100) and
  (283.6930,489.6840) .. (297.5620,487.1780) .. controls (319.1120,500.5470) and
  (344.4960,508.3260) .. (371.7080,508.3260) .. controls (449.2100,508.3260) and
  (512.0010,445.5020) .. (512.0010,368.0120) .. controls (511.9980,338.7190) and
  (503.0410,311.4840) .. (487.6550,288.9690) -- cycle(276.7400,429.5960) ..
  controls (202.0340,433.4870) and (167.0750,416.9590) .. (135.0500,386.9050) ..
  controls (99.2850,353.3370) and (113.6520,315.0500) .. (142.7900,313.1040) ..
  controls (171.9120,311.1590) and (189.3980,346.1160) .. (204.9410,355.8400) ..
  controls (220.4650,365.5280) and (279.5340,387.6000) .. (310.7350,351.9320) ..
  controls (344.7100,313.1040) and (288.1410,293.0120) .. (246.6760,286.9300) ..
  controls (187.4730,278.1640) and (112.7260,246.1370) .. (118.5410,183.0230) ..
  controls (124.3580,119.9490) and (172.1230,87.6090) .. (222.3910,83.0470) ..
  controls (286.4680,77.2300) and (328.1820,92.7540) .. (361.1760,120.9070) ..
  controls (399.3270,153.4360) and (378.6840,189.8010) .. (354.3770,192.7270) ..
  controls (330.1660,195.6360) and (302.9730,139.2230) .. (249.5860,138.3750) ..
  controls (194.5590,137.5110) and (157.3690,195.6360) .. (225.3000,212.1590) ..
  controls (293.2660,228.6640) and (366.0500,235.4450) .. (392.2610,297.5760) ..
  controls (418.4900,359.7130) and (351.5070,425.7010) .. (276.7400,429.5960) --
  cycle;
\protect\end{tikzpicture}}%
  ~}

\makeatletter
% defines one's email (optional)
% usage: \email{<email adress>}
\newcommand*{\skype}[1]{\def\@skype{#1}}

\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% optional detailed information (pre-rendering)
\def\phonesdetails{}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\def\socialsdetails{}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\newbox{\makecvtitledetailsbox}%
\savebox{\makecvtitledetailsbox}{%
\addressfont\color{orange}%

\begin{tabular}[b]{@{}l@{}}%
\makenewline
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
    \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
  \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
  \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
    \ifthenelse{\isundefined{\@skype}}{}{\makenewline{\skypesymbol\@skype}}%
  \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
  \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
  \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
\end{tabular}}%

% optional photo (pre-rendering)
\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}%
    \settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
  }%
% end define optional picture
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\hfill\titlestyle{\@title}}\\[1.5em]%
% optional detailed information (rendering)
{\raggedright\namefont{\color{color2!50}\@firstname}{\color{color2}\@familyname}}\\[1em]
\usebox{\makecvtitledetailsbox}% \llap is used to suppress the width of the box, allowing overlap if the value of
\hfill\usebox{\makecvtitlepicturebox}%
\\[-.35em]%
{\color{color2!50}\rule{\textwidth}{.25ex}}%
}%
\pagestyle{plain}

\makeatletter
\RenewDocumentCommand{\address}{mG{}G{}G{}}{%
  \def\@addressapartment{#1}\def\@addressstreetonly{#2}\def\@addresscity{#3}\def\@addresscountry{#4}%
  \def\@addressstreet{%
  \ifthenelse{\isundefined{\@addressapartment}}{}{\@addressapartment}%
  \ifthenelse{\isundefined{\@addressstreetonly}}{}{\makenewline\@addressstreetonly}%
  }}
\makeatother

\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{lastpage}
\usepackage{ifsym}
\usepackage{color}
\usepackage{etoolbox}
\usepackage{multicol}

\rfoot{\textit{\small{\thepage/\pageref{LastPage}}}}
\graphicspath{ {photo/} }
\usepackage[a4paper, total={7in, 10in}]{geometry} % Reduce document margins
%\setlength{\hintscolumnwidth}{3cm} % 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
%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------
\firstname{} % Your first name
\familyname{Abinash \textcolor{black}{Kar}}% Your last name. All information in this block is optional, comment out any lines you don't need
\title{Curriculum Vitae\newline{}
\scriptsize{\textnormal{Last Updated}\textnormal{ :} \textbf{January, 2015}}
}
\mobile{\color{color2}+91-7205044899}
\skype{\color{color2}kar.abinash93}
\email{[email protected]}
\address{\textifsymbol{18} \color{color2}Room No.\ C-205, M.S Swaminathan Hall of Residence,}{\ \ \ \color{color2}NIT Campus, NIT Rourkela, Rourkela -- 769008,}{\ \ \ \color{color2}District -- Sundergarh, State -- Odisha, India.}
\extrainfo{%
  \color{color2}\\ \color{color2}Date of Birth -- $15$\textsuperscript{th} July, 1993 \\
  \color{color2}Gender -- Male\\
  \color{color2}Nationality -- Indian
}
\AtBeginDocument{
    \hypersetup{colorlinks,urlcolor=cyan}
}

答案1

这里是

在此处输入图片描述

代码:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{red} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\usepackage{ leftidx}
\definecolor{orange}{RGB}{255,127,0}

\newcommand*{\skypesymbol} {%
  \protect\raisebox{-0.085em}{%
\protect\begin{tikzpicture}[y=0.08em,x=0.08em,xscale=0.022,yscale=-0.022, inner sep=0pt, outer sep=0pt]
\protect\path[fill=orange,even odd rule] (487.6550,288.9690) .. controls (489.0610,278.5690) and
  (489.8700,267.9960) .. (489.8700,257.2330) .. controls (489.8700,128.0770) and
  (384.5990,23.3610) .. (254.7670,23.3610) .. controls (241.8630,23.3610) and
  (229.2120,24.4210) .. (216.9010,26.4410) .. controls (194.8280,12.0570) and
  (168.5590,3.6740) .. (140.2880,3.6740) .. controls (62.7660,3.6740) and
  (0.0000,66.4820) .. (0.0000,143.9800) .. controls (0.0000,172.1780) and
  (8.2990,198.3740) .. (22.5900,220.3690) .. controls (20.6650,232.3860) and
  (19.6810,244.6920) .. (19.6810,257.2290) .. controls (19.6810,386.4050) and
  (124.8980,491.1100) .. (254.7660,491.1100) .. controls (269.4230,491.1100) and
  (283.6930,489.6840) .. (297.5620,487.1780) .. controls (319.1120,500.5470) and
  (344.4960,508.3260) .. (371.7080,508.3260) .. controls (449.2100,508.3260) and
  (512.0010,445.5020) .. (512.0010,368.0120) .. controls (511.9980,338.7190) and
  (503.0410,311.4840) .. (487.6550,288.9690) -- cycle(276.7400,429.5960) ..
  controls (202.0340,433.4870) and (167.0750,416.9590) .. (135.0500,386.9050) ..
  controls (99.2850,353.3370) and (113.6520,315.0500) .. (142.7900,313.1040) ..
  controls (171.9120,311.1590) and (189.3980,346.1160) .. (204.9410,355.8400) ..
  controls (220.4650,365.5280) and (279.5340,387.6000) .. (310.7350,351.9320) ..
  controls (344.7100,313.1040) and (288.1410,293.0120) .. (246.6760,286.9300) ..
  controls (187.4730,278.1640) and (112.7260,246.1370) .. (118.5410,183.0230) ..
  controls (124.3580,119.9490) and (172.1230,87.6090) .. (222.3910,83.0470) ..
  controls (286.4680,77.2300) and (328.1820,92.7540) .. (361.1760,120.9070) ..
  controls (399.3270,153.4360) and (378.6840,189.8010) .. (354.3770,192.7270) ..
  controls (330.1660,195.6360) and (302.9730,139.2230) .. (249.5860,138.3750) ..
  controls (194.5590,137.5110) and (157.3690,195.6360) .. (225.3000,212.1590) ..
  controls (293.2660,228.6640) and (366.0500,235.4450) .. (392.2610,297.5760) ..
  controls (418.4900,359.7130) and (351.5070,425.7010) .. (276.7400,429.5960) --
  cycle;
\protect\end{tikzpicture}}%
  ~}

\makeatletter
% defines one's email (optional)
% usage: \email{<email adress>}
\newcommand*{\skype}[1]{\def\@skype{#1}}

\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% optional detailed information (pre-rendering)
\def\phonesdetails{}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\def\socialsdetails{}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\newbox{\makecvtitledetailsbox}%
\savebox{\makecvtitledetailsbox}{%
\addressfont\color{orange}%

\begin{tabular}[b]{@{}l@{}}%
\makenewline
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
    \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
  \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
  \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
    \ifthenelse{\isundefined{\@skype}}{}{\makenewline{\skypesymbol\@skype}}%
  \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
  \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
  \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
\end{tabular}}%

% optional photo (pre-rendering)
\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}%
    \settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
  }%
% end define optional picture
% optional title
\ifthenelse{\equal{\@title}{}}{}{\raggedleft\titlestyle{\@title}}\\[1.5em]%
% optional detailed information (rendering)
\raggedright\namefont{\color{color2!50}\@firstname}{\color{color2}\@familyname}\\[.5em]
\usebox{\makecvtitledetailsbox}% \llap is used to suppress the width of the box, allowing overlap if the value of
\hfill\usebox{\makecvtitlepicturebox}%
\\[-.35em]%
{\color{color2!50}\rule{\textwidth}{.25ex}}%
}%
\pagestyle{plain}

\makeatletter
\RenewDocumentCommand{\address}{mG{}G{}G{}}{%
  \def\@addressapartment{#1}\def\@addressstreetonly{#2}\def\@addresscity{#3}\def\@addresscountry{#4}%
  \def\@addressstreet{%
  \ifthenelse{\isundefined{\@addressapartment}}{}{\@addressapartment}%
  \ifthenelse{\isundefined{\@addressstreetonly}}{}{\makenewline\@addressstreetonly}%
  }}
\makeatother

\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{lastpage}
\usepackage{ifsym}
\usepackage{color}
\usepackage{etoolbox}
\usepackage{multicol}

\rfoot{\textit{\small{\thepage/\pageref{LastPage}}}}
\graphicspath{ {photo/} }
\usepackage[a4paper, total={7in, 10in}]{geometry} % Reduce document margins
%\setlength{\hintscolumnwidth}{3cm} % 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
%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------
\firstname{} % Your first name
\familyname{Abinash \textcolor{black}{Kar}}% Your last name. All information in this block is optional, comment out any lines you don't need
\title{Curriculum Vitae\\
\scriptsize{\textnormal{Last Updated}\textnormal{ :} \textbf{January, 2015}}
}
\mobile{\color{color2}+91-7205044899}
\skype{\color{color2}kar.abinash93}
\email{[email protected]}
\address{\textifsymbol{18} \color{color2}Room No.\ C-205, M.S Swaminathan Hall of Residence,}{\ \ \ \color{color2}NIT Campus, NIT Rourkela, Rourkela -- 769008,}{\ \ \ \color{color2}District -- Sundergarh, State -- Odisha, India.}
\extrainfo{%
  \color{color2}\\ \color{color2}Date of Birth -- $15$\textsuperscript{th} July, 1993 \\
  \color{color2}Gender -- Male\\
  \color{color2}Nationality -- Indian
}
\AtBeginDocument{
    \hypersetup{colorlinks,urlcolor=cyan}
}

\begin{document}

\makecvtitle

\end{document} 

我改变了

\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\hfill\titlestyle{\@title}}\\[1.5em]%
% optional detailed information (rendering)
{\raggedright\namefont{\color{color2!50}\@firstname}{\color{color2}\@familyname}}\\[1em]

\ifthenelse{\equal{\@title}{}}{}{\raggedleft\titlestyle{\@title}}\\[1.5em]%
% optional detailed information (rendering)
\raggedright\namefont{\color{color2!50}\@firstname}{\color{color2}\@familyname}\\[.5em]

\title{Curriculum Vitae\newline{}
\scriptsize{\textnormal{Last Updated}\textnormal{ :} \textbf{January, 2015}}
}

\title{Curriculum Vitae\\
\scriptsize{\textnormal{Last Updated}\textnormal{ :} \textbf{January, 2015}}}

相关内容