From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id TgYgOX95S2NaFAAAbAwnHQ (envelope-from ) for ; Sun, 16 Oct 2022 05:24:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EFY0OH95S2MKPAEAauVa8A (envelope-from ) for ; Sun, 16 Oct 2022 05:24:47 +0200 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 7535CEC97 for ; Sun, 16 Oct 2022 05:24:46 +0200 (CEST) Received: from localhost ([::1]:42058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojuGb-000844-74 for larch@yhetil.org; Sat, 15 Oct 2022 23:24:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojuFs-00083t-AO for emacs-orgmode@gnu.org; Sat, 15 Oct 2022 23:24:00 -0400 Received: from mout02.posteo.de ([185.67.36.66]:44647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojuFp-0007JR-UL for emacs-orgmode@gnu.org; Sat, 15 Oct 2022 23:23:59 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1755D240101 for ; Sun, 16 Oct 2022 05:23:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665890635; bh=NXYYeSGhkVrgkppTYcXWbmOcyrLHls+E2O/mDPdKYnM=; h=From:To:Cc:Subject:Date:From; b=fkNnQRGifrtN/K8e+D47I8Q5JgsJioOdopEwvpMkaUbqO9QVXS0H+QBktLegKUSyy 3YRoFLjXwW7YSU/d47301/M9CnjgwDsD9VW4WaTH6dJAAMCXXRdaDj7RbhZjKMsgDy 9bz3W+NCowAWhYVo7Gnosyyj+VMltkqSTrt46emRBqy8zfkOPf/P9pd4jlajmPzgKO Y79DjnuFrgxw1HR7BxukKPhxxdgiC9WeJTal5l1SzHyL2zdU+JHbPrwbiZULUhSHQX Lf32Y1aFN/KPIC0tG2plPQvkPhZXIzZWmVHpBq2mXu8kTSE8SLdkWAO2f2WjcXG7tB VI+hK1Wpxj1rA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MqlpJ5CVNz9rxD; Sun, 16 Oct 2022 05:23:52 +0200 (CEST) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: orgmode Subject: Re: [bug] `org-latex-line-break-safe' breaks the export of verse blocks to LaTeX In-Reply-To: <875ygk6a8z.fsf@posteo.net> References: <875ygk6a8z.fsf@posteo.net> Date: Sun, 16 Oct 2022 03:24:40 +0000 Message-ID: <874jw4qwlj.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665890687; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=01dKFu/HwEB4DZqWF3rqLJ4bBmOMED26Yeb6ynvZs6g=; b=ZlmaS6oGlrBATjLQj9MzWbKN+38GJaUdKeP20wYtRrJ+uEmcdok4mg3vI5zBF1x7awr9I4 4xRbEWnPuY9clDjr4OlFKAc0+PkVg0eg+zzeawSRajIP4Xh82AMdhVpB+ibM24ckQwSxIa 4dX6/Tn9IY6t/0hazMZ959fLSGG5cmUXJtMD4cMw8/qU9/sT6CgbhpMjQFXquuR5D3anZF mY9KRC+NVMmAh2G+jVgl265PPN7rEwUoUTIadKrVr8ISiDNNo5KKDSLneXyYIAi+J41hoC 2POQKsXO5MI1OlkeAxlg+UUEfkGpReRmweJ8VjCbKAb1NNTXAkoQ6kHMcyGQNw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665890687; a=rsa-sha256; cv=none; b=u2TpNj2zmXFL8qGj1Mqp4IYyKT5GgACRSycQjHUYpoZ4KxDnMB4yN+z0vxWL2sqNOtorpU bVPhO5fq3+MHxrXJ22xIafGucHqiR4w4D08APqjVPW7A0eHiZsMQ7h1QSxhYQyQJhst10U FSzLt2VaDtlvgzFC0SDJCQbO5qQn81gfgKE/0HJz2KS5CjVZpkwQlTnSlJA8xc+Oa3wVS3 cEF6+2so/O55XD/Bv0CIaQItu5UYYGo8Xz2YeJHflbJb5z7skPVjjtnwuKiaau9549jTYO JGRhiS5HYowwdETNMNOlxVYRQqRkNDBuRDemGxl7+ZxiJh8yW06Vgdzv/xxWHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fkNnQRGi; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Spam-Score: -7.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fkNnQRGi; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Queue-Id: 7535CEC97 X-Spam-Score: -7.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: yaxw7M2E2yUq Juan Manuel Mac=C3=ADas writes: > The recent addition of the `org-latex-line-break-safe' constant makes it > impossible to compile verse blocks. The reason is that now a \\ is > inserted between each stanza (aka each paragraph), instead of the > `\vspace{1em}' as before. That's wrong, as this compile error message > says: Thanks for reporting! Fixed on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3D5fa66c7ff= c4efbea11357fe0d05bc570855cfa91 This was an omission when replacing "\\" instances with safer version in ox-latex.el. > On the other hand, I have a few reservations about the usefulness of > org-latex-line-break-safe. To begin with, it is a particular solution > applied in a general way. This can have unexpected consequences, as has > happened in verse blocks. It's like putting your whole body in a > cast because of a broken finger. The idea is to use "\\\someescapeLaTeXcommand" rather than "\\". The latter can take arguments unexpectedly. See https://orgmode.org/list/8735c0kpb9.fsf@localhost > I think if the reason for this addition is to prevent problems with > square brackets, in certain contexts, why not just apply a point > solution? For example, putting {[}, which is a common LaTeX way to > protect a square bracket. Because people export tables not only to LaTeX, but also to other formats. {[} makes no sense then. > Use a macro, for example, or even > define a new entity, something like: > > (setq org-entities-user > '(("lbrack" "{[}" nil "[" "[" "[" "[") > ("rbrack" "{]}" nil "]" "]" "]" "]"))) It will be unclear when to use such entity. Note that it is not obvious at all that LaTeX export specifically will stumble on | [1, 2] | | [3, 4] | without knowing LaTeX internals and checking the exported LaTeX intermediate source closely. We already ask users to deal with Org parser oddities. If we also demand knowing LaTeX oddities, it will be too much. Better modify parser to export valid Org syntax into valid LaTeX. > And finally, I think that applying a general solution to this problem is > something that should be done(IMHO) in LaTeX and not in Org, for > example, with some new package that would protect certain signs or > through ad hoc LaTeX/Lua code. Either way, we will need to use the new package in ox-latex.el. And our current approach is somewhat better because users can still use direct LaTeX @@latex:\\@@ if they want to get "\\" exactly. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at