From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Problem with org-entities-user Date: Mon, 17 Sep 2012 08:41:13 +0200 Message-ID: <87k3vtgnhy.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDV54-0004XG-Dr for emacs-orgmode@gnu.org; Mon, 17 Sep 2012 02:45:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDV53-0001i6-A8 for emacs-orgmode@gnu.org; Mon, 17 Sep 2012 02:45:18 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:59471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDV53-0001gD-3v for emacs-orgmode@gnu.org; Mon, 17 Sep 2012 02:45:17 -0400 Received: by wibhn17 with SMTP id hn17so1743531wib.12 for ; Sun, 16 Sep 2012 23:45:15 -0700 (PDT) In-Reply-To: (Thomas S. Dye's message of "Sun, 16 Sep 2012 16:32:53 -1000") 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: "Thomas S. Dye" Cc: Org-mode Hello, tsd@tsdye.com (Thomas S. Dye) writes: > I'm probably doing something silly here, but can't figure it out. Using > the new LaTeX exporter, and with org-entities-user defined as below, > this: > > \C14 \frac12 \Omacron > > exports as: > > \C14 \textonehalf{} \=3D{O} > > Why isn't my C14 entity being exported correctly? > > All the best, > Tom > > Value: (("U234" "\\textsuperscript{234}U" nil "234U" "234U" "2= 34U" "234U") > ("Th230" "\\textsuperscript{230}Th" nil "230Th" "230Th" "230T= h" "230Th") > ("C14" "\\textsuperscript{14}C" nil "" "14C" "14C" "14C") > ("Umacron" "\\=3D{U}" nil "Ū" "U" "U" "=C5=AA") > ("Omacron" "\\=3D{O}" nil "Ō" "O" "O" "=C5=8C") > ("Imacron" "\\=3D{I}" nil "Ī" "I" "I" "=C4=AA") > ("Emacron" "\\=3D{E}" nil "Ē" "E" "E" "=C4=92") > ("Amacron" "\\=3D{A}" nil "Ā" "A" "A" "=C4=80") > ("umacron" "\\=3D{u}" nil "ū" "u" "u" "=C5=AB") > ("omacron" "\\=3D{o}" nil "ō" "o" "o" "=C5=8D") > ("imacron" "\\=3D{i}" nil "ī" "i" "i" "=C4=AB") > ("emacron" "\\=3D{e}" nil "ē" "e" "e" "=C4=93") > ("amacron" "\\=3D{a}" nil "ā" "a" "a" "=C4=81") > ("space" "\\ " nil " " " " " " " ")) That's because numbers are not allowed in entities, except for a few exceptions: "\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:al= pha:]]\\)" Note that this regexp also matches LaTeX commands. One seducing idea would be to drop support for such commands (I'm _not_ talking about math environments and snippets, but about commands like \hfill{} or \bigskip{}). After all, if you want to write raw LaTeX in an Org buffer, you can always use #+LATEX: or @@latex:...@@ like with any other back-end. I see no compelling reason to keep this convenience if it gets in the way. It would speed-up a bit entities matching, and would allow for a relaxed regexp (i.e. a regexp built upon already defined entities). Regards, --=20 Nicolas Goaziou