ModernCV 長名稱和標題在同一行

ModernCV 長名稱和標題在同一行

是否可以在同一行中包含很長的標題和名稱moderncv?目前,它看起來像這樣: 在此輸入影像描述

理想的情況是 Juantostos 之後沒有換行符。我嘗試取消註釋,\setlength{\makecvtitlenamewidth}{12cm}但它是針對“經典”樣式的,並且還給出了編譯錯誤 (Undefined control sequence)

我正在使用背頁。

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}                            
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
%\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...
\usepackage{upgreek}
\usepackage{import}

% personal data
\name{John}{Juanostos Buenos}
\title{Curriculum Vitae} 

\address{Something}{Stuff 34 more stuff here}{}
\phone[mobile]{+34 342453533}
\extrainfo{FNAC.: 07/19/1985} 

\email{[email protected]}                             

\begin{document}

\makecvtitle


\end{document}

答案1

這是一種選擇:

在此輸入影像描述

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

\usepackage{etoolbox,changepage}
\patchcmd{\makehead}% <cmd>
  {0.8\textwidth}% <search>
  {\linewidth}% <replace>
  {}{}% <success><failure>

% personal data
\name{John}{Juanostos Buenos}
\title{Curriculum Vitae} 

\address{Something}{Stuff 34 more stuff here}{}
\phone[mobile]{+34 342453533}
\extrainfo{FNAC.: 07/19/1985}

\email{[email protected]}

\begin{document}

% Increase block width by 1cm on both sides
\begin{adjustwidth}{-1cm}{-1cm}
\makecvtitle
X\dotfill X
\end{adjustwidth}

Y\dotfill Y

\end{document}

我們做兩件事:

  1. \makehead將標題寬度從 增加到0.8\textwidth的補丁\linewidth。至少,這會將其設定為\textwidth。然而,由於\textwidth是剛性的(或固定的),我們可以......

  2. ……使用adjustwidth(來自changepage) 暫時增加標題的寬度。

在上面的範例中,X.....X表示用於標題的寬度以及Y.....Y後續文字區塊的寬度。

相關內容