如何在 macOS 13.3 中使用 Fontawesome

如何在 macOS 13.3 中使用 Fontawesome

当我尝试在 macOS 13.3 中编译此文档时:

\documentclass{zheyuyesetting}

\usepackage{ctex}
\usepackage{fontspec}
\begin{document}

\name{hello}
\contactInfo{15683761621}{[email protected]}{https://github.com}
\logosection{\faGraduationCap}{Education}

\dateline{\textbf{CPU}}{\dateRange{2009.09}{2013.06}}
\end{document}

显示错误:

Compilation failed: 
kpathsea: Running mktextfm FontAwesome
/usr/local/texlive/2023/texmf-dist/web2c/mktexnam: Could not map source abbreviation F for FontAwesome.
/usr/local/texlive/2023/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2023/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input FontAwesome
This is METAFONT, Version 2.71828182 (TeX Live 2023) (preloaded base=mf)

kpathsea: Running mktexmf FontAwesome

! I can't find file `FontAwesome'.
<*> ...r; mag:=1; ; nonstopmode; input FontAwesome
                                                  
Please type another input file name
! Emergency stop.
<*> ...r; mag:=1; ; nonstopmode; input FontAwesome
                                                  
Transcript written on mfput.log.
grep: FontAwesome.log: No such file or directory
zheyuye handle request: zheyuye
Compilation failed: 
kpathsea: Running mktextfm FontAwesome
/usr/local/texlive/2023/texmf-dist/web2c/mktexnam: Could not map source abbreviation F for FontAwesome.
/usr/local/texlive/2023/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2023/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input FontAwesome
This is METAFONT, Version 2.71828182 (TeX Live 2023) (preloaded base=mf)

kpathsea: Running mktexmf FontAwesome

! I can't find file `FontAwesome'.
<*> ...r; mag:=1; ; nonstopmode; input FontAwesome
                                                  
Please type another input file name
! Emergency stop.
<*> ...r; mag:=1; ; nonstopmode; input FontAwesome
                                                  
Transcript written on mfput.log.
grep: FontAwesome.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input FontAwesome' failed to make FontAwesome.tfm.
kpathsea: Appending font creation commands to missfont.log.

zheyuye handle request: zheyuye
Compilation failed: 
kpathsea: Running mktextfm FontAwesome
/usr/local/texlive/2023/texmf-dist/web2c/mktexnam: Could not map source abbreviation F for FontAwesome.
/usr/local/texlive/2023/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2023/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input FontAwesome
This is METAFONT, Version 2.71828182 (TeX Live 2023) (preloaded base=mf)

kpathsea: Running mktexmf FontAwesome

! I can't find file `FontAwesome'.
<*> ...r; mag:=1; ; nonstopmode; input FontAwesome
                                                  
Please type another input file name
! Emergency stop.
<*> ...r; mag:=1; ; nonstopmode; input FontAwesome
                                                  
Transcript written on mfput.log.
grep: FontAwesome.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input FontAwesome' failed to make FontAwesome.tfm.
kpathsea: Appending font creation commands to missfont.log.

我应该怎么做才能在 macOS 中使用 fontawesome?文件如下zheyuyesetting.cls所示:

\ProvidesClass{zheyuyesetting}
\LoadClass[11pt]{article}

% disable indent globally
\setlength{\parindent}{0pt}


% disable indent globally
\setlength{\parindent}{0pt}

% use hyperlink for email and url
\usepackage{hyperref}
\usepackage{url}
\hypersetup{
    colorlinks=true,
    linkcolor=cyan,
    urlcolor=cyan,
    citecolor=cyan,
}

\urlstyle{tt}

\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}

% some general improvements, defines the XeTeX logo
\RequirePackage{xltxtra}
% use xifthen
\RequirePackage{xifthen}
% use fontawesome
\RequirePackage{fontawesome}
% use xcolor for customizing color
\RequirePackage{xcolor}

\RequirePackage[super]{nth}
%%%% IC Blue
\definecolor{ICBlue}{RGB}{0,62,116}

\usepackage{calc}


% loading fonts
\usepackage{fontspec}
\usepackage{xeCJK}
\CJKsetecglue{} 

% Main document font
\setmainfont[
    Path = Font/,
  Extension = .otf ,
  BoldFont = HelveticaNeueLTPro-Md.otf ,
]{HelveticaNeueLTPro-Roman.otf}

\setCJKmainfont[
Path = Font/,
  Extension = .ttf ,
BoldFont=Pro_GB18030DemiBold.ttf,
]{Pro_GB18030.ttf}


\usepackage{relsize}
\usepackage{xspace}

\usepackage[
    a4paper,
    left=1.2cm,
    right=1.2cm,
    top=1.5cm,
    bottom=1cm,
    nohead
]{geometry}
\renewcommand{\baselinestretch}{1.2} 

\usepackage{titlesec}
\usepackage{enumitem}
\setlist{noitemsep} % removes spacing from items but leaves space around the whole list
% \setlist{nosep} % removes all vertical spacing within and around the list
\setlist[itemize]{topsep=0.25em, leftmargin=*}
\setlist[enumerate]{topsep=0.25em, leftmargin=*}

\titleformat{\section}         % Customise the \section command 
  {\large\bfseries\raggedright} % Make the \section headers large (\Large),
                               % small capitals (\scshape) and left aligned (\raggedright)
  {}{0em}                      % Can be used to give a prefix to all sections, like 'Section ...'
  {}                           % Can be used to insert code before the heading
  [{\color{ICBlue}\titlerule}]                 % Inserts a horizontal line after the heading
\titlespacing*{\section}{0cm}{*1.6}{*1.2}

\titleformat{\subsection}
  {\large\raggedright}
  {}{0em}
  {}
\titlespacing*{\subsection}{0cm}{*1}{*0.5}

\newcommand{\logosection}[2]{%
    \section{\makebox[\widthof{\faGraduationCap}][c]{\color{ICBlue}#1}\  #2}
}


\newcommand{\dateRange}[2]{
    {#1 -- \makebox[\widthof{#1}][s]{#2}}
}


\newcommand{\datedline}[2]{%
  {\par #1 \hfill #2 \par}%
}


\newcommand{\name}[1]{
  \centerline{\LARGE\bfseries{#1}}
  \vspace{1.2ex}
}


\newcommand{\contactInfo}[3]{
    \centerline{
        \normalsize{
            \faPhone\ {#1} \quad 
            \faEnvelopeO\ \href{mailto:{#2}}{#2} \quad 
            \faHome\  \href{#3}{#3}
        }
    }
    \vspace{0.7ex}
}

\newcommand{\basicContactInfo}[2]{
    \centerline{
        \normalsize{
            \faPhone\ {#1} \quad 
            \faEnvelopeO\ \href{mailto:{#2}}{#2}
        }
    }
    \vspace{0.7ex}
}

\newcommand{\role}[2]{
  {\par \textit{#1} ~ #2 \par}
  \vspace{0.5ex}
}

\newcommand{\biInfo}[2]{
    {#1 \quad #2}
}

\newcommand{\tripleInfo}[3]{
    {#1 \quad #2 \quad #3}
}

\usepackage{fontspec}我曾尝试在文档中添加但似乎没有成功。

相关内容