When working with LaTeXe commands integrated in German sentences many times a hyphen will be used. The problem is that this hyphen should always be a break point. LuaLaTeX unfortunately does not do that by default. To show what I mean:
as the LuaLaTeX output vs. the (correct) pdfLaTeX output:
That example would work the way I want it if you change the -
after \LaTeXe
or \href{}{}
to e.g. a \-
(then it breaks correctly).
Question: How to automatically (in the best case I do not want to change the input) convert a hyphen after a command into a hyphen which breaks, but stays if there's no break in LuaLaTeX?
\documentclass{scrreprt}
\usepackage{showframe}
\usepackage[english,main=ngerman]{babel}
\usepackage{hyperref}
\begin{document}
test test test test test test test test test test test test test test test test test \LaTeXe-Dokument test test test test test test test test test test test test test test test test test test te \href{https://en.wikipedia.org/}{\mbox{Wiki}}-Seite test test test test test test test test test test test test test test test test Test-Dokument
\end{document}
babel
shorthand"=
, not"-
.