annotate etc/auctex/style/epsf.el @ 50:ee648375d8d6 r19-16b91

Import from CVS: tag r19-16b91
author cvs
date Mon, 13 Aug 2007 08:56:41 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
1 ;;; epsf.el - Support for the epsf style option.
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
2
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
3 ;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
4
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
5 ;;; Code:
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
6
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
7 (TeX-add-style-hook "epsf"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
8 (function
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
9 (lambda ()
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
10 (TeX-add-symbols
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
11 '("epsfsize" TeX-arg-epsfsize)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
12 '("epsffile" TeX-arg-file)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
13 '("epsfbox" TeX-arg-file)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
14 "epsflly" "epsfury" "testit" "epsfgetlitbb"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
15 "epsfnormal" "epsfgetbb" "other" "epsfsetgraph"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
16 "PsFragSpecialArgs" "epsfaux" "testit" "epsfgrab"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
17 "epsfllx" "epsflly" "epsfury" "epsfverbosetrue"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
18 )
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
19 (LaTeX-add-environments
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
20 '("epsffig" LaTeX-env-epsffigure)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
21 )
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
22
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
23 )))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
24
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
25
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
26 (defun LaTeX-env-epsffigure (environment)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
27 "Create a `figure'-environment with \\label and \\caption and \\epsfbox
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
28 commands. Eventually a `psfrags'-environment is inserted round the \\epsfbox."
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
29
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
30 (let ((float (read-input "Float to: " LaTeX-float))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
31 (caption (read-input "Caption: "))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
32 (label (read-input "Label: " LaTeX-figure-label))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
33 ; gf: ask if there is an psfrag environment needed
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
34 (psfrag (y-or-n-p "PS fragments: "))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
35 (psfile (read-file-name "EPS-file: " "" "" nil))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
36 )
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
37
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
38 (setq LaTeX-float (if (zerop (length float))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
39 LaTeX-float
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
40 float))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
41
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
42 (LaTeX-insert-environment "figure"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
43 (concat LaTeX-optop LaTeX-float LaTeX-optcl))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
44 (LaTeX-insert-environment "center")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
45 (if psfrag
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
46 (progn
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
47 (LaTeX-insert-environment "psfrags")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
48 (newline-and-indent)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
49 ))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
50 (if (or (zerop (length label))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
51 (and (string= "figure" environment)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
52 (equal LaTeX-figure-label label))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
53 )
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
54 ()
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
55 (newline-and-indent)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
56 (insert TeX-esc "label" TeX-grop label TeX-grcl)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
57 (end-of-line 0)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
58 (LaTeX-indent-line))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
59
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
60
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
61 (newline-and-indent)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
62 (insert TeX-esc "leavevmode")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
63 (newline-and-indent)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
64 (insert TeX-esc "epsfbox" TeX-grop psfile TeX-grcl)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
65 (if (zerop (length caption))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
66 ()
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
67 (newline-and-indent)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
68 (insert TeX-esc "caption" TeX-grop caption TeX-grcl))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
69 (newline)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
70 (forward-line 4)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
71 (newline)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
72
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
73 ))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
74
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
75 (defun TeX-arg-epsfsize (optional &optional prompt definition)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
76 "Create a line that print epsf figures at a certain percentage"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
77 (interactive)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
78 (let ((scale (read-input "Scale (%): "))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
79 )
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
80 (setq scalestr (if (zerop (length scale))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
81 "75"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
82 (format "%s" scale)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
83 ))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
84 (save-excursion
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
85 ; append #1#{scale#1}
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
86 (insert "#1#2" TeX-grop "0." scale "#1" TeX-grcl)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
87 ; insert \def before \epsfsize
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
88 (beginning-of-line 1)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
89 (newline)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
90 (insert TeX-esc "def")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
91 (forward-line -1)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
92 (insert "% From now on print figures at " scale "% of original size")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
93 )
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
94 (end-of-line)))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
95
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents:
diff changeset
96 ;;; epsf.el ends here