我想移动我的简历图像,moderncv
使图像的上边缘与我的名字的上半部分处于相同的高度:
这可能吗?而且下面的文本也不会相应移动?
用过的mwe.tex
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75,showframe]{geometry} % <=========================
\moderncvtheme[blue]{classic} % possible themes are "classic" and "casual"
\firstname{Name}
\familyname{Surname}
\title{Curriculum Vitae}
\address{street}{zip city\protect\\[0.1em] country\protect\\[0.2em]}
\mobile{+cell-phone}
\email{name@provider}
\photo[90pt]{example-image-10x16}
\quote{}
\setlength{\hintscolumnwidth}{3.6cm}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description
no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description
line 1\newline{}Description line 2}
\end{document}
日志数据:
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/Debian) (rev 5238) (format=lualatex 2018.10.13) 2 FEB 2019 20:46
restricted \write18 enabled.
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 1 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/moderncv/moderncv.cls
Document Class: moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter do
答案1
新答案:
您可以使用以下代码修补类代码:
\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
{\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}}% code to patch
{\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
\vspace{3.4cm}%
}% new code <=========================================================
{}% success
{\fail}% failure
\makeatother
根据您的需要更改3.4cm
命令中的值。\vspace{3.4cm}
附完整代码
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75,showframe]{geometry} % <=========================
\moderncvtheme[blue]{classic} % possible themes are "classic" and "casual"
\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
{\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}}% code to patch
{\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
\vspace{3.4cm}%
}% new code <=========================================================
{}% success
{\fail}% failure
\makeatother
\firstname{Name}
\familyname{Surname}
\title{Curriculum Vitae}
\address{street}{zip city\protect\\[0.1em] country\protect\\[0.2em]}
\mobile{+cell-phone}
\email{name@provider}
\photo[90pt]{example-image-10x16}
\quote{}
\setlength{\hintscolumnwidth}{3.6cm}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description
no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description
line 1\newline{}Description line 2}
\end{document}
你得到了想要的结果:
旧答案:
嗯,看来你正在使用moderncv
样式oldstyle
。有几种样式可用,可moderncv
产生不同的页眉、正文和页脚。
所以你的情况是 重要的了解所使用的风格(这就是我在你的上一个问题中询问 MWE 的原因,MWE 是一种可编译的代码,我们可以在我们的计算机上复制和测试...)
您需要像这样修补标题的构建:
\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
{\usebox{\makecvheadpicturebox}\\[2.5em]}% code to patch
{\begin{minipage}[t]{\makecvheadpicturewidth}%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\vspace{-1.8cm}%
\color{color1}%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}%
}%
\end{minipage}\\[2.5em]%
}% new code <======================================
{}% success
{\fail}% failure
\makeatother
请参阅我的使用\vspace{-1.8cm}%
取决于您使用的图像,根据您的需要更改值-1.8cm
...请参阅我使用的选项showframe
来geometry
可视化打字区域和边距...
附完整代码
\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{oldstyle}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75,showframe]{geometry} % <=========================
\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
{\usebox{\makecvheadpicturebox}\\[2.5em]}% code to patch
{\begin{minipage}[t]{\makecvheadpicturewidth}%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\vspace{-1.8cm}%
\color{color1}%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}%
}%
\end{minipage}\\[2.5em]%
}% new code <======================================
{}% success
{\fail}% failure
\makeatother
% personal data
\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]{example-image-10x16}
\quote{Some quote}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description
no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description
line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}
\section{Languages}
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{\textbf{Language} 2}{\textbf{Skill} level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}
\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}
\section{Interests}
\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}
\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3. This item is particularly long and therefore
normally spans over several lines. Did you notice the indentation
when the line wraps?}
\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}
\section{References}
\begin{cvcolumns}
\cvcolumn{Category 1}{\begin{itemize}\item Person 1\item Person 2\item Person 3\end{itemize}}
\cvcolumn{Category 2}{Amongst others:\begin{itemize}\item Person 1, and\item Person 2\end{itemize}(more upon request)}
\cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).}
\end{cvcolumns}
\end{document}
您将获得以下结果: