From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Micha=C3=ABl_Cadilhac?= Subject: [PATCH] Export with verbatim LaTeX removes spaces Date: Mon, 8 Jul 2019 15:47:43 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58095) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkU0H-0008Dr-Q1 for emacs-orgmode@gnu.org; Mon, 08 Jul 2019 09:48:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkU0G-0002YF-Tc for emacs-orgmode@gnu.org; Mon, 08 Jul 2019 09:48:25 -0400 Received: from cadilhac.name ([163.172.56.42]:41044 helo=mattermost.cadilhac.name) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkU0G-0002UE-LW for emacs-orgmode@gnu.org; Mon, 08 Jul 2019 09:48:24 -0400 Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) by mattermost.cadilhac.name (OpenSMTPD) with ESMTPSA id aeb0f233 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 8 Jul 2019 13:48:20 +0000 (UTC) Received: by mail-vs1-f50.google.com with SMTP id k9so8215918vso.5 for ; Mon, 08 Jul 2019 06:48:20 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi, When LaTeX is exported verbatim, some spaces are lost. Try for instance: M-: (let ((org-html-with-latex 'verbatim)) (org-html-export-as-html)) RET on a buffer containing "$a$ $b$". Post-blanks were simply not added back, see below. Thanks! Cheers, Micha=C3=ABl ox.el: Add post-blanks when latex is verbatim * lisp/ox.el (org-export--remove-uninterpreted-data): Add post-blanks when latex is verbatim. TINYCHANGE --- lisp/ox.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index 078efaffc..395ce7feb 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2950,7 +2950,12 @@ returned by the function." ;; ... LaTeX environments and fragments... ((latex-environment latex-fragment) (and (eq (plist-get info :with-latex) 'verbatim) - (list (org-export-expand datum nil)))) + (list (concat + (org-export-expand datum nil) + (make-string + (or (org-element-property :post-blank datum= ) + 0) + ?\s))))) ;; ... sub/superscripts... ((subscript superscript) (let ((sub/super-p (plist-get info :with-sub-superscript))