FontAwesome Installed with MiKTeX Console not Working

自作多情 提交于 2019-12-24 10:47:28

问题


I've added the fontawesome package from the MiKTeX console, but when trying to create the document in TeXworks using XeLaTeX, I get the following error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "FontAwesome" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

I'm using Windows 10, and on a previous machine I got my tex file to work as is, but I can't recover whatever configuration I did to make it work. Thoughts?

edit: CLS File

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cv-roald}[2017/01/30 My custom CV class]
\LoadClass{article}

% --------------------------------- %
%           PARAMETERS              %
% --------------------------------- %
\newlength{\margin}
\setlength{\margin}{25mm}
\newlength{\leftcol}
\setlength{\leftcol}{0.22\paperwidth}
\newlength{\hdrheight}
\setlength{\hdrheight}{38mm}
\newlength{\vspacepar}
\setlength{\vspacepar}{0.4\baselineskip}
\newlength{\hspaddress}
\setlength{\hspaddress}{1em}
\newlength{\FAspace}
\setlength{\FAspace}{0.2em}

% --------------------------------- %
%               PACKAGES            %
% --------------------------------- %
\RequirePackage{fontspec}
\RequirePackage{titlesec}
\RequirePackage{tikz} 
\RequirePackage{xcolor} 
\RequirePackage[margin= \margin]{geometry} 
\defaultfontfeatures{ % Important to add, else fontawesome will not work with XeLaTeX 
    Path = Fonts/}
\RequirePackage{fontawesome} 
\RequirePackage{calc}
\RequirePackage{tabularx} 
\RequirePackage{enumitem} 
\setlist{parsep=1 pt, topsep=1 pt} 
\RequirePackage{parskip} 

% --------------------------------- %
%       CALCULATED LENGTHS          %
% --------------------------------- %
\newlength{\hdrskip}
\setlength{\hdrskip}{\hdrheight-\margin}
\newlength{\rightcol}
\setlength{\rightcol}{\paperwidth-\leftcol}
\newlength{\LeftColBody}
\setlength{\LeftColBody}{\leftcol-\margin}
\newlength{\RightColBody}
\setlength{\RightColBody}{\textwidth-\LeftColBody}

% --------------------------------- %
%               FONTS               %
% --------------------------------- %
\setmainfont{SourceSansPro}[ 
    Path = Fonts/,
    Extension = .otf ,
    UprightFont = *-Light,
    ItalicFont = *-LightIt,
    BoldFont = *-Semibold,]    

\newfontfamily\titlefont{AdventPro}[ 
    Path = Fonts/,
    Extension = .ttf,
    UprightFont = *-ExtraLight,
    BoldFont = *-SemiBold,
    ]        

% --------------------------------- %
%               COLORS              %
% --------------------------------- %
\definecolor{maincolor}{RGB}{60, 142, 250}
\colorlet{lightermain}{maincolor!35}
\colorlet{darkermain}{maincolor!90!black}

% --------------------------------- %
%               HEADER              %
% --------------------------------- %
\newcommand{\sep}{\hspace{\hspaddress} | \hspace{\hspaddress}}

\newcommand{\header}[4]{%
% #1 First name
% #2 Last name
% #3 = Address
% #4 = Phone, mail and LinkedIn
  \begin{tikzpicture}[remember picture, overlay]
    % Colored bar on top of the page
    \node [below right, fill=darkermain, minimum height=\hdrheight, minimum width=\paperwidth, outer sep=0] (name) at (current page.north west) {};
    % Node for the name
    \node[anchor=base, text=white, inner sep=0.25 cm] (nametext) at (name.base) {%
          \fontsize{40pt}{32pt}\color{white}%
          {\titlefont #1~}{\titlefont \textbf{#2}\par}
          };
    % Address
    \node[anchor=north, text=lightermain] (address) at (nametext.south)  {#3 \par};
    % Phone/mail/nationality
    \node[anchor=north, text=lightermain] at (address.south)  {#4};
  \end{tikzpicture}
  \vspace{\hdrskip}
} 

% --------------------------------- %
%           TITLE FORMAT            %
% --------------------------------- %

\titleformat{\section}{\titlefont\color{maincolor}\huge\bfseries}{\thesection}{0em}{}
\titlespacing*{\section}{0pt}{1.5ex plus 0.2ex minus .2ex}{-0.5ex plus .2ex}

\newcommand{\worktitle}[2]{
% #1 = Job or education title 
% #2 = Company and location
    {\bfseries\MakeUppercase{#1}}  
    {\itshape #2}
}

% --------------------------------- %
%           ENVIRONMENTS            %
% --------------------------------- %
\newenvironment{tabularcv}{
    \tabularx{\textwidth}{@{}>{\raggedright\arraybackslash}p{\LeftColBody}@{}>{\raggedright\arraybackslash}p{\RightColBody}}}{
    \endtabularx}

\newenvironment{tabitemize}{
    \itemize}{
    \vspace*{-\baselineskip}
        \enditemize}    

% --------------------------------- %
%       BODY TEXT OPTIONS           %
% --------------------------------- %       
\setlength{\parindent}{0pt} % Remove indent at the start of a new paragraph
\setlength{\parskip}{\vspacepar} % adds extra vertical space between paragraphs 

Example Body

\documentclass[]{cv-roald}

\begin{document}
\pagestyle{empty} %to remove the page numbers

\header{First}{Last}{\faMapMarker \hspace{\FAspace} Address \sep Title \sep City, State}
{\faMobile \hspace{\FAspace} +1 123 456 7890 \sep \faEnvelope \hspace{\FAspace} abc@xyz.com \sep Other}

\section*{Skills}
\begin{tabularcv}
       &  \worktitle{Skill}{}
                    \newline Description
\end{tabularcv}

\section*{Education}
\begin{tabularcv}
    Years   &   \worktitle{Major}{Institution (State)}
                    \newline Minor
                    \begin{tabitemize}
                        \item Details
                    \end{tabitemize}
\end{tabularcv}

\section*{Projects}
\begin{tabularcv}
        &   \worktitle{Project Name}{Type}
            \newline Description
            \\[\vspacepar]
\end{tabularcv}

\section*{Work}
\begin{tabularcv}
    2014-2015    &   \worktitle{Title}{Company}
                    \newline Description
\end{tabularcv}
\end{document}

来源:https://stackoverflow.com/questions/51801890/fontawesome-installed-with-miktex-console-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!