
moderncv 클래스의 address 명령에 네 번째 인수를 추가하려고 합니다. 인터넷에서 해결책을 찾고 moderncv 클래스 파일을 편집하는 것을 포함하여 몇 가지를 시도했지만 제대로 작동하는 것이 없습니다. 내가 가장 가까운 방법은 이 방법을 사용하는 것이었습니다.moderncv 스타일에 새 주소 줄을 추가하려면 어떻게 해야 하나요?, 주소(국가)의 마지막 줄과 전화번호가 같은 줄에 있다는 점만 제외하면 원하는 최종 결과를 얻었습니다. 생성되는 코드와 결과는 다음과 같습니다.
\documentclass[12pt,a4paper,sans]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[scale=0.75]{geometry}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\makecvtitle}{\ifthenelse{\equal{\@addresscountry}{}}}%
{\ifstrempty{\@addresscountry}}{}{}
\makeatother
\firstname{John}
\familyname{Smith}
\title{Curriculum Vitae}
\address{42 Apartment complex}{Street}{City\\Country}
\mobile{0000000000}
\email{[email protected]}
명령에 네 번째 인수를 추가하는 것이 바람직하지만 제안할 솔루션이 있는 사람이 있습니까? 하지만 국가를 자체 라인으로 이동하는 위 코드를 수정하고 싶습니까? 도움을 주시면 감사하겠습니다.
답변1
내가 올바르게 이해했다면 아마도 다음과 같을 것입니다.
\documentclass[12pt,a4paper,sans]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[scale=0.75]{geometry}
\usepackage{etoolbox}
\makeatletter
\RenewDocumentCommand{\address}{mG{}G{}G{}}{%
\def\@addressapartment{#1}\def\@addressstreetonly{#2}\def\@addresscity{#3}\def\@addresscountry{#4}%
\def\@addressstreet{%
\ifthenelse{\isundefined{\@addressapartment}}{}{\@addressapartment}%
\ifthenelse{\isundefined{\@addressstreetonly}}{}{\makenewline\@addressstreetonly}%
}}
\makeatother
\firstname{John}
\familyname{Smith}
\title{Curriculum Vitae}
\address{42 Apartment complex}{Street}{City}{Country}
\mobile{0000000000}
\email{[email protected]}
\begin{document}
\makecvtitle
\end{document}