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?
4 Answers
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.
-
2LuaTeX has also been suggested as an alternative, is there a reason to prefer XeTeX over LuaTeX, or over pdfLaTeX — or not to? – orome Feb 20 '12 at 01: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 03 '12 at 07: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 03 '12 at 16:26
-
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.
- 12,679
-
Is there a way to detect if I'm using LuaTeX (vs. pdfTeX or LaTeX) in code — e.g., like
\@ifundefined{XeTeXversion}? – orome Feb 20 '12 at 02:06 -
1
-
1@raxacoricoallapatorius: See http://tex.stackexchange.com/q/13172/5763 – Martin Schröder Feb 20 '12 at 09: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.
The current version (2.5a) of microtype supports protrusion. From the manual:
Note that character protrusion requires pdfTEX (version 0.14f or later), LuaTEX, or X TE EX (at least version 0.9997). Font expansion works with pdfTEX (version 1.20 for automatic expansion) or LuaTEX. The package will by default enable protrusion and expansion if they can safely be assumed to work. Disabling ligatures requires pdfTEX (≥ 1.30) or LuaTEX, while the adjustment of interword spacing and of kerning only works with pdfTEX
- 56,353
microtypepackage works withpdflatexandlualatex, but not (yet) withxelatex. Might you be able to switch fromxelatextolualatex? – Mico Feb 20 '12 at 00:06letterspacepackage. – Mico Feb 20 '12 at 02:07