2

This question is similar, but applies only to XETEX.

In LuaTEX, \prehyphenchar and \posthyphenchar supposedly affect the current language:

All languages start out with \prehyphenchar=`\-, \posthyphenchar=0, \preexhyphenchar=0 and \postexhyphenchar=0. When you assign the values of one of these four parameters, you are actually changing the settings for the current \language, this behaviour is compatible with \patterns and \hyphenation.
(LuaTEX Reference v1.0.7, section 4.4)

However, after changing \addfontfeature, both of those reset to the defaults. Can the hyphenation characters be made permanent? How?

\documentclass[a4paper]{article}
\pagestyle{empty}
\setlength{\textwidth}{17em}

\RequirePackage{lipsum}

\RequirePackage{fontspec}
\setmainfont{cmunrm.otf}

\RequirePackage{polyglossia}
\setmainlanguage{english}
\addto\captionsenglish{\prehyphenchar=`¶ \posthyphenchar=`¶}
\prehyphenchar=`¶ \posthyphenchar=`¶

\begin{document}

\begin{english}
\lipsum*[1]\par
{\addfontfeature{Path}---any feature: hyphen reset---}\par
\lipsum*[1]\par
\end{english}

\end{document}

PDF output

  • fontspec (re)set the values in \__fontspec_init:. Imho this is wrong for luatex, as there the values are tied to languages and not fonts. Open an issue in the github repo of fontspec. – Ulrike Fischer Jan 1 at 17:41
  • I created an issue here. – svenper Jan 1 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.