46

A have a LaTeX paper I want to submit to the EDAS system. EDAS doesn't want papers to have links and suggests to 'remove the hyperref package from your file'. However, if I do that, my compilation breaks because of some hyperref options in my tex files (and also \url definitions, I think).

I want to keep everything as it is, and just disable the linking feature of hyperref to create a link-free version of my PDF. How can I do this?

Following the hyperref documentation I did \usepackage[draft]{hyperref}, and that seems to work. But that doesn't seem to be the official way. And I don't want to test multiple times if EDAS accepts it or not, because all authors get notified each time I submit a new version. Also, the [draft] option doesn't remove the PDF bookmarks either, which EDAS also doesn't want.

  • What do you mean by 'doesn't seem to be the official way'? – Ian Thompson Apr 25 '12 at 15:21
  • 1
    @Ian: I would expect there to be an option like \usepackage[disablelinks]{hyperref} or similar, but I scanned the documentation and didn't find such a thing. – Rabarberski Apr 25 '12 at 15:22
  • 7
    Did you try \usepackage[options]{nohyperref}? This should be a package that defines everything hyperref does, but does nothing. – egreg Apr 25 '12 at 15:26
  • @egreg: good suggestion, but compilation still fails on the \url{http://...} entries in my bibtex file (.bbl): undefined control sequence – Rabarberski Apr 25 '12 at 15:33
  • 5
    Then add \usepackage{url} – Boris Apr 25 '12 at 15:35
31

Thanks to @egreg, the recipe is

\usepackage[options]{nohyperref}  % This makes hyperref commands do nothing without errors
\usepackage{url}  % This makes \url work
  • 5
    The url package does not provide the same \url. In particular if your URL contains special characters such as _%#{}, hyperref's \url does require you to escape them with a backslash, while, with url's \url, those characters are not to be escaped. In fact with the url package any `\` in your URLs is treated as a normal character and displayed in the final PDF. – Po' Lazarus Feb 7 '13 at 10:03
  • 1
    This does not work with the xr package; external references include text and numbers instead of just the equation number. Also, the pdfauthor and pdftitle options to hyperref are not accepted in nohyperref. – Liam Jul 31 '14 at 15:11
  • With this suggestion, does \texorpdfstring{arg1}{arg2} default to arg1? – MdAyq6 Sep 11 at 0:50
20

Add the draft option to your \hypersetup:

\hypersetup{draft}

or as you already mentioned:

\usepackage[draft]{hyperref}
  • 1
    Dear downvoter, please explain why you've downvoted this answer, otherwise I'll never know what I did wrong. – juliohm May 22 '14 at 14:05
  • 2
    FWIW, I didn't down vote, but I suspect the reason for the votes is that the OP mentions exactly this solution in his question, and also that it didn't work for him. – darthbith Aug 7 '14 at 14:59
  • With the draft option, the meta data (Author, Title, Subject, Keywords) that you might have added through other options doesn't make it into the PDF. – MdAyq6 Sep 11 at 0:51
11

hyperref itself provides the NoHyper environment:

\documentclass{article}
\usepackage{hyperref}

\begin{document}
\begin{NoHyper}
...
\end{NoHyper}
\end{document}

This still creates bookmarks (listed in the "Bookmarks" navigation panel of PDF viewers). If these shall be suppressed too, add option bookmarks=false:

\documentclass{article}
\usepackage[bookmarks=false]{hyperref}

\begin{document}
\begin{NoHyper}
...
\end{NoHyper}
\end{document}
  • 1
    I think it is sometimes better than nohyperref package. nohyperref is too low-level to have \url, \autoref etc. – Leo Liu Jun 14 '17 at 7:21
  • Yes, I remember that when I tried using nohyperref, other things went broken. – AlexG Jun 14 '17 at 8:12
  • 1
    Or \AtBeginDocument{\NoHyper} for template authors. – Leo Liu Jun 16 '17 at 2:12
5

I had the same problem, however using \usepackage[options]{nohyperref} doesn't compile my \autoref links. So I used the \usepackage[draft]{hyperref} that you already mentioned and uploaded to the EDAS website, which seems to have accepted the entry. So using the [draft] option is a viable solution to part of the problem.

  • ... except that the PDF meta data doesn't get in. – MdAyq6 Sep 11 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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