Text Formattingpackages url, hyperref and multicolumn incompatible

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
reusser
Posts: 2
Joined: Fri May 28, 2010 5:23 pm

packages url, hyperref and multicolumn incompatible

Post by reusser »

While the following document works perfectly well:

Code: Select all

\documentclass[a4paper,twocolumn,11pt,fleqn]{book}
\usepackage{multirow}
\usepackage{url}      
\begin{document}
\chapter{a}
Some text and then the url \url{https://co-public.lboro.ac.uk/cocwd/HydroTest/Details.html}
should be broken
\end{document}
adding hyperref breaks the linebreak of the url

Code: Select all

\documentclass[a4paper,twocolumn,11pt,fleqn]{book}
\usepackage{multirow}
\usepackage{url}      % Breaks urls across multiple lines
\usepackage{hyperref}
\begin{document}
\chapter{a}
Some text and then the url \url{https://co-public.lboro.ac.uk/cocwd/HydroTest/Details.html}
should be broken
\end{document}
Any idea about how to use the functionality of all three packages?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: packages url, hyperref and multicolumn incompatible

Post by frabjous »

There's no need for the url package if you're using hyperref.

Anyway, your second example works fine for me if processed (as is) with pdflatex. There's only a problem if processed with latex. I tried adding the breaklinks option for hyperref, but it didn't seem to help. If you can process with pdflatex, I'd suggest that. If not, perhaps someone else will have a better idea.
reusser
Posts: 2
Joined: Fri May 28, 2010 5:23 pm

packages url, hyperref and multicolumn incompatible

Post by reusser »

Thank you frabjous. You are right, url is not necessary and the problem also exists for me (with latex and dvi on debian lenny) when not using multicolumn at all, even though breaklinks is set to TRUE.

So, apparently I'm using the wrong driver for hyperref, since it is actually supposed to work according to the hyperref documentation. I haven't been able to find the right driver to get the expected results.

pdflatex works for me. I had to convert all the graphics to pdf and worte a little bash script that does the job for me with graphics in various sub directories and using the graphicspath option for the graphicx package. Maybe it is useful for somebody else as well:

Code: Select all

#!/bin/bash

#obtain information about graphic file names from various tex files:
filelist=`grep includegraphic *.tex | sed "s/.*{\([^}]*\)}.*/\1/"`

for i in $filelist
do
        #search in subdirectories (including links -L option)
        #for .ps or .eps with this name
	file=`find -L | grep $i.e*ps`
	for thefile in $file
	do
                #convert the file
		echo  $file
		epstopdf $file
	done
done
Post Reply