\usepackage[dvips,breaklinks=true]{hyperref}
should give me nice wrapping of urls,
if I use \url,
but it does not if I go
.tex (latex)-> .dvi (dvips)-> .ps (ps2pdf)-> pdf
Is there a way to get proper wrapping?
Thanks,
Alan Isaac
PS pdflatex does give proper wrapping; that is not
my question.
Herbert
yup; pdflatex has engine support for wrapping (that breaklinks option
only really applies to pdflatex, afaik).
the breakurl package is for _your_ problem. i've never used it
myself, so can't really vouch for it, but the faq answer i wrote, at
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=breaklinks
came from information from someone who _does_ know ;-)
note, that answer is in the faq section "why does it _do_ that?" --
you're not alone in being confused by this...
--
Robin Fairbairns, Cambridge
OK, that works well for \url,
but not for \nolinkurl. Odd?
(I thought \url was an \href
and a \nolinkurl.)
Alan Isaac
It is very odd. Not that the package doesn't affect \nolinkurl
(it wouldn't) but that \nolinkurl has no linebreaks in either case,
with or without the breakurl package. What is the url in
question?
Donald Arseneau
> On Sep 30, 12:00 pm, Alan G Isaac<alan.is...@gmail.com> wrote:
>> OK, that works well for \url,
>> but not for \nolinkurl. Odd?
On 9/30/2009 6:17 PM, Donald Arseneau wrote:
> It is very odd. Not that the package doesn't affect \nolinkurl
> (it wouldn't) but that \nolinkurl has no linebreaks in either case,
> with or without the breakurl package. What is the url in
> question?
See below.
Thanks,
Alan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{hyperref,breakurl}
\begin{document}
Fails horribly: (fill words to force wrapping) \href{http://somewhere/out/there/way/off/the/normal/length}{http://somewhere/out/there/way/off/the/normal/length}
Next, use url: (fill words to force wrapping)
\url{http://somewhere/out/there/way/off/the/normal/length}
Works beautifully.
Next use href and nolinkurl: (fill words to force wrapping)
\href{http://somewhere/out/there/way/off/the/normal/length}{\nolinkurl{http://somewhere/out/there/way/off/the/normal/length}}
This works beautifully in pdflatex, but not via dvi.
\end{document}
> Next use href and nolinkurl: (fill words to force wrapping)
> \href{http://somewhere/out/there/way/off/the/normal/length}%
> {\nolinkurl{http://somewhere/out/there/way/off/the/normal/length}}
> This works beautifully in pdflatex, but not via dvi.
It is \href that doesn't break. \nolinkurl should allow breaks when
used by itself. The \href{foo}{\nolinkurl{foo}} is just long-hand for
\url{foo} (which explains why \url{foo} does bot break -- it is the
internal \href).
Donald Arseneau as...@triumf.ca
That's what I used to think ...
> (which explains why \url{foo} does bot break -- it is the
> internal \href).
But \url wraps nicely even with latex (-> .dvi),
while the combination does NOT. Try it.
(See below.)
Alan Isaac
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{hyperref,breakurl}
\begin{document}
Illustration of a difference between \verb|\url| and the \verb|\href| \verb|\nolinkurl| c
ombination ...
These are the same with pdflatex but give \emph{different} results if we
use latex
Fails horribly: (fill words to force wrapping) \href{http://somewhere/out/there/way/off/the/normal/length}{http://somewhere/out/there/way/off/the/normal/length}
Next, use url: (fill words to force wrapping)
\url{http://somewhere/out/there/way/off/the/normal/length}
Works beautifully.
Next use href and nolinkurl: (fill words to force wrapping)
\href{http://somewhere/out/there/way/off/the/normal/length}{\nolinkurl{http://somewhere/out/there/way/off/the/normal/length}}
This works beautifully in pdflatex, but NOT via dvi.
The results are different!
\end{document}
The breakurl package redefines \url again to make multiple \href
commands, allowing line-breaks between them.
> while the combination does NOT. Try it.
> (See below.)
Your example does not contain the simple test:
\href{http://somewhere/out/there/way/off/the/normal/length}%
{simple text that should be easy to break between words}
Donald Arseneau