From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6FlzIuwUTWT2MQAASxT56A (envelope-from ) for ; Sat, 29 Apr 2023 15:00:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SER0IuwUTWSWAgAAauVa8A (envelope-from ) for ; Sat, 29 Apr 2023 15:00:28 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0E36428CAD for ; Sat, 29 Apr 2023 15:00:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pskAo-0008Ib-L8; Sat, 29 Apr 2023 08:59:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pskAn-0008IT-Dp for emacs-orgmode@gnu.org; Sat, 29 Apr 2023 08:59:33 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pskAk-00042j-8z for emacs-orgmode@gnu.org; Sat, 29 Apr 2023 08:59:33 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f19afc4fbfso7217355e9.2 for ; Sat, 29 Apr 2023 05:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew.cmu.edu; s=google-2021; t=1682773164; x=1685365164; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Wkv49mBPC49QzEzTH9o410Eq1WcDKZT6pBgfeOqk0OE=; b=JA4z2Yd7eqqaMYL1Ys0Yqp6hy1FPsFrgAZZlwYraUV+PtdfGRNUeoUCjJdwNaoPmef 7jC5qPF81jQ0IYHLjK1nfgWQKy0ixDImdQ27VYx+VFxyuMZbjiKpErSlOejLGxR69MWM Y/6Io1lNlAWqA5YLHg0r4LH0EEmz+Yr4lG2JSteJ7TR1tEZH4s/0YVkN9dBjswS7BHsB NXqPwzz7Fy4oNqczrWHh0/i9zBx1oPj6+xnPYOKmK7oN0ZeySp+ny9rTkTIfrkdc/s/6 Un4XixeAj3FSDQ3nzjYP/RYunoZ+A7/SczEBcbGCe8W8aONeNfYdzmDfrQGIbgITK7DX yxfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682773164; x=1685365164; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Wkv49mBPC49QzEzTH9o410Eq1WcDKZT6pBgfeOqk0OE=; b=SdCqdBDzMvui42Wb52q+guIqP6UlFDOxEKawesD16cDaQrhnZQlyCzm53edKZSoFgY NRNbStXh/UFzSvnqZas8BYhMWod+0u0u7nZTHZsbo07N+8iDNmgd4IEorshEa/bCIvfI BtmavZlbSvAsIJrV799RKBPRDVM6vLz8fcD5KWSs3A2DgGNOxvNhfi1rJ4f5F3xiSwlr BaKUoG1cyPeHhs+jJOHK8kDeaS9jvMTeo7GqmlOWggCOgTy/ODY+jyNScpuneeIK1uQ5 Ty08wAhFL0meh8teoqvtv/yYQ+s+Ztq9SVckARDSLv93Mx5afOx0wNVO6Rob7ILfTddB WfIQ== X-Gm-Message-State: AC+VfDzIPMwJe3pvb2Lj2hdzrxmcsqF3U9yrMUHSJhqNiWaMkRG+q8LF FJBWIGrY9jQrJR9gPpDZiVgdYe7/IzQ/1FoXb2whWSXXta7Q8Bka+xk= X-Google-Smtp-Source: ACHHUZ7LsFeZydJx6D/ah8cnkISVC5ixoaN/krgdNHhESWiCpnAphtWnB4c2Canj58TpH4T2Zs89zUx3+QGJzlzoVbI= X-Received: by 2002:adf:fdc6:0:b0:306:2767:4959 with SMTP id i6-20020adffdc6000000b0030627674959mr262317wrs.27.1682773163836; Sat, 29 Apr 2023 05:59:23 -0700 (PDT) MIME-Version: 1.0 From: John Kitchin Date: Sat, 29 Apr 2023 08:59:12 -0400 Message-ID: Subject: Troubleshooting empty *Org PDF LaTeX Output* To: Emacs Orgmode Content-Type: multipart/alternative; boundary="000000000000ab1d8205fa79286e" Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=jkitchin@andrew.cmu.edu; helo=mail-wm1-x32f.google.com X-Spam_score_int: 0 X-Spam_score: -0.0 X-Spam_bar: / X-Spam_report: (-0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URI_DOTEDU=1.999 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682773228; a=rsa-sha256; cv=none; b=shT2S21eDS06WImwsfnFNMIZYFlP5CVq+nVD5VzrRoPozoKqIu68SS65MuUXao5vIaAlZ3 3Yi0ZEbD31a6C9SSJn32jEexKr2TJavmwz4mboBE8GyxNCZQF+mNSGA/XlS1lCxBH2fGuM wNmqQ7VLxUUhYG+o6xvym2ZCbXtKptw/3ADHJNjQ+AKuvcgCboTnnfY9vCeZUBjxYy0wbi PJLTjFDimNe8cs13XLNjw7er0JdbF7cpTblAI8K9gxwD1edLsEGiu0Dh8mQIlSyELWZqyZ H4y+54ovnL0i1q2n1SmWblU5XxP6hbuTXooou+RxGZdkSgrKIdbI4TIx1HVPQg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=JA4z2Yd7; dmarc=pass (policy=none) header.from=andrew.cmu.edu; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682773228; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Wkv49mBPC49QzEzTH9o410Eq1WcDKZT6pBgfeOqk0OE=; b=TTCGrY7mcIa1bpgYM1RAPxGH0/bPGWB+5Q8vFmHGmxspT5Lhy5m0bB24UJf+fnjmlQVHFt HEPRnwCSvo5D7/aCKBg2RVom23Xec1WKSJYr2etzxnc8h77d0GBvPLJ+h9vOWahwv7+1om UEG36IPCLKNCSF8Mo5GS7U4tYYXn2fA8ROhmdJ8rIwli+hTrK7RSKjACcm2g6532MW7NEz NJhjoeBS//9pCzV+K+qYuNvOPZAlsWhNmBH4IAaSaF++5eVUkfRLxVB7KfkqDV9mNosmCo tKWQWyG9DxvAMuxWZzbaN9HX2Q1FjRhcsZ5OR1CV361Sh9I6q8Ob/MCfc0vZXQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=JA4z2Yd7; dmarc=pass (policy=none) header.from=andrew.cmu.edu; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.99 X-Spam-Score: -4.99 X-Migadu-Queue-Id: 0E36428CAD X-TUID: vPx2kJKwcJ2Q --000000000000ab1d8205fa79286e Content-Type: text/plain; charset="UTF-8" For a while the *Org PDF LaTeX Output* buffer has been empty for me when I export to PDF. I am currently using: Org mode version 9.7-pre (release_9.6.4-337-geaf274 It looks like this happens because of this code: https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox-latex.el#L4313 It seems to have been added in commit f0dfbf0c3999e44ef7b6704e6584aa2a5d43f2d8 Author: TEC Date: Sun Dec 25 00:59:21 2022 +0800 ox-latex: Erase compile buffer at the start * lisp/ox-latex.el (org-latex-compile): Before running the compile command, erase the log buffer to ensure that stale/old logging is cleared. It seems like it is in the wrong place though, and it erases the buffer after the compile happens. It looks like the code should be modified to look like something like this: (defun org-latex-compile (texfile &optional snippet) "Compile a TeX file. TEXFILE is the name of the file being compiled. Processing is done through the command specified in `org-latex-pdf-process', which see. Output is redirected to \"*Org PDF LaTeX Output*\" buffer. When optional argument SNIPPET is non-nil, TEXFILE is a temporary file used to preview a LaTeX snippet. In this case, do not create a log buffer and do not remove log files. Return PDF file name or raise an error if it couldn't be produced." (unless snippet (message "Processing LaTeX file %s..." texfile)) (let* ((compiler (or (with-temp-buffer (save-excursion (insert-file-contents texfile)) (and (search-forward-regexp (regexp-opt org-latex-compilers) (line-end-position 2) t) (progn (beginning-of-line) (looking-at-p "%")) (match-string 0))) ;; Cannot find the compiler inserted by ;; `org-latex-template' -> `org-latex--insert-compiler'. ;; Use a fallback. org-latex-compiler)) (process (if (functionp org-latex-pdf-process) org-latex-pdf-process ;; Replace "%latex" with "%L" and "%bib" and ;; "%bibtex" with "%B" to adhere to `format-spec' ;; specifications. (mapcar (lambda (command) (replace-regexp-in-string "%\\(?:\\(?:bib\\|la\\)tex\\|bib\\)\\>" (lambda (m) (upcase (substring m 0 2))) command)) org-latex-pdf-process))) (spec `((?B . ,(shell-quote-argument org-latex-bib-compiler)) (?L . ,(shell-quote-argument compiler)))) (log-buf-name "*Org PDF LaTeX Output*") (log-buf (and (not snippet) (get-buffer-create log-buf-name))) (outfile)) (with-current-buffer log-buf (erase-buffer)) (setq outfile (org-compile-file texfile process "pdf" (format "See %S for details" log-buf-name) log-buf spec)) (org-latex-compile--postprocess outfile log-buf snippet) ;; Return output file name. outfile)) WDYT? -- John ----------------------------------- Professor John Kitchin (he/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 https://kitchingroup.cheme.cmu.edu https://pointbreezepubs.gumroad.com/ pycse bookstore --000000000000ab1d8205fa79286e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
For a while the=C2=A0*Org PDF LaTeX Output* buffer ha= s been empty for me when I export to PDF.

I am cur= rently using: Org mode version 9.7-pre (release_9.6.4-337-geaf274=C2=A0

It looks like this happens because of this code:


It seems to have= been added in
commit f0dfbf0c3999e44ef7b6704e6584aa2a5d43f2d8

= Author: TEC <git@tecosaur.net>= ;

Date: =C2=A0 Sun Dec 25 00:59:21 2022 +0800


=C2=A0 =C2= =A0 ox-latex: Erase compile buffer at the start

=C2=A0 =C2=A0
=C2=A0 =C2=A0 * lisp/ox-latex.el (org-latex-compile): Before running the = compile

=C2=A0 =C2=A0 command, erase the log buffer to ensure that s= tale/old logging is

=C2=A0 =C2=A0 cleared.


It seems like = it is in the wrong place though, and it erases the buffer after the compile= happens.

It looks like the code should be modified to l= ook=C2=A0like something like this:

(defun org-late= x-compile (texfile &optional snippet)
=C2=A0 "Compile a TeX fil= e.

TEXFILE is the name of the file being compiled.=C2=A0 Processing = is
done through the command specified in `org-latex-pdf-process',which see.=C2=A0 Output is redirected to \"*Org PDF LaTeX Output*\&qu= ot;
buffer.

When optional argument SNIPPET is non-nil, TEXFILE is= a temporary
file used to preview a LaTeX snippet.=C2=A0 In this case, d= o not
create a log buffer and do not remove log files.

Return PDF= file name or raise an error if it couldn't be
produced."
= =C2=A0 (unless snippet (message "Processing LaTeX file %s..." tex= file))
=C2=A0 (let* ((compiler
=C2=A0(or (with-temp-buffer
(sa= ve-excursion (insert-file-contents texfile))
(and (search-forward-rege= xp (regexp-opt org-latex-compilers)
=C2=A0 =C2=A0(line-end-positio= n 2)
=C2=A0 =C2=A0t)
=C2=A0 =C2=A0 (progn (beginning-of-line= ) (looking-at-p "%"))
=C2=A0 =C2=A0 (match-string 0)))
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Cannot find the compile= r inserted by
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; `org-l= atex-template' -> `org-latex--insert-compiler'.
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Use a fallback.
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-latex-compiler))
(process (if (fun= ctionp org-latex-pdf-process) org-latex-pdf-process
=C2=A0 =C2=A0;; R= eplace "%latex" with "%L" and "%bib" and
= =C2=A0 =C2=A0;; "%bibtex" with "%B" to adhere to `for= mat-spec'
=C2=A0 =C2=A0;; specifications.
=C2=A0 =C2=A0(map= car (lambda (command)
=C2=A0 =C2=A0 =C2=A0(replace-regexp-in-string<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"%\\(?:\\(?:bib\\|la\\)tex\\|= bib\\)\\>"
=C2=A0 =C2=A0 =C2=A0 (lambda (m) (upcase (substri= ng m 0 2)))
=C2=A0 =C2=A0 =C2=A0 command))
=C2=A0 =C2=A0org-l= atex-pdf-process)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(spec `((?B . ,(sh= ell-quote-argument org-latex-bib-compiler))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(?L . ,(shell-quote-argument compiler))))=
(log-buf-name "*Org PDF LaTeX Output*")
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(log-buf (and (not snippet) (get-buffer-create log-buf-= name)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(outfile))
=C2=A0 =C2=A0 (w= ith-current-buffer log-buf
=C2=A0 =C2=A0 =C2=A0 (erase-buffer))
=C2= =A0 =C2=A0 (setq outfile (org-compile-file texfile process "pdf"<= br> =C2=A0 =C2=A0(format "See %S for details" log-buf-name) =C2=A0 =C2=A0log-buf spec))
=C2=A0 =C2=A0 (org-latex-compile--pos= tprocess outfile log-buf snippet)
=C2=A0 =C2=A0 ;; Return output file na= me.
=C2=A0 =C2=A0 outfile))

WDYT?
--
John
-----------------------------------
Professor John Kitchin (he/his= )
Doherty Hall A207F
Department of Chemical Engineering
Carnegie M= ellon University
Pittsburgh, PA 15213
412-268-7803
https://kitchingroup.che= me.cmu.edu
https://pointbreezepubs.gumroad.com/=C2=A0pycse bookstore
--000000000000ab1d8205fa79286e--