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.

When I render my documents using pdfLaTeX and microtype they look fine, but when I switch to XeTeX the right edges of justified text look terrible: some lines overlfow, and hyphens look "indented". Is there a way to fix this?

share|improve this question
2  
My understanding is that the microtype package works with pdflatex and lualatex, but not (yet) with xelatex. Might you be able to switch from xelatex to lualatex? –  Mico Feb 20 '12 at 0:06
    
@Mico: I'm new to this, so, yes — I guess. Are there issues or limitations I should look for? What should I put in my code to detect lulatex? –  raxacoricofallapatorius Feb 20 '12 at 0:28
    
@Mico: FWIW, to start with, I get "letterspacing currently doesn't work with luatex. –  raxacoricofallapatorius Feb 20 '12 at 0:33
2  
Ah, I failed to mention that the official version of microtype, #2.4, only does protrusion and font expansion under lualatex. However, version 2.5, currently in advanced beta, does do a lot more, including letterspacing (for luatex >= 0.62). It's available at tlcontrib.metatex.org/cgi-bin/package.cgi/action=view/id=569. Be aware, though, that kerning and interword space adjusting is not (yet) available under lualatex, even if you use version 2.5. Finally, if you're interested primarily in letterspacing, you might want to use the letterspace package. –  Mico Feb 20 '12 at 2:07
    
As a slightly unrelated question, I'm trying to compile my document with pdftex+microtype and I want to find a nice font (I was using Linux Libertine w/ xetex), where can I find a list of microtype compatible fonts? –  s0rce Feb 20 '12 at 15:29

3 Answers 3

up vote 11 down vote accepted

It is my understanding that margin kerning does work but that font expansion doesn't.

This is one of the reasons why I'm currently using pdflatex and not XeLaTeX: OpenType support in XeTeX is very good because of the fontspec package, but XeTeX is not fully compatible with microtype.

You don't explain why you need XeTeX, so I'll explain some possible alternatives that work well with microtype.

I really like microtype (it makes your documents look great), which is why I decided to drop XeLaTeX and use pdfLaTeX. The lack of OpenType support in pdfLaTeX then forced me to implement (some) OpenType font feature selection myself. For my purposes, the mechanism works. For example, it lets me select all relevant figure features, including fractional figures, alternate glyphs, and [more]. Still the mechanism doesn't provide as good a functionality as fontspec. (The most important implementation details are described in Chapter 16 of LaTeX and Friends.)

The recently published fontaxes package also provides some more general font feature selection (mainly figure feature selection). If all you need is the extra figure features, combining pdftex, microtype, then fontaxes may be worth your while.

I really hope that some day XeTeX will be fully compatible with microtype or that fontspec will be compatible with pdftex.

share|improve this answer
2  
LuaTeX has also been suggested as an alternative, is there a reason to prefer XeTeX over LuaTeX, or over pdfLaTeX — or not to? –  raxacoricofallapatorius Feb 20 '12 at 1:49
    
@raxacoricofallapatorius PdfTeX does not support opentype fonts. Also last time I checked LuaTeX had some problems with multilingual texts, in this case XeTeX is a better alternative. –  pmav99 Jul 3 '12 at 7:21
    
I am not familiar with the procedure you propose. Since I don't have time to check it, I 'll take your word for it :). Anyway, working with XeLaTeX allows you to use unicode characters in your files and especially in math this is great (unicode-math). For those of us that don't use the Latin alphabet though, xelatex makes our life easier. –  pmav99 Jul 3 '12 at 16:26
    
We are in total aggreement! :) –  pmav99 Jul 4 '12 at 17:05

I use LuaTeX for the most part, but fall back on XeTeX if a document requires bidi.

Use TLContrib (see latex-alive.tumblr.com/post/1303450459 for concise instructions) to get the latest version of microtype. It supports protrusion in XeTeX, though not the other microtypographic features. Protrusion is already enough to fix the worst eyesores.

And if you don’t work with right-to-left languages, I think LuaTeX will meet all your needs, including the microtypographic.

share|improve this answer
    
Is there a way to detect if I'm using LuaTeX (vs. pdfTeX or LaTeX) in code — e.g., like \@ifundefined{XeTeXversion}? –  raxacoricofallapatorius Feb 20 '12 at 2:06
1  
@raxacoricofallapatorius There is at least the ifluatex package. –  Torbjørn T. Feb 20 '12 at 7:14
1  
@raxacoricoallapatorius: See tex.stackexchange.com/q/13172/5763 –  Martin Schröder Feb 20 '12 at 9:19

If you end up using LuaTeX, you could also remove microtype entirely (ref):

\pdfprotrudechars=2
\pdfadjustspacing=2
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\defaultfontfeatures{Microtype,Ligatures=TeX}

To get letterspacing, use soul (or soulutf8). Also, you can check for LuaTeX using ifluatex.

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.