Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
3  
The names in the PDF are the postscript name of the font which is not allowed to have spaces. If you want to convert PDF to SVG, I suggest using pdf2svg, Inkscape PDF import is very poor and have lots of issues. –  Khaled Hosny Oct 1 '12 at 14:59
    
Thanks, pdf2svg is also recommended in a somewhat related Inkscape bug report. Have you heard of a Windows version of pdf2svg? Otherwise I would reactivate my unused dual boot... –  matth Oct 1 '12 at 15:14
1  
I once cross-built a Windows binary for a friend, I still have the files on my bolg, hope they still work. –  Khaled Hosny Oct 1 '12 at 16:31
    
Perfect! I just did the conversion under Linux (easy on Ubuntu), then tried to compile under MinGW, but your ready-to-use exe is the nicest solution for me. Thanks a lot. PS: As that solved my problem, I would accept that comment as an answer. Maybe you could add a hint on how to cross-compile pdf2svg? –  matth Oct 1 '12 at 16:40

1 Answer 1

up vote 4 down vote accepted

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.