Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the hyperref package in my document to provide hyperlinks to external documents. However, I don't want to have the links coloured or underlined, because I find this usually ugly and distracting. What I would rather like is a little symbol beside the link text to provide a small hint for the reader that there is something clickable. What I have in mind is something like the little symbol constisting of a small square and an arrow you can find e.g. in Wikipedia for external links. Is there any package or font that provides such a symbol or do I have to brew one myself?

share|improve this question
1  
Have a look at symbols_a4.pdf if you can find a suitable symbol and define your own command which prints the symbol and the hyperlink. If you don't find a symbol you need to define your own symbol, e.g. with TikZ. –  Uwe Ziegenhagen Feb 22 '13 at 16:43

3 Answers 3

In addition to Svend Mortensen’s answer, too long for a comment.

For Xe(La)TeX or Lua(La)TeX see also update below.

If you already set a document with a lot of \hrefin it, you also can redefine the hrefcommand by copying the original macro to a new one with \let (works here, but not in every case!), see my example.

Note, that I used a dedicated hyperref option for hiding the links. I also show some symbols from two dingbat fonts. Fonts of this type should be in general the most useful for your need.

\documentclass{article}

\usepackage{bbding,pifont} % two dingbat fonts

\usepackage{graphicx} % "graphics" would be enough for the minimal example

\usepackage[hidelinks]{hyperref}

% Redefinition:
\let\orighref\href
\renewcommand{\href}[2]{\orighref{#1}{#2}\,\ArrowBoldUpRight} %bbding
% the same with symbol included in link:
% \renewcommand{\href}[2]{\orighref{#1}{#2\,\ArrowBoldUpRight}}

% Examples:
\newcommand{\hrefa}[1]{\orighref{http://example.com/}{#1}\,\scalebox{0.75}{\ArrowBoldUpRight}} %bbding
\newcommand{\hrefb}[1]{\orighref{http://example.com/}{#1}\,\ding{230}} %pifont
\newcommand{\hrefc}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{http://example.com/}{#1}} %bbding
\newcommand{\hrefd}[1]{\scalebox{1.3}{\raisebox{-0.3ex}{\ding{43}}}\,\orighref{http://example.com/}{#1}} %pifont
\newcommand{\hrefe}[1]{\scalebox{0.8}{\raisebox{-0.5ex}{\HandRightUp}}\,\orighref{http://example.com/}{#1}} %bbding
\newcommand{\hreff}[1]{\ding{226}\,\orighref{http://example.com/}{#1}} %pifont
\newcommand{\hrefg}[1]{\ding{238}\,\orighref{http://example.com/}{#1}} %pifont
% the last with symbol included in link:
% \newcommand{\hrefg}[1]{\orighref{http://example.com/}{\ding{238}\,#1}} %pifont

\begin{document}

\hrefa{link A}, \hrefb{link B},

\hrefc{link C}, \hrefd{link D}, \hrefe{link E}, \hreff{link F}, \hrefg{link G}

\end{document}

LaTeX example output


Update:

Bad timing – shortly after writing of this answer a new package fontawesome was released. For Xe(La)TeX or Lua(La)TeX users this package “grants access to 249 web-related icons provided by the included Font Awesome free font” (cite from documentation abstract). One of them is the symbol for external links accessible with \faicon{external-link} or \faExternalLink:

% Compile with LuaLaTeX or XeLaTeX
\documentclass{article}
\usepackage{fontawesome}
\usepackage[hidelinks]{hyperref}

% Redefinition, symbol included in link:
\let\orighref\href
\renewcommand{\href}[2]{\orighref{#1}{#2\,\faExternalLink}}

\begin{document}
\href{http://example.com}{example web site}
\end{document}

LuaLaTeX/XeLaTeX output example

share|improve this answer

Maybe thw following is useful.

Code

\documentclass{article}

\usepackage{bbding}
\usepackage[pdfborder={0 0 0}]{hyperref}

\newcommand*\link[2]{%
  \href{#1}{#2}\,\raisebox{-1pt}{\footnotesize\FourStarOpen}%
}

\begin{document}

Click \link{http://www.latex-project.org/}{here} to go to the webpage.

\end{document}

or

\documentclass{article}

\usepackage{bbding}
\usepackage[pdfborder={0 0 0}]{hyperref}

\newcommand*\link[2]{%
  \href{#1}{#2}\,{\scriptsize\FourStarOpen}%
}

\begin{document}

Click \link{http://www.latex-project.org/}{here} to go to the webpage.

\end{document}

Output (for the first MWE)

enter image description here

share|improve this answer

Another idea:

\documentclass{standalone}
\usepackage{txfonts}
\usepackage{graphicx}
\def\xLink{$\!\vcenter{\hbox{\rotatebox{45}{$\DiamondRight$}}}\!\!$}
\begin{document}
See Wikipedia\xLink\ for details about this logo.
\end{document}

Result

share|improve this answer

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.