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.

For my documents, I have often used the mathpazo package combined with microtype and have found the result to be really good. Because now I need to create PDFs which contain a variety of diacritics and which should be easy to copy from, I have decided to use LuaTeX with TeX Gyre Pagella.

Initially I had difficulty getting microtype to work, but thanks to Alabay's answer in How to set-up LuaTeX, Microtype, with Minion Pro, Myriad Pro I have made it. Still, I'm struggling with protrusion settings.

Given the following code:

\documentclass[a4paper, 12pt, oneside, article]{memoir}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\newfontfeature{Microtype}{protrusion=default;expansion=default;} 
\setmainfont[Microtype,Numbers=OldStyle]{TeX Gyre Pagella}
\usepackage{microtype}
\usepackage{blindtext}
\begin{document}
\blindtext
\end{document}

LuaTeX produces this: Protrusion in TeX Gyre Pagella -- LuaTeX

I must say I don't quite like the fact that the punctuation marks protrude so far from the margin. Is there a way I can change the default settings? I have tried to do this in various ways (e.g. by changing factor in microtype), but to no success. Ideally, I would like to get a similar result as when I run pdfTeX with mathpazo:

Protrusion of mathpazo -- pdfTeX

Another (but related) thing is setting expansion for TeX Gyre Pagella. Can I do it, and if so, how?

share|improve this question

1 Answer 1

up vote 12 down vote accepted

You can change the default factor like this (5 is not a sensible value but shows the effect quite good:

\documentclass[a4paper, 12pt, oneside, article]{memoir}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\newfontfeature{Microtype}{protrusion=default;expansion=default;}

\directlua{fonts.protrusions.setups.default.factor=5}
\setmainfont[Microtype,Numbers=OldStyle]{TeX Gyre Pagella}
\usepackage{microtype}
\usepackage{blindtext}
\begin{document}
\blindtext
\end{document}

For a more fine grained change you should copy the default table from otfl-font-dum.lua (fonts.protrusions.setups['default']). Move it to e.g. prottest.lua, change default to test, adapt the values and then use it like this:

\directlua{require("prottest.lua");}
\newfontfeature{Microtype}{protrusion=test;expansion=default;}

(I didn't test this recently so I'm not sure if this still works.)

share|improve this answer
    
Brilliant! Thank you so much! :) I have written 0.5 as the factor and the document already looks a whole lot better. Thanks to your code, it has also been easy to find a way of manipulating expansion – e.g. by writing \directlua{fonts.expansions.setups.default.stretch=1.5}. Now I'm happy with these basic changes, but might need the fine-tuning in the future, so I'm grateful for the additional information, too. –  jemp Mar 15 '12 at 18:34

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.