I have a named link within my document. I want to allow line breaks of the text at an arbitrary position, preferred at some common know position but if it won't work out than at any kind of position.

While for the \url command there are some packages out (e.g. xurl) I haven't found a solution when using \hyperlink.

\usepackage[margin=2.5cm, showframe]{geometry}
    "DejaVu Sans:mode=harf",
\setmainfont{Liberation Sans}
\usepackage[pdfa, unicode, breaklinks]{hyperref}
The labour participation rate in my own country is estimated to be 99.9\% in 2019 (%
\hyperlink{abc}{ILO/CSO/KRSO 2020})\newline
The labour participation rate in my own country is estimated to be 99.9\% in 2019 (%
\url{ILO/CSO/KRSO 2020})\newline

\hypertarget{abc}{sample anchor text}

enter image description here

I'm using lualatex 1.17.0 with hyperref 2023-02-07 v7.00v.

  • that is simply text, so everything that allows a line break works, e.g. {ILO/CSO/KR\hspace{0pt}SO 2020}. Jan 16 at 18:30
  • Well then I need to take care on my own. Isn't there an automatic solution similar to xurl?
    – LeO
    Jan 16 at 19:05
  • there are various packages around to split a string at some arbitrary place see e.g. tex.stackexchange.com/q/324042/2388 or tex.stackexchange.com/a/595035/2388. It depends a lot on what you actually want and which chars will be in your string (e.g. non-ascii will not work well with url-like commands.) Jan 17 at 9:40
  • @UlrikeFischer: Thank you for the various links you've sent. I finally found the tex.stackexchange.com/a/422570/48642 which fits best since I have as well arbitrary text included. I was not aware that this might have an influence. Thx very much again!
    – LeO
    Jan 18 at 12:08

1 Answer 1


You can use the same line breaking as \url for example

\hyperlink{abc}{\path{ILO/CSO/KRSO 2020}})

\path is like \url but doesn't make a link. By default it uses \texttt but as with \url you can specify the font to use, by default it's defined via


  • Ahhh... Thx... I'll try tomorrow - this sounds promising ☺️
    – LeO
    Jan 16 at 19:39
  • After trying many different approaches I have to admit I'm getting lost between different solutions. Using the path command solves somehow the problem but opens others. First of all the whitespace - but this could be handled with the option of obeyspaces. The other (main) problem is how to use special chars like #@%? By escaping them I can compile the TeX code but the the text has `\` included. Is there a way to resolve it?
    – LeO
    Jan 18 at 16:00

You must log in to answer this question.

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