From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: avoid subscripting text Date: Thu, 28 Mar 2013 09:09:21 +0800 Message-ID: <87y5d8wcse.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL1Fu-00072L-56 for emacs-orgmode@gnu.org; Wed, 27 Mar 2013 21:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UL1Fs-0005wC-Hh for emacs-orgmode@gnu.org; Wed, 27 Mar 2013 21:03:50 -0400 Received: from plane.gmane.org ([80.91.229.3]:52846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL1Fs-0005vy-9h for emacs-orgmode@gnu.org; Wed, 27 Mar 2013 21:03:48 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UL1GC-0004Md-D4 for emacs-orgmode@gnu.org; Thu, 28 Mar 2013 02:04:08 +0100 Received: from 114.250.105.19 ([114.250.105.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Mar 2013 02:04:08 +0100 Received: from eric by 114.250.105.19 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Mar 2013 02:04:08 +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 John Hendy writes: > On Wed, Mar 27, 2013 at 1:24 PM, Samuel Wales wrote: >> There is also a variable (org-export-with-sub-superscript or something >> like that). > > #+begin > org-export-with-sub-superscripts is a variable defined in `ox.el'. > Its value is t > > Documentation: > Non-nil means interpret "_" and "^" for export. > > When this option is turned on, you can use TeX-like syntax for > sub- and superscripts. Several characters after "_" or "^" > will be considered as a single item - so grouping with {} is > normally not needed. For example, the following things will be > parsed as single sub- or superscripts. > #+end_man > >> >> Maybe this would be good as default nil? > > I'd like to poll the list for frequent LaTeX exporters vs. everyone > else before making a change like that. My intuition would suggest that > underscores get used a lot by LaTeX users and not a ton by the rest, > but I could be wrong! Hey! The above led me to `org-export-filter-subscript-functions', and its `superscript' sibling. I should have guessed that was there. Attaching a filter function to the subscript version should be enough to solve the OP's problem: with some experimentation it ought to be possible to conditionally handle the "_", though I haven't tried this yet and don't know how big a chunk of text is passed to the filter. Anyway, in this case I'll bet a filter is the way to go. Meanwhile, I'll look into deleting my local patch that hard-codes Latex superscripts to "\\textsuperscript{%s}" instead of "$_\\mathrm{%s}$"... E