Home > amsmath > font name with a space, using XeLaTeX and fontspec

# font name with a space, using XeLaTeX and fontspec

October 1Hits:9

I use XeLaTeX, amsmath, fontspec, unicode-math and standalone to create a pdf containing one single equation which I then import to Inkscape for a poster. When using font names with a space in it, XeLaTeX finds the font, but in the resulting pdf the font name will be saved without the space, e.g. Cambria Math becomes CambriaMath. When opening the pdf in Inkscape, Inkscape will complain about a missing font, because Inkscape doesn't know CambriaMath, but only Cambria Math.

How would I have to specify the font name in order to preserve the space character?
I tried some brackets, quotes, underscore, ... but could not find a solution.

Here is a MWE:

% !TEX program = XeLaTeX \documentclass{standalone} \usepackage{amsmath} \usepackage{fontspec} \setmainfont{Rotis Serif Std} \setsansfont{Rotis SemiSans Std} \usepackage[]{unicode-math} \unimathsetup{math-style=ISO} \setmathfont{Cambria Math} % ==== ==== ==== ==== \begin{document} $\displaystyle \mathrm{det}(J) = \begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \end{vmatrix} = aei+bfg+cdh-ceg-bdi-afh$ \end{document} 


PS: Inkscape offers to replace fonts by 'the most similar font', but that gives me some other trouble so I would prefer to not replace any fonts.

Inkscape’s PDF imported basically tries to import text strings and render them on its own, so it needs to know the fonts used but it seems to be getting the PostScript name of the font which might not match the full name identified by system font services and thus it would not be able to find the font.

Anyway, importing text from PDF is not generally a good idea, and it would break math badly. Since Inkscape does not support importing text as paths, an alternative solution is to use pdf2svg command line utility which does just that and preserves the original text layout.

(pdf2svg authors does not provide any binaries, building it on Linux is simple, for Windows it is possible to build it natively or cross compiled using MingW, most of the dependencies are provided in pre-built packages by GTK+ Windows port).

## Related Articles

• ### font name with a space, using XeLaTeX and fontspecOctober 1

I use XeLaTeX, amsmath, fontspec, unicode-math and standalone to create a pdf containing one single equation which I then import to Inkscape for a poster. When using font names with a space in it, XeLaTeX finds the font, but in the resulting pdf the

• ### XeLaTeX/LuaLaTeX + fontspec "font-not-found" in CV template September 23

