[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Supporting LatexMK in AUCTeX OOTB
From: |
Arash Esbati |
Subject: |
Re: Supporting LatexMK in AUCTeX OOTB |
Date: |
Mon, 15 Apr 2024 11:55:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Keita,
Ikumi Keita <ikumi@ikumi.que.jp> writes:
> This isn't quite correct because this clause covers cases for Japanese
> LaTeX engines (`TeX-engine' being ptex or uptex※) as well.
>
> ※ `jtex' engine became obsolete and isn't maintained anymore as far as
> I know.
Thanks for your comments. Yes, I ignored tex-jp.el completely :-[ This
is my next approximation:
--8<---------------cut here---------------start------------->8---
diff --git a/tex.el b/tex.el
index c4e4104e..a0649c73 100644
--- a/tex.el
+++ b/tex.el
@@ -250,6 +250,9 @@ If nil, none is specified."
("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil
(plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode)
:help "Convert PostScript file to PDF")
+ ("LaTeXMK" "latexmk -recorder %(latexmk-out) %(file-line-error) \
+%`%(extraopts) %S%(mode)%' %t"
+ TeX-run-format nil (LaTeX-mode docTeX-mode) :help "Run LaTeXMK")
("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command nil
(plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode)
:help "Run makeglossaries to create glossary file")
@@ -672,7 +675,40 @@ string."
;; Okular forward PDF search requires absolute path.
("%a" (lambda nil (prin1-to-string (expand-file-name (buffer-file-name)))))
;; the following is for preview-latex.
- ("%m" preview-create-subdirectory))
+ ("%m" preview-create-subdirectory)
+ ;; LaTeXMK support
+ ("%(latexmk-out)"
+ (lambda ()
+ (cond ((eq TeX-engine 'xetex)
+ " -pdfxe")
+ ((eq TeX-engine 'luatex)
+ (cond ((and TeX-PDF-mode
+ (TeX-PDF-from-DVI))
+ " -dvilua -pdfdvi")
+ ((and (not TeX-PDF-mode)
+ TeX-DVI-via-PDFTeX)
+ " -dvilua -ps")
+ ;; This covers the case:
+ ;; (and TeX-PDF-mode (not (TeX-PDF-from-DVI)))
+ (t
+ " -pdflua")))
+ ;; This covers everything else since we ignore 'omega:
+ (t
+ (cond ((and TeX-PDF-mode
+ (not (TeX-PDF-from-DVI)))
+ " -pdf")
+ ((and TeX-PDF-mode
+ (string= (TeX-PDF-from-DVI) "Dvips"))
+ " -pdfps")
+ ;; FIXME: This might be inaccurate:
+ ((and TeX-PDF-mode
+ (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
+ " -pdfdvi")
+ ((and (not TeX-PDF-mode)
+ TeX-DVI-via-PDFTeX)
+ " -pdflatex -dvi -ps")
+ (t
+ " -dvi -ps")))))))
"List of built-in expansion strings for TeX command names.
This should not be changed by the user who can use
@@ -2200,7 +2236,8 @@ Must be the car of an entry in `TeX-command-list'."
"\\.glo" "\\.gls" "\\.idx" "\\.ilg" "\\.ind"
"\\.lof" "\\.log" "\\.lot" "\\.nav" "\\.out"
"\\.snm" "\\.toc" "\\.url" "\\.synctex\\.gz"
- "\\.bcf" "\\.run\\.xml" "\\.fls" "-blx\\.bib")
+ "\\.bcf" "\\.run\\.xml" "\\.fls" "-blx\\.bib"
+ "\\.fdb_latexmk")
"List of regexps matching suffixes of files to be cleaned.
Used as a default in TeX, LaTeX and docTeX mode.")
--8<---------------cut here---------------end--------------->8---
Reg. this part:
+ ;; FIXME: This might be inaccurate:
+ ((and TeX-PDF-mode
+ (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
+ " -pdfdvi")
I think users have to control the behavior of $dvipdf inside their
latexmk config file; I have no idea how this should work (and don't want
to investigate further). WDYT?
Best, Arash
- Re: Supporting LatexMK in AUCTeX OOTB, Colin Baxter, 2024/04/01
- Re: Supporting LatexMK in AUCTeX OOTB, Ikumi Keita, 2024/04/02
- Re: Supporting LatexMK in AUCTeX OOTB, Arash Esbati, 2024/04/02
- Re: Supporting LatexMK in AUCTeX OOTB, Ikumi Keita, 2024/04/03
- Re: Supporting LatexMK in AUCTeX OOTB, Arash Esbati, 2024/04/04
- Re: Supporting LatexMK in AUCTeX OOTB, Ikumi Keita, 2024/04/10
- Re: Supporting LatexMK in AUCTeX OOTB, Arash Esbati, 2024/04/10
- Re: Supporting LatexMK in AUCTeX OOTB, Ikumi Keita, 2024/04/14
- Re: Supporting LatexMK in AUCTeX OOTB,
Arash Esbati <=
- Re: Supporting LatexMK in AUCTeX OOTB, Ikumi Keita, 2024/04/15
- Re: Supporting LatexMK in AUCTeX OOTB, Arash Esbati, 2024/04/16
- Re: Supporting LatexMK in AUCTeX OOTB, Ikumi Keita, 2024/04/18
- Re: Supporting LatexMK in AUCTeX OOTB, Arash Esbati, 2024/04/18
- Re: Supporting LatexMK in AUCTeX OOTB, Basil L. Contovounesios, 2024/04/19