;;; psfig.el - Support for the psfig style option.
+;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+
;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
;; Please direct comments to him.
))
LaTeX-dialect)
-(defun TeX-arg-psfig (optional)
+(defun TeX-arg-psfig (_optional)
"Ask for file, width and length. Insert psfig macro"
(let ((psfile (read-file-name "PS-file: " "" "" nil))
- (figwidth (read-string "Figure width: "))
- (figheight (read-string "Figure height: "))
+ (figwidth (TeX-read-string "Figure width: "))
+ (figheight (TeX-read-string "Figure height: "))
)
(insert TeX-grop "figure=" psfile)
)
-(defun LaTeX-env-psfigure (environment)
+(defun LaTeX-env-psfigure (_environment)
"Create with \\label and \\caption and \\psfig commands."
- (let ((float (read-string "Float to: " LaTeX-float))
- (caption (read-string "Caption: "))
- (label (read-string "Label: " LaTeX-figure-label))
- ; gf: ask if this should be centered
- (psfile (read-file-name "PS-file: " "" "" nil))
- (figwidth (read-string "Figure width: "))
- (figheight (read-string "Figure height: "))
- )
+ (let* ((float (TeX-read-string "Float to: " LaTeX-float))
+ (caption (TeX-read-string "Caption: "))
+ (short-caption (when (>= (length caption) LaTeX-short-caption-prompt-length)
+ (TeX-read-string "(Optional) Short caption: ")))
+ (label (TeX-read-string "Label: " LaTeX-figure-label))
+ ; gf: ask if this should be centered
+ (psfile (read-file-name "PS-file: " "" "" nil))
+ (figwidth (TeX-read-string "Figure width: "))
+ (figheight (TeX-read-string "Figure height: "))
+ )
(setq LaTeX-float (if (zerop (length float))
LaTeX-float
(if (zerop (length caption))
()
(newline-and-indent)
- (insert TeX-esc "caption" TeX-grop caption TeX-grcl))
+ (insert (LaTeX-compose-caption-macro caption short-caption)))
(if (or (zerop (length label))
(equal LaTeX-figure-label label))
()