emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Change default latex compiler to latexmk
@ 2021-06-06 16:55 Timothy
  2021-06-29 14:32 ` Bruce D'Arcus
  0 siblings, 1 reply; 10+ messages in thread
From: Timothy @ 2021-06-06 16:55 UTC (permalink / raw)
  To: org-mode-email

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

Hey all,

From the earlier discussion on this, I got feeling a consensus had
reached that this is a good idea, as long as we check that latexmk is
available first.
As such, here is a patch changing the default LaTeX compiler to latexmk
--- as long as it's available. For what it's worth I've been using this
exact command in my personal config for months now, and it's worked
excellently.

--
Timothy


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-latex-Change-default-compiler-to-latexmk.patch --]
[-- Type: text/x-patch, Size: 2093 bytes --]

From 95806243e40d5f9f19a8db71e2b8b0cd0c5fdb68 Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Mon, 7 Jun 2021 00:46:09 +0800
Subject: [PATCH] ox-latex: Change default compiler to latexmk

* lisp/ox-latex.el (org-latex-pdf-process): Check for the presence of
latexmk when setting the default, and use it when available.  Fall back
to the current default.  This is important for the incoming citation
support, as PDF generation will now need to involve bibliography
generation.  By using latexmk this is taken care of for us.  The -%latex
part of the command is slightly hacky, but allows latexmk to behave more
intelligently for non-pdflatex options.  Note that latexmk also seems to
care about the order of the arguments.
---
 lisp/ox-latex.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 9724b0d87..c761cfd7f 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1165,9 +1165,11 @@ (defcustom org-latex-bib-compiler "bibtex"
   :package-version '(Org . "9.0"))
 
 (defcustom org-latex-pdf-process
-  '("%latex -interaction nonstopmode -output-directory %o %f"
-    "%latex -interaction nonstopmode -output-directory %o %f"
-    "%latex -interaction nonstopmode -output-directory %o %f")
+  (if (executable-find "latexmk")
+      '("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f")
+    '("%latex -interaction nonstopmode -output-directory %o %f"
+      "%latex -interaction nonstopmode -output-directory %o %f"
+      "%latex -interaction nonstopmode -output-directory %o %f"))
   "Commands to process a LaTeX file to a PDF file.
 
 This is a list of strings, each of them will be given to the
@@ -1211,7 +1213,7 @@ (defcustom org-latex-pdf-process
 	  (const :tag "texi2dvi"
 		 ("cd %o; LATEX=\"%latex\" texi2dvi -p -b -V %b.tex"))
 	  (const :tag "latexmk"
-		 ("latexmk -g -pdf -pdflatex=\"%latex\" -outdir=%o %f"))
+		 ("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f"))
 	  (function)))
 
 (defcustom org-latex-logfiles-extensions
-- 
2.31.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-06-06 16:55 [PATCH] Change default latex compiler to latexmk Timothy
@ 2021-06-29 14:32 ` Bruce D'Arcus
  2021-06-30 10:48   ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Bruce D'Arcus @ 2021-06-29 14:32 UTC (permalink / raw)
  To: Timothy; +Cc: org-mode-email

What's the status of this patch?

On Sun, Jun 6, 2021 at 12:55 PM Timothy <tecosaur@gmail.com> wrote:
>
> Hey all,
>
> From the earlier discussion on this, I got feeling a consensus had
> reached that this is a good idea, as long as we check that latexmk is
> available first.
> As such, here is a patch changing the default LaTeX compiler to latexmk
> --- as long as it's available. For what it's worth I've been using this
> exact command in my personal config for months now, and it's worked
> excellently.
>
> --
> Timothy
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-06-29 14:32 ` Bruce D'Arcus
@ 2021-06-30 10:48   ` Bastien
  2021-06-30 11:14     ` Bruce D'Arcus
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2021-06-30 10:48 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: org-mode-email, Timothy

Hi Bruce,

"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> What's the status of this patch?

Can you quickly review it and say whether it's good?

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-06-30 10:48   ` Bastien
@ 2021-06-30 11:14     ` Bruce D'Arcus
  2021-07-09 12:30       ` Bruce D'Arcus
  0 siblings, 1 reply; 10+ messages in thread
From: Bruce D'Arcus @ 2021-06-30 11:14 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode-email, Timothy

Looks good, Bastien, and I think reflects the consensus of that thread.

But trying just now, I'm not able to apply the patch on my local repo
for whatever reason, so haven't tested it.



