0

I'm askin a very simple question. I'm using XeLaTeX on Linux, and it's working perfectly. I know that Latin Modern Roman is the default font used by \usepackage{fontspec}. However I would like to know what is its name: I tried to use

\setmainfont{Latin Modern Roman}

but it tells me that it couldn't find such a font. Even in ShareLaTeX I have the same problem. This can be useful if I decide to switch font and then to return to Latin Modern? Which name should I use?

thanks

EDIT

Performing fc-match -a modern | grep -i "latin modern" on the command shell I get

LatinModernMathJax_Alphabets-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Arrows-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_DoubleStruck-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Fraktur-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Latin-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Main-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Marks-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Misc-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Monospace-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_NonUnicode-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Normal-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Operators-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_SansSerif-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Script-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Shapes-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size1-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size2-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size3-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size4-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size5-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size6-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Size7-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Symbols-Regular.woff: "Latin Modern Math" "Regular"
LatinModernMathJax_Variants-Regular.woff: "Latin Modern Math" "Regular"

it seems that all Latin Modern I have depend on MathJax, it's strange.

MaPo
  • 1,163
  • 1
    whether you can access a font by internal font name depends on where it is installed but for latin modern \fontfamily{lmr}\selectfont should always work – David Carlisle Dec 14 '16 at 15:56
  • Try \setmainfont{LM Roman 10} (or 12 if your base size is 12pt). – Bernard Dec 14 '16 at 16:20
  • It doesn't work, while \setmainfont{Latin Modern Roman} works with lualatex. How can I make it work also with xelatex? – MaPo Dec 14 '16 at 16:23
  • What do you get at a prompt with fc-match -a modern | grep -i "latin modern"? – Arash Esbati Dec 14 '16 at 17:06
  • @ArashEsbati I've just edited my question – MaPo Dec 14 '16 at 17:17
  • I see lmroman10-regular.otf: "Latin Modern Roman" "10 Regular" (among others). xetex relies on fontconfig to find fonts. I presume you're using TeXlive. Follow the instructions in the docs and see if that helps. – Arash Esbati Dec 14 '16 at 17:25
  • .woff fonts cannot be used by XeTeX, as far as I know – egreg Dec 14 '16 at 18:13
  • I found a directory in which there are my .otf files. But it seems that `\setmainfont' accept only the file name with xelatex. With lualatex it accepts also the font name. How can I make xelatex find the right font also by name? – MaPo Dec 14 '16 at 18:46
  • Are your otf fonts in XeTeX's tree, or in the System fonts directory, or elsewhere? Unlike LuaTeX, XeTeX relies on the System's capabilities to find fonts by name, iiuc. – jarnosc Dec 14 '16 at 21:13
  • It should work if you install a fontconfig file as in your other CMU question – David Carlisle Dec 14 '16 at 23:15

1 Answers1

0

Just one has to write a file 70-prevent-MJ.conf in /etc/fonts/conf.d with the following content

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <selectfont>
  <rejectfont><glob>/usr/share/fonts/mathjax/*</glob></rejectfont>
 </selectfont>
</fontconfig>

This prevent fontconfig to index MathJax font.

MaPo
  • 1,163