I'm using Linux. I'd discovered that is possible to run lualatex and use my system fonts. Well, I'm trying to see how they look like.

Here is my sample:

\setmainfont{Droid Serif}

After running fc-list I just copy some font name and use it on \setmainfont, like above.

My question is: how to be sure that I'm doing this for text and math fonts? When I change as above does the math fonts change accordingly? How to test the math fonts also? How to list all the other otf fonts to use in \setmathfont?

  • 5
    do not use fontenc and fontspec together. with LuaLaTeX and XeLaTeX use fontspec, with anything else, use fontenc
    – ArTourter
    Dec 22, 2012 at 1:13
  • 1
    read "texdoc fontspec" there are a lot examples. And also "texdoc unicode-math" for the math fonts
    – user2478
    Dec 22, 2012 at 7:48
  • 1
    Read texdoc lualatex-doc. Dec 22, 2012 at 12:32
  • @ArTourter Please write a short answer.
    – lockstep
    Dec 23, 2012 at 12:33

1 Answer 1


As I mentioned in my comment, you should only use one of fontspec or fontenc. Basically fontspec is to be used with LuaLaTeX and XeLaTeX, whereas fontenc is to be used with the other engines (LaTeX, pdfLaTeX,...).

Regarding which font are available on your system, fc-list only gives you the list of the font that fontconfig knows about (those in /usr/share/fonts/ and ~/.fonts/), that is the one your Linux distribution can see. However it will not list the font that came with your LaTeX distribution as usually , the TeX distribution does not add these fonts to the system path. This is why fc-list will not show you Asana Math.

There is however a command that LuaLaTeX runs to scan your system and find out which font are accessible: mkluatexfontdb. You can run this command yourself and it will create a file in: ~/.texlive2012/texmf-var/luatex-cache/generic/names/otfl-names.lua which list all the fonts (system or not) which LuaLaTeX can see. (LuaLaTeX will run this command automatically the first time you run it and every time you try to use a font it doesn't know about (in case you added it since).

With LuaLaTeX, it is also possibly best not to use the font file name and rather use the actual font name. This is because in most cases, the different shapes and series are located in a different file. Although this is not the case with Asana Math it is I think a good habit to take. (A note here though is that if you want to use font that are provided by the TeX distribution currently have to be called via their filename when using XeLaTeX, which is not the case with LuaLaTeX)

In your case, you can easily call

\usepackage{unicode-math} %as noted in the comments this will load fontspec as well
\setmathfont{Asana Math}
\setmainfont{Droid Serif}

note that the [math] option to the fontspec package is not necessary at it is the default. However since you are using unicode-math you may want to use the [no-math] option. Indeed the fontspec documentation says

By default, fontspec adjusts LATEX’s default maths setup in order to maintain the correct Computer Modern symbols when the roman font changes. However, it will attempt to avoid doing this if another maths font package is loaded (such as mathpazo or the unicode-math package). If you find that fontspec is incorrectly changing the maths font when it should be leaving well enough alone, apply the [no-math] package option to manually suppress its maths font.

Although I do find that unicode-math is very good and simplifies nicely the use of OTF/TTF for typesetting maths, I should also mention that it is not actually necessary since fontspec also has the \setmathrm, \setmathsf, \setmathtt and \setboldmathrm commands. But since the font you are planning on using contains all this, using \setmathfont is a better solution.

  • loading unicode.math is enough, it loads fontspec itself.
    – user2478
    Dec 23, 2012 at 17:32
  • Thanks @Herbert for this, I had not realised that. These days I tend to use lualatex exclusively so by default I will load fontspec. but I don't always use unicode-math so I got in the habit of adding it to my default setup when needed. Looking as the unicode-math source, fontspec is loaded without options so if one need to use the [no-math] option, one need to make sure that fontspec is loaded before unicode-math, or one use the \PassOptionsToPackage{}{} command instead.
    – ArTourter
    Dec 23, 2012 at 18:36

You must log in to answer this question.

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