yatex

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 diff
     1.1 --- a/yatexadd.el	Thu Feb 09 09:54:06 2012 +0900
     1.2 +++ b/yatexadd.el	Fri Feb 10 09:09:08 2012 +0900
     1.3 @@ -2,7 +2,7 @@
     1.4  ;;; YaTeX add-in functions.
     1.5  ;;; yatexadd.el rev.20
     1.6  ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Sun Jan 29 15:56:28 2012 on firestorm
     1.8 +;;; Last modified Thu Feb  9 09:33:55 2012 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;;
    1.12 @@ -106,25 +106,11 @@
    1.13    "Non-nil indicates put caption before figure.")
    1.14  (defun YaTeX:figure (&optional type firstp)
    1.15    "YaTeX add-in function for figure(*) environment."
    1.16 -  (let*((caption "") (label "") (opts "")
    1.17 -	(top (if type firstp YaTeX:figure-caption-first))
    1.18 -	(tl (or type "Figure"))
    1.19 -	(heremsg (format "%% %s here" tl))
    1.20 -	(pos (YaTeX:read-position "htbp")))
    1.21 -    (setq label (YaTeX-read-string-or-skip (concat tl " Label: ")))
    1.22 -    (if (string= "" label)
    1.23 -	(setq YaTeX-section-name "label")
    1.24 -      (setq opts (format "\n\\label{%s}" label)))
    1.25 -    (setq caption (YaTeX-read-string-or-skip (concat tl " Caption: ")))
    1.26 -    (if (string= "" caption)
    1.27 -	(setq YaTeX-section-name "caption")
    1.28 -      (setq caption (format "\\caption{%s}" caption)
    1.29 -	    opts (format "%s\n%s\n%s"
    1.30 -			 opts
    1.31 -			 (if top caption heremsg)
    1.32 -			 (if top heremsg caption)))
    1.33 -      (format "\\caption{%s}" caption))
    1.34 -    (concat pos opts)))
    1.35 +  (setq YaTeX-section-name
    1.36 +	(if YaTeX:figure-caption-first "caption" "includegraphics")
    1.37 +	YaTeX-env-name "center")
    1.38 +  (YaTeX:read-position "htbp"))
    1.39 +
    1.40  
    1.41  (fset 'YaTeX:figure* 'YaTeX:figure)
    1.42  
    1.43 @@ -137,8 +123,10 @@
    1.44    "YaTeX add-in function for table environment."
    1.45    (cond
    1.46     ((eq major-mode 'yatex-mode)
    1.47 -    (setq YaTeX-env-name "tabular")
    1.48 -    (YaTeX:figure "Table" YaTeX:table-caption-first))
    1.49 +    (setq YaTeX-section-name
    1.50 +	  (if YaTeX:table-caption-first "caption" "label")
    1.51 +	  YaTeX-env-name "tabular")
    1.52 +    (YaTeX:read-position "htbp"))
    1.53     ((eq major-mode 'texinfo-mode)
    1.54      (concat " "
    1.55  	    (completing-read
    1.56 @@ -1903,6 +1891,7 @@
    1.57  				 (format "%s=%s" s (symbol-value s))))
    1.58  			 '(width height scale angle)))
    1.59  	   ","))
    1.60 +    (setq YaTeX-section-name "caption")
    1.61      (if (string= "" str) ""
    1.62        (concat "[" str "]"))))
    1.63