* [PATCH] Export with verbatim LaTeX removes spaces
@ 2019-07-08 13:47 Michaël Cadilhac
2019-07-09 10:45 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Michaël Cadilhac @ 2019-07-08 13:47 UTC (permalink / raw)
To: emacs-orgmode
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))
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Export with verbatim LaTeX removes spaces
2019-07-08 13:47 [PATCH] Export with verbatim LaTeX removes spaces Michaël Cadilhac
@ 2019-07-09 10:45 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2019-07-09 10:45 UTC (permalink / raw)
To: Michaël Cadilhac; +Cc: emacs-orgmode
Hello,
Michaël Cadilhac <michael@cadilhac.name> writes:
> 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.
I applied a variant of your patch. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-09 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-08 13:47 [PATCH] Export with verbatim LaTeX removes spaces Michaël Cadilhac
2019-07-09 10:45 ` Nicolas Goaziou
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).