1 ;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m
3 ;; Copyright (C) 2008, 2013 Free Software Foundation, Inc.
5 ;; Author: Ralf Angeli <angeli@caeruleus.net>
6 ;; Maintainer: auctex-devel@gnu.org
10 ;; This file is part of AUCTeX.
12 ;; AUCTeX is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
17 ;; AUCTeX is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
29 ;; This file adds support for the hyperref package.
33 (defvar LaTeX-hyperref-package-options-list
34 '(;; See http://www.tug.org/applications/hyperref/manual.html#x1-40003
36 ("draft" ("true" "false"))
37 ("final" ("true" "false"))
38 ("debug" ("true" "false"))
39 ("verbose" ("true" "false"))
40 ("implicit" ("true" "false"))
41 ("setpagesize" ("true" "false"))
42 ;; Options for destination names
43 ("destlabel" ("true" "false"))
44 ("hypertexnames" ("true" "false"))
45 ("naturalnames" ("true" "false"))
46 ("plainpages" ("true" "false"))
47 ;; Configuration options
48 ("raiselinks" ("true" "false"))
49 ("breaklinks" ("true" "false"))
50 ("pageanchor" ("true" "false"))
51 ("nesting" ("true" "false"))
72 ("hyperfigures" ("true" "false"))
73 ("backref" ("section" "slide" "page" "none" "false"))
74 ("pagebackref" ("true" "false"))
75 ("hyperindex" ("true" "false"))
76 ("hyperfootnotes" ("true" "false"))
78 ("linktocpage" ("true" "false"))
79 ("breaklinks" ("true" "false"))
80 ("colorlinks" ("true" "false"))
89 ("frenchlinks" ("true" "false"))
91 ;; PDF-specific display options
92 ("bookmarks" ("true" "false"))
93 ("bookmarksopen" ("true" "false"))
94 ("bookmarksopenlevel")
95 ("bookmarksnumbered" ("true" "false"))
97 ("CJKbookmarks" ("true" "false"))
98 ("pdfhighlight" ("/I" "/N" "/O" "/P"))
107 ;; PDF display and information options
109 ("pdfpagemode" ("UseOutlines" "UseThumbs" "FullScreen" "UseOC" "UseAttachments"))
116 ("pdftrapped" ("True" "False" "Unknown"))
118 ("pdfview" ("XYZ" "Fit" "FitH" "FitV" "FitR" "FitB" "FitBH" "FitBV"))
120 ("pdfstartview" ("XYZ" "Fit" "FitH" "FitV" "FitR" "FitB" "FitBH" "FitBV"))
121 ("pdfremotestartview" ("XYZ" "Fit" "FitH" "FitV" "FitR" "FitB" "FitBH" "FitBV"))
123 ("pdfcenterwindow" ("true" "false"))
124 ("pdfdirection" ("L2R" "R2L"))
125 ("pdfdisplaydoctitle" ("true" "false"))
126 ("pdfduplex" ("Simplex" "DuplexFlipShortEdge" "DuplexFlipLongEdge"))
127 ("pdffitwindow" ("true" "false"))
129 ("pdfmenubar" ("true" "false"))
130 ("pdfnewwindow" ("true" "false"))
131 ("pdfnonfullscreenpagemode" ("UseNone" "UseOutlines" "UseThumbs" "FullScreen" "UseOC" "UseAttachments"))
133 ("pdfpagelayout" ("SinglePage" "OneColumn" "TwoColumnLeft" "TwoColumnRight" "TwoPageLeft" "TwoPageRight"))
134 ("pdfpagelabels" ("true" "false"))
135 ("pdfpagetransition" ("Blinds" "Box" "Dissolve" "Glitter" "Split" "Wipe"))
136 ("pdfpicktraybypdfsize" ("true" "false"))
137 ("pdfprintarea" ("MediaBox" "CropBox" "BleedBox" "TrimBox" "ArtBox"))
138 ("pdfprintclip" ("MediaBox" "CropBox" "BleedBox" "TrimBox" "ArtBox"))
139 ("pdfprintpagerange")
140 ("pdfprintscaling" ("AppDefault" "None"))
141 ("pdftoolbar" ("true" "false"))
142 ("pdfviewarea" ("MediaBox" "CropBox" "BleedBox" "TrimBox" "ArtBox"))
143 ("pdfviewclip" ("MediaBox" "CropBox" "BleedBox" "TrimBox" "ArtBox"))
144 ("pdfwindowui" ("true" "false"))
145 ("unicode" ("true" "false")))
146 "Package options for the hyperref package.")
148 (defvar LaTeX-hyperref-href-options
149 '(("pdfremotestartview" ("XYZ" "Fit" "FitH" "FitV" "FitR" "FitB" "FitBH" "FitBV"))
150 ("pdfnewwindow" ("true" "false"))
152 ("ismap" ("true" "false"))
154 "Key=value options for href macro of the hyperref package.")
159 ;; hyperref loads nameref and url (+ some other packages which do not have
161 (TeX-run-style-hooks "url" "nameref")
164 '("hypersetup" (TeX-arg-key-val LaTeX-hyperref-package-options-list))
165 '("href" [ (TeX-arg-key-val LaTeX-hyperref-href-options) ] "URL" "Text")
168 '("hyperimage" "Image URL" "Text")
169 '("hyperdef" "Category" "Name" "Text")
170 '("hyperref" "URL" "Category" "Name" "Text")
171 '("hyperlink" "Name" "Text")
172 '("hypertarget" "Name" "Text")
173 '("phantomsection" 0)
174 '("autoref" TeX-arg-ref)
175 '("ref*" TeX-arg-ref)
176 '("pageref*" TeX-arg-ref)
177 '("autopageref" TeX-arg-ref)
178 '("autopageref*" TeX-arg-ref)
179 '("pdfstringdef" "Macro name" "TeX string")
180 '("pdfbookmark" [ "Level" ] "Text" "name")
181 '("currentpdfbookmark" "Text" "Name")
182 '("subpdfbookmark" "Text" "Name")
183 '("belowpdfbookmark" "Text" "Name")
184 '("texorpdfstring" "TeX string" "PDF string")
186 '("Acrobatmenu" "Menu option" "Text")
187 '("TextField" ["Parameters"] "Label")
188 '("CheckBox" ["Parameters"] "Label")
189 '("ChoiceMenu" ["Parameters"] "Label" "Choices")
190 '("PushButton" ["Parameters"] "Label")
191 '("Submit" ["Parameters"] "Label")
192 '("Reset" ["Parameters"] "Label")
193 '("LayoutTextField" "Label" "Field")
194 '("LayoutChoiceField" "Label" "Field")
195 '("LayoutCheckField" "Label" "Field")
196 '("MakeRadioField" "Width" "Height")
197 '("MakeCheckField" "Width" "Height")
198 '("MakeTextField" "Width" "Height")
199 '("MakeChoiceField" "Width" "Height")
200 '("MakeButtonField" "Text"))
202 (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
203 (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
204 (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")
205 (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperref")
208 (when (and (fboundp 'font-latex-add-keywords)
209 (fboundp 'font-latex-set-syntactic-keywords)
210 (eq TeX-install-font-lock 'font-latex-setup))
211 (font-latex-add-keywords '(("href" "[{{")
222 ("autopageref" "*{"))
224 ;; For syntactic fontification, e.g. verbatim constructs.
225 (font-latex-set-syntactic-keywords))
228 (when (fboundp 'reftex-ref-style-activate)
229 (reftex-ref-style-activate "Hyperref")))
232 (defun LaTeX-hyperref-package-options ()
233 "Read the hyperref package options from the user."
234 (TeX-read-key-val t LaTeX-hyperref-package-options-list))
236 ;;; hyperref.el ends here