From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GJ7LLal1T2N5IQEAbAwnHQ (envelope-from ) for ; Wed, 19 Oct 2022 05:57:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kBYOLal1T2PFNAEAG6o9tA (envelope-from ) for ; Wed, 19 Oct 2022 05:57:29 +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 11F3B36128 for ; Wed, 19 Oct 2022 05:57:29 +0200 (CEST) Received: from localhost ([::1]:50650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol0Cu-0004f2-71 for larch@yhetil.org; Tue, 18 Oct 2022 23:57:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol0Bq-0004ec-3L for emacs-orgmode@gnu.org; Tue, 18 Oct 2022 23:56:22 -0400 Received: from mout02.posteo.de ([185.67.36.66]:59845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol0Bn-0003f2-Ij for emacs-orgmode@gnu.org; Tue, 18 Oct 2022 23:56:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A21E7240104 for ; Wed, 19 Oct 2022 05:56:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666151777; bh=8gztCOzhG13gtpebuoyiYqZuV6dUA2vPAAO9HhNQR0Y=; h=From:To:Cc:Subject:Date:From; b=AB/kLe8NkV28SFQqqVoND4oVFLGDOhSCTMxJ6BrXT5xduqh61xxvWUECcptGBRXeS lSNC+5Gdf4zX/pfBI6n3kcJxAliXJ7upApVZmtmMb0jWMtWslYPxtaU2W3p6xV4dTr xGBPmyTeiMAcdNuuoqhMHAp4AbtNyxFtvNi32oqncbOXMdG8FodyVihmO7lbUAoBOS knmpV31RjKze/WkWYHCmLdh9EQ4dhT8nc3B5pGjy+zpURNssRZGPbbplvate95J3vf +DAR1Z3Eb5SuuXTSQopJwxwxe3eei8Y2EbnPjFhfcsoHV+2qhg5qraTL9HnwP7W20i 5R8nbgv+aNnaA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MscNH6pcsz9rxM; Wed, 19 Oct 2022 05:56:15 +0200 (CEST) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: Daniel Fleischer , Max Nikulin , emacs-orgmode@gnu.org, Ihor Radchenko , Vikas Rawal Subject: Re: Line breaks and brackets in LaTeX export In-Reply-To: <87o7u9rz1a.fsf@posteo.net> References: <875ygk6a8z.fsf@posteo.net> <87a65vitbz.fsf_-_@posteo.net> <87edv6izx4.fsf@localhost> <8735bmelgu.fsf@posteo.net> <878rlecx49.fsf@posteo.net> <874jw2conh.fsf@posteo.net> <87edv5hhgb.fsf@localhost> <87o7u9rz1a.fsf@posteo.net> Date: Wed, 19 Oct 2022 03:57:02 +0000 Message-ID: <87o7u8cvox.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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=1666151849; 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=WMNsOUMLxyD3Fba5iwYDCtGiuOr8bPxZpym5J7JwkVE=; b=JNw39wJy7HI8mE/4XHHk4YE7eL9ixqB/L0jaSozCbbS697EQEEln8O9C0INqx8+rjhLkRc nIx6ElcEbZKqkL7RXIt4eqvlkbV9Ab5LVT/UbWzJFnfziS/gsVtz2eBVH8hbtKAn4euerL x2X1rGtWhv9IyG6NtGLXaGdJBtqoe3NDKD0e8yfh2Mg14pHCduiJmKxQB3pqARDhphQQ7m F+owRszdv7uX10IddrBlq3aRnD26JwlxV7JpN6TWfzBEu4P8Gv3f8KdVWJEizFO9hJ7vuy f2TUAvLk+Ns+pjw7x3zfsPy8h/Kwxql7P9SJGoVMf3Vt33uenVIjpeExUQgs+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666151849; a=rsa-sha256; cv=none; b=oIc0ZXiX7bM4pX1ajC7XSxb0SllMYcIEgMci5Y3FkHRM5Zjno++cnU6HdAX4EKK6/6vP5k iwB1y21yHffkaCUmUTdt+oLjGakVnisq5/eGk1BhpCb5Szu2TXbk23zS5XSGrLH/Wu08Q0 5bqr/dlR349FDGILjMPrih9ZdFpDWffqsXQ9SQUL64s8C8zCXlGJwjraBWatcoAmg88phF EBz4n0P/53h3jhGZrL1OxjoXnt63IcnKbZCsojlUM13gbbgbGcNqsm1dxfDTfnEt2mTQfg DCnvxRtHq7HzfpFMqzKaJmzmGZ1jeMaejPYtu7UhnGXyhNgUS4dP8sHPHaxbYQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="AB/kLe8N"; 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: -3.43 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="AB/kLe8N"; 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: 11F3B36128 X-Spam-Score: -3.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: ehD/2hL8MmHQ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Juan Manuel Mac=C3=ADas writes: >> It is easy to change \\\empty constant to \\[0pt] if necessary. I have >> no objection either way. Though I do not feel like we are in rush. I'd >> like to hear from ox-latex maintainer. > > Today I have tried with the latest version of tabularray (2022C, the one > I tried yesterday was 2022A, included in TeX Live 2022), and the bad > results persist. Also, it now returns a compile error when an \empty > precedes a \hline. I suspect this package does a pretty drastic > redefinition of \\. The [0pt] option still works fine here, though. Then [0pt] should it be. At least for now, before we have a cleaner solution. See the attached patch. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-org-latex-line-break-safe-Use-safer-value-of-0pt.patch Content-Transfer-Encoding: quoted-printable >From b060f63078d65758f8fd2ab7725fbcf8b2de0057 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Wed, 19 Oct 2022 11:48:26 +0800 Subject: [PATCH] org-latex-line-break-safe: Use safer value of "\\[0pt]" MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/ox-latex.el (org-latex-line-break-safe): (org-latex-table-row): Change \empty ending to explicit optional argument. \empty still has undesired side effects in some cases. * testing/lisp/test-org-table.el (test-org-table/to-latex): * testing/lisp/test-ox-latex.el (test-ox-latex/verse): Update tests. Reported-by: Juan Manuel Mac=C3=ADas Link: https://orgmode.org/list/87o7u9rz1a.fsf@posteo.net --- lisp/ox-latex.el | 12 ++++++------ testing/lisp/test-org-table.el | 6 +++--- testing/lisp/test-ox-latex.el | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index dc8477d14..a5652fd78 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -278,17 +278,17 @@ (defconst org-latex-language-alist =20 - `:lang-name' the actual name of the language.") =20 -(defconst org-latex-line-break-safe "\\\\\\empty" +(defconst org-latex-line-break-safe "\\\\[0pt]" "Linebreak protecting the following [...]. =20 -Without \"\\empty\" it would be interpreted as an optional argument to +Without \"[0pt]\" it would be interpreted as an optional argument to the \\\\. =20 This constant, for example, makes the below code not err: =20 \\begin{tabular}{c|c} - [t] & s\\\\\\empty - [I] & A\\\\\\empty + [t] & s\\\\[0pt] + [I] & A\\\\[0pt] [m] & kg \\end{tabular}") =20 @@ -4005,9 +4005,9 @@ (defun org-latex-table-row (table-row contents info) (org-export-get-parent-table table-row) info)))) (format "%s \\endfirsthead -\\multicolumn{%d}{l}{%s} \\\\\\empty +\\multicolumn{%d}{l}{%s} \\\\[0pt] %s -%s \\\\\\empty\n +%s \\\\[0pt]\n %s \\endhead %s\\multicolumn{%d}{r}{%s} \\\\ diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el index 722c37ea4..573179878 100644 --- a/testing/lisp/test-org-table.el +++ b/testing/lisp/test-org-table.el @@ -1635,11 +1635,11 @@ (ert-deftest test-org-table/to-generic () (ert-deftest test-org-table/to-latex () "Test `orgtbl-to-latex' specifications." (should - (equal "\\begin{tabular}{l}\na\\\\\\empty\n\\end{tabular}" + (equal "\\begin{tabular}{l}\na\\\\[0pt]\n\\end{tabular}" (orgtbl-to-latex (org-table-to-lisp "| a |") nil))) ;; Test :environment parameter. (should - (equal "\\begin{tabularx}{l}\na\\\\\\empty\n\\end{tabularx}" + (equal "\\begin{tabularx}{l}\na\\\\[0pt]\n\\end{tabularx}" (orgtbl-to-latex (org-table-to-lisp "| a |") '(:environment "tabularx")))) ;; Test :booktabs parameter. @@ -1648,7 +1648,7 @@ (ert-deftest test-org-table/to-latex () "\\toprule" (orgtbl-to-latex (org-table-to-lisp "| a |") '(:booktabs t= )))) ;; Handle LaTeX snippets. (should - (equal "\\begin{tabular}{l}\n\\(x\\)\\\\\\empty\n\\end{tabular}" + (equal "\\begin{tabular}{l}\n\\(x\\)\\\\[0pt]\n\\end{tabular}" (orgtbl-to-latex (org-table-to-lisp "| $x$ |") nil))) ;; Test pseudo objects and :raw parameter. (should diff --git a/testing/lisp/test-ox-latex.el b/testing/lisp/test-ox-latex.el index 4fb9f2888..adb3a60ea 100644 --- a/testing/lisp/test-ox-latex.el +++ b/testing/lisp/test-ox-latex.el @@ -60,14 +60,14 @@ (ert-deftest test-ox-latex/verse () (should (search-forward "\\begin{verse} -lorem ipsum dolor\\\\\\empty -lorem ipsum dolor\\\\\\empty +lorem ipsum dolor\\\\[0pt] +lorem ipsum dolor\\\\[0pt] \\vspace*{1em} -lorem ipsum dolor\\\\\\empty -lorem ipsum dolor\\\\\\empty +lorem ipsum dolor\\\\[0pt] +lorem ipsum dolor\\\\[0pt] \\vspace*{1em} -lorem ipsum dolor\\\\\\empty -lorem ipsum dolor\\\\\\empty +lorem ipsum dolor\\\\[0pt] +lorem ipsum dolor\\\\[0pt] \\end{verse}")))) =20 (provide 'test-ox-latex) --=20 2.35.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 --=-=-=--