yatex
diff yatexadd.el @ 97:6be1692f81cd
Gave up to use `current' as branch name, because changeset 25:ab9c4c4f9f7a
is tagged with the same name.
author | yuuji@gentei.org |
---|---|
date | Mon, 28 Sep 2009 12:50:26 +0900 |
parents | 9b4354af748c |
children | 47a11079cc56 |
line diff
1.1 --- a/yatexadd.el Sun Dec 24 06:16:52 2006 +0000 1.2 +++ b/yatexadd.el Mon Sep 28 12:50:26 2009 +0900 1.3 @@ -2,7 +2,7 @@ 1.4 ;;; YaTeX add-in functions. 1.5 ;;; yatexadd.el rev.18 1.6 ;;; (c)1991-2006 by HIROSE Yuuji.[yuuji@yatex.org] 1.7 -;;; Last modified Sun Dec 24 15:12:30 2006 on firestorm 1.8 +;;; Last modified Fri Sep 21 11:44:42 2007 on firestorm 1.9 ;;; $Id$ 1.10 1.11 ;;; 1.12 @@ -796,7 +796,7 @@ 1.13 "\\)\\|\\(" YaTeX::ref-labeling-regexp "\\)")) 1.14 (itemsep (concat YaTeX-ec-regexp 1.15 "\\(\\(bib\\)?item\\|begin\\|end\\)")) 1.16 - (refcmd (or refcmd "ref")) 1.17 + (refcmd (or refcmd "\\(page\\)?ref")) 1.18 (p (point)) initl line cf 1.19 (percent (regexp-quote YaTeX-comment-prefix)) 1.20 (output 1.21 @@ -1097,8 +1097,12 @@ 1.22 (switch-to-buffer buf) 1.23 (goto-char p) 1.24 (if (re-search-backward 1.25 - (concat "\\\\" refcmd "{\\([^}]+\\)}") nil t) 1.26 - (setq label (YaTeX-match-string 1)) 1.27 + (concat "\\\\" refcmd "{") nil t) 1.28 + (setq label (YaTeX-buffer-substring 1.29 + (progn (goto-char (1- (match-end 0))) 1.30 + (1+ (point))) 1.31 + (progn (forward-list 1) 1.32 + (1- (point))))) 1.33 (setq label "")))) 1.34 ((>= line (+ lnum 2)) 1.35 (setq label (read-string (format "\\%s{???}: " refcmd)))) 1.36 @@ -1565,11 +1569,14 @@ 1.37 (setq YaTeX-default-document-style sname))))) 1.38 1.39 (defun YaTeX::include (argp &optional prompt) 1.40 + "Read file name setting default directory to that of main file." 1.41 (cond 1.42 ((= argp 1) 1.43 - (let*((insert-default-directory) 1.44 - (file (read-file-name (or prompt "Input file: ") ""))) 1.45 - (setq file (substring file 0 (string-match "\\.tex$" file))))))) 1.46 + (save-excursion 1.47 + (YaTeX-visit-main t) 1.48 + (let*((insert-default-directory) 1.49 + (file (read-file-name (or prompt "Input file: ") ""))) 1.50 + (setq file (substring file 0 (string-match "\\.tex$" file)))))))) 1.51 1.52 (fset 'YaTeX::input 'YaTeX::include) 1.53 1.54 @@ -1764,6 +1771,10 @@ 1.55 "Add-in for \\includegraphics" 1.56 (YaTeX::include argp "Image File: ")) 1.57 1.58 +(defun YaTeX::verbfile (argp) 1.59 + "Add-in for \\verbfile" 1.60 + (YaTeX::include argp "Virbatim File: ")) 1.61 + 1.62 (defun YaTeX:caption () 1.63 (setq YaTeX-section-name "label") 1.64 nil)