11

I recently migrated to Ubuntu from Mac OS. I installed TexLive and it works. However, fontspec doesn't work, no matter what fonts I use. This goes for fonts native to Ubuntu and fonts that I have installed in ~/.fonts/ myself. I know that these fonts are installed, because I can use them in LibreOffice, including those that I have installed myself. However, if I load fontspec, I invariably get the error:

*************************************************
* LaTeX warning: "xparse/redefine-command"
* 
* Redefining document command \oldstylenums with arg. spec. 'm' on line 128.
*************************************************
) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd)kpathsea:make_tex:     Invalid fontname `[lmroman10-regular]', contains '['

! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadab
le: Metric (TFM) file or installed font not found.
 <to be read again> 
               relax 
l.100 \fontencoding\encodingdefault\selectfont

A M(non)WE is:

\documentclass[utf8,12pt,letterpaper]{article}
\usepackage{fontspec}
\setmainfont[Ligatures={Common,TeX},Contextuals=NoAlternate]{DejaVuSerif.ttf}
\begin{document}
test
\end{document}

I compile in xelatex (this is necessary since I will want to use CJK).

I've googled and googled and reinstalled TexLive several times, rebooted the system, etc. I'm out of ideas. All help greatly appreciated!

4
  • 3
    You have a faulty or incomplete TeX Live installation, because you're missing the Latin Modern fonts in OpenType format. Did you install TeX Live with the Debian/Ubuntu methods or the “vanilla” one?
    – egreg
    Commented Mar 30, 2014 at 23:19
  • honestly, it's hard to tell at this point, since I installed and uninstalled so many times. if you could tell me how I can wipe the installation clean and install it again I would be very grateful. I need a lot of language packages so I guess a full install would be best?
    – Mårten
    Commented Mar 31, 2014 at 0:35
  • solved it. please change your comment to an answer and I will label the question resolved. Thank you!
    – Mårten
    Commented Mar 31, 2014 at 2:20
  • @Mårten: chiark.greenend.org.uk/~sgtatham/bugs.html Commented Mar 31, 2014 at 17:07

3 Answers 3

6

Your TeX Live installation is faulty or incomplete. It misses the Latin Modern fonts in OpenType format which are necessary for fontspec to work, because they are the “fallback fonts”.

If you have the “vanilla” TeX Live, use tlmgr to install/reinstall

collection-fontsrecommended

(or just the lm package). For a TeX Live/Debian, use apt-get to install all “recommended” packages.

In any case, a full install is preferable than adjusting it when things go wrong. Within TeX Live/Debian it's always difficult to understand what Debian package contains what we need.

3

This worked for me:

sudo apt-get install lmodern

See XeTeX not working on Ubuntu 10.04?

1
  • FYI, this solution worked for me when using Debian 8 (Jessie).
    – Digger
    Commented Oct 4, 2021 at 19:06
1

Installing Microsoft fonts in Ubuntu using below link helped me https://linux.how2shout.com/how-to-install-microsoft-fonts-on-ubuntu-22-04-20-04-lts/

2
  • If installing MS fonts in Ubuntu helped, then you did not have the same problem or the same error message as the OP. That error concerns a missing Latin Modern font in opentype format. That has absolutely nothing to do with MS.
    – cfr
    Commented Feb 22 at 5:01
  • I understand, in my case lualatex was complaining about missing "the font "georgia" cannot be found"
    – Arun Kp
    Commented Feb 22 at 5:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .