[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 7371b46 07/48: Add support for dvipdfmx to \incl
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 7371b46 07/48: Add support for dvipdfmx to \includegraphics |
Date: |
Sun, 16 Sep 2018 01:47:20 -0400 (EDT) |
branch: externals/auctex
commit 7371b4617346d6f77fed2e916acd5b794743a733
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
Add support for dvipdfmx to \includegraphics
* style/graphicx.el (LaTeX-includegraphics-extensions-list): Add
support for dvipdfmx.
* tests/latex/latex-test.el (LaTeX-includegraphics-extensions): New
test to check whether correct extensions are generated.
---
style/graphicx.el | 15 +++++++--
tests/latex/latex-test.el | 86 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+), 3 deletions(-)
diff --git a/style/graphicx.el b/style/graphicx.el
index 94ec51c..bb89b13 100644
--- a/style/graphicx.el
+++ b/style/graphicx.el
@@ -124,8 +124,11 @@ Return value is a list of regexps."
temp))
;; We're generating a .dvi to process with dvips or dvipdfmx
(progn
- (dolist (x '("jpe?g" "pdf" "png"))
- (setq temp (delete x temp)))
+ ;; dvipdfmx can handle jpeg, pdf and png for image formats.
+ (unless (and TeX-PDF-mode
+ (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
+ (dolist (x '("jpe?g" "pdf" "png"))
+ (setq temp (delete x temp))))
(TeX-delete-duplicate-strings
(append LaTeX-includegraphics-dvips-extensions
temp)))))
@@ -148,7 +151,13 @@ Return value is a list of regexps."
temp)))
;; For anything else
(t
- temp))))
+ (if (and TeX-PDF-mode
+ (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
+ ;; dvipdfmx can handle the same image formats as dvips.
+ (TeX-delete-duplicate-strings
+ (append LaTeX-includegraphics-dvips-extensions
+ temp))
+ temp)))))
(defun LaTeX-includegraphics-extensions (&optional list)
"Return appropriate extensions for input files to \\includegraphics.
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index a2dc565..78d2341 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -162,4 +162,90 @@ backend=biber % here is a comment
(should (LaTeX-provided-package-options-member
"biblatex" "backend=biber"))))
+(ert-deftest LaTeX-includegraphics-extensions ()
+ "Check correct extensions are generated accoding to `TeX-engine'."
+ (with-temp-buffer
+ (LaTeX-mode)
+ (TeX-load-style "graphicx")
+ (let (TeX-engine TeX-PDF-mode TeX-PDF-from-DVI
+ TeX-PDF-via-dvips-ps2pdf TeX-DVI-via-PDFTeX)
+ ;; tests for default engine
+ (setq TeX-engine 'default)
+ ;; default 1
+ (setq TeX-PDF-mode t
+ TeX-PDF-from-DVI nil
+ TeX-DVI-via-PDFTeX nil)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
+ "PNG" "PDF" "JPE?G" "JBIG2" "JB2" "eps") #'string<)))
+ ;; default 2
+ (setq TeX-PDF-mode t
+ TeX-PDF-from-DVI "Dvips"
+ TeX-DVI-via-PDFTeX nil)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("eps" "mps" "EPS") #'string<)))
+ ;; default 3
+ (setq TeX-PDF-mode nil
+ TeX-PDF-from-DVI nil
+ TeX-DVI-via-PDFTeX nil)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("eps" "mps" "EPS") #'string<)))
+ ;; default 4
+ (setq TeX-PDF-mode nil
+ TeX-PDF-from-DVI nil
+ TeX-DVI-via-PDFTeX t)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
+ "PNG" "PDF" "JPE?G" "JBIG2" "JB2" "eps") #'string<)))
+ ;; default 5
+ (setq TeX-PDF-mode t
+ TeX-PDF-from-DVI "Dvipdfmx"
+ TeX-DVI-via-PDFTeX nil)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("eps" "mps" "EPS" "jpe?g" "pdf" "png") #'string<)))
+
+ ;; tests for luatex engine
+ (setq TeX-engine 'luatex)
+ ;; luatex 1
+ (setq TeX-PDF-mode t)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("png" "pdf" "jpe?g" "jbig2" "jb2" "mps"
+ "PNG" "PDF" "JPE?G" "JBIG2" "JB2" "eps") #'string<)))
+ ;; luatex 2
+ (setq TeX-PDF-mode nil)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("eps" "mps" "EPS") #'string<)))
+
+ ;; test for xetex engine
+ (setq TeX-engine 'xetex)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("pdf" "eps" "mps" "ps" "png" "jpe?g" "jp2" "jpf"
+ "PDF" "EPS" "MPS" "PS" "PNG" "JPE?G" "JP2" "JPF"
+ "bmp" "pict" "psd" "mac" "tga" "gif" "tif" "tiff"
+ "BMP" "PICT" "PSD" "MAC" "TGA" "GIF" "TIF" "TIFF")
+ #'string<)))
+
+ ;; test for other engine
+ (setq TeX-engine 'omega)
+ ;; other 1
+ (setq TeX-PDF-mode t
+ TeX-PDF-from-DVI "Dvipdfmx")
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("eps" "mps" "EPS" "jpe?g" "pdf" "png") #'string<)))
+ ;; other 2
+ (setq TeX-PDF-mode nil
+ TeX-PDF-from-DVI nil)
+ (should
+ (equal (sort (LaTeX-includegraphics-extensions-list) #'string<)
+ (sort '("eps" "jpe?g" "pdf" "png") #'string<))))))
+
;;; latex-test.el ends here
- [elpa] externals/auctex 94378c1 09/48: Correct record in changes.texi, (continued)
- [elpa] externals/auctex 94378c1 09/48: Correct record in changes.texi, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 00f0e0e 13/48: ; * tex.el (TeX-expand-list): Fix docstring (bug#31217)., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 59a9e5b 10/48: Correct how `TeX-record-buffer' is used, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex c64a0e1 27/48: Quote %b expansion string for Zathura, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4775f96 21/48: ; * tex-jp.el (japanese-TeX-self-insert-command): Silence byte compiler., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 96ba113 23/48: Support UTF-8 with BOM in Japanese TeX documents, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex d5f98ae 32/48: ; Fix typos, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 3b1ffcd 30/48: TL 2018 non-ascii file name fix for preview-latex, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 0d8f8a2 14/48: Prevent spurious newlines to be added, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 527bcb2 16/48: ; * doc/auctex.texi (Processor Options): Add note of case in an option., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 7371b46 07/48: Add support for dvipdfmx to \includegraphics,
Tassilo Horn <=
- [elpa] externals/auctex 4afd633 11/48: Update key=val options to geometry package v5.8, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 6a17a52 24/48: ; * doc/changes.texi (News in 12.2): Add news about removed option., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex ff08d38 28/48: Fix region compilation with \usepackage[utf8]{inputenc}, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex cad042f 31/48: Add note and test about the change involving non-ascii file name, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 5ce08ab 33/48: Raise robustness of call of dvipng command, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 3741b8c 26/48: Prepare for UTF-8 with BOM, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4816092 36/48: Fix possible endless loop, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 74c4843 40/48: Add new style/thmtools.el and style/thm-restate.el, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex ff8f183 39/48: ; * style/floatrow.el (LaTeX-floatrow-update-key-val-options): Use `setq' inside the loop., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex e0caf59 25/48: Drop compatibility code for older emacsen in preview-latex, Tassilo Horn, 2018/09/16