In the lualatex-doc I am reading under "switching from LaTeX to LuaLaTeX":
- Don’t load
inputenc
, just encode your source in UTF-8. - Don’t load
fontenc
, but loadfontspec
. - Don’t use any package that changes the fonts, but use
fontspec
’s commands instead.
Consider the following example:
% !Mode:: "TeX:UTF-8"
\documentclass[paper=a4]{scrartcl}
\usepackage{fontspec}
\usepackage{lmodern}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
Hellöö! ßßäü
\end{document}
It compiles perfectly fine and looks as desired with lualatex from TeXLive 2012. It is in agreement with points (1) and (2) from the list above. However, I am wondering:
- Doesn't
\usepackage{lmodern}
violate point (3) from above?
If yes:
- What would be the LuaLaTeX way of using
lmodern
? - Why does it work then? In which cases is this expected to break?
I just took lmodern
as an example, the question applies to all such kinds of font packages.
fontspec
uses Latin Modern by default (the OpenType version), but you can also load it manually like any other font:\setmainfont{Latin Modern Roman}
etc.