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 ms5.migadu.com with LMTPS id SMheIpxKRGNpzwAAbAwnHQ (envelope-from ) for ; Mon, 10 Oct 2022 18:38:52 +0200 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 KCHbIZxKRGMWewEA9RJhRA (envelope-from ) for ; Mon, 10 Oct 2022 18:38:52 +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 6334F2D26A for ; Mon, 10 Oct 2022 18:38:52 +0200 (CEST) Received: from localhost ([::1]:50508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohvnl-00061r-Vi for larch@yhetil.org; Mon, 10 Oct 2022 12:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohvfY-0000CX-7C for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 12:30:20 -0400 Received: from ciao.gmane.io ([116.202.254.214]:35700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohvfV-0001ms-Gr for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 12:30:19 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ohvfS-0002NZ-RJ for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 18:30:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH v2] Re: [BUG] Tables with square brackets do not compile in PDF (latex) export [9.5 (release_9.5-59-g52e6f1 @ /home/sjt015/repo/emacs/lisp/org/)] Date: Mon, 10 Oct 2022 23:30:04 +0700 Message-ID: References: <8735c0kpb9.fsf@localhost> <87lepqlwrl.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US In-Reply-To: <87lepqlwrl.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-2.007, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=1665419932; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=hk7Om2KCefzwOapow3qeW9423WkEEjkMe9oIAmxr7Ew=; b=ItxNad4cg1Gn1YmgSVkovFocrx3obHjBCaJpNKC0Ivhlh6R9VT1dMr2S787ETeFCMm3CLg imSis9REDNaf2/PPnvvpJNqAAlPM9++8ncZhHfYICiiv/WcbCDeu71mEr+T0zQoZQxVfeu AYgflhSrRzwd6hyLvlRimg3L/91ovAYQ7GWqfisuZlvfhYzPGkrp4T8jZxJHXTOfic7Hm+ z5mJl/3d/ZywpRpYj0cDdQbFZ9WUGGqUzSH7/aX9/y4XaVSMf2lJRb9x35PtYuAUg+e3Gf cg2DVqjumZnjeMHAm7h5+jUn8kGPIh7kNyepOqdqYpuxfewr5QFwFtN3HGHG4g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665419932; a=rsa-sha256; cv=none; b=NWrzrNdVPL9uVIQG37Mbb0VASr3PLopMw1ySkhbMGvYyaz5SX0LcMfL41gNP00go2H6Gq9 kvcqOG7RnMu3PAAz7h4bkjgRloi3QFqzNTSX4lbEWVHbR3LD92or9kSVcN/Dc/9LKTASa0 H6nUjbTEqFP69cOevJfOnFVmkitzN6jmS8aqgrYqlUYsvmiGJ+hCdREp9lxzVowD1/yqiF 1Ddnxka6WD17rSvq+E7khpzhwlD7gN0jKv2iTlO3HK/j8NmeTrw4tHpvnnnTw4wOFnVHRy lZ+kP/00hvgNa/7OZw8JX44nOM++5IHV32x3yZFctdsqq2pPeVXiSko6GhKgwA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 2.31 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 6334F2D26A X-Spam-Score: 2.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: U46LbVd+mW0z Ihor, I have tried your patch (v2). With a tiny test file it works as expected. I have not managed to add some text immediately after \relax to break this command. On 08/10/2022 12:17, Ihor Radchenko wrote: > Max Nikulin writes: > >>> +(defconst org-latex-linebreak-safe "\\\\\\relax" >> >> Is there a reason why you did not add \n at the end? It could help to >> avoid a lot of `concat' calls. > > Mostly because there are a couple of places where we need the version > without newline. I though that `concat' is better than > `replace-regexp-in-string' or introducing two constants with/without > newline. > > I guess, we can introduce the two constants. It might be slightly more > optimal. See the updated version of the patch. Reading with more attention, I do not think that second constant really makes the code more clear. I had a hope that it is enough to introduce a single constant, but it seems it is not the case. I did not expect that newline should not be added e.g. planning export handler. Perhaps it is better to commit v1. >>> - (equal "\\begin{tabular}{l}\n\\(x\\)\\\\\n\\end{tabular}" >>> + (equal "\\begin{tabular}{l}\n\\(x\\)\\\\\\relax\n\\end{tabular}" >> >> May be left as is since the line next to \\ does not start from square >> brackets. > > Nope. It can't. These are ERT tests for the ox-latex output. My bad. I am sorry. > @@ -2659,7 +2675,7 @@ ;;;; Line Break > (defun org-latex-line-break (_line-break _contents _info) > "Transcode a LINE-BREAK object from Org to LaTeX. > CONTENTS is nil. INFO is a plist holding contextual information." > - "\\\\\n") > + org-latex-linebreak-safe-newline) A minor naming inconsistency: "line-break" and "linebreak".