6

For url's, I know the bare URL can be made bold, as illustrated in this question: How to make URL bold?.

How can I do the same thing, for an entire document, for the text field of \href?

4

Redefine \href to always use \href[.]{..}{\bfseries ...}:

enter image description here

\documentclass{article}

\usepackage{hyperref}
\usepackage{letltxmacro,xparse}

\LetLtxMacro\oldhref\href
\RenewDocumentCommand{\href}{o m m}{%
  \IfValueTF{#1}
    {\oldhref[#1]{#2}{\bfseries #3}}
    {\oldhref{#2}{\bfseries #3}}%
}

\begin{document}

\href{http://tex.stackexchange.com}{\TeX.SE}

\end{document}
3

If you want all your urls bold using \href, you can redefine the \href macro by adding \bfseries to the second argument as follows:

\documentclass{article}
\usepackage{hyperref}

\let\oldhref\href
\renewcommand{\href}[2]{\oldhref{#1}{\bfseries#2}}

\begin{document}

Bold font:

\href{http://tex.stackexchange.com/}{http://tex.stackexchange.com/}

\href{http://tex.stackexchange.com/}{http://tex.stackexchange.com/}

\end{document}

enter image description here

  • This doesn't reference \href at all – Adam_G Feb 2 '17 at 1:22
  • @Adam_G - I modified for the case of href. Please see my edit. – AboAmmar Feb 2 '17 at 1:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.