
私はmoderncvクラスを使用しています(http://www.ctan.org/pkg/moderncv) を使用して履歴書を書きました。住所セクションを変更するために、moderncvstyleclassic.sty を変更しました。
住所セクションのテキストを左揃えにしたいのですが (これは機能しました)、住所の最初の行 (addressstreet) がインデントされるという問題が発生しています。
私の質問は、この情報ボックス内の最初の行のインデントを防ぐにはどうすればよいかということです。
これまでのところ、この問題に対する解決策は見つかりませんでした。
コードインモダンcvスタイルクラシック.sty私の変更についてコメントしました:
%% code above omitted
% optional detailed information box
\newbox{\makecvtitledetailsbox}%
\savebox{\makecvtitledetailsbox}{%
\addressfont\color{color2}%
\begin{tabular}[b]{@{}l@{}}%% MY MODIFICATION <<-- l for left-justified (instead of "r")
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\@addressstreet%\addresssymbol##
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}% if \addresstreet is defined, \addresscity will always be defined but could be empty
\ifthenelse{\isundefined{\@countryinfo}}{}{\makenewline\@countryinfo}%%##moved up to use as country
\ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile}%
\ifthenelse{\isundefined{\@phone}}{}{\makenewline\phonesymbol\@phone}%
\ifthenelse{\isundefined{\@fax}}{}{\makenewline\faxsymbol\@fax}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
{\makenewline\homepagesymbol\httplink{\@homepage}}%
{\makenewline\homepagesymbol\httplink[\@homepagetitle]{\@homepage}}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%##moved up to use as country
\end{tabular}
}%
%% code below omitted
答え1
マクロの使用\patchcmd
:
\makeatletter
\patchcmd{\makecvtitle}{@{}r@{}}{@{}l@{}}{}{}
\patchcmd{\makecvtitle}{\makenewline\addresssymbol\@addressstreet}{\addresssymbol\@addressstreet\makenewline}{}{}
\makeatother
スタイル宣言の後。
前に:
後:
または、.sty ファイルを手動で編集する場合 (非推奨)、次のように変更します。
\makenewline\addresssymbol\@addressstreet
に:
\addresssymbol\@addressstreet\makenewline
都市の下に extrainfo も配置するには、前のコマンドの代わりに次のコマンド セットを使用します。
\makeatletter
\patchcmd{\makecvtitle}{@{}r@{}}{@{}l@{}}{}{}
\patchcmd{\makecvtitle}{\makenewline\addresssymbol\@addressstreet}{\addresssymbol\@addressstreet\makenewline}{}{}
\patchcmd{\makecvtitle}{\makenewline\@extrainfo}{}{}{}
\patchcmd{\makecvtitle}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}\makenewline\@extrainfo}{}{}
\makeatother
結果:
次のようにcountry
設定した場合、フィールドはオプションになります。address
\address{street and number}{postcode city}{country}
国ができます。 そうでなければ、次のようになります:
\address{street and number}{postcode city}
あなたには国がなくなります(私の最後の写真のように)。
MWEを完了する
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\makeatletter
\patchcmd{\makecvtitle}{@{}r@{}}{@{}l@{}}{}{}
\patchcmd{\makecvtitle}{\makenewline\addresssymbol\@addressstreet}{\addresssymbol\@addressstreet\makenewline}{}{}
\patchcmd{\makecvtitle}{\makenewline\@extrainfo}{}{}{}
\patchcmd{\makecvtitle}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}\makenewline\@extrainfo}{}{}
\makeatother
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
% 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]{picture}
\quote{Some quote}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\end{document}