1

When I try to enable fontawesome icons in moderncv, I get this error in the pdflatex log:

! LaTeX Error: Encoding scheme `TU' unknown.

A minimal example:

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{casual}
\moderncvcolor{blue}

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

\usepackage{babel}

\name{John}{Doe}
\title{C/C++ Development}
\phone[mobile]{+1~xxx-yyyy}
\email{john.doe@gmail.com}
\homepage{www.tractor.com}

\social[linkedin]{johndoe}
\social[github]{john-doe}
\social[stackoverflow]{012345/johndoe}
\social[orcid]{0000-0001-2345-6778}
\social[researchgate]{John-Doe}
\social[googlescholar]{ADFIE89AD}

\moderncvicons{awesome}

\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}

\begin{document}

\makecvtitle

foo

\end{document}

In fontawesomebrands.fd and fontawesomepro.fd there are many references to TU, so it appears to be some kind of central element. But without any hint from pdflatex, and nothing in google searches, I don't have a way to figure out what's missing or configured wrong.

UPDATE: excerpts from the log file that look relevant to fontawesome (since there is no way to post an actual log file attachment):

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex 2023.3.13)  10 AUG 2023 12:33
entering extended mode                                                                                               
 restricted \write18 enabled.                                                                                        
 %&-line parsing enabled.                                                                                            
**minimal.tex                                                                                                        
(./minimal.tex                                                                                                       
LaTeX2e <2020-10-01> patch level 4                                                                                   
L3 programming layer <2021-05-07>                                                                                    
(/usr/share/texlive/texmf-dist/tex/latex/moderncv/moderncv.cls                                                       
Document Class: moderncv 2021/01/21 v2.1.0 modern curriculum vitae and letter document class                         
...                                                                                                                  
(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/fontawesome5.sty                                               
Package: fontawesome5 2020/03/24 v5.13.0 Font Awesome 5

(/usr/share/texlive/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
Package: l3keys2e 2021-05-07 LaTeX2e option processing using LaTeX3 keys
)
(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/fontawesome5-generic-help
er.sty
Package: fontawesome5-generic-helper 2020/03/24 v5.13.0 non-uTeX helper for fon
tawesome5

(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/fontawesome5-mapping.def)
)) (/usr/share/texlive/texmf-dist/tex/latex/academicons/academicons.sty
Package: academicons 2020/08/14 v1.9.0 Academicons Icons
))
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2021-02-27 v7.00k Hypertext links for LaTeX
...
LaTeX Font Info: Trying to load font information for U+fontawesomefree2 on i
nput line 33.
(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/ufontawesomefree2.fd)
(/usr/share/texlive/texmf-dist/tex/latex/microtype/mt-cmr.cfg
File: mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman
(RS)
)
LaTeX Font Info: Trying to load font information for TS1+lmr on input line 3
3.

(/usr/share/texlive/texmf-dist/tex/latex/lm/ts1lmr.fd
File: ts1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
LaTeX Font Info: Trying to load font information for U+fontawesomefree1 on i
nput line 33.

(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/ufontawesomefree1.fd)
LaTeX Font Info: Trying to load font information for U+fontawesomebrands0 on
input line 33.

(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/ufontawesomebrands0.fd)
LaTeX Font Info: Font shape U/fontawesomebrands0/solid/n' in size &lt;10&gt; not available (Font) Font shapeU/fontawesomebrands0/regular/n' tried instead o
n input line 33.
LaTeX Font Info: Trying to load font information for U+fontawesomebrands1 on
input line 33.

(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/ufontawesomebrands1.fd)
LaTeX Font Info: Font shape U/fontawesomebrands1/solid/n' in size &lt;10&gt; not available (Font) Font shapeU/fontawesomebrands1/regular/n' tried instead o
n input line 33.

! LaTeX Error: Encoding scheme `TU' unknown.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.33 \end{document}

  • 1
    TU is the default unicode encoding used in lualatex and xelatex, it is not usable in pdflatex – David Carlisle Aug 10 '23 at 06:13
  • When making the switch from pdflatex to lualatex/xelatex, be sure to also delete (or comment out) the instructions \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc}. – Mico Aug 10 '23 at 06:20
  • I get no error from pdflatex in texlive 2023 show the log of your test file – David Carlisle Aug 10 '23 at 07:31
  • @DavidCarlisle: I was not intending to use either lualatex or xelatex, I just want to use pdflatex. Is that possible with fontawesome icons in moderncv? – Byron Hawkins Aug 10 '23 at 10:31
  • do not show only snippets from the log. You don't know what is important, and it makes it impossible to use diff to compare with our logs. – Ulrike Fischer Aug 10 '23 at 10:48
  • I get the error you show in texlive 2020 but not 2021, 2022, 2023 so the simplest thing to do would be to update your tex system it was clearly a bug that got fixed. – David Carlisle Aug 10 '23 at 10:58
  • Trying to post the log file, I get: Body is limited to 30000 characters; you entered 43718. – Byron Hawkins Aug 10 '23 at 11:00
  • It's texlive 2021: This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021). But ok, I'll update and see if anything changes. – Byron Hawkins Aug 10 '23 at 11:03
  • Nothing changes after updating. It's still texlive 2021, and it still fails with the same error about 'TU' encoding. – Byron Hawkins Aug 10 '23 at 11:17
  • Solved by upgrading to Fedora 38. It was a bug, and the fixed version will apparently never be available in the Fedora 36 packages (which will expire soon anyway). – Byron Hawkins Aug 10 '23 at 17:06

