Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I compile with LaTeX + dvips, I get the following warning message:

Package hyperref Warning: You have enabled option `breaklinks'.  
(hyperref)                But driver `hdvips.def' does not suppport this.  
(hyperref)                Expect trouble with the link areas of broken links.  

Right now, I am using the report document class and call the hyperref package with the following commands (I am using MikTeX 2.9 and WinEdt 7.0 on Windows 7)

\usepackage[breaklinks]{hyperref}  
\usepackage[hyphenbreaks]{breakurl}

The document compiles (using LaTeX+dvips) and the links spanning two lines appear to break correctly, but I receive the warning message. Is this a problem? How can I fix it? I tried to add the following package and compile using pdflatex (instead of LaTeX + dvips)

 \usepackage[pdf]{pstricks} 

but it produced the following warning message:

 >>> Loading package auto-pst-pdf <<<  

 Package pstricks Warning: ************************************ 
 (pstricks)                Option pdf needs a "pdflatex -shell-escape <file>" 
 (pstricks)                or a "pdflatex -enable-write18 <file>" 
 (pstricks)                (if you are using MikTeX) 
 (pstricks)                ************************************.  

I also get the following error, which prevented me from being able to compile with pdflatex:

 Package ifplatform Warning: 
     shell escape is disabled, so I can only detect \ifwindows  

 ! Package auto-pst-pdf Error:
     "shell escape" (or "write18") is not enabled:
     auto-pst-pdf will not work!

Alternatively, I tried using the epstopdf package (and compiled with pdflatex), but that package is not compatible with the psfrag package. I am looking for a way to fix the breaklinks warning message (see above), without losing the ability to use eps figures and the psfrag package.

share|improve this question
2  
You need to compile using pdflatex, otherwise this won't work (see Hyperref link spanning two lines and Link text doesn’t break at end line). Is there a reason (or requirement) for using dvips? –  Werner Apr 2 '12 at 18:52
    
I use eps figures. –  richtera Apr 2 '12 at 18:58
3  
use pdflatex, and eps-figures-with-pdflatex –  cmhughes Apr 2 '12 at 19:44
4  
You're using conflicting declarations: if you use latex+dvips you mustn't load pstricks with the pdf option. Load the package breakurl after hyperref for being able to break URLs. However, switching to pdflatex by converting EPS files to PDF (which can be done automatically with the epstopdf package and the option --shell-escape to pdflatex) is better. –  egreg Apr 3 '12 at 12:16
    
My understanding is that epstopdf can not handle psfrag –  richtera Apr 3 '12 at 12:19
show 2 more comments

1 Answer

up vote 5 down vote accepted
+50

As you load the breakurl package you can safely ignore the warning message issued by the hyperref package. It’s the dedicated purpose of the breakurl package to enable breakable URL links in case of the traditional DVI→PS→PDF document generation path supported by the hdvips output driver. If you want to get rid of the redundant hyperref warning message omit the breaklinks option, i.e.,

\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}

or use the silence package:

\usepackage{silence}

\WarningFilter{hyperref}{You have enabled option `breaklinks'.}

\usepackage[breaklinks]{hyperref}
\usepackage[hyphenbreaks]{breakurl}

If you choose to switch from the DVI mode to the PDF mode of pdfTeX there will be no hyperref warning message and you won’t need the breakurl package since the hpdftex output driver is capable of breaking URL links itself. In this case, however, you additionally have to load a support package such as the pstool package facilitating the usage of psfrag features in the PDF mode of pdfTeX. Moreover, you probably have to enable the \write18{...} construct, e.g. by passing the appropriate command-line option (-shell-escape in TeX Live/Linux) to the pdflatex program. A little example (You need an EPS file pi.eps containing the tag pi):

%% LaTeX master file test.tex: Process with pdflatex -shell-escape test.tex.

\documentclass{article}

\usepackage{pstool}

\usepackage{hyperref}

\begin{document}

\begin{figure}
  \centering
  %% Include pi.eps and replace the tag ‘pi’ with π.
  \pstool{pi}{\psfrag{pi}{\(\pi\)}}
\end{figure}

\noindent
\parbox{3cm}{\raggedright\url{http://tex.stackexchange.com}}

\end{document}
share|improve this answer
    
Can you please post a working example of the packages/options that are needed for pdf mode with the psfrag package? –  richtera Apr 11 '12 at 11:59
    
Can you also explain why the warning message is issued and how the breakurl fixes the problem? This would be helpful for others who run into the same problem. –  richtera Apr 11 '12 at 12:01
    
@richtera: I’ve upgraded my answer. –  mhp Apr 11 '12 at 22:13
    
I tried using the silence package and the warning filter you suggested, but it did not work. –  richtera Apr 12 '12 at 14:36
    
@richtera: With the TeX Live 2009 and current versions of the hyperref and silence packages, it works at least. –  mhp Apr 13 '12 at 6:12
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
http://tex.stackexchange.com/questions/50490/hyperref-package-breaklinks-option
tex.stackexchange.com
crawl=CC-MAIN-2014-15
76599
application/http; msgtype=response
sha1:7QYSPMIVI2WHGIO7MYS4HG2MK2RQN7MZ
<urn:uuid:d5092c5f-730f-472f-85e7-579a6b105222>
2014-04-21T05:14:24Z
198.252.206.140
sha1:F25GJJQOE63E32VEKRLQKXVBVWCE7BQJ
<urn:uuid:504cbf63-80f7-4552-9996-81123220b9a6>
http://tex.stackexchange.com/questions/50490/hyperref-package-breaklinks-option
response
<urn:uuid:8050f1bb-be72-408a-b8d3-3ce1ea5a7847>
robots: classic
hostname: ip-10-147-4-33.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2014-15
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for April 2014
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf