From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Italics + footnote in latex export Date: Tue, 04 Jun 2013 01:56:01 -0400 Message-ID: <87hahepgge.fsf@pierrot.dokosmarshall.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujkcv-0001za-N4 for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 02:21:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjkED-0003zC-8T for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 01:56:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:42931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjkEC-0003z0-Vx for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 01:56:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UjkE9-0001to-0N for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 07:56:13 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 07:56:13 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 07:56:13 +0200 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 James Harkins writes: > I have: > > Western notation supports a type of /polyphony/[fn:1] > > I get: > > Western notation supports a type of /polyphony/\footnote{ ... blah blah ... } > I believe you have to fiddle with org-emphasis-regexp-components. The default value is (" ('\"{" "- .,:!?;'\")}\\" " ,\"'" "." 1) Pretty, isn't it? Looks like Perl :-) There are four strings and an integer in that list, if you squint hard enough and count (unescaped) double quotes. The second string in this list (i.e. "- .,:!?;'\")}\\") specifies the set of characters that are allowed as the "postmatch", and they include the dash, a space, a tab, a period, a comma, a colon, an exclamation mark, a question mark, a semicolon, a single quote, a double quote (escaped as \"), a closing paren, a closing curly brace and a backslash (which has to be escaped as \\ above). Note that this set does *not* include the opening square bracket, so [ is not a valid postmatch character. That's what needs to be done to have the parser recognize ``.../foo/[bar]'' as an italics ``foo''. So we add it, but one has to be careful: you cannot add it at the beginning of the string, before the dash. This whole set becomes a character class in the *real* regexp, org-emph-re, that is used by the rest of the code and if the dash does not come at the very beginning, it takes on a special meaning, which we don't want to give it in this case. So let's add the square bracket at the end of that string: "- .,:!?;'\")}\\[" That should be safe. BTW, don't cut and paste anything from here: I'm not sure that I've cut and pasted everything correctly in the first place and additionally mailers tend to mangle various things in email: this is much too delicate to withstand even the slightest kind of mangling. Best to copy the default definition of org-emphasis-regexp-components from org.el into your .emacs and make the modification there. Make sure that you restart emacs or reload org after adding the modification: the wheels have to turn again in order to transform the pieces of org-emphasis-regexp-components into the real regexp, org-emph-re. This works (I tested it), but it is rather fiddly, so you have to double and triple check to make sure that you got things right. Maybe there is an easier method: if so, I'd appreciate a pointer. NB: no warranty is offered. If it breaks, you get to pick up the pieces. -- Nick