4

I was wondering how I can underline and color URL in LuaLaTex. I was able to add underline but could not change the URL and the underline to blue. Font is Calibri. Thanks!

% code used in LuaLaTex

\documentclass{article}
\usepackage{fancyhdr,graphicx,xcolor,colortbl}
\usepackage{fontspec}

\setmainfont{Calibri}

\begin{document}

Further information can be found online (\underline {http://findsource.org/})

\end{document}
1
  • Please provide a working example of what you've done so far. It's hard to provide specific advice without such information.
    – Mico
    Sep 25, 2013 at 21:24

2 Answers 2

4

Try this code

\documentclass{article}
\usepackage{fancyhdr,graphicx,xcolor,colortbl}
\usepackage{fontspec}
\usepackage[colorlinks,urlcolor=blue]{hyperref}

\setmainfont{Calibri}

\begin{document}

Further information can be found online {\color{blue}\underline{\href{http://findsource.org/}{http://findsource.org/}}}

\end{document} 

It uses hyperref package with options colorlinks and urlcolor=blue.

enter image description here

1

Another try, this time redefining the \urlcommand:

\documentclass{article}
\usepackage{fancyhdr,graphicx,xcolor,colortbl}
\usepackage{fontspec}
\usepackage{hyperref}

\DeclareUrlCommand{\url}{%
    \def\UrlFont{\color{blue}\normalfont}%      Adding a little color 
    \def\UrlLeft##1\UrlRight{\underline{##1}}%  Underlining the url
    }


\setmainfont{Calibri}

\begin{document}

Further information can be found online \url{http://findsource.org/}

\end{document} 

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.