10

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?

Dirk
  • 2,728

2 Answers2

11

Which input encoding are you using? If you don't use fontspec, whatever the input encoding is you must indicate it to LuaLaTeX. E.g. if your editor is configured with utf8-unicode, you must insert the line

\usepackage[utf8]{luainputenc}

in the preamble of your program. In that case your file works perfectly for me.

Franck Pastor
  • 18,756
  • Thanks for your hint to luainputenc. I always use utf8. However, I thougth one has to use utf8 with LuaLaTeX. That is the reason I did not mentioned it. – Dirk Feb 04 '14 at 13:44
  • 3
    You only have to enter your code in utf8 if the fontspec package is loaded (which is recommanded). Otherwise you may use any encoding you wish, you only have to specify it to LuaLaTeX via the luainputencpackage. That's the way to go if you want to import old 8-bits-encoded documents to LuaLaTeX. – Franck Pastor Feb 04 '14 at 14:30
9

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}
Ulrike Fischer
  • 327,261