我想将标题(即“简历”)左对齐到水平线下方。我也不希望它为斜体。因此,我的名字位于左侧水平线上方,标题再次位于左侧水平线下方。
答案1
标题等元素的字体样式由 形式的相应命令控制\titlefont
。您的默认设置是\LARGE\mdseries\slshape
。因此,为了正确起见,请将后者替换为\upshape
。对于标题的定位,恐怕您必须复制样式文件的定义\makecvtitle
并\hfill
在插入标题之前删除 。由于此定义@
中包含 内部命令,因此您必须将重新定义括在一\makeatletter/\makeother
对中。
\documentclass{moderncv}
\usepackage{moderncvstylecasual}
\firstname{Roozbeh} \familyname{Sasan} \title{Curriculum Vitae}
\renewcommand*{\titlefont}{\LARGE\mdseries\upshape}
\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% ensure footer with personal information
\makecvfooter%
% optional picture
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
{\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}}%
\usebox{\makecvtitlepicturebox}%
% name
\@initializelength{\makecvtitlepicturewidth}%
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
\raggedleft\namefont{\color{color2!50}\@firstname} {\color{color2}\@familyname}}\\[-.35em]%
{\color{color2!50}\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\titlestyle{\@title}}\\[2.5em] % optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother
\begin{document}
\makecvtitle
Test.
\end{document}
添加以回应评论:要对名称进行类似的调整,请查看包含 的行\@firstname
。将 更改\raggedleft
为\raggedright
将使名称左对齐。最后删除\color
命令将得到黑色文本。这些行将变为:
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
\raggedright\namefont{\@firstname} {\@familyname}}\\[-.35em]%
{\rule{\textwidth}{.25ex}}%
完整文档如下:
\documentclass{moderncv}
\usepackage{moderncvstylecasual}
\firstname{Roozbeh} \familyname{Sasan} \title{Curriculum Vitae}
\renewcommand*{\titlefont}{\LARGE\mdseries\upshape}
\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% ensure footer with personal information
\makecvfooter%
% optional picture
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
{\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}}%
\usebox{\makecvtitlepicturebox}%
% name
\@initializelength{\makecvtitlepicturewidth}%
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
\raggedright\namefont{\@firstname} {\@familyname}}\\[-.35em]%
{\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\titlestyle{\@title}}\\[2.5em] % optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother
\begin{document}
\makecvtitle
Test.
\end{document}