academicons.sty 缺少字体

academicons.sty 缺少字体

我在 Ubuntu 14.04 上使用 TeXlive 2015。我有一个如下所示的文件:

\documentclass{article}
\usepackage{academicons}
\begin{document}
\aiicon{orcid}
\end{document}

当我这样做时,$ latexmk -xelatex foo出现以下错误:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !fontspec 错误:“font-not-found” ! !无法找到字体“academicons”。 !有关更多信息,请参阅 fontspec 文档。 !如需立即获得帮助,请输入 H。 !...............................................

我以为安装 Academicons .ttf 会有帮助,但事实并非如此。有人知道为什么 xelatex 找不到字体吗?

以下是日志:

Latexmk: applying rule 'pdflatex'...
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2015/10/01> patch level 2
Babel <3.9n> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2015/texmf-dist/tex/latex/academicons/academicons.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec-patches.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/local/texlive/2015/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/local/texlive/2015/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/local/texlive/2015/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/xelatex/xetex-def/xetex.def
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))))
(/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec.cfg)))

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

l.12 \newfontfamily{\AI}{academicons}

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

l.12 \newfontfamily{\AI}{academicons}

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

l.12 \newfontfamily{\AI}{academicons}

? ) (./foo.aux) (/usr/local/texlive/2015/texmf-dist/tex/latex/tipa/t3cmr.fd)
! Font EU1/academicons(0)/m/n/10=academicons: at 10.0pt not loadable: Metric (T
FM) file or installed font not found.
<to be read again> 
                   relax 
l.4 \aiicon{orcid}

? [1] (./foo.aux) )
Output written on foo.pdf (1 page).
Transcript written on foo.log.
Latexmk: Errors, so I did not complete making targets

答案1

编辑:

从 1.6-1 版开始,手册指出建议在系统上安装 academicons 字体。因此,正如 @dfernan 在评论中所述,如果系统上未安装字体,XeLaTeX 就无法找到该字体,这不是错误,而是设计使然。


我认为这是软件包中的一个错误。软件包尝试加载字体,texmf-dist/fonts并按字体名称保存在文件夹中,如下所示:

\newfontfamily{\AI}{Academicons}

这只适用于 LuaTeX。请查看询问更多信息。因此,该包应该使用

\newfontfamily{\AI}{academicons.ttf}

开箱即可适用于 XeLaTeX 和 LuaTeX。

但在系统上安装字体实际上应该可以解决字体加载问题。我现在手头没有 Linux 系统,但如果我记得正确的话,安装字体后必须更新字体配置缓存?你这样做了吗?

相关内容