changeset 374:9b3093c0c181 dev

conv2image format set to jpg for testing
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 30 Dec 2014 09:19:04 +0900
parents 1b2e55ef1026
children afb8cb06b1d4
files yatexprc.el
diffstat 1 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/yatexprc.el	Mon Dec 29 22:42:39 2014 +0900
+++ b/yatexprc.el	Tue Dec 30 09:19:04 2014 +0900
@@ -1,7 +1,7 @@
 ;;; yatexprc.el --- YaTeX process handler
 ;;; 
 ;;; (c)1993-2014 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Mon Dec 29 22:42:27 2014 on sdr
+;;; Last modified Tue Dec 30 09:17:29 2014 on sdr
 ;;; $Id$
 
 ;;; Code:
@@ -437,11 +437,11 @@
 (defvar YaTeX-typeset-dvi2image-chain
   (cond
    ((YaTeX-executable-find "dvipng")
-    (list "dvipng %b"))
+    (list "dvipng %b.dvi"))
    ((YaTeX-executable-find YaTeX-cmd-dvips)
     (list
      (format "%s -E -o %%b.eps %%b.dvi" YaTeX-cmd-dvips)
-     "convert -alpha off -density %d %b.eps %b.png")))
+     "convert -alpha off -density %d %b.eps %b.%f")))
   "*Pipe line of command as a list to create png file from DVI or PDF.
 %-notation rewritten list:
  %b	basename of target file(\"texput\")
@@ -460,15 +460,13 @@
 (defun YaTeX-typeset-conv2image-chain ()
   (let*((proc (or YaTeX-typeset-process YaTeX-typeset-conv2image-process))
 	(prevname (process-name proc))
-	(target "texput.png")
+	(texput "texput") (format "jpg")
+	(target (concat texput "." format))
 	(math (get 'YaTeX-typeset-conv2image-chain 'math))
-	;(conv (format "convert -density %d - %s" (if math 250 100) target))
-	;(chain (list (format "dvips -E -o - texput|%s" conv)))
-	;(conv (format "convert -alpha off - %s"  target))
-	(case-fold-search t)
 	(srctype (or (get 'YaTeX-typeset-conv2image-chain 'srctype)
-		     (if (save-excursion
-			   (re-search-backward "this is pdftex" nil t))
+		     (if (file-newer-than-file-p
+			  (concat texput ".pdf")
+			  (concat texput ".dvi"))
 			 'pdf 'dvi)))
 	(chain (cdr (assq srctype YaTeX-typeset-conv2image-chain-alist)))
 	;; This function is the first evaluation code.
@@ -493,7 +491,7 @@
 	  (let ((cmdline (YaTeX-replace-formats
 			  command
 			  (list (cons "b" "texput")
-				(cons "f" "png")
+				(cons "f" format)
 				(cons "d" (if math "300" "200"))))))
 	    (insert (format "Calling `%s'...\n" cmdline))
 	    (set-process-sentinel

yatex.org