1 Answers1

2

The message that TU is unknown indicates that you are trying to use a font package which only works with LuaLaTeX and XeLaTeX in a pdfLaTeX document.

The font causing this issue is academicons which automatically gets loaded by moderncv up to version 2.1.0 when \moderncvicons{awesome} is selected.

In moderncv version 2.2.0 (released on 2021-07-28), \moderncvicons{awesome} has been changed to no longer automatically load academicons and therefore became compatible with pdfLaTeX.

So in order to solve this issue, you need to install a newer moderncv version. The latest version (v2.3.1) still got into TeX Live 2021, so you can do this either by updating to e.g. TeX Live 2023 or by installing package updates for your existing TeX Live 2021. When trying to update an existing installation, remember that since TeX Live 2022 has been released the default mirrors no longer contain packages for TeX Live 2021, so to update TeX Live 2021 you have to follow the instructions for updating historic distributions. That's assuming that you installed TeX Live manually. If you got it from some distribution package you need to follow the usual procedures to update your packages.

  • Thank you, I see the problem here. Both texlive and moderncv were installed using dnf on Fedora, which (after updating today) still gives me \ProvidesClass{moderncv}[2021/01/21 v2.1.0 modern curriculum vitae and letter document class]. So I'll have to find some workaround, or upgrade the entire install beyond Fedora 36. – Byron Hawkins Aug 10 '23 at 16:25
  • Works perfect in Fedora 38, including other stuff that was broken like the \born command. – Byron Hawkins Aug 10 '23 at 17:04
  • Semi off topic, but you are aware that Fedora 36 reached EOL about three months ago? I would strongly recommend updating it ASAP. – Marcel Krüger Aug 10 '23 at 17:12
  • I'm often hesitant to update because things get broken. For example, after upgrading to Fedora 38 across my network, I am now unable to compile my main C++ project. Version 13.2 of GCC crashes with a segfault while instantiating a particularly complex template, and emits an error message indicating to file a report on redhat bugzilla. Nobody at redhat has responded to my report after 3 days. It's taking me quite a while to work around the bug, and it would not have happened if I had chosen to keep dragging my feet about the upgrade. – Byron Hawkins Aug 15 '23 at 17:28