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'd like to use the most modern version of the Computer Modern fonts for XeTeX [or anything newer, of course] with the FontSpec package. Currently, I'm using

\setromanfont{CMU Serif}

However, this produces odd results with certain characters, e.g. -- or ' in italic text (created with \emph), e.g. instead of '. The problem isn't there when I use Latin Modern Roman or Linux Libertine O, but [with Latin Modern Roman] foreign characters don't show up.

(Sure, Linux Libertine is beautiful, but I want something a little less classy for normal documents :). )

I'm also using polyglossia, LyX, and a small script to remove LyX output errors, if it matters. I've looked at the TeX file and it seems fine.

Edit 1

Here's a minimal example, sorry for not providing this earlier.

\documentclass{article}
\usepackage{xunicode,fontspec,xltxtra}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setromanfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\begin{document}
\emph{hello -- a'b}
\end{document}

The render I get using xelatex is this:

my xelatex render

Edit 2

Files used are here, thanks for the help all.

share|improve this question
3  
Can you make a minimal example that doesn't work for you, and add it to your question. If you make a document that just loads fontspec and sets the main font to CMU Serif does the problem arise? If yes, then there's something wrong, since such a document works for me. If not, add packages gradually to the sample document until you can reproduce the problem, and then post that example. –  Alan Munn May 9 '11 at 2:13
1  
I get the expected output with your example. You could add \listfiles to the preamble to get all packages and their versions that you have. –  Andrey Vihrov May 9 '11 at 8:05
    
Thanks both, see edit... if it's not showing up for you, don't worry about it. It's possible that the OpenSuSE TeX distro is just outdated or somehow nonstandard. –  gatoatigrado May 9 '11 at 8:16
add comment

1 Answer

Apparently this bug is caused by the mapping=tex-text option (and its Ligatures=TeX equivalent), which translates things like -- into the en-dash, and so forth. I can't seem to find any related bugs using Google...

share|improve this answer
1  
Given that you are not running an up-to-date TeXLive distribution (there are many differences between your file list and mine) it's not exactly fair to call this a bug. –  Alan Munn May 9 '11 at 10:18
    
Yes, that's very possible, thanks! I know the unicode-math package is also broken on my distro, the getnonfreefonts script is missing, etc. Hopefully things will get fixed upstream, or I'll switch to Ubuntu; thanks very much to you and everyone for helping me debug it. –  gatoatigrado May 9 '11 at 22:30
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.