3

Why do I have to use the luainputenc when every program is using UTF-8 encoding?

Example

good The way it should be

Bad Missing Characters


Tex Code // Please use lualatex

\documentclass[german]{article}
\usepackage[ngerman]{babel} 
%\usepackage{polyglossia} cannot be used: 
http://tex.stackexchange.com/questions/291425/lualatex-and-
polyglossia-with-setdefaultlanguagegerman-does-not-work-after-re

\usepackage[utf8]{luainputenc} % Please turn on and off

\usepackage[backend=biber,bibencoding=utf8]{biblatex} %biber war fehlerhaft / sorting wird verwendet damit es der Reihenfolge entpsricht
\addbibresource{biblo.bib}
\begin{document}
    Test \cite{test}
    \printbibliography
\end{document}

Bib Code // Please use biblatex and biber

@article{test,
author={Günter Frö},
title = {Wörter},
journal = {Wörter in Österreich},
year = {2013}
}
6
  • why can't you use \usepackage[utf8]{inputenc} ?
    – Runar
    Jul 3, 2016 at 17:28
  • 1
    @RunarTrollet inputenc does nothing useful with luatex. Jul 3, 2016 at 17:51
  • 1
    @DavidCarlisle I didn't realise this was a luatex-only question.
    – Runar
    Jul 3, 2016 at 17:54
  • @DavidCarlisle you mean fontspec not fontenc Jul 3, 2016 at 19:10
  • you are using classic 7bit fonts, rather than use luainputenc it would be better to add \usepackage{fontspec} and use Unicode encoded fonts Jul 3, 2016 at 19:50

1 Answer 1

4

It's not clear why using LuaLaTeX, but here it is.

\begin{filecontents*}{\jobname.bib}
@article{test,
author={Günter Frö},
title = {Wörter},
journal = {Wörter in Österreich},
year = {2013}
}
\end{filecontents*}

\documentclass{article}
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel} 

\usepackage[
  backend=biber,
  bibencoding=utf8
]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}

Test \cite{test}

\printbibliography

\end{document}

The filecontents* environment is just to make the example self-contained.

enter image description here

Why do you need luainputenc? Because you're using legacy fonts, which have no character in the slots pointed at by Unicode characters above code 127.

Otherwise, use fontspec:

\begin{filecontents*}{\jobname.bib}
@article{test,
author={Günter Frö},
title = {Wörter},
journal = {Wörter in Österreich},
year = {2013}
}
\end{filecontents*}

\documentclass{article}
\usepackage[ngerman]{babel} 
\usepackage{fontspec}

\usepackage[
  backend=biber,
  bibencoding=utf8
]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}

Test \cite{test}

\printbibliography

\end{document}

The output is essentially the same.

2
  • Thank you for your answer! After trying to figure out the difference between those two: As I understand it, fontspec seems to be in a UTF-8 editor the "better" choice, when using lualatex or Xelatex
    – TimK
    Jul 4, 2016 at 7:30
  • I need LuaLatex because of Lua Scripting
    – TimK
    Jul 4, 2016 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .