mailto:PDF 中的电子邮件链接在邮件应用程序中呈现不正确的链接

mailto:PDF 中的电子邮件链接在邮件应用程序中呈现不正确的链接

包裹:

\ProvidesFile{jobapp}
\special{papersize=8.5in,11in}

%----------------------------------------------
%   Dependencies 
%----------------------------------------------
\usepackage{array}
\usepackage{xcolor}
\usepackage[margin=1.5cm,top=50pt]{geometry}
\usepackage{parskip}
\usepackage{setspace}
\usepackage{tgpagella} % TG Pagella font
\usepackage{textcomp} % Needed for pagella font bullet points
\usepackage[T1]{fontenc}
%\usepackage[sc]{mathpazo}
%\usepackage{lmodern}
%\usepackage[urw-garamond]{mathdesign}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{ifthen}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage{xparse}
%----------------------------------------------
%   Debugging utilities (uncomment to enable)
%----------------------------------------------
%\overfullrule=1mm % Show overfull hboxes
%\usepackage{layout} % Insert graphic of page layout using \layout in body

%----------------------------------------------
%   Custom things
%----------------------------------------------
\definecolor{lightgray}{gray}{0.8}
\newcommand\VRule{\color{lightgray}\vrule width 1pt}
\newcommand\HRule{\color{lightgray}\hrule height 0.4pt} 
\newcolumntype{L}{>{\raggedleft}p{0.11\textwidth}}
\newcolumntype{R}{p{0.83\textwidth}}

