From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id n5mWOSpv1V/yRwAA0tVLHw (envelope-from ) for ; Sun, 13 Dec 2020 01:32:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0F/XNCpv1V8DDAAA1q6Kng (envelope-from ) for ; Sun, 13 Dec 2020 01:32:26 +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 786F894014B for ; Sun, 13 Dec 2020 01:32:26 +0000 (UTC) Received: from localhost ([::1]:37594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koGFN-0002s6-DR for larch@yhetil.org; Sat, 12 Dec 2020 20:32:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koGDQ-0002nv-On for emacs-orgmode@gnu.org; Sat, 12 Dec 2020 20:30:26 -0500 Received: from lxc-smtp.ens-lyon.fr ([140.77.167.80]:57952) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koGDM-0003O2-Vg for emacs-orgmode@gnu.org; Sat, 12 Dec 2020 20:30:24 -0500 Received: from localhost (localhost [127.0.0.1]) by lxc-smtp.ens-lyon.fr (Postfix) with ESMTP id 0994E22FB2 for ; Sun, 13 Dec 2020 02:30:16 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr Received: from lxc-smtp.ens-lyon.fr ([127.0.0.1]) by localhost (lxc-smtp.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qpMr29zZP_kr for ; Sun, 13 Dec 2020 02:30:16 +0100 (CET) Received: from Inspiron.Inspiron (lfbn-idf2-1-1313-107.w92-169.abo.wanadoo.fr [92.169.127.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by lxc-smtp.ens-lyon.fr (Postfix) with ESMTPSA id EF36E22EBE for ; Sun, 13 Dec 2020 02:30:15 +0100 (CET) From: Firmin Martin To: emacs-orgmode@gnu.org Subject: Bug: LaTeX: inline maths expression in \textrm is not fully supported Date: Sun, 13 Dec 2020 02:30:15 +0100 Message-ID: <87h7oq1oig.fsf@ens-lyon.fr> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=140.77.167.80; envelope-from=firmin.martin@ens-lyon.fr; helo=lxc-smtp.ens-lyon.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.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: -2.30 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: 786F894014B X-Spam-Score: -2.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: wyx4vf+tRYLh Sometimes, we want to nest inline maths expression in \textrm to handle spaces easily and avoid repetition. Examples: 1. $A = \{n : \textrm{$n$ odd in $X$}\}$ 2. $A = \{n : \textrm{\(n\) odd in \(X\)}\}$ 3. \(A = \{n : \textrm{\(n\) odd in \(X\)}\}\) 4. \(A = \{n : \textrm{$n$ odd in $X$}\}\) are all equivalent to - $A = \{n : n \textrm{ odd in } X}\}$ But Org mode exports them in LaTeX as \begin{enumerate} \item \$A = $\backslash${n : \textrm{$n$ odd in $X$}$\backslash$}\$ \item \(A = \{n : \textrm{\(n\) odd in \(X\)}\}\) \item \(A = \{n : \textrm{\(n\) odd in \(X\)\}$\backslash$}$\backslash$) \item \(A = \{n : \textrm{$n$ odd in $X$}\}\) \end{enumerate} Namely, only cases 2. and 4., where nested maths delimiters are different than the outer-most maths delimiters, are correctly exported. On the other hand, Cases 1. and 3. introduced extra $\backslash$. Interestingly, display style maths expressions are correctly exported. 5. $$A = \{n : \textrm{$n$ odd in $X$}\}$$ 6. $$A = \{n : \textrm{\(n\) odd in \(X\)}\}$$ 7. \[A = \{n : \textrm{\(n\) odd in \(X\)}\}\] 8. \[A = \{n : \textrm{$n$ odd in $X$}\}\] exports to \begin{enumerate} \item $$A = \{n : \textrm{$n$ odd in $X$}\}$$ \item $$A = \{n : \textrm{\(n\) odd in \(X\)}\}$$ \item \[A = \{n : \textrm{\(n\) odd in \(X\)}\}\] \item \[A = \{n : \textrm{$n$ odd in $X$}\}\] \end{enumerate} without extra $\backslash$. Best, Firmin 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-55-g706ba9-elpaplus @ ~/.emacs.d/elpa/org-20201207/)