changeset 246:9105918e45a2 dev

Abolish too-much guidance for table/figure.
author yuuji@gentei.org
date Fri, 10 Feb 2012 09:09:08 +0900
parents 8ad85ce1ee98
children 3e3ccba06ca1
files yatexadd.el
diffstat 1 files changed, 11 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/yatexadd.el	Thu Feb 09 09:54:06 2012 +0900
+++ b/yatexadd.el	Fri Feb 10 09:09:08 2012 +0900
@@ -2,7 +2,7 @@
 ;;; YaTeX add-in functions.
 ;;; yatexadd.el rev.20
 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Sun Jan 29 15:56:28 2012 on firestorm
+;;; Last modified Thu Feb  9 09:33:55 2012 on firestorm
 ;;; $Id$
 
 ;;;
@@ -106,25 +106,11 @@
   "Non-nil indicates put caption before figure.")
 (defun YaTeX:figure (&optional type firstp)
   "YaTeX add-in function for figure(*) environment."
-  (let*((caption "") (label "") (opts "")
-	(top (if type firstp YaTeX:figure-caption-first))
-	(tl (or type "Figure"))
-	(heremsg (format "%% %s here" tl))
-	(pos (YaTeX:read-position "htbp")))
-    (setq label (YaTeX-read-string-or-skip (concat tl " Label: ")))
-    (if (string= "" label)
-	(setq YaTeX-section-name "label")
-      (setq opts (format "\n\\label{%s}" label)))
-    (setq caption (YaTeX-read-string-or-skip (concat tl " Caption: ")))
-    (if (string= "" caption)
-	(setq YaTeX-section-name "caption")
-      (setq caption (format "\\caption{%s}" caption)
-	    opts (format "%s\n%s\n%s"
-			 opts
-			 (if top caption heremsg)
-			 (if top heremsg caption)))
-      (format "\\caption{%s}" caption))
-    (concat pos opts)))
+  (setq YaTeX-section-name
+	(if YaTeX:figure-caption-first "caption" "includegraphics")
+	YaTeX-env-name "center")
+  (YaTeX:read-position "htbp"))
+
 
 (fset 'YaTeX:figure* 'YaTeX:figure)
 
@@ -137,8 +123,10 @@
   "YaTeX add-in function for table environment."
   (cond
    ((eq major-mode 'yatex-mode)
-    (setq YaTeX-env-name "tabular")
-    (YaTeX:figure "Table" YaTeX:table-caption-first))
+    (setq YaTeX-section-name
+	  (if YaTeX:table-caption-first "caption" "label")
+	  YaTeX-env-name "tabular")
+    (YaTeX:read-position "htbp"))
    ((eq major-mode 'texinfo-mode)
     (concat " "
 	    (completing-read
@@ -1903,6 +1891,7 @@
 				 (format "%s=%s" s (symbol-value s))))
 			 '(width height scale angle)))
 	   ","))
+    (setq YaTeX-section-name "caption")
     (if (string= "" str) ""
       (concat "[" str "]"))))
 

yatex.org