yatex

changeset 219:ad4e0a008972 dev

Add-in function for figure and refine table.
author yuuji@fusion.yk.gentei.org
date Sun, 15 Jan 2012 09:47:56 +0900
parents 58a023f16e07
children 4bb77d7ee8f0
files yatexadd.el
diffstat 1 files changed, 32 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/yatexadd.el	Sun Jan 15 09:08:17 2012 +0900
     1.2 +++ b/yatexadd.el	Sun Jan 15 09:47:56 2012 +0900
     1.3 @@ -2,7 +2,7 @@
     1.4  ;;; YaTeX add-in functions.
     1.5  ;;; yatexadd.el rev.19
     1.6  ;;; (c)1991-2011 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Mon Mar  7 12:12:11 2011 on firestorm
     1.8 +;;; Last modified Sun Jan 15 09:39:36 2012 on fusion
     1.9  ;;; $Id$
    1.10  
    1.11  ;;;
    1.12 @@ -103,18 +103,44 @@
    1.13    "YaTeX add-in function for table environment."
    1.14    (cond
    1.15     ((eq major-mode 'yatex-mode)
    1.16 -    (setq YaTeX-env-name "tabular"
    1.17 -	  YaTeX-section-name "caption")
    1.18 -    (YaTeX:read-position "htbp"))
    1.19 +    (let (pos (caption "") (label "") (opts ""))
    1.20 +      (setq pos (YaTeX:read-position "htbp")
    1.21 +	    caption (read-string "Table Caption: "))
    1.22 +      (if (string= "" caption)
    1.23 +	  (setq YaTeX-section-name "caption")
    1.24 +	(setq opts (format "\n\\caption{%s}" caption)))
    1.25 +      (setq label (read-string "Label: "))
    1.26 +      (if (string= "" label)
    1.27 +	  (setq YaTeX-section-name "label")
    1.28 +	(setq opts (format "%s\n\\label{%s}" opts label)))
    1.29 +      (setq YaTeX-env-name "tabular"
    1.30 +	    YaTeX-section-name "caption")
    1.31 +      (concat pos opts)))
    1.32     ((eq major-mode 'texinfo-mode)
    1.33      (concat " "
    1.34  	    (completing-read
    1.35  	     "Highlights with: "
    1.36  	     '(("@samp")("@kbd")("@code")("@asis")("@file")("@var"))
    1.37  	     nil nil "@")))))
    1.38 +(fset 'YaTeX:table* 'YaTeX:table)
    1.39  
    1.40 -(fset 'YaTeX:figure 'YaTeX:table)
    1.41 -(fset 'YaTeX:figure* 'YaTeX:table)
    1.42 +;;;
    1.43 +;; Functions for figure environemnt
    1.44 +;;;
    1.45 +(defun YaTeX:figure ()
    1.46 +  "YaTeX add-in function for figure(*) environment."
    1.47 +  (let ((caption "") (label "") (opts ""))
    1.48 +    (setq label (read-string "Figure Label: "))
    1.49 +    (if (string= "" label)
    1.50 +	(setq YaTeX-section-name "label")
    1.51 +      (setq opts (format "\n\\label{%s}" label)))
    1.52 +    (setq caption (read-string "Figure Caption: "))
    1.53 +    (if (string= "" caption)
    1.54 +	(setq YaTeX-section-name "caption")
    1.55 +      (setq opts (format "%s\n%% figure here\n\\caption{%s}" opts caption)))
    1.56 +    opts))
    1.57 +
    1.58 +(fset 'YaTeX:figure* 'YaTeX:figure)
    1.59  
    1.60  
    1.61  (defun YaTeX:description ()