From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: [PATCH] Re: manual linebreaks in odt Date: Wed, 23 Oct 2013 19:05:07 +0200 Message-ID: References: <87r4bccc2l.fsf@med.uni-goettingen.de> <87r4bct13c.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ1ma-0000rs-2r for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 12:59:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZ1mU-0000qA-5w for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 12:59:44 -0400 Received: from mail-forward4.uio.no ([2001:700:100:10::33]:52808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ1mT-0000pg-S2 for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 12:59:38 -0400 Received: from exim by mail-out4.uio.no with local-bsmtp (Exim 4.80.1) (envelope-from ) id 1VZ1mS-0002Bc-5u for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 18:59:36 +0200 In-reply-to: <87r4bct13c.fsf@gmail.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Andreas Leha , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi, Nicolas, Andreas did put the "\\" at the end, but the line must have got wrapped in your email client. I confirm the behavior Andreas reported -- spaces are being needlessly added after forced line breaks in ODT export. A couple of redundant newlines in ox-odt.el seem to be at fault, so I attach one of the simplest patches ever... Yours, Christian --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ODT-Stop-adding-leading-space-after-line-break.patch >From 187ba51d721ef4e06ca7ae647216ada8800a9c32 Mon Sep 17 00:00:00 2001 From: Christian Moe Date: Wed, 23 Oct 2013 18:49:03 +0200 Subject: [PATCH] ODT: Stop adding leading space after line break * lisp/ox-odt.el (org-odt-line-break): remove newline after line-break tag (org-odt-plain-text): ditto. The exporter was pretty-printing the ODT XML with newlines after forced line breaks, but LibreOffice would interpret those as spaces. This led to a leading space after every manual line break. --- lisp/ox-odt.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 57a9b6e..775fe1d 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2059,7 +2059,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (defun org-odt-line-break (line-break contents info) "Transcode a LINE-BREAK object from Org to ODT. CONTENTS is nil. INFO is a plist holding contextual information." - "\n") + "") ;;;; Link @@ -2980,7 +2980,7 @@ contextual information." ;; Handle break preservation if required. (when (plist-get info :preserve-breaks) (setq output (replace-regexp-in-string - "\\(\\\\\\\\\\)?[ \t]*\n" "\n" output t))) + "\\(\\\\\\\\\\)?[ \t]*\n" "" output t))) ;; Return value. output)) -- 1.8.3.2 --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Hello, > > Andreas Leha writes: > >> Here is a MWE: >> * Test line breaks in odt exports >> >> Here is a manual\\ linebreak. > > This is not a line break. In Org "\\" string has to appear at the end of > line. > > > Regards, --=-=-=--