From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: How to detect latex subscripts with org-element? Date: Mon, 10 Mar 2014 15:05:28 +0100 Message-ID: <87zjkyno7r.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN0o6-00058Q-BG for emacs-orgmode@gnu.org; Mon, 10 Mar 2014 10:04:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN0ny-0007Y7-RT for emacs-orgmode@gnu.org; Mon, 10 Mar 2014 10:03:54 -0400 Received: from plane.gmane.org ([80.91.229.3]:38961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN0ny-0007Xv-KM for emacs-orgmode@gnu.org; Mon, 10 Mar 2014 10:03:46 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WN0nw-0004DZ-2a for emacs-orgmode@gnu.org; Mon, 10 Mar 2014 15:03:44 +0100 Received: from 109.201.154.157 ([109.201.154.157]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Mar 2014 15:03:44 +0100 Received: from rasmus by 109.201.154.157 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Mar 2014 15:03:44 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I want to detect if my point is inside a super/subscript irrespective of whether I'm in a latex-fragment/environment or in plain text. If "|" is my point, I can easily detect the subscript here x_{z|} using `org-element-context`. However, I have found no good way of detecting if I'm in the subscript in this example $x^{3}_{z|}$ Can I somehow ask org-element to tread a latex-fragment or a latex-environment as-if it was a plain paragraph? The motivation is that I'm writing a function to escape fontified subscripts, such as those of the second example, using double space, but I cannot find a way to detect if I'm in a subscript when I have several sup/superscritps. Thanks, Rasmus -- Hooray!