branch: elpa
commit 18ee3e9bfd0f35a2b7789ebc5dca405a9dd3f062
Author: Arash Esbati <[email protected]>
Commit: Mosè Giordano <[email protected]>
Add `Form' environment needed for PDF and HTML forms.
* style/hyperref.el ("hyperref"): Add `Form' environment needed
for PDF and HTML forms.
(LaTeX-hyperref-forms-options): New variable for key-val options
used in form related macros (`TextField', `CheckBox',
`ChoiceMenu', `PushButton', `Submit', `Reset').
Signed-off-by: Mosè Giordano <[email protected]>
---
ChangeLog | 8 +++++
style/hyperref.el | 81 ++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 82 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d874f66..72dbba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-12-30 Arash Esbati <[email protected]>
+
+ * style/hyperref.el ("hyperref"): Add `Form' environment needed
+ for PDF and HTML forms.
+ (LaTeX-hyperref-forms-options): New variable for key-val options
+ used in form related macros (`TextField', `CheckBox',
+ `ChoiceMenu', `PushButton', `Submit', `Reset').
+
2014-12-22 Tassilo Horn <[email protected]>
* doc/changes.texi: Document addition of LaTeX-command-section and
diff --git a/style/hyperref.el b/style/hyperref.el
index ad1c628..a1eee7c 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -1,6 +1,6 @@
;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m
-;; Copyright (C) 2008, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2013, 2014 Free Software Foundation, Inc.
;; Author: Ralf Angeli <[email protected]>
;; Maintainer: [email protected]
@@ -153,6 +153,64 @@
("nextactionraw"))
"Key=value options for href macro of the hyperref package.")
+;; See http://www.tug.org/applications/hyperref/ftp/doc/manual.html#x1-220006.2
+
+(defvar LaTeX-hyperref-forms-options
+ '(("accesskey")
+ ("align" ("0" "1" "2"))
+ ("altname")
+ ("backgroundcolor")
+ ("bordercolor")
+ ("bordersep")
+ ("borderwidth")
+ ;; "borderstyle" is not mentioned in the original hyperref-doc, it
+ ;; can be seen in action in
+ ;; http://mirrors.ctan.org/macros/latex/contrib/hyperref/test/testform.tex
+ ;; S=Solid (default), D=Dashed, B=Beveled, I=Inset, U=Underline
+ ("borderstyle" ("S" "D" "B" "I" "U"))
+ ("calculate")
+ ("charsize")
+ ("checkboxsymbol" ("true" "false"))
+ ("checked")
+ ("color")
+ ("combo" ("true" "false"))
+ ("default")
+ ("disabled" ("true" "false"))
+ ("format")
+ ("height")
+ ("hidden" ("true" "false"))
+ ("keystroke")
+ ("mappingname")
+ ("maxlen")
+ ("menulength")
+ ("multiline" ("true" "false"))
+ ("name")
+ ("onblur")
+ ("onchange")
+ ("onclick")
+ ("ondblclick")
+ ("onfocus")
+ ("onkeydown")
+ ("onkeypress")
+ ("onkeyup")
+ ("onmousedown")
+ ("onmousemove")
+ ("onmouseout")
+ ("onmouseover")
+ ("onmouseup")
+ ("onselect")
+ ("password" ("true" "false"))
+ ("popdown" ("true" "false"))
+ ("radio" ("true" "false"))
+ ("radiosymbol")
+ ("readonly" ("true" "false"))
+ ("rotation")
+ ("tabkey")
+ ("validate")
+ ("value")
+ ("width"))
+ "Key=value options for Forms related macros of the hyperref package.")
+
(TeX-add-style-hook
"hyperref"
(lambda ()
@@ -184,12 +242,15 @@
'("texorpdfstring" "TeX string" "PDF string")
'("hypercalcbp" t)
'("Acrobatmenu" "Menu option" "Text")
- '("TextField" ["Parameters"] "Label")
- '("CheckBox" ["Parameters"] "Label")
- '("ChoiceMenu" ["Parameters"] "Label" "Choices")
- '("PushButton" ["Parameters"] "Label")
- '("Submit" ["Parameters"] "Label")
- '("Reset" ["Parameters"] "Label")
+ ;; The next 6 macros take Key-vals defined in
+ ;; "LaTeX-hyperref-forms-options". For an example, see
+ ;; http://mirrors.ctan.org/macros/latex/contrib/hyperref/test/testform.tex
+ '("TextField" [ (TeX-arg-key-val LaTeX-hyperref-forms-options) ] "Label")
+ '("CheckBox" [ (TeX-arg-key-val LaTeX-hyperref-forms-options) ] "Label")
+ '("ChoiceMenu" [ (TeX-arg-key-val LaTeX-hyperref-forms-options) ] "Label"
"Choices")
+ '("PushButton" [ (TeX-arg-key-val LaTeX-hyperref-forms-options) ] "Label")
+ '("Submit" [ (TeX-arg-key-val LaTeX-hyperref-forms-options) ] "Label")
+ '("Reset" [ (TeX-arg-key-val LaTeX-hyperref-forms-options) ] "Label")
'("LayoutTextField" "Label" "Field")
'("LayoutChoiceField" "Label" "Field")
'("LayoutCheckField" "Label" "Field")
@@ -199,6 +260,12 @@
'("MakeChoiceField" "Width" "Height")
'("MakeButtonField" "Text"))
+ ;; Form fields must be inside a "Form"-env, one per file is allowed, cf.
+ ;; http://www.tug.org/applications/hyperref/ftp/doc/manual.html#x1-200006
+ ;; It is up to user to insert [<options>] after \begin{Form}
+ (LaTeX-add-environments
+ '("Form"))
+
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")