TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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}
share|improve this answer

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

share|improve this answer
    
This doesn't reference \href at all – Adam_G 4 hours ago
    
@Adam_G - I modified for the case of href. Please see my edit. – AboAmmar 3 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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