yatex
changeset 430:fa7408c1a9e3 dev
merged
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Thu, 01 Oct 2015 15:47:12 +0859 |
parents | 8923ea11c085 64c07f0a179f |
children | 5cce749f9bbb |
files | |
diffstat | 2 files changed, 86 insertions(+), 3 deletions(-) [+] |
line diff
1.1 --- a/yatex.el Thu Oct 01 15:46:25 2015 +0859 1.2 +++ b/yatex.el Thu Oct 01 15:47:12 2015 +0859 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; yatex.el --- Yet Another tex-mode for emacs //–ì’¹// -*- coding: sjis -*- 1.5 ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] 1.6 -;;; Last modified Wed Jul 8 13:41:17 2015 on duke 1.7 +;;; Last modified Mon Aug 31 11:59:17 2015 on zxr 1.8 ;;; $Id$ 1.9 ;;; The latest version of this software is always available at; 1.10 ;;; http://www.yatex.org/ 1.11 @@ -299,6 +299,8 @@ 1.12 ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit") 1.13 ;;cleveref 1.14 ("cref") ("crefrange") ("cpageref") ("labelcref") ("labelcpageref") 1.15 + ;; beamer 1.16 + ("frametitle") ("framesubtitle") 1.17 ) 1.18 (if YaTeX-use-LaTeX2e 1.19 '(("documentclass") ("usepackage") 1.20 @@ -349,7 +351,7 @@ 1.21 ; Set tex-environment possible completion 1.22 (defvar env-table 1.23 (append 1.24 - '(("quote") ("quotation") ("center") ("verse") ("document") 1.25 + '(("quote") ("quotation") ("centerc") ("verse") ("document") 1.26 ("verbatim") ("itemize") ("enumerate") ("description") 1.27 ("list") ("tabular") ("tabular*") ("table") ("tabbing") ("titlepage") 1.28 ("sloppypar") ("picture") ("displaymath") 1.29 @@ -359,6 +361,7 @@ 1.30 ("minipage") 1.31 ("supertabular") 1.32 ("wrapfigure") ("wraptable") 1.33 + ("frame") ("block") ("example") ("columns") ("column") ;beamer 1.34 ) 1.35 (if YaTeX-use-LaTeX2e 1.36 '(("comment") ;defined in version 1.37 @@ -410,6 +413,7 @@ 1.38 ("linebreak") ("pagebreak") ("noindent") ("indent") 1.39 ("left") ("right") ("dots") ("smallskip") ("medskip") ("bigskip") 1.40 ("displaystyle") 1.41 + ("onslide") ("pause") ;beamer 1.42 ) 1.43 (if YaTeX-greek-by-maketitle-completion 1.44 '(("alpha") ("beta") ("gamma") ("delta") ("epsilon")
2.1 --- a/yatexadd.el Thu Oct 01 15:46:25 2015 +0859 2.2 +++ b/yatexadd.el Thu Oct 01 15:47:12 2015 +0859 2.3 @@ -1,6 +1,6 @@ 2.4 ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*- 2.5 ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] 2.6 -;;; Last modified Wed Jul 8 09:15:15 2015 on firestorm 2.7 +;;; Last modified Mon Aug 31 22:40:47 2015 on zxr 2.8 ;;; $Id$ 2.9 2.10 ;;; Code: 2.11 @@ -2105,6 +2105,85 @@ 2.12 ((memq c '(?c ?C)) (setq left "{\\scriptsize " right "}"))) 2.13 (format "%s%s%s" left char right))))) 2.14 2.15 +;;; -------------------- beamer stuff -------------------- 2.16 +(defvar YaTeX:frame-option-alist-default 2.17 + '(("plain") ("containsverbatim") ("shrink") ("squeeze") 2.18 + ("allowframebreaks") ("label="))) 2.19 +(defvar YaTeX:frame-option-alist-private nil 2.20 + "*Alist for completion list of the argument for `frame' environemnt") 2.21 +(defvar YaTeX:frame-option-alist 2.22 + (append YaTeX:frame-option-alist-private YaTeX:frame-option-alist-default)) 2.23 + 2.24 +(defun YaTeX:frame () 2.25 + (let*((minibuffer-local-completion-map YaTeX-minibuffer-completion-map) 2.26 + (delim ",") 2.27 + (opt (YaTeX-completing-read-or-skip 2.28 + "Frame option: " YaTeX:frame-option-alist)) 2.29 + (title (YaTeX-read-string-or-skip "Title: ")) 2.30 + (subtitle (YaTeX-read-string-or-skip "Subtitle: "))) 2.31 + (setq YaTeX-env-name "columns") 2.32 + (concat 2.33 + (if (string< "" opt) (concat "[" opt "]")) 2.34 + (if (string< "" title) (concat "{" title "}")) 2.35 + (if (string< "" subtitle) (concat "{" subtitle "}"))))) 2.36 + 2.37 +(defun YaTeX:column-read-width () 2.38 + "Completing function for column environment/macro of Beamer" 2.39 + (let ((md (match-data)) (colsinf (YaTeX-quick-in-environment-p "columns")) 2.40 + (totalw (float 1)) restw (ww "\\textwidth") defw cw) 2.41 + (unwind-protect 2.42 + (progn 2.43 + (if (save-excursion 2.44 + (YaTeX-re-search-active-backward 2.45 + "totalwidth=\\([.0-9]+\\)\\(\\\\.*width\\)" 2.46 + YaTeX-comment-prefix (cdr colsinf) t)) 2.47 + (setq totalw (float (string-to-number (YaTeX-match-string 1))) 2.48 + ww (YaTeX-match-string 2))) 2.49 + (setq restw totalw) 2.50 + (save-excursion 2.51 + (while (YaTeX-re-search-active-backward 2.52 + (concat 2.53 + "\\\\begin{column}{\\([.0-9]+\\)\\(\\\\.*width\\)}" 2.54 + "\\|" 2.55 + "\\\\column{\\([.0-9]+\\)\\(\\\\.*width\\)}") 2.56 + YaTeX-comment-prefix 2.57 + (cdr colsinf) t) 2.58 + (setq restw (- restw (string-to-number 2.59 + (or (YaTeX-match-string 1) 2.60 + (YaTeX-match-string 3))))))) 2.61 + (setq defw (format "%.2f%s" 2.62 + (if (= totalw restw) (/ totalw 2) restw) 2.63 + (or (YaTeX-match-string 2) 2.64 + (YaTeX-match-string 4) 2.65 + ww)) 2.66 + cw (YaTeX:read-length 2.67 + (format "Column width(default: %s): " defw))) 2.68 + (if (string= "" cw) (setq cw defw)) 2.69 + (prog1 2.70 + cw 2.71 + (setq YaTeX-section-name "column"))) 2.72 + (store-match-data md)))) 2.73 + 2.74 +(defun YaTeX:column () 2.75 + (if (eq YaTeX-current-completion-type 'begin) 2.76 + (concat "{" (YaTeX:column-read-width) "}"))) 2.77 +(defun YaTeX::column (argp) 2.78 + (cond 2.79 + ((= argp 1) (YaTeX:column-read-width)))) 2.80 +(defvar YaTeX:columns-option-alist 2.81 + '(("t") ("T") ("b") ("c") ("onlytextwidth") ("totalwidth=0.9\\textwidth")) 2.82 + "*Default option alist for completing columns environment of Beamer") 2.83 + 2.84 +(defun YaTeX:columns () 2.85 + (setq YaTeX-section-name "column" 2.86 + YaTeX-env-name "column") 2.87 + (let*((minibuffer-local-completion-map YaTeX-minibuffer-completion-map) 2.88 + (delim ",=") 2.89 + (tbl (append YaTeX:columns-option-alist)) ;XX 2.90 + (opt (YaTeX-completing-read-or-skip "columns option: " tbl))) 2.91 + (if (string< "" opt) 2.92 + (concat "[" opt "]")))) 2.93 + 2.94 ;;; -------------------- math-mode stuff -------------------- 2.95 (defun YaTeX::tilde (&optional pos) 2.96 "For accent macros in mathmode"