* [[hyperref:http://www.tug.org/applications/hyperref/]] [#s8bca501]
* [[hyperref:https://ctan.org/pkg/hyperref]] [#s8bca501]

[[hyperref>CTAN:help/Catalogue/entries/hyperref.html]] パッケージは、TeX 文書(DVI、PDF など)に HTML と同じハイパーリンク 機能を加えるためのマクロです。
[[hyperref:https://ctan.org/pkg/hyperref]] パッケージは,TeX 文書(DVI、PDF など)に HTML と同じハイパーリンク 機能を加えるためのマクロです.

''目次''

#contents

** 更新履歴 [#e8ca0037]

[[ChangeLog:http://www.tug.org/applications/hyperref/ftp/ChangeLog]] を参照。
-https://github.com/ho-tex/hyperref/commits/master
-https://github.com/ho-tex/hyperref/blob/master/ChangeLog.xml
-http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/doc/latex/hyperref/ChangeLog?&view=markup
-http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/hyperref/?view=log

**注意点 [#he2b8021]
** [[PXjahyper:https://github.com/zr-tex8r/PXjahyper]] [#ve9bb11b]

***hyperref を使用するとページサイズの値がおかしくなる [#v71488f4]
-[[LaTeX で用紙サイズがおかしくなるときは:http://fugenji.org/thomas/diary/index.php?no=r683]]
[[PXjahyper:https://github.com/zr-tex8r/PXjahyper]] パッケージは (u)pLaTeX + hyperref + dvipdfmx の環境における日本語の「しおり」の作成を支援する upLaTeX, pLaTeX 用のパッケージです.
PXjahyper パッケージは TeX Live に含まれています.

以下の方法のうちのどれかを使用することで回避可能です.
*** ChangeLog [#h773478f]
-https://github.com/zr-tex8r/PXjahyper
--https://github.com/zr-tex8r/PXjahyper/commits/
-[[[texlive] Index of /trunk/Master/texmf-dist/tex/platex/pxjahyper:http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/platex/pxjahyper/]]
--[[log:http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/platex/pxjahyper/?view=log]]

-クラスオプションに papersize を指定する
 \documentclass[papersize]{jsarticle}
** 注意点 [#he2b8021]

*** hyperref を使用するとページサイズの値がおかしくなる [#v71488f4]

[[PXjahyper パッケージ:https://github.com/zr-tex8r/PXjahyper]] v0.3 以降を使用するとページサイズを正しい値に修正してくれます([[pxjahyper パッケージ:http://d.hatena.ne.jp/zrbabbler/20120528/1338221936]] を参照).

PXjahyper パッケージが使用できない場合は hyperref のオプションに setpagesize=false を指定して回避することも可能です.

-hyperref のオプションに setpagesize=false を指定する
 \usepackage[dvipdfmx,setpagesize=false]{hyperref}

jsclasses を使用している場合はクラスオプションに papersize を指定しても OK です.

***[["--"が hyperref で正しく扱われてないっぽくて,しおりが変になる:http://twitter.com/#!/t_teruya/status/99411185539100672]] [#d46c2828]
以下のように \texorpdfstring{texstring}{pdfstring} を使って pdfstring の方を8進数表記で書くことで回避可能です.
 \section{\texorpdfstring{a--b}{a\055\055b}}
-クラスオプションに papersize を指定する
 \documentclass[uplatex,papersize]{jsarticle}

''参考ページ''
-[[いつでも jsarticle と hyperref を使いたい:http://uep.ipe.media.kyoto-u.ac.jp/%E3%81%84%E3%81%A4%E3%81%A7%E3%82%82-jsarticle-%E3%81%A8-hyperref-%E3%82%92%E4%BD%BF%E3%81%84%E3%81%9F%E3%81%84/]]
-[[texliveで文字サイズがA4に収まらない。:http://zundoya.blogspot.jp/2012/03/texlivea4.html]]
-[[LaTeX で用紙サイズがおかしくなるときは:http://fugenji.org/thomas/diary/index.php?no=r683]]
-[[XeLaTeXでhyperrefを使う:http://d.hatena.ne.jp/tizz/20100429/1272567178]]
-[[hyperrefを使うとページサイズがおかしくなる:http://glsharp.blogspot.jp/2010/04/hyperref.html]]
-[[jsclassesとhyperrefを併用して卒論などを執筆するときの注意事項:http://written.4403.biz/archives/2010/02/jsclasses-hyperref.html]]

*** "--"が hyperref で正しく扱われず,しおりが変になる [#d46c2828]

[[PXjahyper パッケージ:https://github.com/zr-tex8r/PXjahyper]] を使用すれば文字化けせずに表示できるようになります.([[「PXjahyper」の検索結果 - マクロツイーター:http://d.hatena.ne.jp/zrbabbler/searchdiary?word=PXjahyper]] を参照.)

PXjahyper パッケージが使用できない場合は \texorpdfstring{texstring}{pdfstring} を使って pdfstring の方を8進数表記で書くことで回避可能です.
 \section{a\texorpdfstring{--}{\055\055}b}

*** [[hyperrefとgraphicxの組み合わせでエラー:http://ubutun.blogspot.jp/2012/12/hyperrefgraphicx_4.html]] [#g6c06203]

原因は,hyperref パッケージの colorlinks オプションを指定することで color パッケージが読み込まれるにもかかわらず,dvipdfmx オプションが渡されないことのようです。

対策は,ドキュメントクラスのオプションで dvipdfmx ドライバ指定する
 \documentclass[dvipdfmx,…]{article}
または color にも明示的に dvipdfmx オプションを指定する
 \usepackage[dvipdfmx]{graphicx,color}
が有効です。
-hyperref パッケージの color.sty 依存対策 [[forum:1606]]
-hyperref 側で対処していただきました ([[Pull Request #2:https://github.com/ho-tex/hyperref/pull/2]])


** 不具合 [#p03bc3d7]

*** [[hyperref が非 e-TeX で動かない:http://d.hatena.ne.jp/zrbabbler/20120531/1338472669]] [#fbe5149d]

[[非 e-TeX で hyperref を使うと……:http://d.hatena.ne.jp/zrbabbler/20120531/1338472669]] を参照.

2012/05/28 の oberdiek バンドルの更新でこの問題が解決されました.
詳細については上掲のリンク先を参照してください.
2012/06/13 以降の W32TeX ではこの新しい oberdiek バンドルが含まれています.

** 指定可能なオプション [#za8c61cb]

プリアンプルに \usepackage[オプション]{hyperref} として、オプションを指定します.

*** しおり(bookmark)つきのpdf文書作成 [#fe7cad10]

platex + dvipdfmx の場合は,下記のようにします.
(u)platex + dvipdfmx の場合は,下記のようにします.

 \usepackage[dvipdfmx,%
  bookmarks=true,%
  bookmarksnumbered=true,%
  colorlinks=true,%
  setpagesize=false,%
  pdftitle={LaTeX研修課程},%
  pdfauthor={ななしのごんべぇ},%
  pdfsubject={hyperref入門・演習},%
  pdfkeywords={TeX; dvipdfmx; hyperref; color;}]{hyperref}
 \usepackage{pxjahyper}

または, \hypersetup{オプション} を使用して

 \usepackage[dvips]{hyperref}
 \usepackage[dvipdfmx]{hyperref}
 \usepackage{pxjahyper}
 \hypersetup{%
  bookmarksnumbered=true,%
  colorlinks=true,%
  setpagesize=false,%
  pdftitle={LaTeX研修課程},%
  pdfauthor={ななしのごんべぇ},%
  pdfsubject={hyperref入門・演習},%
  pdfkeywords={TeX; dvipdfmx; hyperref; color;}}

とすることも可能です.

しおりを作成する場合は2回コンパイルが必要です.
\usepackage で dvipdfmx を指定してエラーが発生する場合は hyperref パッケージを最新版にアップデートしてください.

v6.75e で dvipdfmx が指定できるようになりました.
hyperref は pTeX の縦書きモードの場合にうまくいかないことがあるようです.
-[http://qiita.com/munepi/items/004d19a657d3bf2d4ded pLaTeX縦書きでhyperrefパッケージを使うときの変更点]
-[http://d.hatena.ne.jp/yayugu/20110526/1306417041 pTeXで縦書きモード時にハイパーリンクを埋め込む方法のメモ]

\usepackage で dvipdfmx を指定してエラーが発生する場合は
*** (e-)(u)pTeX の内部コードを判別して hyperref の設定を切り換える [#a2ccb2b3]

-hyperref を最新のもの (6.75e 以降のバージョン) にアップデートする
-\usepackage でオプションを dvipdfmx ではなく dvipdfm を指定する
(u)platex + dvipdfmx で,日本語を使用する場合は [[PXjahyper パッケージ:https://github.com/zr-tex8r/PXjahyper]] を使用すればしおり・タイトル等の日本語の文字化けを防止できます.

のどちらかを試してみてください.
 \usepackage[dvipdfmx]{hyperref}
 \usepackage{pxjahyper}

platex + dvips + Ghostscript (ps2pdf) の場合は,オプションを dvipdfmx ではなく dvips に変更します.
使用方法は [[hyperref で日本語しおりに endash を出す件について:http://d.hatena.ne.jp/zrbabbler/20120527/1338111080]] を参照してください.
PXjahyper パッケージが使用できない場合はプリアンブルに以下を記述しておけば,しおり・タイトル等の日本語の文字化けを防止できます.(解説は [[TeXnique を更新:http://blog.arq.name/archives/736]] を参照)
uplatex + dvipdfmx を使用する場合は CMap は [[UTF8-UTF16:http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/fonts/cmap/uptex-fonts/UTF8-UTF16?view=markup]] を使用します.補助面 (U+10000以上) の文字も使用することができます.TeX Live 2012 以降, W32TeX の場合は UTF8-UTF16 はインストール済み (texmf-dist\fonts\cmap\uptex-fonts\UTF8-UTF16) です.((あるいは[[TeX memo - upTeX:http://www.t-lab.opal.ne.jp/tex/uptex.html]] から CMap UTF8-UTF16 が入手できます.))TeX Live 2013, TeX Live 2012 で PXjahyper を使用する場合は bigcode オプションを指定することで UTF8-UTF16 が使用できます.[[TeX Live 2014 以降で PXjahyper を使用する場合は bigcode が既定になっています:http://d.hatena.ne.jp/zrbabbler/20160615/1465995071]].

hyperref は pTeX の縦書きモードの場合にうまくいかないことがあるようです.[[pTeXで縦書きモード時にハイパーリンクを埋め込む方法のメモ:http://d.hatena.ne.jp/yayugu/20110526/1306417041]]
 \ifx\kanjiskip\undefined\else
   \usepackage{atbegshi}
   \ifx\enablecjktoken\undefined
     \ifnum 42146=\euc"A4A2
       \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}}
     \else
       \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
     \fi
   \else
     \AtBeginShipoutFirst{\special{pdf:tounicode UTF8-UTF16}}
   \fi
   \usepackage[dvipdfmx]{hyperref}
 \fi

(u)platex + dvipdfmx で,日本語を使用する場合は \usepackage[dvipdfmx]{hyperref} の前に以下を追加しておけば,しおりタイトル等の日本語の文字化けを防止できます.
\usepackage[dvipdfmx]{hyperref} の前に \usepackage{atbegshi} を記述する必要があります.
\usepackage[dvipdfmx]{hyperref} の後に \usepackage{atbegshi} を記述すると PDF のタイトルが文字化けしてしまいます.

 \usepackage{atbegshi}
 \ifnum 42146=\euc"A4A2
   \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}}
 \else
   \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
 \fi
(u)platex + dvips + Ghostscript (ps2pdf) で日本語の文字化けを防止する場合は Postscript ファイルに対して convbkmk または bkmk2uni を使用します.
 \usepackage{hyperref}
 \hypersetup{%
  bookmarksnumbered=true,%
  colorlinks=true,%
  setpagesize=false,%
  pdftitle={LaTeX研修課程},%
  pdfauthor={ななしのごんべぇ},%
  pdfsubject={hyperref入門・演習},%
  pdfkeywords={TeX; dvipdfmx; hyperref; color;}}

(e)uplatex + updvipdfmx, xelatex では必要ありません.
uplatex, platex を使用してドライバオプションを指定しない場合はデフォルトでは dvips に設定されます.
指定しないとうまく動作しない場合は以下のように指定します.

platex + dvips + Ghostscript (ps2pdf) で日本語の文字化けを防止する場合は Postscript ファイルに対して convbkmk, bkmk2uni, ps2jpdf 等を使用します.
 \usepackage[dvips]{hyperref}

(e)uplatex + dvips + Ghostscript (ps2pdf) で日本語の文字化けを防止する場合は Postscript ファイルに対して convbkmk を使用します.
lualatex の場合は,hyperref のオプションに

 pdfencoding=auto

または

 unicode=true

を追加します.

 \usepackage[pdfencoding=auto]{hyperref}

lualatex の場合はドライバは自動検出されます.指定しないとうまく動作しない場合は以下のように指定します.

 \usepackage[luatex,pdfencoding=auto]{hyperref}

xelatex の場合は、指定しても指定しなくても文字化けしないしおりになります。

 \usepackage{hyperref}

xelatex の場合はドライバは自動検出されます.指定しないとうまく動作しない場合は以下のように指定します.

 \usepackage[xetex]{hyperref}

// 以前は何も指定しなくても文字化けせずにしおりが作成できていたのですが,
// W32TeX 2011-11-06 版の hyperref v6.82j で xelatex で unicode オプション
// を指定しないでタイプセットした場合,out ファイルが変換されずに出力され,
// これを xelatex で処理するとしおりが文字化けします.この場合,unicode
// オプションを明示的に指定することで out ファイルが変換され,これを
// xelatex で処理すると文字化けせずにしおりが作成できます.~
// TeX Live 2011 で hyperref v6.82j で同じ内容の TeX ファイルを処理すると
// out ファイルが変換されていなくても文字化けせずにしおりが表示できるので
// W32TeX の xelatex (xdvipdfmx) に不具合があるかもしれません.~
//
// 実は、2011-11-06 には2度の変更をしています。おそらく一度目の変更
// をしたものをお使いでしょう。一度目は Heiko さんのために、pdf string
// を UTF-16BE に変換するのを止めました。この場合、hyperref で unicode=true
// としてやる必要があります。しかし hyperref を使用しない場合、しおり作成
// が困難になりますから、Jonathan さんの意見もあり、元に戻して xdvipdfmx
// 側で UTF-16BE に変換するようにしました。この場合、unicode=true として
// おくと、xdvipdfmx を -q オプションなしで使うと warning が出ます。
// xelatex, xetex から自動的に xdvipdfmx を呼ぶ場合は -q オプションを
// 付けて呼びますから、warning は出ません。 --kakuto
//
// なるほど了解しました.
// dvipdfmx の仕様変更に合わせて xdvipdfmx も仕様を変えたのかと勘違いしていました.
// たしかに xdvipdfmx で変換しないと hyperref を使わずにしおりを作成する場合に
// フィルターを書かなければいけなくなりそうですね.
// 詳細な説明をしていただいてありがとうございます.kakuto さん.

*** オプション一覧表 [#re898c38]

|オプション|意味|指定値(太字はデフォルト)|h
|a4paper|use A4 paper|CENTER: -|
|a5paper|use A5 paper|CENTER: -|
|anchorcolor|set color of anchors|''black''|
|b5paper|use B5 paper|CENTER: -|
|backref|do bibliographical back references|true/''false''|
|baseurl|set base URL for document|空|
|bookmarks|make bookmarks|''true''/false|
|bookmarksdepth|しおりのレベル|数値または名前(sectionやsubsectionなど)を指定する。何も指定しなければtocdepthの値が使われる。|
|bookmarksnumbered|put section numbers in bookmarks|true/''false''|
|bookmarksopen|open up bookmark tree|true/''false''|
|bookmarksopenlevel|level to which bookmarks are open|''\maxdimen''|
|bookmarkstype|to specify which `toc' file to mimic|''toc''|
|breaklinks|allow links to break over lines|true/''false''|
|citebordercolor|color of border around cites|RGB値 ''0 1 0''|
|citecolor|color of citation links|''green''|
|colorlinks|color links|true/''false'' ただし、tex4htまたはdviwindoを指定した際のデフォルトはtrue|
|debug|provide details of anchors defined|true/''false''|
|draft|do not do any hyper linking|true/''false''|
|dvipdf|use dvipdf backend|CENTER: -|
|dvipdfm|use dvipdfm backend|CENTER: -|
|dvipdfmx|use dvipdfmx backend (6.75e 以降)|CENTER: -|
|dvips|use dvips backend|CENTER: -|
|dvipsone|use dvipsone backend|CENTER: -|
|dviwindo|use dviwindo backend|CENTER: -|
|executivepaper|use executivepaper|CENTER: -|
|extension|suffix of linked files|''dvi''|
|filebordercolor|color of border around file links|RGB値 ''0 .5 .5''|
|filecolor|color of file links|''cyan''|
|frenchlinks|use small caps instead of color for links|true/''false''|
|hidelinks|リンクに色や枠をつけない|CENTER: -|
|hyperfigures|make figures hyper links|true/''false''|
|hyperindex|set up hyperlinked indices|''true''/false|
|hypertex|use HyperTeX backend|CENTER: -|
|hypertexnames|use guessable names for links|''true''/false|
|implicit|redefine LATEX internals|''true''/false|
|latex2html|use LATEX2HTML backend|CENTER: -|
|legalpaper|use legalpaper|CENTER: -|
|letterpaper|use letterpaper|CENTER: -|
|linkbordercolor|color of border around links|RGB値 ''1 0 0''|
|linkcolor|color of links|''red''|
|linktocpage|make page number, not text, be link on TOC, LOF and LOT|true/''false''|
|luatex|use LuaTeX backend (6.83p 以降)|CENTER: -|
|menubordercolor|color of border around menu links|RGB値 ''1 0 0''|
|menucolor|color for menu links|''red''|
|naturalnames|use LATEX-computed names for links|true/''false''|
|nesting|allow nesting of links|true/''false''|
|pageanchor|put an anchor on every page|''true''/false|
|pagebackref|backreference by page number|true/''false''|
|pagebordercolor|color of border around page links|RGB値 ''1 1 0''|
|pagecolor|color of page links|''red''|
|pdfauthor|text for PDF Author field|空|
|pdfborder|width of PDF link border|0 0 1 ただし、colorlinksのデフォルトは 0 0 0|
|pdfcenterwindow|position the document window center of the screen|true/''false''|
|pdfcreator|text for PDF Creator field|''LaTeX with hyperref package''|
|pdfencoding|PDFDocEncoding or Unicode|auto/pdfdoc/unicode|
|pdffitwindow|resize document window to fit document size|true/''false''|
|pdfhighlight|set highlighting of PDF links|''/I'' /N /O /P|
|pdfkeywords|text for PDF Keywords field|空|
|pdfmenubar|make PDF viewer's menu bar visible|''true''/false|
|pdfnewwindow|make links that open another PDF file start a new window|true/''false''|
|pdfpagelayout|set layout of PDF pages|空|
|pdfpagemode|set default mode of PDF display|UseThumbs UseOulines FullScreen|
|pdfpagelabels|set PDF page labels|''true''/false ((6.75aからデフォルトがtrueに変更された))|
|pdfpagescrop|set crop size of PDF document|空|
|pdfpagetransition|set PDF page transition style|空|
|pdfproducer|text for PDF Producer field|空|
|pdfstartpage|page at which PDF document opens|''1''|
|pdfstartview|starting view of PDF document|''/Fit''|
|pdfsubject|text for PDF Subject field|空|
|pdftex|use pdfTEX backend|CENTER: -|
|pdftex|use pdfTeX backend|CENTER: -|
|pdftitle|text for PDF Title field|空|
|pdftoolbar|make PDF toolbar visible|''true''/false|
|pdfview|PDF `view' when on link traversal|空|
|pdfwindowui|make PDF user interface elements visible|''true''/false|
|plainpages|do page number anchors as plain arabic|true/''false'' ((6.75aからデフォルトがfalseに変更された))|
|ps2pdf|use ps2pdf backend|CENTER: -|
|raiselinks|raise up links (for HyperTeX backend)|true/''false''|
|runbordercolor|color of border around `run' links|RGB値 ''0 .7 .7''|
|setpagesize|set page size by special driver commands|''true''/false|
|tex4ht|use TEX4ht backend|CENTER: -|
|textures|use Textures backend|CENTER: -|
|unicode|Unicode encoded pdf strings||
|unicode|Unicode encoded pdf strings|''true''/false ((v7.00g 2021-02-04でデフォルトtrueに。upLaTeX+hyperref+pxjahyperでは明示的にfalseにしないとpdfタイトルが文字化けする[[場合:https://okumuralab.org/tex/mod/forum/discuss.php?d=3067&parent=18164]]がある))|
|urlbordercolor|color of border around URL links|RGB値 ''0 1 1''|
|urlcolor|color of URL links|''magenta''|
|verbose|be chatty|true/''false''|
|vtex|use VTEX backend|CENTER: -|
|xetex|use XeTeX backend|CENTER: -|
|pdfescapeform|エスケープ処理の有効化|true/''false''|
|pdfborderstyle| |/S/U|

** 提供されるコマンド [#dd6f0c82]

hyperref.styを読み込むことによって下記のコマンドが使用可能。
hyperref.sty を読み込むことによって下記のコマンドが使用可能になります.

|コマンド|説明|h
|\href{URL}{text}|テキストにハイパーリンクを付加する|
|\hyperbaseurl{URL}| |
|\hyperimage{image URL}| |
|\hyperdef{category}{name}text | |
|\hyperref{URL}{category}{name}{text}| |
|\hyperlink{name}{text}| |
|\hypertarget{name}{text}| |

さらに,細かい制御用のコマンドとして以下があります.

- \section や \addcontentsline に渡す文字列を,実際に組版されるものとしおりに使われるものとで使い分けたい場合には,それぞれの引数内で次のコマンドを使います.
 \texorpdfstring{TeX に渡すトークン列}{PDF で使う文字列}
- \section などが明示的に書かれていないページで \addcontentsline を使って目次やしおりにそのページへのハイパーリンクを追加したい場合は
 \phantomsection
をリンクを張りたい箇所へ入れておくと正しいページへリンクすることができます.

** url/nolinkurl [#h026c44c]

url及びnolinkurl とは hyperref.styを読み込むことによって使用可能なコマンドの一つ
url 及び nolinkurl とは,hyperref.styを読み込むことによって使用可能なコマンドの一つです.

- url文字列を指定フォントへ変更する
- tildeを上手に処理してくれる
- 改行処理が必要な場合にurl文字列を上手に途中で分割する
- hyperrefパッケージ(urlパッケージではなく)のurlコマンドは処理が上手ではないらしい.(hyperrefのオプション指定 pdftex/dvipdfm/dvipdfmx/xetex/dvips 等に依存するおそれがある)
- LaTeX 向け UTF-8 前提 URL エンコード・ツール → [[URL encode in LaTeX:http://nox-insomniae.ddo.jp/insomnia/2010/12/url-encode-in-latex.html]] を参照.
- マクロ展開されることを抑止したい場合は \protect\url{url文字列} とする.例えば \caption{} の中で必要.

***pdfファイル作成 [#ib05c931]
*** pdfファイル作成 [#ib05c931]

タイプセットでpdfファイルを作成し,
Adobe Reader で開くと(その御節介機能により),
Adobe Acrobat Reader で開くと(その御節介機能により),
url文字列にはhyper link機能が付与されます.(下記例ではnolinkurとtextttの両方に)
 \documentclass{book}
 \usepackage[dvipdfmx,
  bookmarkstype=toc,
  linktocpage=true,
  bookmarks=true
  ]{hyperref}
 \begin{document}
 \tableofcontents
  \chapter{Test}
  \nolinkurl{http://www.apple.com}  \\
  \texttt{http://www.apple.com}
 \end{document}


** Adobe Acrobat Reader を操作するボタン [#bfd00112]

** Adobe Reader を操作するボタン [#bfd00112]

 \Acrobatmenu{menuoption}{text}

PDF 文書の中に「次のページへ」や「先頭のページへ」などリンクを埋め込むことができます。~
最新の Adobe Reader では,セキュリティ上の制限により,過去のバージョンのものとは挙動が異なるものもあります。
PDF 文書の中に「次のページへ」や「先頭のページへ」などリンクを埋め込むことができます.
最新の Adobe Acrobat Reader では,セキュリティ上の制限により,過去のバージョンのものとは挙動が異なるものもあります.

*** \Acrobatmenu の例 [#p427ac0e]

 \Acrobatmenu{SaveAs}{Save As}
 \Acrobatmenu{Close}{Close}
 \Acrobatmenu{GeneralInfo}{Properties}
 \Acrobatmenu{Print}{Print}
 \Acrobatmenu{Quit}{Exit}
 \Acrobatmenu{Find}{Find}
 \Acrobatmenu{FindSearch}{Advanced Search}
 \Acrobatmenu{GeneralPrefs}{Preferences}
 \Acrobatmenu{FirstPage}{First Page}
 \Acrobatmenu{PrevPage}{Previous Page}
 \Acrobatmenu{NextPage}{Next Page}
 \Acrobatmenu{LastPage}{Last Page}
 \Acrobatmenu{GoToPage}{Go To Page}
 \Acrobatmenu{GoBack}{Previous View}
 \Acrobatmenu{GoForward}{Next View}
 \Acrobatmenu{FullScreen}{Full Screen Mode}
 \Acrobatmenu{ShowHideBookmarks}{Show/Hide Bookmarks}
 \Acrobatmenu{ShowHideThumbnails}{Show/Hide Page Thumbnails}

** 他のパッケージとの互換性 [#z442922c]

他のパッケージとhyperrefを同時使用する際には、ちょっとした工夫が必要だったり、読み込む順番に気をつけなればならないものもある。
他のパッケージとhyperrefを同時使用する際には,ちょっとした工夫が必要だったり,読み込む順番に気をつけなればならないものもあります.

*** algorithm [#o8dbc2be]
   \usepackage{hyperref}
   \usepackage[chapter]{algorithm}% eg.
 

*** amsmath [#se667310]
The environments equation and eqnarray are not supported too well.
For example, there can be spacing problems. Consider using the
environments that package amsmath provide, e.g. gather for equation.
The environment equation can even redefined to use gather:
 

   \usepackage{amsmath}
   \let\equation\gather
   \let\endequation\endgather
 

*** arydshln, longtable [#sf5e3f3f]
Package longtable must be put before hyperref and arydshln,
hyperref after arydshln generates an error, thus the
resulting package order is then:
 

   \usepackage{longtable}
   \usepacakge{hyperref}
   \usepackage{arydshln}
 

*** babel/magyar.ldf [#v90c07e3]
Unsupported.

magyar.ldf's redefinitions of many LaTeX internals conflict
with hyperref's redefinitions of these commands.
 

*** bibentry [#zc121442]
Workaround:
 

   \makeatletter
   \let\saved@bibitem\@bibitem
   \let\saved@lbibitem\@lbibitem 
   \let\saved@lbibitem\@lbibitem
   \makeatother
 

   \usepackage{bibentry}
   \usepackage{hyperref}
 

   \begin{document}
 

   \begingroup
     \makeatletter
     \let\@bibitem\saved@bibitem
     \let\@lbibitem\saved@lbibitem
     \nobibliography{database}
   \endgroup
// alpha.bst あたりを使用した場合には,\@lbibitem について \@bibitem と
// 同様の衝突回避措置が必要.なお,natbib パッケージを併用しても構わない
// 場合には,natbib パッケージを用いてもよい.
 

*** cite [#x27bc69f]
This is from Mike Shell:
> cite.sty cannot currently be used with hyperref.
> However, I can do a workaround via:
>
> \makeatletter
> \def\NAT@parse{\typeout{This is a fake Natbib command to fool Hyperref.}}
> \makeatother
>
> \usepackage[hypertex]{hyperref}
>
> so that hyperref will not redefine any of the biblabel stuff - so cite.sty
> will work as normal - although the citations will not be hyperlinked, of
> course (But this may not be an issue for many people).
cite.sty cannot currently be used with hyperref.
However, I can do a workaround via:
 \makeatletter
 \def\NAT@parse{\typeout{This is a fake Natbib command to fool Hyperref.}}
 \makeatother
 
 \usepackage[hypertex]{hyperref}
so that hyperref will not redefine any of the biblabel stuff - so cite.sty will work as normal - although the citations will not be hyperlinked, of course (But this may not be an issue for many people).
<

*** dblaccnt [#h7b3c5f5]
pd1enc.def or puenc.def should be loaded before:
   \usepackage{hyperref}
   \usepackage{dblaccnt}
or see entry for "vietnam".
 

*** easyeqn [#s2f4cce7]
Not compatible, breaks.
 

*** ellipsis [#p3f61fda]
This packages redefines \textellipsis, thus it has to be loaded
after package hyperref (pd1enc.def/puenc.def should be loaded before):
   \usepackage{hyperref}
   \usepackage{ellipsis}
 

*** float [#p0427388]
   \usepackage{float}
   \usepackage{hyperref}
 

- Several \caption commands are not supported inside one float object.
- Anchor are set at top of the float object, if its style is controlled by float.sty.
 

*** footnote [#f2570f39]
This package is not supported, you have to disable hyperref's footnote
support by using option "hyperfootnotes=false".
 

*** IEEEtran.cls [#w0526a31]
   version >= V1.6b (because of \@makecaption, see ChangeLog)
 

*** index [#i8981e97]
   version >= 1995/09/28 v4.1 (because of \addcontentsline redefinition)
 

*** lastpage [#d840dc39]
Compatible.
 

*** linguex [#o8f74e36]
   \usepackage{hyperref}
   \usepackage{linguex}
 

*** ltabptch [#u5dadd27]
   \usepackage{longtable}
   \usepackage{ltabptch}
   \usepackage{hyperref}
 

*** minitoc-hyper [#v6aa949d]
This package is obsolete, use the uptodate original
package minitoc instead.
 

*** multind [#s3bce4df]
   \usepackage{multind}
   \usepackage{hyperref}
 

*** natbib [#i112ee0c]
   \usepackage{natbib}
   \usepackage{hyperref}
 

*** nomencl [#s2a437f3]
Example for introducing links for the page numbers:
 \renewcommand*{\pagedeclaration}[1]{\unskip, \hyperpage{#1}}
 

*** prettyref [#n537f78a]
 %%% example for prettyref %%%
 \documentclass{article}
 \usepackage{prettyref}
 \usepackage[pdftex]{hyperref}
 

 %\newrefformat{FIG}{Figure~\ref{#1}}% without hyperref
 \newrefformat{FIG}{\hyperref[{#1}]{Figure~\ref*{#1}}}
 

 \begin{document}
   This is a reference to \prettyref{FIG:ONE}.
   \newpage
   \begin{figure}
     \caption{This is my figure}
     \label{FIG:ONE}
   \end{figure}
 \end{document}
 %%% example for prettyref %%%
 

*** ntheorem [#dc514872]
ntheorem-hyper.sty is an old patched version of ntheorem.sty.
Newer versions of ntheorem know the option hyperref:
     \usepackage{hyperref}
     \usepackage[hyperref]{ntheorem}
But there are still unsolved problems (options thref, ...).
 

*** setspace [#n2cbb7c1]
   \usepackage{setspace}
   \usepackage{hyperref}
 

*** sidecap [#l728be5c]
Before 2002/05/24 v1.5h:
     \usepackage{nameref}
     \usepackage{hyperref}
     \usepackage{sidecap}
 

*** subfigure [#pc68b165]
1995/03/06 v2.0:
     \usepackage{subfigure}
     \usepackage{hyperref}
     % hypertexnames is set to false.

v2.1:
     \usepackage{nameref}
     \usepackage{subfigure}
     \usepackage{hyperref}
or
     \usepackage{hyperref}
     \usepackage{subfigure}

v2.1.2: 
v2.1.2:
please update

v2.1.3:
     \usepackage{hyperref}
     \usepackage{subfigure}
     or vice versa?
 

*** titleref [#i6c782d6]
   \usepackage{nameref}
   \usepackage{titleref}% without usetoc
   \usepackage{hyperref}
 

*** titlesec [#yf2b34b9]
"nameref" supports titlesec, but hyperref does not
(unsolved is the anchor setting, missing with unnumbered
section, perhaps problems with page breaks with numbered ones).
 

*** varioref [#s5f6c173]
   \usepackage{nameref}
   \usepackage{varioref}
   \usepackage{hyperref}
Some babel versions (eg. 2005/05/21 v3.8g) contain a patch for
varioref that breaks the hyperref support for varioref.
Thus with babel v3.8g varioref cannot be used with hyperref.
 

*** verse [#p86d2aed]
Version 2005/08/22 v2.22 contains support for hyperref.
 
For older versions see example from 

For older versions see example from
de.comp.text.tex (2005/08/11, slightly modified):
 

   \documentclass{article}
 

   % package order does not matter
   \usepackage{verse}
   \usepackage{hyperref}
 

   \makeatletter
   % make unique poemline anchors
   \newcounter{verse@env}
   \setcounter{verse@env}{0}
   \let\org@verse\verse
   \def\verse{%
     \stepcounter{verse@env}%
     \org@verse
   }
   \def\theHpoemline{\arabic{verse@env}.\thepoemline}
 

   % add anchor for before \addcontentsline in \@vsptitle
   \let\org@vsptitle\@vsptitle
   \def\@vsptitle{%
     \phantomsection
     \org@vsptitle
   }
   \makeatother
 

   \begin{document}
 

   \poemtitle{Poem 1}
   \begin{verse}
   An one-liner.
   \end{verse}
 

   \newpage
 

   \poemtitle{Poem 2}
   \begin{verse}
   Another one-liner.
   \end{verse}
 

   \end{document}
 

*** vietnam [#o7d0377c]
   % pd1enc.def should be loaded before package dblaccnt:
   \usepackage[PD1,OT1]{fontenc}
   \usepackage{vietnam}
   \usepackage{hyperref}



** 他のパッケージとの重複関係 [#ca4547b3]

*** urlパッケージ [#u1bf19c1]
hyperrefパッケージと同じ(?) \urlコマンドを提供する.
hyperref パッケージと同じ(?) \url コマンドを提供します.

*** beamerクラス [#z7cec6eb]
hyperrefパッケージをデフォルトで読み込む.
hyperref パッケージをデフォルトで読み込みます.


** pTeX の内部コードを判別して hyperref の設定を切り換える [#a2ccb2b3]

 \usepackage[dvipdfmx]{hyperref}

の前に以下を入力

 \ifx\kanjiskip\undefined\else
 \ifx\ucs\undefined
 \usepackage{atbegshi}
 \ifnum 42146=\euc"A4A2
   \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}}
 \else
   \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
 \fi\fi\fi

\usepackage[dvipdfmx]{hyperref} の後では PDF のタイトルが文字化けしてしまいます.

** しおりの色とフォントスタイルの変更 [#xafa8ac2]

以下にサンプルコードを示します。hyperref 6.82g で確認しました.~
hyperref は,バージョンによって中身の構造がここで示した例とは異なる場合があります.~
その場合は,変更できないと思われるので,適宜修正して使ってください.~
この機能は PDF-1.4 (Acrobat 5.x) 以降のバージョンで有効になります.~
以下にサンプルコードを示します.hyperref 6.83m で確認しました.
hyperref は,バージョンによって中身の構造がここで示した例とは異なる場合があります.
その場合は変更できないと思われるので,適宜修正して使ってください.
この機能は PDF-1.4 (Acrobat 5.x) 以降のバージョンで有効になります.

*** pdftex の場合 [#ec16a11d]

 \documentclass{article}
 \usepackage[pdftex]{hyperref}
 %******************************************************
 % Change bookmarks color and font style [pdftex only]
 % (override a part of hpdftex.def)
 % PDF-1.4 (Acrobat 5.x) or later is valid
 % /C array [R G B]
 % /F integer
 %******************************************************
 \makeatletter
 \newcount\bookmarksFontStyleInteger
 \def\bookmarksColorArray{1 0 0}
 \def\Hy@OutlineName#1#2#3#4{%
   \pdfoutline
     attr{%
       /C [\bookmarksColorArray]%
       /F \the\bookmarksFontStyleInteger%
     }%
   goto name{#2}count#3{#4}%
 }
 \makeatother
 %*************************************************************
 % Bookmarks Font Style
 % (0 -> Plain; 1 -> Italic; 2 -> Bold; 3 -> Bold and Italic)
 %*************************************************************
 \bookmarksFontStyleInteger2
 %******************
 % Bookmarks Color
 % {R G B}
 %******************
 \renewcommand{\bookmarksColorArray}{0 0.5 1.0}
 \begin{document}
 \section{abc}
 abc
 \end{document}

*** dvipdfm/dvipdfmx/xetex の場合 [#d3c17ccb]
*** dvipdfmx/xetex の場合 [#d3c17ccb]

 \documentclass{article}
 %\usepackage[dvipdfm]{hyperref}
 \usepackage[dvipdfmx]{hyperref}
 %\usepackage[xetex]{hyperref}
 %**********************************************************************
 % Change bookmarks color and font style [dvipdfm/dvipdfmx/xetex only]
 \ifdefined\XeTeXversion
   \usepackage[xetex]{hyperref}
 \else
   \usepackage[dvipdfmx]{hyperref}
 \fi
 %*************************************************************
 % Change bookmarks color and font style [dvipdfmx/xetex only]
 % (override a part of hdvipdfm.def/hxetex.def)
 % PDF-1.4 (Acrobat 5.x) or later is valid
 % /C array [R G B]
 % /F integer
 %**********************************************************************
 %*************************************************************
 \makeatletter
 \newcount\bookmarksFontStyleInteger
 \def\bookmarksColorArray{1 0 0}
 \def\ReadBookmarks{%
   \pdf@ifdraftmode{}{%
     \begingroup
       \def\do##1{%
	 \ifnum\catcode`##1=\active
	   \@makeother##1%
	 \else
	   \ifnum\catcode`##1=6 %
	     \@makeother##1%
	   \fi
	 \fi
       }%
       \dospecials
       \Hy@safe@activestrue
       \escapechar=`\\%
       \def\@@BOOKMARK[##1][##2]##3##4##5{%
	 \calc@bm@number{##5}%
       }%
       \InputIfFileExists{\jobname.out}{}{}%
       \ifx\WriteBookmarks\relax
	 \global\let\WriteBookmarks\relax
       \fi
       \def\@@BOOKMARK[##1][##2]##3##4##5{%
	 \def\Hy@temp{##4}%
	 \Hy@pstringdef\Hy@pstringName{\HyperDestNameFilter{##3}}%
	 \@pdfm@mark{%
	   outline \ifHy@DvipdfmxOutlineOpen
		     [%
		     \ifnum##21>\z@
		     \else
		       -%
		     \fi
		     ] %
		   \fi
		   ##1<<%
	     /C [\bookmarksColorArray]%
	     /F \the\bookmarksFontStyleInteger%
	     /Title(\expandafter\strip@prefix\meaning\Hy@temp)%
	     /A<<%
	       /S/GoTo%
	       /D(\Hy@pstringName)%
	     >>%
	   >>%
	 }%
       }%
       \begingroup
	 \def\WriteBookmarks{0}%
	 \InputIfFileExists{\jobname.out}{}{}%
       \endgroup
       %{\escapechar\m@ne\InputIfFileExists{\jobname.out}{}{}}%
     \endgroup
   }%
   \ifx\WriteBookmarks\relax
   \else
     \if@filesw
       \newwrite\@outlinefile
       \Hy@OutlineRerunCheck
       \immediate\openout\@outlinefile=\jobname.out\relax
       \ifHy@typexml
	 \immediate\write\@outlinefile{<relaxxml>\relax}%
       \fi
     \fi
   \fi
 }
 \makeatother
 %*************************************************************
 % Bookmarks Font Style
 % (0 -> Plain; 1 -> Italic; 2 -> Bold; 3 -> Bold and Italic)
 %*************************************************************
 \bookmarksFontStyleInteger2
 %******************
 % Bookmarks Color
 % {R G B}
 %******************
 \renewcommand{\bookmarksColorArray}{0 0.5 1.0}
 \begin{document}
 \section{abc}
 abc
 \end{document}

*** dvips/dvipsone の場合 [#q60cb78c]
*** dvips の場合 [#q60cb78c]

 \documentclass{article}
 \usepackage[dvips]{hyperref}
 %\usepackage[dvipsone]{hyperref}
 %**************************************************************
 % Change bookmarks color and font style [dvips/dvipsone only]
 %*************************************************************
 % Change bookmarks color and font style [dvips only]
 % (override a part of pdfmark.def)
 % PDF-1.4 (Acrobat 5.x) or later is valid
 % /C array [R G B]
 % /F integer
 %**************************************************************
 %*************************************************************
 \makeatletter
 \newcount\bookmarksFontStyleInteger
 \def\bookmarksColorArray{1 0 0}
 \def\ReadBookmarks{%
   \pdf@ifdraftmode{}{%
     \begingroup
       \def\do##1{%
	 \ifnum\catcode`##1=\active
	   \@makeother##1%
	 \else
	   \ifnum\catcode`##1=6 %
	     \@makeother##1%
	   \fi
	 \fi
       }%
       \dospecials
       \Hy@safe@activestrue
       \escapechar=`\\%
       \def\@@BOOKMARK[##1][##2]##3##4##5{%
	 \calc@bm@number{##5}%
       }%
       \InputIfFileExists{\jobname.out}{}{}%
       \ifx\WriteBookmarks\relax
	 \global\let\WriteBookmarks\relax
       \fi
       \def\@@BOOKMARK[##1][##2]##3##4##5{%
	 \def\Hy@temp{##4}%
	 \pdfmark{%
	   pdfmark=/OUT,%
	   Raw={%
	     /Count ##2\check@bm@number{##3}%
	     /Dest (##3)%
	     /C [\bookmarksColorArray]%
	     /F \the\bookmarksFontStyleInteger%
	     /Title (\expandafter\strip@prefix\meaning\Hy@temp)%
	   }%
	 }%
       }%
       \begingroup
	 \def\WriteBookmarks{0}%
	 \InputIfFileExists{\jobname.out}{}{}%
       \endgroup
       %{\escapechar\m@ne\InputIfFileExists{\jobname.out}{}{}}%
     \endgroup
   }%
   \ifx\WriteBookmarks\relax
   \else
     \if@filesw
       \newwrite\@outlinefile
       \Hy@OutlineRerunCheck
       \immediate\openout\@outlinefile=\jobname.out\relax
       \ifHy@typexml
	 \immediate\write\@outlinefile{<relaxxml>\relax}%
       \fi
     \fi
   \fi
 }
 \makeatother
 %*************************************************************
 % Bookmarks Font Style
 % (0 -> Plain; 1 -> Italic; 2 -> Bold; 3 -> Bold and Italic)
 %*************************************************************
 \bookmarksFontStyleInteger2
 %******************
 % Bookmarks Color
 % {R G B}
 %******************
 \renewcommand{\bookmarksColorArray}{0 0.5 1.0}
 \begin{document}
 \section{abc}
 abc
 \end{document}

**関連リンク [#h792e133]
-http://www.tug.org/applications/hyperref/
-[[CTAN:help/Catalogue/entries/hyperref.html]]
-https://miktex.org/packages/pxjahyper
-[[「hyperref」の検索結果一覧 - マクロツイーター:http://d.hatena.ne.jp/zrbabbler/archive?word=hyperref]]
-[[LaTeXの縦書き右綴じの文書をPDFにしたときに、うまく見開き表示するための方法:http://id.fnshr.info/2015/11/03/latex-pdf-r2l/]]
-[[hyperref利用時の2つの注意点:http://0-chromosome.hatenablog.jp/entry/2015/04/10/175912]]
-[[HyperTeX]]

----
- \usepackage[dvipdfm,bookmarkstype=toc,colorlinks=true,urlcolor=black,linkcolor=black,citecolor=black,linktocpage=true,bookmarks=false]{hyperref} -- kd &new{2007-03-20 (火) 15:21:01};
- \usepackage[dvipdfmx,bookmarkstype=toc,colorlinks=true,urlcolor=black,linkcolor=black,citecolor=black,linktocpage=true,bookmarks=false]{hyperref} -- kd &new{2007-03-20 (火) 15:21:01};
- 修士論文のpdf作成等の際には,ぜひともhyperrefをご利用してpdfファイルを作って下さい.(例えば上記例をプリアンブル部に書けばよいと思います.目次から本文のページ等へジャンプ可能だと読み手が楽です.) -- kd &new{2007-03-20 (火) 15:27:11};
- 逆に「書籍の原稿」といった、「最終的な組版を書き手自身がやるのではない」文書の場合には、hyperref パッケージをはじめとする、お行儀の悪い(=LaTeX の内部処理をあちこち書き換える)パッケージは決して使用しないでください。 -- 1296893894 &new{2011-02-05 (土) 17:18:14};
- texlive2011ではsetpagesize=falseを指定しないと版面が紙の右下側にずれる現象がおこりました。私の環境特有かもしれませんが一応報告を -- yayugu &new{2011-08-09 (火) 22:11:52};

#comment