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:
\documentclass[11pt,a4paper]{amsart}
\usepackage[math]{fontspec}
\usepackage{unicode-math}
\setmathfont{Asana-Math.otf}
\usepackage{fontenc}
\setmainfont{Droid Serif}
\begin{document}
\[(D_e\Phi_{\gamma(s)})^{-1}(\gamma'(s))=\varphi'(s)(D_e\Phi_{\alpha(\varphi(s))})^{-1}(\alpha'(\varphi(s)))\]
\end{document}
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
?
Best Answer
As I mentioned in my comment, you should only use one of
fontspec
orfontenc
. Basicallyfontspec
is to be used withLuaLaTeX
andXeLaTeX
, whereasfontenc
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 thatfontconfig
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 whyfc-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) whichLuaLaTeX
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
note that the
[math]
option to the fontspec package is not necessary at it is the default. However since you are usingunicode-math
you may want to use the[no-math]
option. Indeed the fontspec documentation saysAlthough 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 sincefontspec
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.