Mercurial > hgrepos > hgweb.cgi > yatex
diff yatexadd.el @ 86:f14ec50103d0
as of 2009/9/28
author | yuuji@gentei.org |
---|---|
date | Mon, 28 Sep 2009 07:56:08 +0900 |
parents | 9b4354af748c |
children | 47a11079cc56 |
line wrap: on
line diff
--- a/yatexadd.el Sun Sep 27 12:53:18 2009 +0000 +++ b/yatexadd.el Mon Sep 28 07:56:08 2009 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX add-in functions. ;;; yatexadd.el rev.18 ;;; (c)1991-2006 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Dec 24 15:12:30 2006 on firestorm +;;; Last modified Fri Sep 21 11:44:42 2007 on firestorm ;;; $Id$ ;;; @@ -796,7 +796,7 @@ "\\)\\|\\(" YaTeX::ref-labeling-regexp "\\)")) (itemsep (concat YaTeX-ec-regexp "\\(\\(bib\\)?item\\|begin\\|end\\)")) - (refcmd (or refcmd "ref")) + (refcmd (or refcmd "\\(page\\)?ref")) (p (point)) initl line cf (percent (regexp-quote YaTeX-comment-prefix)) (output @@ -1097,8 +1097,12 @@ (switch-to-buffer buf) (goto-char p) (if (re-search-backward - (concat "\\\\" refcmd "{\\([^}]+\\)}") nil t) - (setq label (YaTeX-match-string 1)) + (concat "\\\\" refcmd "{") nil t) + (setq label (YaTeX-buffer-substring + (progn (goto-char (1- (match-end 0))) + (1+ (point))) + (progn (forward-list 1) + (1- (point))))) (setq label "")))) ((>= line (+ lnum 2)) (setq label (read-string (format "\\%s{???}: " refcmd)))) @@ -1565,11 +1569,14 @@ (setq YaTeX-default-document-style sname))))) (defun YaTeX::include (argp &optional prompt) + "Read file name setting default directory to that of main file." (cond ((= argp 1) - (let*((insert-default-directory) - (file (read-file-name (or prompt "Input file: ") ""))) - (setq file (substring file 0 (string-match "\\.tex$" file))))))) + (save-excursion + (YaTeX-visit-main t) + (let*((insert-default-directory) + (file (read-file-name (or prompt "Input file: ") ""))) + (setq file (substring file 0 (string-match "\\.tex$" file)))))))) (fset 'YaTeX::input 'YaTeX::include) @@ -1764,6 +1771,10 @@ "Add-in for \\includegraphics" (YaTeX::include argp "Image File: ")) +(defun YaTeX::verbfile (argp) + "Add-in for \\verbfile" + (YaTeX::include argp "Virbatim File: ")) + (defun YaTeX:caption () (setq YaTeX-section-name "label") nil)