From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: [bug?][patch] Org LaTeX Fragments Date: Wed, 11 Sep 2013 12:19:01 +0200 Message-ID: <87d2ofu0dm.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJhWG-0001vF-Cq for emacs-orgmode@gnu.org; Wed, 11 Sep 2013 06:19:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJhW9-0007jb-Uj for emacs-orgmode@gnu.org; Wed, 11 Sep 2013 06:19:32 -0400 Received: from plane.gmane.org ([80.91.229.3]:57988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJhW9-0007jV-JS for emacs-orgmode@gnu.org; Wed, 11 Sep 2013 06:19:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VJhW7-0003Ft-Nz for emacs-orgmode@gnu.org; Wed, 11 Sep 2013 12:19:23 +0200 Received: from 31.55.37.175 ([31.55.37.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Sep 2013 12:19:23 +0200 Received: from rasmus by 31.55.37.175 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Sep 2013 12:19:23 +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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi, I don't know if this is a bug or a feature, but consider the following test file: #+BEGIN_SRC Org #+TITLE: Fails when exporting #+TITLE: Fails when exporting * Instructions :noexport: 1. Start =emacs -q= 2. <> Run \src_emacs-lisp{(org-preview-latex-fragment)} - WORKS 3. <> Run \src_emacs-lisp{(org-latex-export-to-pdf)} =./test.pdf= - FAILS [[p2]] works when [[p3]] fails because `org-format-latex-header` loads =amsmath=, but Org LaTeX export doesn't. Why I don't know. *Proposal: Replace amstext with amsmath.* * test \begin{align} x \mathcal{ABC} \end{align} #+END_SRC The first patch adds amsmath as a dependency which fixes the above bug. According to my TeXLive it seems amstext is distributed with amsmath, so I don't think that's an issue. Increased load time? Well, maybe. I didn't test. Will amstext be missed? No, it's loaded by amsmath, currently line 120 \RequirePackage{amstext}[1995/01/25] The second patch removes the dependency on eucal. Eucal provides an alternative font for the mathcal macro. Unless someone believes it's better than the standard font, e.g. for small fonts, there is little point in requiring it IMO. We could also replace color with xcolor, which is the better alternative, but I don't think it matters in this case and hence I haven't provided a patch for that. –Rasmus --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-amsmath-as-a-global-LaTeX-dependency.patch >From 8753024dca47d906e73f7963293b2174ae0f37fe Mon Sep 17 00:00:00 2001 From: rasmus Date: Wed, 11 Sep 2013 11:53:47 +0200 Subject: [PATCH 1/2] Add amsmath as a global LaTeX dependency * org.el (org-format-latex-header): Remove amsmath. (org-latex-default-packages-alist): Remove amstext and add amsmath. This increases consistency between LaTeX exports and LaTeX preview snippets. --- lisp/org.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 59a22a2..e8f25e9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3780,7 +3780,6 @@ images at the same place." (defcustom org-format-latex-header "\\documentclass{article} \\usepackage[usenames]{color} -\\usepackage{amsmath} \\usepackage[mathscr]{eucal} \[PACKAGES] \[DEFAULT-PACKAGES] @@ -3832,11 +3831,11 @@ header, or they will be appended." ("" "float" nil) ("" "wrapfig" nil) ("normalem" "ulem" t) + ("" "amsmath" t) ("" "textcomp" t) ("" "marvosym" t) ("" "wasysym" t) ("" "amssymb" t) - ("" "amstext" nil) ("" "hyperref" nil) "\\tolerance=1000") "Alist of default packages to be inserted in the header. @@ -3848,7 +3847,7 @@ The packages in this list are needed by one part or another of Org mode to function properly: - inputenc, fontenc: for basic font and character selection -- amstext: for subscript and superscript +- amsmath: for subscript and superscript and math environments - textcomp, marvosymb, wasysym, amssymb: for various symbols used for interpreting the entities in `org-entities'. You can skip some of these packages if you don't use any of their symbols. -- 1.8.4 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Remove-depedency-on-eucal-for-LaTeX-fragments-genera.patch >From 6c2139cc4275a426cedfbe548290b3c3f1b836a6 Mon Sep 17 00:00:00 2001 From: rasmus Date: Wed, 11 Sep 2013 11:58:08 +0200 Subject: [PATCH 2/2] Remove depedency on eucal for LaTeX fragments generation. * org.el (org-format-latex-header): Remove eucal. With amsmath loaded eucal (basically) only provides an alternative typeface to \mathcal{.} --- lisp/org.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index e8f25e9..997e740 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3780,7 +3780,6 @@ images at the same place." (defcustom org-format-latex-header "\\documentclass{article} \\usepackage[usenames]{color} -\\usepackage[mathscr]{eucal} \[PACKAGES] \[DEFAULT-PACKAGES] \\pagestyle{empty} % do not remove -- 1.8.4 --=-=-= Content-Type: text/plain -- There are known knowns; there are things we know that we know. --=-=-=--