\makeatletter
\newcommand{\DoIfNoText}[1]{% Thanks to http://tex.stackexchange.com/a/44938
  \begingroup
  \sbox0{#1}%
  \ifdim\wd0=\z@
    \endgroup
    \expandafter\@gobble
  \else
    \endgroup
    \expandafter\@firstofone
  \fi}
\makeatother

%----------------------------------------------
%   Document Variables
%----------------------------------------------
\newcommand\Name{}
\newcommand\Address{}
\newcommand\Phone{}
\newcommand\Email{}
\newcommand\Company{}
\newcommand\CompanyAddress{}
\newcommand\Encl{}
\newcommand\Skype{}
%----------------------------------------------
%   Setters
%----------------------------------------------
\newcommand{\SetName}[1]{\renewcommand{\Name}{#1}}
\newcommand{\SetAddress}[1]{\renewcommand{\Address}{#1}}
\newcommand{\SetPhone}[1]{\renewcommand{\Phone}{#1}}
\newcommand{\SetEmail}[1]{\renewcommand{\Email}{#1}}
\newcommand{\SetSkype}[1]{\renewcommand{\Skype}{#1}}

\newcommand{\OptionalCompany}[1]{%
  \DoIfNoText{#1}
    {\renewcommand{\Company}{\ignorespaces#1}}%
  }

\newcommand{\OptionalCompanyAddress}[1]{%
  \DoIfNoText{#1}
    {\renewcommand{\CompanyAddress}{\ignorespaces#1}}%
  }

\newcommand{\OptionalEncl}[1]{%
  \DoIfNoText{#1}
    {\renewcommand{\Encl}{\ignorespaces#1}}%
  }

%----------------------------------------------
%   Helpers \href{mailto:[email protected]}{\nolinkurl{[email protected]}}
%----------------------------------------------
\newcommand{\emailhref}{\href{mailto:\Email}{\Email}}
\newcommand{\contactblock}{\Address \\ \Phone \\ \emailhref \\ \Skype}
\newcommand{\first}{1\textsuperscript{st}}
\newcommand{\second}{2\textsuperscript{nd}}
\newcommand{\third}{3\textsuperscript{rd}}
\newcommand{\nth}[1]{#1\textsuperscript{th}}

%----------------------------------------------
%   Page customizations
%----------------------------------------------
\pagestyle{fancy}
\setlength{\headheight}{56pt}
\setlength{\headsep}{32pt}
\setlength{\textheight}{668pt}
\setlength{\footskip}{10pt}
\setlength{\parskip}{10pt}
\renewcommand{\arraystretch}{1.2}
\renewcommand{\headrule}{\vspace{5pt}\HRule}
\renewcommand{\footrule}{}
\titleformat*{\section}{\bfseries\Large\uppercase}
\titlespacing{\section}
  {0pt} % left
  {5pt} % before
  {-2pt} % after
  [0pt] % right

%----------------------------------------------
%   Header & footer definitions
%----------------------------------------------

%% Header Left - Show large name on first page
\fancyhead[LH]{% 
  \ifthenelse{\value{page}=1}{%
    \raisebox{0.5\height}{\Huge\scshape{\Name}}%
  }{}
}

%% Header Right - Show contact info on first page; name otherwise.
\fancyhead[RH]{% 
  \ifthenelse{\value{page}=1}{%
    \contactblock%
  }{%
    \Large\scshape{\Name}%
  }
}

%% Footer - Empty Footer
\fancyfoot[CF]{}

%----------------------------------------------
%   Macros & other
%----------------------------------------------

%% Table style used by resume including vertical divider
\newenvironment{CvTable}
  {\begin{tabular}{L!{\VRule}R}}
  {\end{tabular}}

%% Formats resume item blocks
\NewDocumentEnvironment
  {CvBlockEnv}
  {m >{\SplitArgument{1}{\\}} m}
  {%
    \begin{CvTable} %
      #1 & \CvBlockSplitTitle#2 % Set year/title/subtitle
  }{%
    \end{CvTable} % End block detail
  }

%% Splits the second argument to CvBlockEnv into Title & Subtitle
\def\CvBlockSplitTitle#1#2{%
  \parbox[t]{0.8\textwidth}{\textbf{#1}%
    \IfValueTF {#2} { \\ \textit{#2} } { }%
  }
}

%% Create compact itemize
\newenvironment{citemize}
  { \vspace{0.2em}\begin{itemize}[leftmargin=12pt, itemsep=0.2em] }
  { \vspace{-1em}\end{itemize} }

%----------------------------------------------
%   Cover Letter
%----------------------------------------------
\newenvironment{CoverLetter}
  {%
    \today \par \vspace{20pt}%
    \DoIfNoText{\CompanyAddress} {%
      \DoIfNoText{\Company}%
        {\Company \\}
      \CompanyAddress \par \vspace{30pt}
    }
  }
  {
    \par 
    %\vspace{0pt}%
    \Name{} \par \vspace{10pt}%
    \DoIfNoText{\Encl} {\par\noindent\textbf{Encl:}~\Encl{}}%
  }

平均能量损失

\documentclass[10pt]{article}
    \usepackage{jobapp}
    \usepackage{amsmath}%symbols
    \usepackage{fontawesome} % add skype, FB and Gtalk symbol :)
    \providecommand\faSkype{{\FA\symbol{"F17E}}} % add skype symbol.
    \usepackage[export]{adjustbox} % left align the figure
    \usepackage{graphicx}%graphicx package
    \usepackage{lipsum} % Used only for this example.

%----------------------------------------------
%   Document information
%----------------------------------------------
\usepackage{color,hyperref}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}%0.0,0.0,0.3
\hypersetup{colorlinks,breaklinks,
            linkcolor=darkblue,urlcolor=darkblue,
            anchorcolor=darkblue,citecolor=darkblue}
%------------------------------------------------------------
\usepackage{fontspec} % use package for cambria font
\setmainfont{Cambria} %set font

%------------------------------------------------------------
\SetName{First Last}
\SetEmail{\faEnvelope{}[email protected]} % email address

%----------------------------------------------
%   Document
%----------------------------------------------
\begin{document}

\end{document}

MWE输出:这是我从编译的 PDF 中获取的电子邮件链接。为什么会这样显示。它运行正常。

MWE 输出

答案1

该包jobapp需要运行pdflatex,但你的主文件需要xelatex

注释掉jobapp.sty中的以下三行:

%\usepackage{tgpagella} % TG Pagella font
%\usepackage{textcomp} % Needed for pagella font bullet points
%\usepackage[T1]{fontenc}

并使用

\renewcommand\emailhref{\faEnvelope{}~\href{mailto:\Email}{\Email}}
\SetName{First Last}
\SetEmail{[email protected]} % email address

然后运行该文档,xelatex它应该可以工作。至少对我来说是这样 :-)

相关内容