7

Here is a minimal reproducible example:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[magyar]{babel}
\begin{document}
Árvíztűrő tükörfúrógép.
\end{document}

Compiling this results in a Please use \usepackage[latin2]{inputenc} or \usepackage[utf8]{inputenc} with \usepackage[magyar]{babel} warning.

An earlier question addressed this, but I still receive this warning, despite the fact that I've the newest magyar.ldf in my texmf tree (1.5c) and I've positively verified that it contains the bugfix mentioned there (\def\magyar@sugg@ie@low#1\@inpenc@undefined@#2#3\vfuzz#4{%).

3 Answers 3

4

The newest magyar.ldf (as of this week) on CTAN doesn't display this warning anymore.

I can confirm that \usepackage[utf8]{inputenc} is a harmless no-op in new versions of latex, pdflatex and lualatex. (I've just tried it with TeX Live 2018 on Linux.)

\usepackage[utf8]{inputenc} makes a difference in old versions of latex and pdflatex: without it non-ASCII letters don't show up. (This happens in TeX Live 2016 and probably also in TeX Live 2017.)

My recommendation is to keep using \usepackage[utf8]{inputenc} for compatibility with older versions of latex and pdflatex.

8

Starting from the 2018-04-01 release, LaTeX directly supports UTF-8, so the instruction \usepackage[utf8]{inputenc} does nothing apart from loading inputenc. In particular, utf8.def is not loaded, which makes magyar.ldf that no support for UTF-8 exists.

This should be addressed by the maintainer of magyar.ldf.

In the meantime, you can avoid the spurious warning:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc} % not needed with LaTeX 2018-04-01 or later

\def\magyarOptions{defaults=hu-min,suggestions=no}
\usepackage[magyar]{babel}

\begin{document}

Árvíztűrő tükörfúrógép.

\end{document}

A different strategy is to keep the same setup as before, but adding a command at the beginning.

\UseRawInputEncoding
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\def\magyarOptions{defaults=hu-min}
\usepackage[magyar]{babel}

\begin{document}

Árvíztűrő tükörfúrógép.

\end{document}

The setting to \magyarOptions is recommended in the magyar.ldf file notes.

6
  • 1
    You could also force the definition of \@inpenc@undefined, which is where the data comes from
    – Joseph Wright
    Commented Aug 19, 2018 at 9:34
  • @JosephWright Yes, but since the suggestions are useless anyway, the suggestions=no method seems better.
    – egreg
    Commented Aug 19, 2018 at 9:39
  • FYI suggestions=no disables other, possibly useful suggestions as well.
    – pts
    Commented Oct 22, 2018 at 14:02
  • @pts Possibly they can be reinserted with other options.
    – egreg
    Commented Oct 22, 2018 at 14:06
  • 1
    An upload of the newest magyar.ldf to CTAN is in progress. It should be available soon.
    – pts
    Commented Jan 14, 2019 at 15:37
1

use \usepackage[latin2,utf8]{inputenc} and everything should be fine.

You must log in to answer this question.

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