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've run into strange problems with fonts in figures included in XeLaTeX document. I have figures generated from Metapost sources with rotated math labels. When I include resulting EPS into document its rendering depends upon including another figure before it. Example should clear what I mean.

problem.tex is compiled with xelatex, both figures with mpost.

When I don't include the first picture, the second one is alright. However, when it's included, rotated label ($\text{odvěsna úhlu }\alpha$) is displayed with totally inappropriate font. I've no idea if it's a bug or some hidden feature I am not aware of... (In a little bit different setup than presented only alpha is displayed incorrectly as ligature ff.)

I'll be grateful for any ideas.

problem.tex:

\documentclass{article}
\usepackage{xltxtra}
\usepackage[czech]{polyglossia}
\begin{document}
\begin{figure}[!h]
    \includegraphics{imgA.eps} %this causes problem
\end{figure}

\includegraphics{imgB.eps}

\end{document}

imgA.mp:

input fks
verbatimtex
%&latex
\documentclass[9pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{fkssugar} % only helping macros
\begin{document}
etex
prologues:=3;
u:=1cm;
beginfig(1);

z0=(0,0);
z1=(0, 2u);
z2=( 3u, 0);

draw z0--z1--z2--cycle;

uhelR(z2,z0,4mm);
draw (thelabel.top(btex $a - \text{odvěsna}$ etex,z0)).rotated 90 .shifted    (.5[z0,z1]);
label.bot(btex $b - \text{odvěsna}$ etex,.5[z0,z2]);
label.urt(btex $c - \text{přepona}$ etex,.5[z1,z2]);

endfig;
verbatimtex
\end{document}
etex
end;

imgB.mp:

input fks
verbatimtex
%&latex
\documentclass[9pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{fkssugar}
\begin{document}
etex

prologues:=3;
u:=1cm;

beginfig(1);

z0=(0,0);
z1=(0, 2u);
z2=( 3u, 0);


draw z0--z1--z2--cycle;
uhel(z1,z2,z0,8mm);

uhelR(z2,z0,4mm);

draw (thelabel.top(btex $a - \text{protilehlá}$ etex,z0+(0,8pt))).rotated 90 .shifted(.5[z0,z1]);

draw (thelabel.top(btex $\text{odvěsna úhlu }\alpha$ etex,z0)).rotated 90 .shifted(.5[z0,z1]);
label.bot(btex $b - \text{přilehlá}$ etex,.5[z0,z2]);
label.bot(btex $\text{odvěsna úhlu } \alpha$ etex,.5[z0,z2]-(0,9pt));
label.urt(btex $c - \text{přepona}$ etex,.5[z1,z2]);
label.ulft(btex $\alpha$ etex,z2-(3mm,0));


endfig;

verbatimtex
\end{document}
etex

end;
share|improve this question
add comment

1 Answer 1

You aren't providing fks.mp and fkssugar.sty. However I have already encountered similar problems with inclusion of Metapost generated EPS files in XeLaTeX.

The solution is to convert the EPS file to PDF and to include the latter:

epstopdf --hires --outfile=imgA.pdf imgA.1 
share|improve this answer
add comment

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.