auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] [PATCH 5/5] TikZ: Add prompting for TikZ's \node macro.


From: Matthew Leach
Subject: [AUCTeX-devel] [PATCH 5/5] TikZ: Add prompting for TikZ's \node macro.
Date: Sun, 27 Mar 2016 19:04:31 +0100

* style/tikz.el (TeX-TikZ-node-arg): New.
---
 style/tikz.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/style/tikz.el b/style/tikz.el
index a877cb8..d002811 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -167,11 +167,21 @@ functions.")
                                           "Coordinate point type: ")))
     (insert options " " name " at" point ";")))
 
+(defun TeX-TikZ-node-arg (optional)
+  "Prompt the user for the arguments to a TikZ node macro."
+  (let ((options (TeX-TikZ-arg-options t))
+        (name (TeX-TikZ-arg-name nil))
+        (point (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map
+                                          "Node point type: "))
+        (text (TeX-TikZ-arg-text nil)))
+    (insert options " " name  " at" point text ";")))
+
 (TeX-add-style-hook
  "tikz"
  (lambda ()
    (TeX-add-symbols
     '("draw" (TeX-TikZ-draw-arg))
-    '("coordinate" (TeX-TikZ-coordinate-arg)))
+    '("coordinate" (TeX-TikZ-coordinate-arg))
+    '("node" (TeX-TikZ-node-arg)))
    (LaTeX-add-environments
     '("tikzpicture"))))
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]