我有一份文件[简历模板取自保罗·盖斯勒。我在从 fontspec 包中查找 AGaramondpro-Semibold 字体时遇到了困难。我已经从包存储库升级了 fontspec 包。当我将所有 AGaramondPro-Semibold 替换为 Georgia 时,我没有遇到问题。
梅威瑟:
\documentclass[12pt,letterpaper]{article}
\def\myauthor{Paul Gessler}
\def\mytitle{pdg-vita}
\def\myemail{[email protected]}
\def\myweb{pdgessler}
\def\myphone{414-241-1627}
\def\mykeywords{
paul gessler,
resume,
curriculum,
vita,
curriculum vita,
cv,
paul,
gessler,
pdg
}
\setlength\parindent{0pt}
\newenvironment{itemize*}%
{\begin{itemize}%
\setlength{\itemsep}{0pt}}%
{\end{itemize}}
\usepackage{url}
\usepackage{fancyhdr}
\usepackage{lastpage}
%\usepackage{ocgtools}
\usepackage{enumitem}
\setlist{nolistsep,leftmargin=0.15in}
\usepackage[log-declarations=false]{xparse}
\usepackage{fontspec}
\usepackage{microtype}
\usepackage[margin=1.125in,right=1in,left=2in]{geometry}
\usepackage[strict]{changepage}
\usepackage[
ocgcolorlinks,
urlcolor={[rgb]{0,0,0.54}},
unicode,
plainpages=false,
pdfpagelabels,
pdftitle={\mytitle},
pdfauthor={\myauthor},
pdfkeywords={\mykeywords}
]{hyperref}
% fix ocgcolor link breaking; thanks due to Benjamin Lerner (http://goo.gl/VZKR7M)
\makeatletter
\AtBeginDocument{%
\newlength{\temp@x}%
\newlength{\temp@y}%
\newlength{\temp@w}%
\newlength{\temp@h}%
\def\my@coords#1#2#3#4{%
\setlength{\temp@x}{#1}%
\setlength{\temp@y}{#2}%
\setlength{\temp@w}{#3}%
\setlength{\temp@h}{#4}%
\adjustlengths{}%
\my@pdfliteral{\strip@pt\temp@x\space\strip@pt\temp@y\space\strip@pt\temp@w\space\strip@pt\temp@h\space re}}%
\ifpdf
\typeout{In PDF mode}%
\def\my@pdfliteral#1{\pdfliteral page{#1}}% I don't know why % this command...
\def\adjustlengths{}%
\fi
\ifxetex
\def\my@pdfliteral #1{\special{pdf: literal direct #1}}% isn't equivalent to this one
\def\adjustlengths{\setlength{\temp@h}{-\temp@h}\addtolength{\temp@y}{1in}\addtolength{\temp@x}{-1in}}%
\fi%
\def\Hy@colorlink#1{%
\begingroup
\ifHy@ocgcolorlinks
\def\Hy@ocgcolor{#1}%
\my@pdfliteral{q}%
\my@pdfliteral{7 Tr}% Set text mode to clipping-only
\else
\HyColor@UseColor#1%
\fi
}%
\def\Hy@endcolorlink{%
\ifHy@ocgcolorlinks%
\my@pdfliteral{/OC/OCPrint BDC}%
\my@coords{0pt}{0pt}{\pdfpagewidth}{\pdfpageheight}%
\my@pdfliteral{F}% Fill clipping path (the url's text) with current color
\my@pdfliteral{EMC/OC/OCView BDC}%
\begingroup%
\expandafter\HyColor@UseColor\Hy@ocgcolor%
\my@coords{0pt}{0pt}{\pdfpagewidth}{\pdfpageheight}%
\my@pdfliteral{F}% Fill clipping path (the url's text) with \Hy@ocgcolor
\endgroup%
\my@pdfliteral{EMC}%
\my@pdfliteral{0 Tr}% Reset text to normal mode
\my@pdfliteral{Q}%
\fi
\endgroup
}%
}
\makeatother
% end fixes
\newcommand{\ML}{\textsc{Matlab}}
\newcommand{\Simu}{Simulink}
\newcommand{\MLS}{\ML{}/\Simu{}}
\newcommand{\apdl}{\textsc{APDL}}
\newcommand{\ansys}{\textsc{Ansys}}
\newcommand{\fluent}{\textsc{Fluent}}
\newcommand\CPP{C/C\ensuremath{+}\ensuremath{+}}
\newcommand{\Star}{\textsc{Star-CCM\ensuremath{+}}}
\newcommand{\mhead}[1]{\leavevmode\marginpar{\sffamily\footnotesize #1}}
\newcommand{\rdate}[1]{{\addfontfeature{Numbers=OldStyle} \hfill #1}}
\renewcommand{\date}[1]{{\addfontfeature{Numbers=OldStyle} #1}}
\renewcommand{\labelitemi}{-}
\setmainfont[
Ligatures={TeX,Common},
BoldFont={AGaramondPro-Semibold},
]{Adobe Garamond Pro}
\setsansfont[
Ligatures={TeX,Common},
Letters=SmallCaps,
Color=660000,
]{Adobe Garamond Pro}
\setmonofont{FontAwesome}
\begin{document}
\pagestyle{fancy} \setlength\headwidth{6.5in}
\rhead{\textsc{paul d.~gessler—r\'{e}sum\'{e}—\thepage{} of \pageref*{LastPage}}} \cfoot{}
\thispagestyle{empty}
\begin{adjustwidth}{-1in}{}
{\Huge
{\textsc{%
{\addfontfeature{Style=TitlingCaps}P}\kern-1.5ptaul
{\addfontfeature{Style=TitlingCaps}D}\kern-2pt.~%
{\addfontfeature{Style=TitlingCaps}G}essler}
}
}
\hfill\hfill\hfill
{
\begin{minipage}[b]{1.6in}
\flushleft \footnotesize
2040 West Wisconsin Avenue \\
Apartment S406A \\
Milwaukee, WI~~53233-2098
\end{minipage}
\hfill
\begin{minipage}[b]{1.6in}
\flushright \footnotesize
\href{tel:\myphone}{\myphone} \\ %\texttt{}~
\href{mailto:\myemail}{\myemail} \\
\href{https://www.github.com/\myweb}{\texttt{}}~\href{https://www.linkedin.com/in/\myweb}{\texttt{}~\myweb}
\end{minipage}
}\par
\hrulefill
\end{adjustwidth}
\reversemarginpar
\setlength\marginparwidth{0.85in}
\medskip
\mhead{Education}%
\textbf{Marquette University,} Milwaukee, Wisconsin \newline
\emph{Master of Science, \href{http://www.marquette.edu/engineering/mechanical/}{Mechanical Engineering}} \rdate{2012–2014}
\begin{itemize*}
\item Cumulative GPA: 3.60/4.00; \href{http://www.marquette.edu/engineering/mechanical/grad_study.shtml}{Energy Systems Specialization}
\item Thesis: One-Dimensional Model of a Refrigeration Cycle Compressor Test Block
\item Advisor: Dr.~Margaret M.~Mathison
% \item Coursework:\newline
% \begin{tabular}{ll}
% \addlinespace\toprule
% Advanced Engineering Mathematics & Transport Phenomena \\
% Approx.~Methods in Engineering Analysis & Advanced Fluid Mechanics \\
% Intermediate Thermodynamics & Sustainable Engineering \\
% Statistical Thermodynamics & Combustion \\
% \bottomrule
% \end{tabular}
\end{itemize*}
\medskip
\textbf{Milwaukee School of Engineering,} Milwaukee, Wisconsin \newline
\emph{Bachelor of Science, \href{http://www.msoe.edu/community/academics/mechanical-engineering-department/mechanical-engineering}{Mechanical Engineering}} \rdate{2008–2012}
\begin{itemize*}
\item Cumulative GPA: 3.56/4.00; \href{http://www.msoe.edu/community/academics/minors/page/1448/mathematics-minor}{Mathematics Minor}
\item Senior Project: \href{https://dl.dropbox.com/u/10724484/resume/ME492_2012_Design_Report_PulseWaterJet.pdf}{Modeling of Pulsed Jet Impingement on Brittle Materials}
\item Advisors: Prof.~Thomas J.~Labus and Dr.~Vincent C.~Prantil
% \item Selected Coursework:\newline
% \begin{tabular}{ll}
% \addlinespace\toprule
%
% \bottomrule
% \end{tabular}
\end{itemize*}
\end{document}
错误 :
答案1
你运行的是 Windows 吗?你可以尝试运行
fc-list
获取计算机上安装的字体列表。它们应以以下格式列出
<path>:<font names>:<styles>
例如。
C:/WINDOWS/fonts/corbelz.ttf: Corbel:style=Bold Italic
在这种情况下,您可以使用字体“Corbel”。据我所知,您必须确保字体完全列为“AGaramondPro-Semibold”。
答案2
你遇到了让 Will Robertson建议通过文件名加载字体。 XeLaTeX 和 LuaLaTeX 使用不同的字体加载器,并在您告诉它加载时对您的意思做出不同的猜测Adobe Garamond Pro
。
快速修复方法是尝试BoldFont={AGaramondPro-Semibold.otf}
。不过,我曾经遇到过 XeLaTeX 遇到类似问题的情况。如果您收到有关 howAGaramondPro-Semibold.md
不存在的错误,一种糟糕的解决方法可能是添加BoldFeatures = {Extension = .otf}
。
根据 fonts.com 上的技术信息,您可以按照以下方式设置您的字体系列:
\setmainfont[
Scale = 1.0,
Ligatures = {Common, TeX},
Numbers = OldStyle,
UprightFont = *-Regular ,
UprightFeatures = {Ligatures = Discretionary},
BoldFont = *-Semibold ,
ItalicFont = *-Italic ,
ItalicFeatures = {Ligatures = Discretionary},
BoldItalicFont = *-SemiboldItalic ,
Extension = .otf
]{AGaramondPro}
您还可以将该设置移动到名为的文件中AGaramondPro.fontspec
,并在购买新版本的字体系列时对其进行更新。