0

I want to change the color of my URLs only for a particular section in my report. I assume this may need a \newcommand to modify or override \href?

I found a similar question here -> How can I define a command for urls using hyperref

And I tried the below.

\usepackage[hyperindex=true,
            bookmarks=true,
            pdftitle={}, 
            pdfauthor={Mad},
            colorlinks=true, % Set to false to disable coloring links
            pdfborder=0,
            pagebackref=false,
            plainpages=false,
            pdfpagelabels,
            pagebackref=true,
            hyperfootnotes=false,
            breaklinks=true,
            citecolor=blue,
            hidelinks]{hyperref}

\newcommand{\myhref}[2] {\hypersetup{urlcolor=blue}% \href{#1}{#2}% \hypersetup{urlcolor=magenta}% }

But this did not change the color of the hyperlink for some reason.

In general, not only color, can we change other settings in \href when we use it in different places in the same document?

Appreciate any thoughts on how this could be achieved.

Mad
  • 143
  • 4
  • You have hidelinks in your options. There's no way to turn that off, so I don't think you can use that globally if you want some links not to be hidden. (You could use it with hypersetup in a portion/group to hide the links temporarily; see here.) – frabjous Oct 01 '22 at 02:58
  • 1
    don't show only snippets, always make a small but complete example that other can use for a test. Beside this see https://tex.stackexchange.com/a/636731/2388 – Ulrike Fischer Oct 01 '22 at 07:49

0 Answers0