1

I have an old article in which I use fontawesome icons from version 4.7.

In Ubuntu 16.04, I had installed font-awesome (v4.5) and texlive-fonts-extra from the repositories. Then I downloaded the fontawesome 4.7 font from the fontawesome website, and placed the new FontAwesome.otf file at /usr/share/fonts/opentype/font-awesome

This allowed me to use icons in newer releases of fontawesome.

Now fontawesome5 has come up and everything is different, and I do not seem to be able to make it work.

So what would be the best practice to have fontawesome5 up and running?

Please assume I have no idea, walk me through how to install the fontawesome5 package and the fonts.

This is my old MWE:

\documentclass{article}
\usepackage{fontawesome}
\newfontfamily{\FA}{FontAwesome}
%1 - Install font-awesome and texlive-fonts-extra from the repositories
%2 - If you want to use the latest, download font awesome latest version from http://fortawesome.github.io/Font-Awesome/
%3 - Uncompress and copy the FontAwesome.otf file to the following location, replacing current file
%sudo cp FontAwesome.otf /usr/share/fonts/opentype/font-awesome/FontAwesome.otf
%4 - Call symbols newer than your previous version separately
\newcommand\faUserCircle{{\FA\symbol{"F2BD}}}
\newcommand\faIdCard{{\FA\symbol{"F2C2}}}

\begin{document}
some symbols:\\
\faEnvelope\\
\faSkype\\


new symbols:\\
\faUserCircle\\
\faIdCard\\

\end{document}

which produces:

image1

I want to reproduce it with fontawesome5, including some icon that is new to that release.

I tried the following, but it gives me multiple errors, so I guess I did not install the package or fonts correctly.

\documentclass{article}
\usepackage{fontawesome5}

\begin{document}
some symbols:\\
\faEnvelope\\
\faSkype\\


new symbols:\\
\faUserCircle\\
\faIdCard\\

\end{document}
DaniCee
  • 2,217
  • What errors would that be? – LaRiFaRi Jun 27 '18 at 11:15
  • "If you use XeLeLaTeX or LuaLaTeX, you can also directly download the new Desktop Fonts from https://fontawesome.com into your TeX tree. If you save them with the filenames FontAwesome5Brands-Regular-400.otf FontAwesome5Free-Regular-400.otf FontAwesome5Free-Solid-900.otf you can start using the new files right away." – LaRiFaRi Jun 27 '18 at 11:17
  • Yes I use lualatex, but where do I store the otf files, how do I install the fontawesome5 package, how do I call the icons, etc? The errors are related to not being able to find the sty files or the icons... – DaniCee Jun 27 '18 at 11:29
  • Ubuntu 16.04 comes with TeXLive 2015 while fontawesome5 is not supported before TeXLive 2017. Even if you manually install the package, it probably fails because expl3 and LuaTeX are too old. Instead I recommmend installing a "vanilla" TeXLive to get current packages, see https://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu on how to do this.

    With TeXLive 2018, fontawesome5 is available by default and your second example just works.

    – Marcel Krüger Jun 27 '18 at 18:18
  • OK let me try this – DaniCee Jun 28 '18 at 01:52
  • I have followed the steps to get the newest texlive in https://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu It still complains with error File fontawesome5.sty not found... Is my system still making use of the old texlive installation (the one I installed from the repositories)? – DaniCee Jun 28 '18 at 05:52

1 Answers1

1

No problem with up-to-date TL2018 and your example. I downloaded the fonts and did not changed the original file names. With LuaLaTeX:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
YJJRQL+LMRoman10-Regular             CID Type 0C       Identity-H       yes yes yes      4  0
IXHJTI+FontAwesome5FreeSolid         CID Type 0C       Identity-H       yes yes yes      5  0
QQOXUN+FontAwesome5BrandsRegular     CID Type 0C       Identity-H       yes yes yes      6  0

I installed TeXLive on Ubuntu with the following steps:

  • first remove the complete Ubuntu/Debian TeXLive installation with sudo apt remove texlive-full If it will delete also an TeX editor, then say yes.
  • Create the texlive directory with sudo mkdir /usr/local/texlive
  • Set the permission for texlive to the user and not root (makes installtion/updates easier) with sudo chown <USER> /usr/local/texlive Replace <USER> with your username
  • Now run wget https://github.com/scottkosty/install-tl-ubuntu/raw/master/install-tl-ubuntu && chmod u+x ./install-tl-ubuntu
  • As an alternative get first the install script with wget https://github.com/scottkosty/install-tl-ubuntu/raw/master/install-tl-ubuntu and change the permission with chmod u+x ./install-tl-ubuntu
  • Now we can run the install script as a user: ./install-tl-ubuntu
  • in the end you should have an up-to-date TeXLive 2018
  • now install your favorite editor as usual.
  • that's all
  • Have you tested this without downloading the fonts too? As maintainer of fontawesome5 I would be very surprised if downloading the free fonts without renaming the files would make any difference. – Marcel Krüger Jun 27 '18 at 18:22
  • Yes, always no problem –  Jun 27 '18 at 18:34
  • OK but where do I place the fonts, how do I install the fontawesome5 package, etc? Could you provide a full answer with an example? – DaniCee Jun 28 '18 at 01:42
  • I have followed the steps to get the newest texlive in https://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu It still complains with error File fontawesome5.sty not found... Is my system still making use of the old texlive installation (the one I installed from the repositories)? – DaniCee Jun 28 '18 at 05:53
  • @DaniCee: see my edited answer –  Jun 28 '18 at 06:54
  • Still get the File fontawesome5.sty not found error... what am I doing wrong?? I made the 2018 texlive vanilla installation... do I have to download the fontawesome5 package and place the sty file somewhere?? I thought it came with the fresh installation – DaniCee Jun 28 '18 at 09:49
  • try kpsewhich fontmath.ltx. It should output something like /usr/local/texlive/2018/texmf-dist/tex/latex/base/fontmath.ltx. Do you get similiar output? –  Jun 28 '18 at 11:05
  • it outputs /usr/share/texlive/texmf-dist/tex/latex/base/fontmath.ltx – DaniCee Jun 29 '18 at 01:38
  • that looks like an directory from Ubuntus/Debians installation of TeXLive. Do you have also a /usr/local/texlive directory? –  Jun 29 '18 at 10:52
  • yes, the whole new installation is at /usr/local/texlive/2018 – DaniCee Jul 02 '18 at 01:41
  • OK so now I made sure I uninstalled everything related to my Ubuntu texlive installation and installed texlive 18 again. The output of kpsewhich fontmath.ltx is now /usr/local/texlive/2018/texmf-dist/tex/latex/base/fontmath.ltx. However, when I try to run my example tex file with lualatex I get the error Error: Could not start the command: lualatex -synctex=1 -interaction=nonstopmode "test".tex, along with the same error File fontawesome5.sty not found – DaniCee Jul 02 '18 at 05:28
  • Will a fresh installation of Ubuntu 18.4 and installing TexLive from the repositories solve the problem? I think I am going to give up and try that route, since I've been wanting to try Ubuntu 18.4 for some time now... – DaniCee Jul 02 '18 at 06:05
  • Removing all TeX-related packages (including an editor) and then reinstall TL from the github Link should solve the problem! Hoewever, the link to your binaries is missing. You could append the path in your local .bashrc –  Jul 02 '18 at 06:26
  • I uninstalled and reinstalled TexStudio after installing TL 2018, and added the following lines in my .bashrc export PATH=$PATH:/usr/local/texlive/2018/bin/x86_64-linux, export INFOPATH=$INFOPATH:/usr/local/texlive/2018/texmf-dist/doc/info and export MANPATH=$MANPATH:/usr/local/texlive/2018/texmf-dist/doc/man... still I get the errors Error: Could not start the command: lualatex -synctex=1 -interaction=nonstopmode "test".tex and File fontawesome5.sty not found. – DaniCee Jul 02 '18 at 09:45
  • did you opened a new shell so that the PATH setting is active? –  Jul 02 '18 at 09:56
  • I edited the paths in my bashrc file right after installing TL a few days ago, since then I have rebooted the computer multiple times... the error persists. Can it be related to how TexStudio is calling LuaLatex? – DaniCee Jul 02 '18 at 10:19
  • no, that should be no problem. Open a terminal, go into your TeX example directory and run by hand lualatex <myfile>. Then provide the complete log file for download –  Jul 02 '18 at 11:29
  • OK, it seems like lualatex test.tex has worked, it produces the pdf file satisfactorily, but still when running it in TexStudio gives me the same errors, so it might be a problem with TexStudio... – DaniCee Jul 03 '18 at 01:10
  • Delete TeXstudio with the configuration file and reinstall it. It should then lok for a tex distribution when started at the first time and then sets the path for the programs correct. –  Jul 03 '18 at 04:31
  • what configuration file? – DaniCee Jul 03 '18 at 07:11
  • ~/.config/texstudio –  Jul 03 '18 at 07:45
  • That is a directory, should I delete it all? – DaniCee Jul 03 '18 at 08:11
  • yes, and then reinstall texstudio –  Jul 03 '18 at 09:54
  • Nothing, now TexStudio gives me this `No LaTeX distribution was found on your system. As a result, the corresponding commands are not configured. This means, that you cannot compile your documents to the desired output format (e.g. pdf).

    If you intend to work with LaTeX, you'll most certainly want to install a LaTeX distribution.`

    – DaniCee Jul 03 '18 at 10:32
  • That is curious ... However, go into TeXstudios's configuration for commands and set the path for e.g. lualatex and the pdf viewer. Then try to run the example from within TeXStudio. –  Jul 03 '18 at 11:47
  • 1
    So at the end I installed Ubuntu 18.04 (with much trouble) almost only for this, but it still does not have the latest version of fontawesome (though it works perfect with fontawesome5 and the MWE above). I confirm I downloaded the latest Desktop version of fontawesome5 and placed the otf files in /usr/share/texlive/texmf-dist/fonts/opentype/public/fontawesome5, I did have to change the file names to remove the spaces, then run sudo texhash, and it worked! – DaniCee Jul 07 '18 at 05:32