I'm interested in using hyperref
package to highlight links typed as href
elements, the links should be:
- Of the same colour as the remaining text (default, black)
- Underlined with single lines including spaces
- No other modifications are required in the future I would like to be able to easily change link fonts, colour or face. Ideally by changing the
hyperref
package load.
Document
% Define document class, font size
\documentclass[9pt]{extarticle}
% Tweak page margins
% Set left and right margin and compute the remaining ones
% https://www.sharelatex.com/learn/Page_size_and_margins#!#Paper_size.2C_orientation_and_margins
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm
}
% --
% Font settings using the fontspec package
% https://stackoverflow.com/a/1840608/1655567
\usepackage{fontspec}
\setmainfont{IBM Plex Sans}
% --
% Define PDF metadata and link colours
\usepackage{xcolor}
\usepackage[pdfauthor={Person},
pdftitle={What a fancy title},
pdfkeywords={Keyword},
pdfproducer={LaTeX},
pdfcreator={xelatex},
colorlinks=false, % hyperlinks will be black
linkbordercolor=black, % hyperlink borders will be red
pdfborderstyle={/S/U/W 1} % border style will be underline of width 1pt
]{hyperref}
% --
\begin{document}
% Place details side-by-side using minipage placeholder
% https://tex.stackexchange.com/a/157246/123504
% Minipage 1
\begin{minipage}{.5\textwidth}
{\Large\textbf{ABC} \par}
\textit{abc:} 111 \textit{Email:} \href{mailto:abc.abc@abc.com}{abc.abc@abc.com}
\end{minipage}
\hspace{0.5cm}
% Another minipage
\begin{minipage}{.5\textwidth}
\textit{Search:} \href{https://www.google.com}{google.com}
\end{minipage}
\end{document}
Preview
Desired results
Desired results can be achieved with use of \underline{}
:
\textit{Search:} \href{https://www.google.com}{\underline{google.com}}
I want to arrive at the same results via the hyperref
settings, if possible.
fontspec
section is not that relevant and can be omitted. I wanted for the posted code to reflect closely my actual document. BTW, IBM Plex is free so it could be always be sourced, if desired.