2

This question already has an answer here:

I'm trying to break a url that is part of the figure's caption. I used \burl but didn't work. What can I do?

This is my main code:

\documentclass[11 pt, letterpaper, oneside, openright]{book}
\listfiles 

\usepackage[spanish]{babel} % Manejo de idiomas}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[pages = some]{background} 
\usepackage{tabularx}
\usepackage{epigraph}
\usepackage{kantlipsum}
\usepackage{nomencl}
\usepackage[acronym]{glossaries}
\usepackage{graphicx}
\graphicspath{ {imagenes/} }

\usepackage[style=ieee, backend=biber]{biblatex}
\bibliography{bibliografia}

\usepackage{hyperref}
\PassOptionsToPackage{hyphens}{url}

\usepackage{caption}
\glsenablehyper

\usepackage{tikz}
\usetikzlibrary{mindmap}

\usepackage{geometry}
 \geometry{
 letterpaper,
 left=20mm,
 right=20mm,
 top=30mm,
 bottom=30mm,
 }

\begin{document}
\include{Chap2}
\end{document}

This is my Chap2.tex code:

\begin{figure}[t]
\includegraphics[width=\textwidth]{calderacarbon.jpg}
\captionof{figure}{Diagrama de una caldera de carbón pulverizado.}
\captionsetup{font={footnotesize,it}, width=\textwidth}
\caption*{Fuente: Valvexport, Inc. \url{http://www.valvexport.com/soluciones-para-alimentacion-y-combustion-de-carbon-pulverizado.html}}
\label{fig:Calderacarbon}
\end{figure}

And this is my result:

enter image description here

Thanks for your help

EDIT: I also used \usepackage[hyphens]{url} but as I'm using {hyperref} I need to put it in the following way

\usepackage[colorlinks=false]{hyperref}
\PassOptionsToPackage{hyphens}{url}

But this doesn't work either

marked as duplicate by Werner, Johannes_B, user13907, Mike Renfro, Paul Gaborit Apr 15 '15 at 18:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Have you loaded \usepackage[hyphens]{url}? – Werner Apr 15 '15 at 17:03
  • 1
    Its not really a duplicate, as the issue was that \PassOptionsToPackage{hyphens}{url} was not executed early enough. – Karalga Apr 16 '15 at 17:31
  • @Karalga Thank you, I'm agree with you. – Juan David Apr 16 '15 at 21:45
2

You need to pass \PassOptionsToPackage{hyphens}{url} before the url package is loaded for the first time - which in your case is by biblatex. So if you change your code to:

\documentclass[11 pt, letterpaper, oneside, openright]{book}
\listfiles 
\usepackage[spanish]{babel} % Manejo de idiomas}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[pages = some]{background} 
\usepackage{tabularx}
\usepackage{epigraph}
\usepackage{kantlipsum}
\usepackage{nomencl}
\usepackage[acronym]{glossaries}
\usepackage{graphicx}
\graphicspath{ {imagenes/} }

\PassOptionsToPackage{hyphens}{url}

\usepackage[style=ieee, backend=biber]{biblatex}

\usepackage{hyperref}

it works.

Example

  • Hello friend. Please check my edit – Juan David Apr 15 '15 at 17:50
  • Could you please include a full example, including all your import packages? – Karalga Apr 15 '15 at 18:11
  • Of course, give me a moment – Juan David Apr 15 '15 at 18:11
  • 1
    Please see my updated answer above. – Karalga Apr 15 '15 at 19:42

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