1

I am trying to change or disable protrusion for specific characters. However, it doesn't seem to have any effect at all.

emdash protrusion

I use Charis SIL font and for now I am trying to disable endash and emdash protrusion. I am compiling with LuaLaTeX 1.0.4 (TeXLive 2017).

\documentclass[final,11pt]{book}
\usepackage{fontspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Charis SIL}
\usepackage[factor=1000]{microtype}
\SetProtrusion
{ 
encoding = {*}
family = {*}
% family = Charis SIL
}
{ 
\textemdash = {,0},
\textendash = {,0},
% \textemdash = {,2000}, % Setting protrusion to bigger value doesn't change anything either
% \textendash = {,2000}, %
}
\begin{document}
\lipsum[1]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Uta purus quis.

Lorem ipsum dolor sit aemet, consectetuer adipiscing elit. Utea purous---

Lorem ipsum dolor sit aemet, consectetuer adipiscing elit. Utea purous\textemdash

Lorem ipsum dolor sit aemet, consectetuer adipiscing elit. Utean purousa\textendash

\end{document}

For my test case, I have tried to either disable or increase protrusion for these 2 characters, but nothing works. What am I doing wrong?

Side question: is this possible to enable protrusion only for specific characters? For example, I would want to have protrusion disabled for all fonts in all encodings, with exception of period, comma and semicolon.

Rafal
  • 1,684
  • 2
    There is a comma missing in your code after encoding = {*}. Some info about how to override settings are also here https://tex.stackexchange.com/a/124032/2388 – Ulrike Fischer Jul 07 '17 at 10:00
  • I added comma now, but it did not change the result. I saw that answer before asking my question, but I have no idea what name to use with LoadMicrotypeFile and whether it is actually required. – Rafal Jul 07 '17 at 10:06
  • When I add the command and use the 2000 values I see changes even without LoadMicrotypeFile. – Ulrike Fischer Jul 07 '17 at 10:07
  • I meant "when I add the comma". – Ulrike Fischer Jul 07 '17 at 10:17
  • 2
    Btw: When using the zero values the endash sticks in the margin not because of protrusion but because of an overfull line. You can see the warning in the log. – Ulrike Fischer Jul 07 '17 at 10:21
  • 1
    put \LoadMicrotypeFile{CharisSIL} before the \SetProtrusion command. – Robert Jul 07 '17 at 16:07
  • @Robert Thanks a lot: it wasn't working for me without \LoadMicrotypeFile{CharisSIL}. I noticed that \SetProtrusion from my MWE (with comma added) together with \LoadMicrotypeFile disables protrusion for characters not defined in \SetProtrusion command. Is this intended behaviour? – Rafal Jul 10 '17 at 07:24
  • @Robert In other words, should \SetProtrusion used together with LoadMicrotypeFile overwrite default settings for specified font set? I expected that only characters defined in \SetProtrusion would have their default values overwritten by whatever I specify. – Rafal Jul 10 '17 at 07:31
  • 1
    Yes, if you create new settings, the old settings will be overwritten. You can, however, as is explained in the answer @UlrikeFischer linked to (https://tex.stackexchange.com/a/124032/7674), load settings, which you can then modify or extend. – Robert Jul 11 '17 at 17:18

0 Answers0