From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71364: Fix Table.el export Date: Fri, 07 Jun 2024 13:54:48 +0300 Message-ID: <86jzj1f2fb.fsf@gnu.org> References: <8734ptj6lj.fsf@gmail.com> <86r0dagv7v.fsf@gnu.org> <87frtpqltu.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26061"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71364@debbugs.gnu.org To: Pranshu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 07 12:56:04 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sFXGN-0006VS-Cy for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jun 2024 12:56:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFXG9-00034X-Oh; Fri, 07 Jun 2024 06:55:49 -0400 Original-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 1sFXG7-00033q-D3 for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 06:55:47 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFXG7-0005ah-4V for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 06:55:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFXGM-00053H-76 for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 06:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jun 2024 10:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71364 X-GNU-PR-Package: emacs Original-Received: via spool by 71364-submit@debbugs.gnu.org id=B71364.171775772119311 (code B ref 71364); Fri, 07 Jun 2024 10:56:02 +0000 Original-Received: (at 71364) by debbugs.gnu.org; 7 Jun 2024 10:55:21 +0000 Original-Received: from localhost ([127.0.0.1]:46344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFXFe-00051H-U2 for submit@debbugs.gnu.org; Fri, 07 Jun 2024 06:55:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFXFZ-00050j-VH for 71364@debbugs.gnu.org; Fri, 07 Jun 2024 06:55:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFXFF-0005Aq-Cr; Fri, 07 Jun 2024 06:54:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fnxHssutKxdsC4FIy3QhFQ3BihqLperVqzDlmCQJ/IU=; b=ZX5dn4Ks26EzxLDaJeSs xNEqBlJgQOeKeT9pAPSZi9T72g7p8t61qhoxiu/bEDASt+Um+aQujAVUpQTL0hKSfGdzoUq5ziRVY k115c3tUGiZSHtttHsIyPeakRS8+9yyHMAyddr2bSR9f7pGiOHLZC8OYhA8emrcI4ZnPJssmCr3pq aoBwdNbii5Di77udB8KBiM68PsYZoyIt+NjzlG2K26/4+w8LdTBv7sdLK+0joGF0ZT009GLH64+8Q A5pfETPlFiGj4j/67wtQz7piE1JeegCdoJRXoAlYUEv2lFCFq9K/4FWSOSG/hrVxUFByIt5jm7mY7 8iCtRAxtUVPe6w==; In-Reply-To: <87frtpqltu.fsf@gmail.com> (message from Pranshu on Fri, 07 Jun 2024 17:00:13 +1000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286758 Archived-At: > From: Pranshu > Cc: 71364@debbugs.gnu.org > Date: Fri, 07 Jun 2024 17:00:13 +1000 > > Now, the problem is if you have a table like the following: > +---------+-------+--------+ > |$\delta$ |x |y | > +---------+-------+--------+ > |x | $x^2$ |$xy$ | > +---------+-------+--------+ > |y | $xy$ | $y^2$ | > +---------+-------+--------+ > > Now if you export to latex using "C-^" or M-x table-generate-source you > get: > > % This LaTeX table template is generated by emacs 30.0.50 > \begin{tabular}{|l|l|l|} > \hline > \$$\backslash$delta\$ & x & y \\ > \hline > x & \$x\^2\$ & \$xy\$ \\ > \hline > y & \$xy\$ & \$y\^2\$ \\ > \hline > \end{tabular} > > The problem with this is that since the all the dollar and caret signs > are all escaped, the maths will not render. So you are saying that exporting to latex is basically completely broken in the current code? Is that command use to export only to latex, or is the fact that the export is to latex is just one of the possibilities? > What the diff does, is that it adds a variable that allows the user to > change what will be escaped. Also as you can see in the above latex > table, the backslash had to be escaped in a different way, so using one > regexp variable would not be enough. That is why the solution contains > a variable called 'table-source-latex-escape-characters', which is a > cons cell with the documentation: Why would a user need to customize this on the level of characters? Shouldn't there be a single boolean that causes latex-specific characters to be escape or not to be escaped, all of them or none? > A cons cell containing which charecters to escape in the latex source > of ‘table-generate-source’. The head of the list, if non-nil contains a > regexp that matches all text that is to be adding a preceding backslash > to the matching text. If nil, no non-backslash charecters will be > escaped. The tail, if non-nil, escapes all the backslashes in the latex > source. What is the purpose of the "tail", i.e. why would a user want to escape all the backslashes? Thanks.