I would like to break an URL in my source file, using the \href command as follows:

 {data availibility}

where "data availibility" should appear in the PDF file, bearing (pointing to) the underlying URL. I tried using the \sloppy command, but the link is dead due to an extra whitespace. Could you please help me how to solve this problem?


1 Answer 1

{data availibility}

Does this solve your problem?

You can't have a space between the curly brackets or in this URL, as this is not a way either the command or the URL can be recognized. % makes LaTeX ignore the space.

Alternatively, \href{http://www.nature.com/authors/policies/data/data-availability-statements-data-citations.pdf}{data availibility} would be the standard way to go about this.

  • You can't suppress spaces with % in an url. Commented Feb 21, 2020 at 13:30
  • But the line break seems to be ignored in this href here, for me the hyperref works with % in this example, and doesn't without %.
    – TivV
    Commented Feb 21, 2020 at 13:55
  • Hm. You are right, it actually ignores the one at the end. Commented Feb 21, 2020 at 15:03

You must log in to answer this question.

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