pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Soul underlining gobbles some characters if --pdf-engine=xelatex

Open kopeckyf opened this issue 7 months ago • 4 comments

The usage of \ul from soul for underlining can be problematic if the PDF output is generated using XeLaTeX (even with recent releases from 2024). soul's font does not provide some characters outside the base Latin character set, like the Hungarian ő (Latin small o with double acute) or stacked diacritics like ȭ (o with tilde and macron). Stacked diacritics appear in many diverse languages around the world. These characters not available in soul will then be gobbled and erroneously removed from the output.

LaTeX's primitive \underline as well as \uline from ulem do not have these issues.

There are several solutions I could imagine:

  • Advise different LaTeX engine
  • It is possible to load ulem and soul in the same document. This way, soul could still be used for highlighting but ulem (via \usepackage[normalem]{ulem}) used for strikeout, underline, etc.
  • Find a way to load soul conditionally if highlighting in use. Also load ulem conditionally if strikeout, underlining, etc., in use

kopeckyf avatar Jun 27 '24 10:06 kopeckyf