使用 XeLatex 编译时出现 Fontspec 错误

使用 XeLatex 编译时出现 Fontspec 错误

我在使用 XeLatex 在 Texmaker 中编写简历时遇到了问题。任何帮助我都非常感谢。问题似乎是从 fontspec 包中查找字体。

我的代码

\documentclass[a4paper,11pt]{article} % Default font size and paper size

\usepackage{fontspec} % For loading fonts
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} % Main document font

\usepackage{xunicode,xltxtra,url,parskip} % Formatting packages 

\usepackage[usenames,dvipsnames]{xcolor} % Required for specifying custom colors

\usepackage[big]{layaureo} % Margin formatting of the A4 page, an alternative   to layaureo can be \usepackage{fullpage}
% To reduce the height of the top margin uncomment: \addtolength{\voffset}{-1.3cm}

\usepackage{hyperref} % Required for adding links   and customizing them
\definecolor{linkcolour}{rgb}{0,0.2,0.6} % Link color
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour,linkcolor=linkcolour} % Set link colors throughout the document

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{3pt} % Spacing around sections

\begin{document}

\pagestyle{empty} % Removes page numbering

\font\fb=''[cmr10]'' % Change the font of the \LaTeX command under the skills section

标题格式和标题间距应正确如下:

fontspec 和 titlesec 软件包的问题

此外,我还下载了最新版本的 Texmaker,并确保安装了字体。我不知道它们是否位于正确的目录中,因为在我的 Mac 上升级到 EL Capitan 后,我确实遇到了一些编译问题。使用本指南解决了此问题:

安装 El Capitan 后 TexMaker(和 TexShop)无法运行

我得到的错误

在此处输入图片描述

相关内容