![moderncv классический заголовок вертикального выравнивания сверху](https://rvso.com/image/305759/moderncv%20%D0%BA%D0%BB%D0%B0%D1%81%D1%81%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B9%20%D0%B7%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D0%B2%D0%BE%D0%BA%20%D0%B2%D0%B5%D1%80%D1%82%D0%B8%D0%BA%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B3%D0%BE%20%D0%B2%D1%8B%D1%80%D0%B0%D0%B2%D0%BD%D0%B8%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F%20%D1%81%D0%B2%D0%B5%D1%80%D1%85%D1%83.png)
Следующий код — мой moderncv
в classic
стиле. На данный момент между страницей (сверху) и изображением есть пространство около 4-5 см. Как мне уменьшить это пространство, чтобы вынести полный заголовок дальше вверх? Может ли кто-нибудь мне помочь с этим?
\documentclass[11pt,a4paper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman
\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\makeatletter
\renewcommand{\makecvtitle}{%
\recomputecvlengths%
% optional picture box
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\hspace*{\separatorcolumnwidth}%
\color{color1}%
\setlength{\fboxrule}{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
\newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
% name and title
\setlength{\makecvtitlenamewidth}{189pt}% dummy value, was overwritten
\begin{minipage}[b]{\makecvtitlenamewidth}%
\raggedleft%
\namestyle{\@firstname} \namestyle{\@familyname}\\[1em]%
\ifthenelse{\equal{\@title}{}}{}{\titlestyle{\@title}}\\[1em]
\vspace{20pt}%
\addressfont\color{color2}%
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}%
\ifthenelse{\isundefined{\@mobile}}{}{\makenewline mobile: \@mobile}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline mail: \emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
\end{minipage}%
\hfill%
% optional picture box
\usebox{\makecvtitlepicturebox}\\[2.5em]%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}%
\makeatother
%----------------------------------------------------------------------------------------
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage[scale=0.75]{geometry} % Reduce document margins
\setlength{\hintscolumnwidth}{3.7cm} % Uncomment to change the width of the dates column
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
%----------------------------------------------------------------------------------------
% NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------
\firstname{Mr} % Your first name
\familyname{Smith} % Your last name
% All information in this block is optional, comment out any lines you don't need
\title{CV}
\address{mystreet}{mytown}
\mobile{12345}
\email{[email protected]}
\photo[230pt][0pt]{mypic} % The first bracket is the picture height, the second is the thickness of the frame around the picture
\quote{quote}
% ----------------------------------------------------------------------------------------
\usepackage{pdfpages}
\begin{document}
\pdfbookmark[0]{bookmark}{bo}
\begin{minipage}[b]{\textwidth}
\vspace{2cm}
\end{minipage}
%----------------------------------------------------------------------------------------
\makecvtitle % Print the CV title
%----------------------------------------------------------------------------------------
% EDUCATION SECTION
%----------------------------------------------------------------------------------------
\section{me}
\cvitem{born}{1 January 1900}
\vspace{2cm}
%\emptysection \closesection
mytown, \today
\label{lastpage} %
\end{document}
решение1
Заголовок по умолчанию устанавливается в верхней части страницы (вертикальное пространство не добавляется).Тыдобавил \vspace{2cm}
над \makecvtitle
, в результате чего он сместился вниз на 2 см. Уберите это, и вы заметите, что заголовок выровнен по верху:
\documentclass[11pt,a4paper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman
\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\makeatletter
\renewcommand{\makecvtitle}{%
\recomputecvlengths%
% optional picture box
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\hspace*{\separatorcolumnwidth}%
\color{color1}%
\setlength{\fboxrule}{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
\newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
% name and title
\setlength{\makecvtitlenamewidth}{189pt}% dummy value, was overwritten
\begin{minipage}[b]{\makecvtitlenamewidth}%
\raggedleft%
\namestyle{\@firstname} \namestyle{\@familyname}\\[1em]%
\ifthenelse{\equal{\@title}{}}{}{\titlestyle{\@title}}\\[1em]
\vspace{20pt}%
\addressfont\color{color2}%
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}%
\ifthenelse{\isundefined{\@mobile}}{}{\makenewline mobile: \@mobile}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline mail: \emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
\end{minipage}%
\hfill%
% optional picture box
\usebox{\makecvtitlepicturebox}\\[2.5em]%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}%
\makeatother
%----------------------------------------------------------------------------------------
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage[scale=0.75]{geometry} % Reduce document margins
\setlength{\hintscolumnwidth}{3.7cm} % Uncomment to change the width of the dates column
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
%----------------------------------------------------------------------------------------
% NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------
\firstname{Mr} % Your first name
\familyname{Smith} % Your last name
% All information in this block is optional, comment out any lines you don't need
\title{CV}
\address{mystreet}{mytown}
\mobile{12345}
\email{[email protected]}
\photo[230pt][0pt]{example-image} % The first bracket is the picture height, the second is the thickness of the frame around the picture
\quote{quote}
% ----------------------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
\makecvtitle % Print the CV title
%----------------------------------------------------------------------------------------
% EDUCATION SECTION
%----------------------------------------------------------------------------------------
\section{me}
\cvitem{born}{1 January 1900}
\vspace{2cm}
mytown, \today
\end{document}
На изображении выше показан макет страницы с добавлениемshowframe
упаковка.
Если вы хотите, чтобы заголовок CV был еще выше на странице, вы можете либо вставить ручной, отрицательный \vspace
, но это повлияет только на первую страницу. Если вы хотите настроить все глобально, используйтеgeometry
упаковкаи установить определенную маржу для top
.