[Tex/LaTex] LuaLaTeX: german special character ß with `newpxtext`

font-encodingsfontsluatex

I use the font Palatino from the package newpxtext in combination with LuaLaTeX. With this package it is not possible to set the german special character ß directly:

% Magic comments for TeXstudio
% !TeX spellcheck = de_DE
% !TeX program = lualatex

\documentclass{scrartcl}

%\usepackage{fontspec}
% Font: Palatino
\usepackage{newpxtext}

\begin{document}

Draußen währt am längsten.

Drau\ss en währt am längsten.

\end{document}

The result from the MWE is: DrauSSen währt am längsten.. It works when I switch to fontspec.

How is it possible to use the sign ß instead of \ss to set a text?

Best Answer

You can make the ß active and define it:

\documentclass{scrartcl}
\usepackage{newpxtext}
\catcode`\ß=13
\defß{\ss}
\begin{document}

Draußen währt am längsten.

Drau\ss en währt am längsten.

\end{document}

That's more or less what luainputenc does. But it is much better to use fontspec instead:

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella} %palatino clone

\begin{document}
Draußen währt am längsten.
\end{document}
Related Question