From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 kJtgLfZZDGQbAAAASxT56A (envelope-from ) for ; Sat, 11 Mar 2023 11:37:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oGhvLfZZDGQVrQAA9RJhRA (envelope-from ) for ; Sat, 11 Mar 2023 11:37:42 +0100 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 638C1C03D for ; Sat, 11 Mar 2023 11:37:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paway-0004Ev-DW; Sat, 11 Mar 2023 05:37:00 -0500 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 1pawaw-000487-Rg for emacs-orgmode@gnu.org; Sat, 11 Mar 2023 05:36:58 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pawau-0006mI-7o for emacs-orgmode@gnu.org; Sat, 11 Mar 2023 05:36:57 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A6E8E240246 for ; Sat, 11 Mar 2023 11:36:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678531014; bh=LE6jh+zusiMgkkygIJErQoVTPl+OvwlvAx7TKL0spyU=; h=From:To:Cc:Subject:Date:From; b=STT8h4mLi59DNtX0KR77Cc9U7oi9hvDaHenw8jqT0vlZWgIrMWoQekT8EM3SGl4NJ hSiA1zZmPH3vl+EaEfEcY1vUcMXjQPhfV6HEN8I8xvbLDfrunmp9sbP4ElXBAEDuu5 AnPOgGRcnSP4pwRV0IE6d0KxYSDybLA5oK604gMvVJhdBbcp8nxe65S3RcFtj+zlTk tgmWeorGVuOyJdhJb0oAhc/53IUKjWGyhiknQOuYYSDLwYoDSe0fAgelj+G7LNmKtv voDXg8IXA5y1DS3glwB8jMSz8WyjgPAZsdY3Dnx+J32iwGgEs2iTHzVrKX7T4vmUkk XKBFCnvbj606Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PYfVZ14rCz9rxQ; Sat, 11 Mar 2023 11:36:54 +0100 (CET) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] No space after footnote with org-export-with-footnotes set to nil [9.6.1 ( @ /Users/test/.emacs.d/elpa/28.0/develop/org-9.6.1/)] In-Reply-To: References: <5BB5EF8E-6D40-4055-99AE-BF596E5E8C98@gmail.com> <851a585b-ea53-b24f-438b-ffd9b36d29f5@gmail.com> <87v8jh4z2d.fsf@localhost> <9302738a-b351-0422-22ad-e764aade01e5@gmail.com> <87o7p7z9k3.fsf@localhost> <0D66BE43-7FF4-4B96-A1EC-03AF5FCA93B5@gmail.com> <878rgbz7w1.fsf@localhost> <5571340B-0551-4DA1-AFA1-3A7C94C8DDB7@gmail.com> <875ybfz71b.fsf@localhost> <2b73ed2c-214b-36f9-d695-9137a37a88f3@gmail.com> <877cvsfyr1.fsf@localhost> <87y1o6p02i.fsf@localhost> <87v8j8yfjk.fsf@localhost> Date: Sat, 11 Mar 2023 10:38:25 +0000 Message-ID: <87zg8jwp26.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=STT8h4mL; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678531062; a=rsa-sha256; cv=none; b=esYxW/lZ8mCWOtzFJFBcFBl84V1S9VP0ZQwQBFHGx4tfD3/7IidlSKYihzfz6JiceFsR58 k1/IqRh4qmmgNZw26ofdIM6mwpHfVaVRnWVTgMykPH6OMfiC/d5EN0KW4iVmEOr48QAwbd ZGqqFoQZB1kJ5DGg+ObDx89JnXzZNSxMIPevgDCAcEX/1PDNPlALk7pWo1D4P4v4ReHesx 1Fjxuuontf4aJ6eISSUJCpYbsP8n99Tm0z4KtuOy/1zzoe+WQ6mwAWmqBmJIk6Ndn+aaO6 EsIZ3/aOSlxzskU6LYoGUNBw71kz0uEB/UhaUlgXFSCFWAA+sO2X5tUojhPsEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678531062; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PyytshVODJPTV7tnSbeUiiaFHGFwW9j/TfgtUXmskgw=; b=M4dUFy/yg++8DTD2OpSEEHbTClMSHse0YBCQIuhdfm9UMn0If1NhCm9L6cgfSIc1osQY5O rBs/tncxyzw+f0gbEQQkISxGPR31jnlsxjifvUNwLsuEJ121vtuDH0vle0+rtCaT/fwYlA /JHHuZL53EmQ6qjpzhGvHxYiWtjtNiMubVZYGRSS70vv16NfoH1DQuFG3WJ9ocicXG2PMe 1YZhVtMamlH9/k9Y/2ZvMfs3b2YfXB1+MN3vRzxl5X4z6z1uWhTyyDtKJOzf/fxdGEMefq l6FtEIGJKfKsEQ40O/Kys6K0wtIL/57tM7MBdKHiN8gohdoG0yNfLcjkLuX14A== X-Migadu-Spam-Score: -6.20 X-Spam-Score: -6.20 X-Migadu-Queue-Id: 638C1C03D X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=STT8h4mL; 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"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: FGFV0yu3QIwd --=-=-= Content-Type: text/plain Max Nikulin writes: >> [previous object ] > > Yes, you do. > > I expected some complications due to newline characters (not line break > markup objects), but they are not included in :post-blank and > represented as "\n" string objects. Newlines are tricky. They may or may not be significant. For example, in CJK paragraphs, newlines are to be stripped. I think that a reasonable thing to do could be not adding newlines if the previous object is a plain string ending with a newline. > Actually there is an issue with newline characters and ox-latex. > Stripping footnotes splits single paragraphs into 2 ones: > > ---- >8 ---- > #+options: f:nil > First > [fn::foot] > Second > ---- 8< ---- > > So newlines should be handled somehow. Earlier I faced a similar issue with > @@comment:export snippets@@ > and ox-latex. This is latex-specific. See the attached tentative fix. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-latex-paragraph-Ensure-that-paragraphs-are-not-s.patch >From 92800f77ea6389b531c4d96cc4b32ed5557aa47a Mon Sep 17 00:00:00 2001 Message-Id: <92800f77ea6389b531c4d96cc4b32ed5557aa47a.1678531087.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sat, 11 Mar 2023 11:34:45 +0100 Subject: [PATCH] org-latex-paragraph: Ensure that paragraphs are not split by empty lines * lisp/ox-latex.el (org-latex-paragraph): If export creates single paragraph contents with empty lines, remove the empty lines to ensure that we retain a single paragraph. Reported-by: Max Nikulin Link: https://orgmode.org/list/tufdb6$11h2$1@ciao.gmane.io --- lisp/ox-latex.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index b84fe89db..f31d94da2 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2980,7 +2980,14 @@ (defun org-latex-paragraph (_paragraph contents _info) "Transcode a PARAGRAPH element from Org to LaTeX. CONTENTS is the contents of the paragraph, as a string. INFO is the plist used as a communication channel." - contents) + ;; Ensure that we do not create multiple paragraphs, when a single + ;; paragraph is expected. + ;; Multiple newlines may appear in CONTENTS, for example, when + ;; certain objects are stripped from export, leaving single newlines + ;; before and after. + (replace-regexp-in-string + (rx (1+ (0+ space) "\n")) "\n" + contents)) ;;;; Plain List -- 2.39.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--