From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MDBrOaBnx1+kCwAA0tVLHw (envelope-from ) for ; Wed, 02 Dec 2020 10:08:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aJVANaBnx18bEwAAB5/wlQ (envelope-from ) for ; Wed, 02 Dec 2020 10:08:32 +0000 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 530169403CA for ; Wed, 2 Dec 2020 10:08:32 +0000 (UTC) Received: from localhost ([::1]:60056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkP3l-00039I-AH for larch@yhetil.org; Wed, 02 Dec 2020 05:08:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkOCv-0000Tf-4C for emacs-orgmode@gnu.org; Wed, 02 Dec 2020 04:13:53 -0500 Received: from mail.tuxteam.de ([5.199.139.25]:47688) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1kkOCs-00080S-KD for emacs-orgmode@gnu.org; Wed, 02 Dec 2020 04:13:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=8c2ovP0H8TDlwN1GTNfi7IigQqbvf+LAfGQRu/hTHG0=; b=cnXNOLEf/08WLUg15/yiyckVmlgHKIw4uJbjWVkYdvAD9RMgywIB8H953siKg8fk8m0nc9ROE6KcIeQFbZZ0q5OwwcbRXlKiwmXDGzxZ9Af+TgvuceugfVC7h5pBFfE3awxBaogvq1nHtPWPgmYFKhfPzktP2Kt+Gp4uskMu/855t5YMOF/Qd151YiD38jb0TwcKAGNs60xRVXxpKgCPWF8BC2OL4/3GLSjdMVAefiP0t3JFuwgUUcFLI6YBjH/lxuiV0sV7MNL0Xa6FRsQSU+dsGCRgxxcCMp+Td2diJhOhpi9Bps6T7XPrJqTKcRjy7OmmnzZzGHqzPciLN7R3fQ==; Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1kkOCj-0004M0-Pw for emacs-orgmode@gnu.org; Wed, 02 Dec 2020 10:13:41 +0100 Date: Wed, 2 Dec 2020 10:13:41 +0100 To: emacs-orgmode@gnu.org Subject: Re: Bug: LaTeX inline maths expression \(+\) wrongly toggles strike-through face Message-ID: <20201202091341.GB14592@tuxteam.de> References: <87zh2x2bm8.fsf@ens-lyon.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <87zh2x2bm8.fsf@ens-lyon.fr> User-Agent: Mutt/1.5.21 (2010-09-15) From: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.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, 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.23 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-Spam-Score: -3.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=tuxteam.de header.s=mail header.b=cnXNOLEf; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 530169403CA X-Spam-Score: -3.08 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: bmtjhfvkmRNT --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 02, 2020 at 03:19:27AM +0100, Firmin Martin wrote: >=20 > Consider the following lines:=20 > - $+$ foobar $+$ > - \[+\] foobar \[+\] > - $$+$$ foobar $$+$$ > - \(+\) foobar \(+\) > Each of them is correct LaTeX inline/display maths expressions, but only = the > last one toggles strike-through face when it shouldn't.=20 >=20 > Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.= 24.20, cairo version 1.16.0) > of 2020-10-16 > Package: Org mode version 9.4 (9.4-53-gc97446-elpa) That's interesting. Happens to me too -- but I don't understand why the first thre are /not/ rendered as strike-through. The relevant variables are - org-emphasis-regexp-components in my installation: org-emphasis-regexp-components is a variable defined in =E2=80=98org.el= =E2=80=99. Its value is ("-[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]" "." 5) =20 Documentation: Components used to build the regular expression for emphasis. This is a list with five entries. Terminology: In an emphasis string like " *strong word* ", we call the initial space PREMATCH, the final space POSTMATCH, the stars MARKERS, "s" and "d" are BORDER characters and "trong wor" is the body. The different components in this variable specify what is allowed/forbidden in each part: =20 pre Chars allowed as prematch. Beginning of line will be allow= ed too. post Chars allowed as postmatch. End of line will be allowed to= o. border The chars *forbidden* as border characters. body-regexp A regexp like "." to match a body character. Don=E2=80=99t= use non-shy groups here, and don=E2=80=99t allow newline here. newline The maximum number of newlines allowed in an emphasis exp. (I changed the value of newline to 5). Note `border' is just "[[:space:]]", so I'd expect '$', '\' and '$' (for the first three examples) to be "allowe= d" borders, and - org-emph-re which is calculated from the above, and in my box, not suprprisingly, is "\\([-[:space:]('\"{]\\|^\\)\\(\\([*/_+]\\)\\([^[:space:]]\\|[^[:space= :]].*?\\(?: .*?\\)\\{0,5\\}[^[:space:]]\\)\\3\\)\\([-[:space:].,:!?;'\")}\\[]\\|$\\)" =2E..which would confirm my expectation above. So why are the three examples not rendered as overstrike? There seems to be more magic involved. This happens for other emph markers, too. To work around in your case, Martin, you could try to add a backslash to your `org-emphasis-regexp-component's third element, like so: (setf (nth 3 org-emphasis-regexp-components) "\\\\[:space:]") and reload Org to give it the chance to rebuild org-emph-re. (Caveat: I didn't try it). Cheers - t --1UWUbFP1cBYEclgG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl/HWsUACgkQBcgs9XrR2kYhdgCfbLs1wyJJAdHhgvyYQ2r74g/a TJ4An2VxodJc+5sqnXKlWCQ/auGGQGeg =GJIm -----END PGP SIGNATURE----- --1UWUbFP1cBYEclgG--