emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Michaël Cadilhac" <michael@cadilhac.name>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Export with verbatim LaTeX removes spaces
Date: Mon, 8 Jul 2019 15:47:43 +0200	[thread overview]
Message-ID: <CADt3fpPZERpvF49DGiAuDL6L9aN2Ld9scnXdzp=qV=q5gQ6AVw@mail.gmail.com> (raw)

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ël

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))

             reply	other threads:[~2019-07-08 13:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 13:47 Michaël Cadilhac [this message]
2019-07-09 10:45 ` [PATCH] Export with verbatim LaTeX removes spaces Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADt3fpPZERpvF49DGiAuDL6L9aN2Ld9scnXdzp=qV=q5gQ6AVw@mail.gmail.com' \
    --to=michael@cadilhac.name \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).