2

I'm using TeXlive 2015 on Ubuntu 14.04. I have a file that looks like this:

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

When I do $ latexmk -xelatex foo I get the following error:

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

I thought it would help to install the Academicons .ttf, but it didn't. Does anybody know why xelatex can't find the font?

Here is the log:

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
twsh
  • 2,718
  • 1
    You shouldn't have to install anything extra. The font is included already. Your minimal example compiles fine for me. However, I have a system set-up which includes the relevant font directory in fontconfig's configuration. Run without latexmk to rule out complications there. What's your OS? What does kpsewhich academicons.ttf give? If you are on a suitable system, what does fc-match Academicons give? – cfr Feb 27 '16 at 21:45
  • I'm using Ubuntu 14.04.kpsewhich academicons.ttf gives me '/usr/local/texlive/2015/texmf-dist/fonts/truetype/public/academicons/academicons.ttf'. fc-match Academicons gives 'academicons.ttf: "Academicons" "Regular"'. – twsh Feb 27 '16 at 21:51
  • Can you post the log from your minimal example up to the error? It shouldn't be too long. – cfr Feb 27 '16 at 21:54
  • I've added a log. – twsh Feb 27 '16 at 22:09
  • 1
    That's strange. Are you using the most recent version (2016/01/14 v1.6 ) of academicons? Because as I already wrote in my answer, in the most recent version the font is loaded using \newfontfamily{\AI}{Academicons} (pay attention to the capital A). – Benjamin Feb 27 '16 at 23:24
  • I had academicons.sty 1.5 and upgrading to 1.6 has fixed the problem. – twsh Feb 28 '16 at 00:22
  • Ah, right. Yes, I've got 1.6, too. That must be it then: a bug in 1.5. @Benjamin It will work correctly on a properly configured system. Most GNU/Linux distro installations of TeX Live would be so configured, for example, and usually if you install TL from upstream you configure your system the same way. It may also work on OS X, although that may be more unpredictable. In general, there are disadvantages to loading by filename. However, in this case, I don't think it would do any harm so it might be better to support improperly configured systems as well. – cfr Feb 28 '16 at 04:24
  • 4
    I'm voting to close this question as off-topic because the problem was due to an outdated package and has been fixed by upgrading to the latest TeX Live. (See comments.) – cfr Feb 28 '16 at 04:26
  • @cfr How should that be possible on OS X? I am not aware of any way. – Benjamin Feb 28 '16 at 09:57
  • Sorry about that. I hadn't grasped the complications of tlmgr on Ubuntu. So I was getting a 'there are no updates' message even though there were. – twsh Feb 28 '16 at 12:48
  • @Tom No need to be sorry. (And it depends how you installed TeX Live as well, of course. Just make sure you don't have both distro packages for TeX Live and upstream's installed at the same time.) – cfr Feb 28 '16 at 13:30
  • @Benjamin I don't say it is since it is a long time since I used OS X and much may have changed. OS X used to be able to use fontconfigalthough I doubt XeTeX can use it on OS X. But I don't know whether OS X's font handling can find a file specified without an extension. If so and if OS X still uses a case-insensitive file system, as it used to, it might work. But, as I say, I haven't used OS X for ages and I would have considered it by no means clear whether this would work or not anyway. So I'm not surprised if you say it doesn't. – cfr Feb 28 '16 at 13:34
  • @cfr Just so I'm clear, I shouldn't have both the version I would get from apt-get and what I get from the installer provided for TeXlive 2015? I'm asking because I didn't do that, but tlmgr in user mode seems to have installed a second copy of academicons.sty. It's the behaviour of user mode that confuses me because I used to use OS X and there was nothing like it. – twsh Feb 28 '16 at 22:18
  • It should not be defaulting to user mode unless you are using Ubuntu's packages rather than upstream's. Are you sure that apt-get has not installed texlive when you installed an editor or something? If so, you may have 2 installations, which generally means trouble eventually. tlmgr won't use user mode by default on a GNU/Linux system. – cfr Feb 29 '16 at 00:48
  • If you try to update a package as a user without permission, for example, it tells you you can't. You don't have permission to change the installation in any way, specifically, the directory /usr/local/texlive/2015/tlpkg/ is not writable. Please run this program as administrator, or contact your local admin. (I tried just to double-check.) – cfr Feb 29 '16 at 00:51
  • @cfr That's what I get too. When I do it in user mode (tlmgr --usermode) I can install packages but they go in a different texmf tree in my home directory. Doing that seems to work i.e. I now have academicons 1.6 there and it gets used. tlmgr isn't defaulting to user mode: I have to specify it. I don't have the Ubuntu package because that's still TeXlive 2013 and I have TeXlive 2015. – twsh Feb 29 '16 at 01:33
  • *Don't use --usermode unless you have no choice.* Update the installation properly. If you use --usermode and later update the installation, you'll have stale files being used in place of new ones. If you install (TeX) font packages in this way, you will get some particularly nasty results. See https://tex.stackexchange.com/questions/255709/why-shouldnt-i-use-getnonfreefonts-to-install-additional-fonts-why-shouldnt-i. – cfr Feb 29 '16 at 01:57
  • I have exactly the same problem on Mac OS. I have installed MacTex from scratch and installed academicians.tiff but cannot make the mwe to work. Any ideas? – an1234 Dec 13 '17 at 10:41

1 Answers1

1

EDIT:

As of version 1.6-1 the manual states, that it is recommended to install the academicons font on the system. So as @dfernan stated in the comments the behavior, that XeLaTeX cannot find the font if it is not installed on the system, is not a bug but by design.


In my opinion this is a bug in the package. The package tries to load the font, saved in the texmf-dist/fonts folder by its font name like this:

\newfontfamily{\AI}{Academicons}

That does only work for LuaTeX. Have a look at this Question for more information. So instead the package should load the font using

\newfontfamily{\AI}{academicons.ttf}

to work for XeLaTeX and LuaTeX out of the box.

But installing the font on your system should actually solve the font loading problem. I don't have a Linux system at hand right now, but if I remember correctly you have to update your fontconfig caches after a font installation? Did you do that?

Benjamin
  • 4,781
  • 1
    As is clear from the comments, the font is already recognised by fontconfig. – cfr Feb 27 '16 at 21:53
  • 1
    This is not a bug in the package. \newfontfamily{\AI}{Academicons} loads the font from the system, which requires installing it. Because there may be differences between the package and previous or newest font versions, it is recommended to have the bundled version installed. The OP had mismatched versions of the package and the font, which caused the issue. I am the academicons package maintainer. – dfernan Mar 02 '16 at 16:27
  • @dfernan Ok if that is intended, it is not a bug. But then you should update the manual. You write in the manual: "This package requires the fontspec package and either the XƎ(LA)TEX or Lua(LA)TEX engine to load the included academicons.ttf font." This implies, that it is not necessary to install the font. – Benjamin Mar 02 '16 at 16:33
  • @Benjamin, I did just that while posting the comment here and uploaded a new package noting that. Thanks for the comment. – dfernan Mar 02 '16 at 17:15