From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geralt Subject: Bug in LaTeX export of org-html-entities? Date: Fri, 26 Feb 2010 11:24:57 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkxNV-000185-Qe for emacs-orgmode@gnu.org; Fri, 26 Feb 2010 05:25:01 -0500 Received: from [140.186.70.92] (port=46859 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkxNU-00017x-JM for emacs-orgmode@gnu.org; Fri, 26 Feb 2010 05:25:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NkxNT-0005Q1-NP for emacs-orgmode@gnu.org; Fri, 26 Feb 2010 05:25:00 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:63176) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkxNT-0005Pk-Ib for emacs-orgmode@gnu.org; Fri, 26 Feb 2010 05:24:59 -0500 Received: by fxm22 with SMTP id 22so7322149fxm.26 for ; Fri, 26 Feb 2010 02:24:57 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello, I think there's at least one bug in the org-export-latex-treat-backslash-char function, because it does not correctly export entries of the org-html-entities variable that have the form ("Rightarrow" . "⇒"). To render such entities the function uses (member (list string-after) org-html-entities), but that fails for these entries. Assuming that org-html-entities is an alist a correct check would be (assoc string-after org-html-entities). But even then I think the function is broken, because it renders these entities with the following piece of code: (cond ((member (list string-after) org-html-entities) ;; backslash is part of a special entity (like "\alpha") (concat string-before "$\\" (or (cdar (member (list string-after) org-html-entities)) string-after) "$")) ;; other cases follow here, I've omitted them If I replace just the condition-check with the (assoc ...) version the export of, for example, \Rightarrow works, but due to the association of Rightarrow with rArr we should expect that it should render \Rightarrow as "⇒" which is of course only meaningful for HTML. So I think we need here another condition, namely (cond ((assoc string-after org-html-entities) (concat string-before "$\\" (or (cdr (assoc string-after org-html-entities)) string-after) "$")) but that's not enough we also need a new entity variable org-latex-entities which mapps entities like \rArr to \Rightarrow, so instead of an entry ("Rightarrow" . "⇒") we need an entry ("rArr" . "Rightarrow") and put an entry with empty cdr in this alist for Rightarrow: ("Rightarrow"). Can you confirm this bug? And if yes, do you have a better solution than I to avoid the duplication of the entities variable? Geralt.