找不到 Adob​​e Garamond Pro,Mac xelatex

找不到 Adob​​e Garamond Pro,Mac xelatex

我正在使用 Mac,并遵循模板 .tex 文件。我尝试运行xelatex myFile.tex,但收到​​错误:

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

l.35 \setmainfont{Adobe Garamond Pro}

我遵循了 Frank Pastor 在之前的文章中的建议(MacOSX:无法使用 Garamond 字体)。我还听从了建议,从以下网址下载 Fontin 包(http://www.exljbris.com/fontin.html)然而,我仍然遇到同样的错误。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plasmati Graduate CV
% LaTeX Template
% Version 1.0 (24/3/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Alessandro Plasmati ([email protected])
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
% Important note:
% This template needs to be compiled with XeLaTeX.
% The main document font is called Fontin and can be downloaded for free
% from here: http://www.exljbris.com/fontin.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[a4paper,10pt]{article} % Default font size and paper size
\usepackage{etoolbox}
\patchcmd{\thebibliography}{\section*{\refname}}{}{}{}
\usepackage{fontspec} % For loading fonts
\defaultfontfeatures{
    Path = /usr/local/texlive/2015/texmf-dist/fonts/opentype/public/fontawesome/ }
\usepackage{fontawesome}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Adobe Garamond Pro} % Main document font
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} % Main document font
\usepackage{fancyhdr}
\usepackage{lastpage}
\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
\usepackage{lastpage}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{My Name}
\rfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\cfoot{}
\lhead{}
\rhead{}
\chead{}
\begin{document}

任何建议对我都有帮助!我已经排除故障大约 2 个小时了,虽然我发现了类似的问题,但我无法复制答案并查看结果。

答案1

首先显而易见的是:如果您真的希望您的来源能够与您合作,\setmainfont{Adobe Garamond Pro}您需要Adobe Garamond Pro......

此外,您使用的是xelatexMac OS这与其他系统不同xelatex。最简单的方法xelatex是以Mac OSMac 方式在 Mac 上安装字体。这可以通过FontBook应用程序和合适的菜单项来完成。字体可以在 中全局安装,/Library/Fonts也可以在 中本地安装/Users/<username>/Library/Fonts

您链接到的说明MacOSX:无法使用 Garamond 字体安装在具有 256 个插槽的 TeXLive 字体树中:查看\usepackage[T1]{fontenc}那里的问题。这些字体附带各种支持文件,用于 LaTeX NFSS 字体处理。这是一点也不Adobe Garamond Pro与使用我认为是带有引擎的 OpenType 字体的字体相同xelatex

您也可以安装这样的 OpenType 字体,texmf-localxelatexMac OS X需要使用fontspec带有字体的命令文件名(带.otf/.ttf扩展名,),并且您还需要根据字体规范文档说明fontspecBold=..Italic=...最好BoldItalic=...避免这种情况。只需在 Mac 上安装 OpenType 字体,供所有 Mac 文本处理应用程序使用,并且您xelatex+fontspec将知道如何开箱即用。

答案2

如果您没有 Adob​​e Garamond Pro 的授权版本,或者想避免复杂安装的麻烦,那么这是第二好的解决方案:安装包ebgaramond并说\usespackage{ebgaramond}。此包安装 Garamond 的开源版本乔治·杜夫纳我觉得做得非常好。此外,使用起来也很简单,因为包提供了很好的默认设置。我是pdflatex这样使用它的:

\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}

采用\usepackage{ebgaramond}一些值得了解的选项,这些选项在包文档中有详细说明。

相关内容