10

I encountered the following problem while preparing my CV. There are a few links prepared by hyperref that are not broken in several lines. I am wondering if there is a way to fix this problem. This is a minimal working example:

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage[left=1.8in,right=1.8in,top=0.6in,bottom=0.6in]{geometry}

\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}

\usepackage{hyperref}

\definecolor{linkcolour}{rgb}{0,0.2,0.6} 
\hypersetup{colorlinks=true,
breaklinks=true,
urlcolor=linkcolour,linkcolor=linkcolour,
citecolor=NavyBlue}

\begin{document}

\begin{itemize}

\item A.~M.~Aragón, S.~Soghrati, and P.~H.~Geubelle. In-plane deformation effect on the cohesive failure of heterogeneous adhesives: a multi-scale analysis based on a 3D generalized finite element scheme, \emph{Journal of the Mechanics and Physics of Solids}, Published online; doi: \href{http://dx.doi.org/10.1016/j.jmps.2013.03.003}{http://dx.doi.org/10.1016/j.jmps.2013.03.003}

\item A.~M.~Aragón, S.~Soghrati, and P.~H.~Geubelle. In-plane deformation effect on the cohesive failure of heterogeneous adhesives: a multi-scale analysis based on a 3D generalized finite element scheme, \emph{Journal of the Mechanics and Physics of Solids}, Published online; doi: \url{http://dx.doi.org/10.1016/j.jmps.2013.03.003}

\end{itemize}

\end{document}

The result of this code is as follows:

enter image description here

Also, is there a way to use bibtex entries in the middle of a document as they show up in the end of an article? I need to put a list of publications and the only way I managed to do this is just writing regular text to mimic the bibtex entries.

aaragon
  • 3,041
  • For in-text bibtex entries, you should look at biblatex and its \fullcite commands. It should also provide a workaround to the previous problem, since you can use the \url field in the .bib entry. – T. Verron May 01 '13 at 09:30
  • Hi Verron, thanks for your answer. I'm interested in making this fullcite environment to work. Do you have a nice reference for it? – aaragon May 01 '13 at 13:18
  • The biblatex manual is by itself an excellent reference, although "too much for the job". For more specific tutorials, you can have a look at the questions tagged biblatex on this site, and in particular this one to get started: http://tex.stackexchange.com/questions/5091/what-to-do-to-switch-to-biblatex – T. Verron May 01 '13 at 13:34
  • I'm trying to make the fullcite approach to work, and for some reason I can't. I just posted to get some help on this issue. – aaragon May 01 '13 at 13:36
  • Very compliments for your question. – Sebastiano Oct 26 '17 at 20:18

1 Answers1

11

The second argument of hyperref is treated (and hyphenated) like normal text - you would e.g. also get an error if you used an underscore. If you want that hyperref treats it as url use \nolinkurl:

\href{http://dx.doi.org/10.1016/j.jmps.2013.03.003}{\nolinkurl{http://dx.doi.org/10.1016/j.jmps.2013.03.003}}
Ulrike Fischer
  • 327,261
  • 1
    Also the text can be different: \href{http://dx.doi.org/10.1016/j.jmps.2013.03.003}{\nolinkurl{10.1016/j.jmps.2013.03.003}} gets 10.1016/j.jmps.2013.03.003 in the text as DOI identifier, but it is linked with the full URL. – Heiko Oberdiek May 01 '13 at 10:32
  • Thanks for posting your solution Ulrike. Even though it works, it does also change the font of the link and makes it as the send link in the figure above. Is there a way to avoid this? – aaragon May 01 '13 at 13:34