0

In writing my resume, I have found \hypersetup{baseurl=url} to be quite handy. For example, I could just define my GitHub homepage as the base URL and write \url{helloworld} to have it automatically point to the project page while showing only the project name on paper. On the other hand, I could also define the DOI homepage as the base URL and write ##.####/xxxxxx and have a valid DOI link. The problem is I can't do both in one document.

According to the hyperref package documentation:

\hyperbaseurl{URL}
A base URL is established, which is prepended to other specified URLs, to make it easier to write portable documents.

From the description, it seems I just have to use this user macro, but it didn't work.

How do I achieve what I want without resorting to hacks like this? Am I just misunderstanding something and using the macro wrongly?

Gao
  • 235

1 Answers1

2

The base URL is a global property of the PDF file and is written in the document's catalog object. Therefore, it cannot be changed locally.

There are packages like doi or doipubmed that provide a \doi macro.

Heiko Oberdiek
  • 271,626