我在移动银行风格标题的某些部分时遇到了问题,但我设法移动了大部分内容
\patchcmd{\makehead}% <cmd>
{\setlength{\makeheaddetailswidth}{0.8\textwidth}}% <search>
{\setlength{\makeheaddetailswidth}{0.7\textwidth}}% <replace>
{}{}% <success><failure>
\patchcmd{\makehead}% <cmd>
{\\[2.5em]}% <search>
{\hfill\raisebox{-1.9cm}[0pt][0pt]{\includegraphics[width=.25\textwidth]{DSC_0126-v2.jpg}} \\[2.5em]}% <replace>
{}{}% <success><failure>
完整代码如下:
\documentclass[10pt,a4paper]{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{banking} % style options are 'casual' (default), 'classic', 'banking', 'oldstyle' and 'fancy'
\moderncvcolor{blue} % color options 'black', 'blue' (default), 'burgundy', 'green', 'grey', 'orange', 'purple' and 'red'
%\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
%\nopagenumbers{} % uncomment to suppress automatic page numbering for CVs longer than one page
% character encoding
\usepackage[utf8]{inputenc} % if you are not using xelatex ou lualatex, replace by the encoding you are using
%\usepackage{CJKutf8} % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean
% adjust the page margins
\usepackage[scale=0.80,top=8mm,textheight=1000pt,footskip=.25in]{geometry}
%\usepackage[a4paper,bindingoffset=0.2in,%
% left=1in,right=1in,top=1in,bottom=1in,%
% footskip=.25in]{geometry}
% \setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column with the dates
%\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...
\patchcmd{\makehead}% <cmd>
{\setlength{\makeheaddetailswidth}{0.8\textwidth}}% <search>
{\setlength{\makeheaddetailswidth}{0.7\textwidth}}% <replace>
{}{}% <success><failure>
\patchcmd{\makehead}% <cmd>
{\\[2.5em]}% <search>
{\hfill\raisebox{-2.9cm}[0pt][0pt]{\includegraphics[width=.25\textwidth]{DSC_0126-v2.jpg}}\\[2.5em]}% <replace>
{}{}% <success><failure>
% personal data
\name{Name}{Surname}
% \title{Curriculum Vitae} % optional, remove / comment the line if not wanted
\address{XXXX}{XXXXX}% optional, remove / comment the line if not wanted; the "postcode city" and "country" arguments can be omitted or provided empty
\phone[mobile]{+xxxxxxxxxxx} % optional, remove / comment the line if not wanted; the optional "type" of the phone can be "mobile" (default), "fixed" or "fax"
% \phone[fixed]{+2~(345)~678~901}
% \phone[fax]{+3~(456)~789~012}
\email{[email protected]} % optional, remove / comment the line if not wanted
% \homepage{www.johndoe.com} % optional, remove / comment the line if not wanted
\social[linkedin]{xxxxxx} % optional, remove / comment the line if not wanted
% \social[twitter]{jdoe} % optional, remove / comment the line if not wanted
\social[github]{xxxxxx} % optional, remove / comment the line if not wanted
\extrainfo{xx de xx de xxxxx}
\extrainfo{xx xxxxxxx}
% \photo[128pt][0.4pt]{almacen.jpg} % 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
\quote{ TestingTesting TestingTestingTesting TestingTesting TestingTesting TestingTestingTestingTestingTesting Testing } % optional, remove / comment the line if not wanted
% bibliography adjustements (only useful if you make citations in your resume, or print a list of publications using BibTeX)
% to show numerical labels in the bibliography (default is to show no labels)
% \makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
% to redefine the bibliography heading string ("Publications")
%\renewcommand{\refname}{Articles}
% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn} % to typeset your resume in Chinese using CJK
%----- resume ---------------------------------------------------------
\makecvtitle
\section{Education}
\section{Experience}
\section{Languages}
\section{Knowledge}
\section{Courses}
\begin{cvcolumns}
\cvcolumn{}{}
\cvcolumn{}{}
\end{cvcolumns}
\section{Job references}
\cvlistitem{}
\end{document}
%% end of file `template.tex'.
\grid
\grid
答案1
您需要\makehead
像这样进行修补(根据您的需要使用不同的值[2.5em]
...):
\patchcmd{\makehead}
{\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}}
{\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}
\flushmakeheaddetails\\[2.5em]\ifthenelse{\isundefined{\@quote}}{}%
{{\begin{minipage}{0.7\textwidth}\centering\quotestyle{\@quote}\end{minipage}\\}}%
}
{}
{}
并删除原始引用,如下所示:
\renewcommand*{\makecvhead}{% TODO: use \@initializecommand, which requires modifying its definition to handle \par
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
\makehead%
}
因此,完整的 MWE 如下
\documentclass[10pt,a4paper]{moderncv}
% moderncv themes
\moderncvstyle{banking}
\moderncvcolor{blue}
% character encoding
\usepackage[utf8]{inputenc}
% adjust the page margins
\usepackage[scale=0.80,top=8mm,textheight=1000pt,footskip=.25in]{geometry}
%\usepackage[a4paper,bindingoffset=0.2in,%
% left=1in,right=1in,top=1in,bottom=1in,%
% footskip=.25in]{geometry}
\patchcmd{\makehead}% <cmd>
{\setlength{\makeheaddetailswidth}{0.8\textwidth}}% <search>
{\setlength{\makeheaddetailswidth}{0.7\textwidth}}% <replace>
{}{}% <success><failure>
\patchcmd{\makehead}% <cmd>
{\\[2.5em]}% <search>
{\hfill\raisebox{-1cm}[0pt][0pt]{\includegraphics[width=.25\textwidth]{example-image}}\\[2.5em]}% <replace>
{}{}% <success><failure>
\makeatletter % <=======================================================
\patchcmd{\makehead}
{\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}}
{\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}
\flushmakeheaddetails\\[2.5em]\ifthenelse{\isundefined{\@quote}}{}%
{{\begin{minipage}{0.7\textwidth}\centering\quotestyle{\@quote}\end{minipage}\\}}%
}
{}
{}
\renewcommand*{\makecvhead}{% TODO: use \@initializecommand, which requires modifying its definition to handle \par
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
\makehead%
}
\makeatother % <========================================================
% personal data
\name{Name}{Surname}
% \title{Curriculum Vitae}
\address{XXXX}{XXXXX}
\phone[mobile]{+xxxxxxxxxxx}
% \phone[fixed]{+2~(345)~678~901}
% \phone[fax]{+3~(456)~789~012}
\email{[email protected]}
% \homepage{www.johndoe.com}
\social[linkedin]{xxxxxx}
% \social[twitter]{jdoe}
\social[github]{xxxxxx}
\extrainfo{xx de xx de xxxxx}
\extrainfo{xx xxxxxxx}
% \photo[128pt][0.4pt]{almacen.jpg} % 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
\quote{ TestingTesting TestingTestingTesting TestingTesting TestingTesting TestingTestingTestingTestingTesting Testing }
\begin{document}
\makecvtitle
\section{Education}
\section{Experience}
\section{Languages}
\section{Knowledge}
\section{Courses}
\begin{cvcolumns}
\cvcolumn{}{}
\cvcolumn{}{}
\end{cvcolumns}
\section{Job references}
\cvlistitem{}
\end{document}
您将获得以下结果 pdf: