yatex

changeset 413:368a86a179ff dev

The variable YaTeX::get-boundingbox-cmd added
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 08 Jul 2015 09:16:35 +0900
parents b899adfd0879
children 0863123199f0 1ab1b9ba8698
files yatexadd.el
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/yatexadd.el	Fri Feb 13 20:42:31 2015 +0900
     1.2 +++ b/yatexadd.el	Wed Jul 08 09:16:35 2015 +0900
     1.3 @@ -1,6 +1,6 @@
     1.4  ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*-
     1.5  ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org]
     1.6 -;;; Last modified Fri Jan 16 14:57:59 2015 on firestorm
     1.7 +;;; Last modified Wed Jul  8 09:15:15 2015 on firestorm
     1.8  ;;; $Id$
     1.9  
    1.10  ;;; Code:
    1.11 @@ -1945,12 +1945,22 @@
    1.12      (if (string= "" str) ""
    1.13        (concat "[" str "]"))))
    1.14  
    1.15 +(defvar YaTeX::get-boundingbox-cmd YaTeX-cmd-gs
    1.16 +  "Command to get bounding box from PDF files.
    1.17 +Possible values are `gs' and `extractbb'.")
    1.18 +
    1.19  (defun YaTeX::get-boundingbox (file)
    1.20    "Return the bound box as a string
    1.21  This function relies on gs(ghostscript) command installed."
    1.22    (let ((str (YaTeX-command-to-string
    1.23 -	      (format "%s -sDEVICE=bbox -dBATCH -dNOPAUSE %s"
    1.24 -		      YaTeX-cmd-gs file))))
    1.25 +	      (format
    1.26 +	       (cond
    1.27 +		((string-match "extractbb" YaTeX::get-boundingbox-cmd)
    1.28 +		 "%s -O %s")
    1.29 +		((string-match "gs" YaTeX::get-boundingbox-cmd)
    1.30 +		 "%s -sDEVICE=bbox -dBATCH -dNOPAUSE %s")
    1.31 +		(t "echo %s %s"))
    1.32 +	       YaTeX::get-boundingbox-cmd file))))
    1.33      (if (string-match
    1.34  	 "%%BoundingBox:\\s \\([0-9]+\\s [0-9]+\\s [0-9]+\\s [0-9]+\\)"
    1.35  	 str)