In a LuaLaTeX book document with Koma Script I have two problems with Hyperref (which may are one):
sampel.bib
@online{Writ:Title,
author = {Writ, R.},
title = {Title},
date = {2005},
url = {http://www.blabliblabla.com/filefolder/folder_folder/folder/R._Schreib_AVery_-_LongTitle_That_Shoud_Have_A_Break.pdf},
urldate = {2017-08-15}}
linkwrap.tex
\documentclass[a4paper,oneside,twocolumn]{scrbook}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{german}{german-apa}
\addbibresource{sampelbib.bib}
\usepackage[dvipsnames,svgnames,x11names,hyperref]{xcolor}
\PassOptionsToPackage{hyphens,obeyspaces,spaces}{url}
\usepackage[
breaklinks=true,
allbordercolors=Maroon,
ocgcolorlinks=true,
colorlinks=true,
anchorcolor=Maroon,
citecolor=Maroon,
filecolor=Maroon,
linkcolor=Maroon,
menucolor=Maroon,
runcolor=Maroon,
urlcolor=Maroon,
linktoc=all
]{hyperref}
\makeatletter
\g@addto@macro{\UrlBreaks}{\do\/\do\-\do\_}
\makeatother
\begin{document}
\chapter{A Chapter}
Some sample text from \textcite{Writ:Title} with a link to the Chapter \ref{Too Long Reference}. \nameref{Too Long Reference} \blindtext[1]
\chapter{Another Chapter With A Too Long Text For A Nice Reference}
\label{Too Long Reference}
\onecolumn
\printbibliography
\end{document}
When creating a PDF I get this:
What do I have to change to get wrapped the url and chapter link?
Best Answer
ocgcolorlinks
option of thehyperref
package prevents links from wrapping around line and page breaks. Instead, try theocgx2
package with an improvedocgcolorlinks
implementation.It seems though, that the
apa
style has some bug related to underscores in urls. Replacing it withauthoryear
gives the following result: