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

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

''目次''

#contents

** 更新履歴 [#e8ca0037]

[[ChangeLog:http://www.tug.org/applications/hyperref/ftp/ChangeLog]] を参照。

**注意点 [#he2b8021]

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

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

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

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

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

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

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

とすることも可能です.

しおりを作成する場合は2回コンパイルが必要です.

v6.75e で dvipdfmx が指定できるようになりました.

\usepackage で dvipdfmx を指定してエラーが発生する場合は

-hyperref を最新のもの (6.75e 以降のバージョン) にアップデートする
-\usepackage でオプションを dvipdfmx ではなく dvipdfm を指定する

のどちらかを試してみてください.

platex + dvips + Ghostscript (ps2pdf) の場合は,オプションを dvipdfmx ではなく dvips に変更します.

hyperref は pTeX の縦書きモードの場合にうまくいかないことがあるようです.[[pTeXで縦書きモード時にハイパーリンクを埋め込む方法のメモ:http://d.hatena.ne.jp/yayugu/20110526/1306417041]]

platex + dvipdfmx で,日本語を使用する場合は \usepackage[dvipdfmx]{hyperref} の前に以下を追加しておけば,しおりタイトル等の日本語の文字化けを防止できます.

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

(e)uplatex + updvipdfmx, xelatex では必要ありません.

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

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

|オプション|意味|指定値(太字はデフォルト)|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''|
|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''|
|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''|
|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: -|
|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||
|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を読み込むことによって下記のコマンドが使用可能。

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


** url/nolinkurl [#h026c44c]

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]] を参照.

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



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

 \Acrobatmenu{menuoption}{text}

PDF 文書の中に「次のページへ」や「先頭のページへ」などリンクを埋め込むことができます。~
最新の Adobe 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}

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

他のパッケージと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 
   \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).

*** 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: 
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 
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コマンドを提供する.

*** beamerクラス [#z7cec6eb]
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) 以降のバージョンで有効になります.~

*** 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]

 \documentclass{article}
 %\usepackage[dvipdfm]{hyperref}
 \usepackage[dvipdfmx]{hyperref}
 %\usepackage[xetex]{hyperref}
 %**********************************************************************
 % Change bookmarks color and font style [dvipdfm/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]

 \documentclass{article}
 \usepackage[dvips]{hyperref}
 %\usepackage[dvipsone]{hyperref}
 %**************************************************************
 % Change bookmarks color and font style [dvips/dvipsone 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}

----
- \usepackage[dvipdfm,bookmarkstype=toc=true,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};

#comment