Closed NeverGameStar closed 3 months ago
It would help if you could instead post a minimum working example.
When it comes to using accents, I would strongly, strongly suggest to use XeLaTeX instead. You'll have to remove the fontenc
and inputenc
lines.
Minimum working example:
\documentclass[fontsize=12pt, oneside]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
%\usepackage{pythonhighlight} % uncomment this to fuck up the Umlaute
%\usepackage{scrhack} % uncomment this as well for "Package scrhack Warning: unknown \lstlistoflistings definition found!"-Warning
\begin{document}
\chapter{German Umlaute}
\centering
Ä and ä can also be written as Ae and ae \\
Ö and ö can also be written as Oe and oe \\
Ü and ö can also be written as Ue and ue \\
ß can also be written as ss \\
\end{document}
Using XeLaTeX is not an option for me since I use other packages that are incompatible with it. I have to use PdfLaTex...
The problem is an incompatibility with babel
.
Loading pythonhighlight
before babel
solves the problem for me.
Can you confirm?
If you do, we can close this issue. I do not know what exactly the problem is, but I am not willing to investigate since I consider pdfLaTeX
to be superseded by XeLaTeX
nowadays. Feel free to take a look, though, maybe there is an easy explanation/fix which would allow to load the packages in an arbitrary order.
Loading
pythonhighlight
beforebabel
solves the problem for me.Can you confirm?
Nope, but for me loading it at the beginning of the document (before \usepackage[utf8]{inputenc}) solves the first issue and Umlaute are displayed properly.
I therefore guess the issue is related to the \UseRawInputEncoding
command, which was pushed on March 4th, 2024.
I'd suggest to remove the command again since the reason for pushing it in the first place seemed to be an incorrect utf-8 codec implementation on the contributors behalf.
Thank you, you found the culprit! I'll remove \UseRawInputEncoding
shortly.
For completeness, here is a guide to the recent changes about LaTeX and encodings. From this document one sees that \usepackage[utf8]{inputenc}
is no longer necessary, and that \UseRawInputEncoding
is almost never useful, and should certainly never be in a package. Apologies for my oversight here.
One of the past updates to this package (within the last ~5 months) has brought up two issues:
Including \usepackage{pythonhighlight} when using a KOMA-Script class (scrreprt) in combination with: \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} will still prevent German Umlaute (ß, ä, ö, ü) from being printed properly (in the entire document). Excluding the package solves the issue.
When using the packages together with \usepackage{scrhack}, following warning is printed: "unknown \lstlistoflistings definition found!(scrhack) Maybe you are using a unsupported listings version."
Log:
Before the update, these issues were not there.