I am trying to compile a CV template using XeLateX. I have always used Pdflatex, so I created a XeLaTeX command as described here: Use XeLaTeX in Texmaker instead of pdfLaTeX. I then downloaded the font and installed it (as described here: http://www

• ### how to specify font for superscripts using ucharclasses with xelatexApril 9

Lohit Tamil Classical font that I am using with Xelatex does not have a glyph for superscript 4. (please see https://github.com/pravins/lohit/issues/68) I have tried using ucharclasses for automatic switching to a different font for superscripts, but

• ### XeLaTeX / XeTeX - fontspec and ornaments/dingbats May 15

This question already has an answer here: How can I access a specific glyph in LuaLaTeX/Fontspec? 5 answers I would like to know if it is possible to use the ornaments contained in a font like Minion Pro from Adobe. I'm using XeLaTeX and fontspec (or

• ### How to obtain proper justification with XeLaTeX and fontspec package?November 30

I'm trying to obtain a justified paragraph with greek text using XeLaTeX and fontspec package, but there is always a word that exceed the right alignment. Note that with LaTex and the default greek font the given output is correct, with hyphenation,

• ### URW Grotesk for XeLaTeX/LuaLaTeX (fontspec)?June 4

How can I use URW Grotesk font with XeLaTeX/LuaLaTeX (fontspec) ? Or if this is not possible/easy, are there a good heavy font replacement for it (if possible that works as well with PDFLaTeX) ? Here is a MWE compiled with PDFLaTeX: \documentclass[bo

• ### XeLaTeX with fontspec is slow every time, not just the first timeJune 23

I am running XeLaTeX (distributed as part of MikTeX) on Windows 7 Service Pack 1 64-bit. The following test file takes a long time to compile: \documentclass{article} \usepackage{fontspec} \message{Hello} \setmainfont{AlegreyaSC-Regular} \message{How

• ### Latest MiKTeX-Update broke XeLaTeX with fontspecJuly 17

I updated MiKTeX a few days ago and since then I cannot compile XeLaTeX with fontspec anymore. \documentclass{article} \usepackage{fontspec} \begin{document} Hello world! \end{document} When I try to compile it MiKTeX tells me that it expl3 is an unk

• ### dealing with thin spaces in XeLaTeX and LuaLaTeXDecember 22

In the following small example I get unexpected but different results in XeLaTeX and LuaLaTeX: \documentclass{article} \usepackage{fontspec} \setlength\parindent{0pt} \newcommand*\x{\rule{1cm}{1cm}} \begin{document} \x\,\x \par \x~\x \par \x \x \par

• ### What is the best font for extremely limited space, i.e. will fit the most READABLE text in the smallest space?February 2

I often have very limited space when creating reports and dashboards for users. I usually use Arial, or Arial Narrow, but UI isn't my area of expertise, so I want to know, is there an optimal font for fitting the most readable text in the smallests s

• ### What math fonts are available that work in xelatex?February 8

For LaTeX, we have the Font Catalogue which is a good resource for fonts available through LaTeX. There doesn't appear to be a similar resource for Xe(La)TeX. So let's say I'm bored of computer modern and I want to try out some new fonts in XeLaTeX.

• ### What is the best Font with less empty Space (ultra fat)May 1

I search a good looking font which has small empty space, means the characters are full and nearly quadratic. Or in other words, if you draw a rectangle or quadre around a letter, nearly 80 % should be filled with the character, only small empty spac

• ### Additional white spaces with xelatex and fancyvrb/VerbatimSeptember 9

I've tested xelatex with the following code: \documentclass[b5paper,11pt]{article} \usepackage{fontspec} \usepackage{xeCJK} \usepackage{fancyvrb} \setCJKmonofont{Adobe Ming Std} \setmonofont{Courier Std} \begin{document} \begin{Verbatim}[commandchars

• ### How to use abundant math font features in one article in XeLaTeX? March 1

Sometimes I receive a message: ! LaTeX Error: Too many math alphabets used in version normal. I know that there is a limit of 16 alphabets at most allowed to one article. However this message specified version normal, so are there any other version o

• ### Problem using XeLaTeX and fontspec with arial fontJanuary 2

I'm using LaTeX to write my reports, recently I have discovered XeLaTeX as an alternative to use different fonts with LaTeX. I'm using MiKTeX 2.9 as LaTeX compiler and TeXnicCenter 2.0. I'm newbie in XeLaTeX and for this reason, I did a .tex file tes

• ### Telugu font characters not correctly produced from xelatexMay 8

Anyone have this issue. This is the following code. \documentclass{article} \usepackage{fontspec} \setmainfont{Gautami} \usepackage{polyglossia} \setmainlanguage{telugu} \begin{document} చేయి అనగా మానవులు, చింపాంజీలు, కోతులు మరియు లెమూర్లకు గల శరీరభా

• ### Best math font with Times New Roman in XeLaTeXNovember 9

I compile my document with the following commands in the header: \usepackage{fontspec} \setmainfont{Times New Roman} which works fine. What is the "best" math font that will match the text in the body, and what are the commands to set up this fo

• ### How can I change to font used by hepparticles/hepnames with XeLaTeX?April 25

I am trying to get the hepparticles/hepnames packages to work with XeLaTeX. I am using Libertine as serif font and Biolinum as sans font. The particle names are somehow rendered in the wrong font. The HEP packages insert glyphs for particle names use

• ### XeLaTeX with fontspec not recognizing ANY fonts on a windows platform (with miktex) December 19

Getting the message: font-not-found see fontspec documentation. I'm using cls file abbreviated at the bottom of this page whose origin is latextemplates.com/template/friggeri-resume-cv. I've tried all sorts of fonts from system fonts and tex fonts. N

• ### XeLaTeX/beamer/fontspec/unicode-math: Change font of all math digitsApril 28

Please consider the following MWE: \documentclass{beamer} \usepackage{unicode-math} \usepackage{fontspec} \setsansfont{some-font.otf} \usefonttheme[onlymath]{serif} \begin{document} \begin{frame} Some text with the number \textit{two} in text mode (2