I'm using luatatex 1.0.4 and I already found some solutions for breaking urls. Nevertheless I have special cases for which I didn't find a solution. My sample code looks like:
\documentclass[a4paper,11pt]{article}
\usepackage{fontspec}
\usepackage[english, ngerman]{babel}
\usepackage{hyperref}
\def\UrlBreaks{\do\/\do-\do\_\do\%} % for breaking long URLS additonally
\begin{document}
\href{http://google.com}{http://www.darinews.com/\%D8\%A7\%D8\%B2-\%D8\%B3\%D8\%B1\%DA\%AF\%DB\%8C\%D8\%B1\%DB\%8C-\%D9\%BE\%D8\%B1\%D9\%88\%D8\%A7\%D8\%B2-\%D9\%87\%D8\%A7\%DB\%8C-\%D8\%AE\%D8\%A7\%D8\%B1\%D8\%AC\%DB\%8C-\%D8\%A7\%D8\%B2-\%D9\%85\%DB\%8C\%D8\%AF\%D8\%A7\%D9\%86-\%D8\%A8\%DB\%8C\%D9\%86-\%D8\%A7/}
\end{document}
I'm aware that the sample looks somehow weird nevertheless its a good one.
My first problem I have is that the line break does not kick in. I'm aware that I should define chars for breaking long URLs.
- I tried to do so with
UrlBreaks
for the char%
but this does NOT work. - The line break works fine if I would use
\url
but than I have no idea how to specifiy the name differently from the link. - I read that the package
url
is not useful as soon as I use lualatex. Therefore I did not include it.
hyperref
url
will be loaded automatically anyway, so usually there is little point in loadingurl
if one also loadshyperref
. But this should have nothing to do with LuaLaTeX. Where did you read that? – moewe Jan 17 '19 at 15:49