打印 \address 的内容

打印 \address 的内容

我在moderncv文档中设置了我的地址\address{...}{...}{...}

现在我想在其他地方使用该地址,如何访问该地址?

答案1

查看moderncv.cls定义可以\address告诉你数据存储在哪里:

\NewDocumentCommand{\address}{mG{}G{}}{\def\@addressstreet{#‌​1}\def\@addresscity{‌​#2}\def\@addresscoun‌​try{#3}}

以下是稍后提取数据的 MWE,使用

\makeatletter
Street: \@addressstreet\\
City: \@addresscity\\
Country: \@addresscountry

\documentclass[11pt,a4paper,sans]{moderncv} 

\moderncvstyle{classic} 
\moderncvcolor{blue} 
\usepackage{lipsum} 

\usepackage[scale=0.75]{geometry} 
 \firstname{John} % Your first name
 \familyname{Smith} % Your last name
 \address{123 Broadway}{City, State 12345}{USA}
 \mobile{(000) 111 1111}
 \phone{(000) 111 1112}
 \email{[email protected]}
%----------------------------------------------------------------------------------------

\begin{document}

\makecvtitle % Print the CV title

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\section{Dissecting Address}
\makeatletter
Street: \@addressstreet\\
City: \@addresscity\\
Country: \@addresscountry

\end{document}

在此处输入图片描述

相关内容