On Wed, Jun 30, 2021 at 6:48 AM Bastien <bzg@gnu.org> wrote:
>
> Hi Bruce,
>
> "Bruce D'Arcus" <bdarcus@gmail.com> writes:
>
> > What's the status of this patch?
>
> Can you quickly review it and say whether it's good?
>
> Thanks,
>
> --
>  Bastien


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-06-30 11:14     ` Bruce D'Arcus
@ 2021-07-09 12:30       ` Bruce D'Arcus
  2021-07-09 14:17         ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Bruce D'Arcus @ 2021-07-09 12:30 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode-email, Timothy

Can we merge this patch now?

On Wed, Jun 30, 2021 at 7:14 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>
> Looks good, Bastien, and I think reflects the consensus of that thread.
>
> But trying just now, I'm not able to apply the patch on my local repo
> for whatever reason, so haven't tested it.
>
>
>
> On Wed, Jun 30, 2021 at 6:48 AM Bastien <bzg@gnu.org> wrote:
> >
> > Hi Bruce,
> >
> > "Bruce D'Arcus" <bdarcus@gmail.com> writes:
> >
> > > What's the status of this patch?
> >
> > Can you quickly review it and say whether it's good?
> >
> > Thanks,
> >
> > --
> >  Bastien


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-07-09 12:30       ` Bruce D'Arcus
@ 2021-07-09 14:17         ` Bastien
  2021-07-09 14:25           ` Timothy
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2021-07-09 14:17 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: org-mode-email, Timothy

"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> Can we merge this patch now?

I let Timothy decide.

-- 
 Bastien


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-07-09 14:17         ` Bastien
@ 2021-07-09 14:25           ` Timothy
  2021-07-09 15:03             ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Timothy @ 2021-07-09 14:25 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode-email, Bruce D'Arcus


Bastien <bzg@gnu.org> writes:

> I let Timothy decide.

I consider this patch fit to merge. I'm just under the impression that
this I should only push files I'm listed as a maintainer for without
explicit approval.

--
Timothy


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-07-09 14:25           ` Timothy
@ 2021-07-09 15:03             ` Bastien
  2021-07-09 16:41               ` Timothy
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2021-07-09 15:03 UTC (permalink / raw)
  To: Timothy; +Cc: org-mode-email, Bruce D'Arcus

Hi Timothy,

Timothy <tecosaur@gmail.com> writes:

> Bastien <bzg@gnu.org> writes:
>
>> I let Timothy decide.
>
> I consider this patch fit to merge. I'm just under the impression that
> this I should only push files I'm listed as a maintainer for without
> explicit approval.

You can consider this an explicit approval :)  Even if we do something
wrong, we can always discuss and revert it.

Thanks!

-- 
 Bastien


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-07-09 15:03             ` Bastien
@ 2021-07-09 16:41               ` Timothy
  2021-07-09 16:50                 ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Timothy @ 2021-07-09 16:41 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode-email, Bruce D'Arcus


Bastien <bzg@gnu.org> writes:

> You can consider this an explicit approval :)  Even if we do something
> wrong, we can always discuss and revert it.
>
> Thanks!

Pushed :) For future reference, should I be less wary of pushing commits
I'm confident in and haven't had any negative feedback on?

--
Timothy

p.s. updates.orgmode.org is returning a 502 error again


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Change default latex compiler to latexmk
  2021-07-09 16:41               ` Timothy
@ 2021-07-09 16:50                 ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2021-07-09 16:50 UTC (permalink / raw)
  To: Timothy; +Cc: org-mode-email, Bruce D'Arcus

Timothy <tecosaur@gmail.com> writes:

> Pushed :) For future reference, should I be less wary of pushing commits
> I'm confident in and haven't had any negative feedback on?

Yes, sure.

> p.s. updates.orgmode.org is returning a 502 error again

Fixed, thanks.

PS: I'm off next week but will be more available from 20-30 July.

-- 
 Bastien


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-09 16:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 16:55 [PATCH] Change default latex compiler to latexmk Timothy
2021-06-29 14:32 ` Bruce D'Arcus
2021-06-30 10:48   ` Bastien
2021-06-30 11:14     ` Bruce D'Arcus
2021-07-09 12:30       ` Bruce D'Arcus
2021-07-09 14:17         ` Bastien
2021-07-09 14:25           ` Timothy
2021-07-09 15:03             ` Bastien
2021-07-09 16:41               ` Timothy
2021-07-09 16:50                 ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).