15

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.

richtera
  • 1,521

1 Answers1

17

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}
mhp
  • 8,692
  • 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 06:12
  • I am still hoping that someone can shed more light on this issue, since the silence package does not seem to work with LaTeX+dvips. – richtera Jun 01 '12 at 22:28
  • @richtera: In TeX Live 2012/Debian, it works. By the way, the output driver/mode is irrelevant for the silence package. – mhp Jun 02 '12 at 17:26