15

I'm using soul to letterspace headings in a Hungarian document and compiling it with lualatex.

For some reason soul drops some of the accented letters at the end of a word, but not all. In the example below, only ő and ű are affected:

\documentclass{minimal}
\usepackage{fontspec}
\setmainfont[Ligatures = TeX]{TeX Gyre Pagella}
\usepackage{soul}
\begin{document}
\noindent
\so{áll llá ÁLL LLÁ}\\
\so{íll llí ÍLL LLÍ}\\
\so{űll llű ŰLL LLŰ}\\
\so{őll llő ŐLL LLŐ}\\
\so{üll llü ÜLL LLÜ}\\
\so{öll llö ÖLL LLÖ}\\
\so{úll llú ÚLL LLÚ}\\
\so{óll lló ÓLL LLÓ}\\
\so{éll llé ÉLL LLÉ}
\end{document}

sample letters

4

1 Answer 1

14

The problem is in the font used for testing hyphenation. If you add

\makeatletter
\let\SOUL@tt\relax
\newfontface{\SOUL@tt}{FreeMono}
\makeatother

after loading soul the problem seems to disappear. It probably won't show again characters that are not in the \SOUL@tt font.

Full code:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures = TeX]{TeX Gyre Pagella}
\usepackage{soul}
\makeatletter
\let\SOUL@tt\relax
\newfontface{\SOUL@tt}{TeX Gyre Cursor}
\makeatother

\begin{document}
\noindent
\so{áll llá ÁLL LLÁ}\\
\so{íll llí ÍLL LLÍ}\\
\so{űll llű ŰLL LLŰ}\\
\so{őll llő ŐLL LLŐ}\\
\so{üll llü ÜLL LLÜ}\\
\so{öll llö ÖLL LLÖ}\\
\so{úll llú ÚLL LLÚ}\\
\so{óll lló ÓLL LLÓ}\\
\so{éll llé ÉLL LLÉ}
\end{document}

enter image description here

1
  • Of course, a better method would be to use microtype for such a job.
    – egreg
    Nov 30, 2022 at 10:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .