annotate lisp/auctex/style/psfig.el @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 4103f0995bd7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
1 ;;; psfig.el - Support for the psfig style option.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
2
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
3 ;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
4 ;; Please direct comments to him.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
5
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
6 ;;; Code:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
7
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
8 (TeX-add-style-hook "psfig"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
9 (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
10 (lambda ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
11 ;; probable some of the following symbols may be removed
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
12 (TeX-add-symbols "protect" "figurepath" "fbox"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
13 "other" "letter" "other" "then" "Sine" "Cosine"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
14 "psdraft" "psfull" "psscalefirst" "psrotatefirst"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
15 "psnodraftbox" "psdraftbox" "pssilent" "psnoisy"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
16 "minmaxtest"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
17 '("psfig" TeX-arg-psfig)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
18 '("psfigurepath" t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
19 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
20 (LaTeX-add-environments
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
21 '("psfigure" LaTeX-env-psfigure)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
22 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
23 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
25 (defun TeX-arg-psfig (optional)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
26 "Ask for file, width and length. Insert psfig macro"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
27 (let ((psfile (read-file-name "PS-file: " "" "" nil))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
28 (figwidth (read-input "Figure width: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
29 (figheight (read-input "Figure height: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
30 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
31
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
32 (insert TeX-grop "figure=" psfile)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
33 (if (not (zerop (length figwidth)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
34 (insert ",width=" figwidth))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
35 (if (not (zerop (length figheight)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
36 (insert ",height=" figheight))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
37 (insert TeX-grcl)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
38 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
39 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
40
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
41
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
42 (defun LaTeX-env-psfigure (environment)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
43 "Create with \\label and \\caption and \\psfig commands."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
44 (let ((float (read-input "Float to: " LaTeX-float))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
45 (caption (read-input "Caption: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
46 (label (read-input "Label: " LaTeX-figure-label))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
47 ; gf: ask if this should be centered
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
48 (psfile (read-file-name "PS-file: " "" "" nil))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
49 (figwidth (read-input "Figure width: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
50 (figheight (read-input "Figure height: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
51 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
52
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
53 (setq LaTeX-float (if (zerop (length float))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
54 LaTeX-float
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
55 float))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
56
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
57 (LaTeX-insert-environment "figure"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
58 (concat LaTeX-optop LaTeX-float LaTeX-optcl))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
59
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
60 (insert TeX-esc "centerline" TeX-grop TeX-esc "psfig" TeX-grop
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
61 "figure=" psfile)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
62 (if (not (zerop (length figwidth)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
63 (insert ",width=" figwidth))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
64 (if (not (zerop (length figheight)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
65 (insert ",height=" figheight))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
66 (insert TeX-grcl TeX-grcl)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
67 (if (zerop (length caption))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
68 ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
69 (newline-and-indent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
70 (insert TeX-esc "caption" TeX-grop caption TeX-grcl))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
71 (if (or (zerop (length label))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
72 (equal LaTeX-figure-label label))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
73 ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
74 (newline-and-indent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
75 (insert TeX-esc "label" TeX-grop label TeX-grcl))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
76
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
77 (forward-line 2)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
78
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
79 ;;; psfig.el ends here