I have just installed MacTex and I am running this simple program:




\setsansfont{DejaVu Sans}
\setromanfont{DejaVu Serif}
\setmonofont{DejaVu Sans Mono}

This is the paper's abstract \ldots

This is time for all good men to come to the aid of their party!


When I run this command : xelatex simple.tex I get:

This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(./simple.aux) (/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3cmr.fd)

LaTeX Font Warning: Font shape `EU1/DejaVuSerif-TLF/m/n' undefined
(Font)              using `EU1/lmr/m/n' instead on input line 6.

kpathsea:make_tex: Invalid fontname `DejaVu Sans', contains ' '

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

l.8 \setsansfont{DejaVu Sans}

I opened up my TexLive Utility to see if the dejavu package is installed and it is.

What is going on here?

  • I don’t have a copy to test, but creating DejaVuSerif.fontspec still works, right?
    – Davislor
    Oct 17, 2020 at 13:26

3 Answers 3


On Mac OS xetex + fontspec will not find OpenType fonts from the TeXLive tree if you use font names:

  • either use filenames,

  • or (simplest and recommended by some) copy over those fonts you need to a location recognized by MacOS, thus ~/Library/Fonts

  • or add a symlink inside ~/Library/Fonts, this is what I have done once and for all, I add two symlinks with targets respectively /Library/TeX/Root/texmf-dist/fonts/opentype and /Library/TeX/Root/texmf-dist/fonts/truetype. This assumes a "texdist" like structure is present. I understand it is now implemented via TeXLiveUtility in MacTeX, but as MacTeX has decided for TL2017 to drop MacOSes like Mavericks, I am not MacTeX user anymore hence I am not 100% sure these locations (themselves symlinks) exist under the above names. This set-up needs no yearly update. It does not create issues with LuaLaTeX either as the latter (via luaotfload) is (since some time, it wasn't though further back in the past) able to trim its database of fonts from duplicates originating in finding same fonts both in directly in TeXLive tree and indirectly via the two user added symlinks above to official MacOS location, targeting TeXLive tree repertories.


kpathsea:make_tex: Invalid fontname `DejaVu Sans', contains ' '

It says that your font name has space

For Ubuntu, if in case dejavu is indeed missing install it using:

sudo apt install fonts-dejavu*

Or install all texlive fonts

sudo apt install texlive-fonts-recommended
sudo apt install texlive-fonts-extra

I also found dejavu font here https://ctan.org/pkg/dejavu. I was able to download the zip file containing required files but I didn't install it because texlive-fonts-extra fixed the 'DejaVuSans.sty' missing issue on my computer. But if you want to install it check out this blog : https://nathanvan.wordpress.com/2012/06/14/managing-latex-packages-manually-in-ubuntu-12-04/


The following has just worked for me on macOS.

Downloading the dejavu package as a ZIP file from the package page: https://ctan.org/tex-archive/fonts/dejavu was the easiest way to fix this.

In the ZIP file, there is a dejavu folder that contains *.ttf files. I have opened the /Applications/Font Book.app application, clicked + and pointed it to the dejavu/truetype folder.

Here's my Sphinx configuration for Latex in the conf.py file:

'fontpkg': r'''
    \setmainfont{DejaVu Sans}
    \setsansfont{DejaVu Sans}
    \setmonofont{DejaVu Sans Mono}

To make it work on Linux Ubuntu 20 I have used the apt install command as recommended by Sawan Vaidya.

You must log in to answer this question.