2

Essentially, the command \href of hyperref adds ".pdf" to the url making the link useless, in addition to marking such link as a citation (I guess, from the green border).

This is particularly strange because it happens only for a specific webpage, while it does not happen with other urls, as you can see in the MWE picture following.

code-and-output

The picture is taken from an example using LuaLatex, but the same happens with standard Latex. I have tried erasing all auxiliary files, but the issue persists, as well as uninstalling hyperref from TeX Live 2020, but I cannot do that because of dependencies of other packages.

oibaFox
  • 163
  • 1
    use proper urls, starting with the protocol, e.g. https://www.google.it. – Ulrike Fischer Dec 02 '20 at 15:41
  • 1
    just as in html a link to <a href="www.google.it is not a link to the google website but a relative link to the file www.google.it in the current directory. But from a latex source where the same source might make .dvi or .pdf or .ps or .html depending on the pipeline used, hyperref guesses the final filename extension here if no extension is given and adds .pdf. This is by design not a malfunction and hyperref has always done this, it isn't a recent change. – David Carlisle Dec 02 '20 at 15:51
  • Thank you! The link works correctly adding the protocol at the beginning. I am wondering, why did everything work correctly with the other websites I have tried even though they were without the protocol too (like google and facebook in the example)? Are there specific exceptions for known websites? – oibaFox Dec 02 '20 at 15:54
  • oh, I have just read the comment of @DavidCarlisle. Thank you both. Should I delete the question then? – oibaFox Dec 02 '20 at 15:55
  • 2
    no need to delete I think. It's a reasonable question, I'll post an answer. – David Carlisle Dec 02 '20 at 15:58

2 Answers2

5

In PDF, just as in html, a link to <a href="www.google.it" is not a link to the google website but a relative link to the file www.google.it in the current directory.

But from a latex source where the same source might make .dvi or .pdf or .ps or .html depending on the pipeline used, hyperref guesses the final filename extension here if no extension is given and adds .pdf. This is by design not a malfunction and hyperref has always done this, it isn't a recent change

So .pdf is not added in your examples that end in .it simply because hyperref thinks it is a file with extension .it and doesn't add the default .pdf extension in those cases.

If by your comment you mean the link to www.google.it not only doesn't get .pdf added but works as a link, then that is your PDF browser being "kind" and interpreting the "relative URL beginning www" as "absolute URL but with the http protocol omitted" which is not impossible, browsers and email readers do that kind of thing all the time of course.

David Carlisle
  • 757,742
1

use proper urls, starting with the protocol, e.g. https://www.google.it. – Ulrike Fischer Dec 2, 2020 at 15:41 this helped me resolve the issue

its was only "www." in the beginning that was throwing the error

\href{www.linkedin.com/in/xxxx-xxxx/}{\seticon{faLinkedin}

but i replace that with 'https://' , i even tried 'https://www.' and that worked as well

\href{https://linkedin.com/in/xxxx-xxxx/}{\seticon{faLinkedin}