From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: [PATCH 5/5] ox-latex: Convert the image inclusion code to use optional packages Date: Wed, 20 Feb 2013 23:02:26 -0500 Message-ID: <1361419346-23146-6-git-send-email-aaronecay@gmail.com> References: <1361419346-23146-1-git-send-email-aaronecay@gmail.com> Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8NN4-0001YO-Hm for emacs-orgmode@gnu.org; Wed, 20 Feb 2013 23:03:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8NMx-00038m-5J for emacs-orgmode@gnu.org; Wed, 20 Feb 2013 23:02:56 -0500 Received: from mail-ve0-f178.google.com ([209.85.128.178]:34851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8NMx-00038g-1E for emacs-orgmode@gnu.org; Wed, 20 Feb 2013 23:02:51 -0500 Received: by mail-ve0-f178.google.com with SMTP id db10so7620439veb.9 for ; Wed, 20 Feb 2013 20:02:50 -0800 (PST) In-Reply-To: <1361419346-23146-1-git-send-email-aaronecay@gmail.com> 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 Eliminate unconditional use of wrapfig and graphicx packages. Also allows loading the (large, expensive) tikz package only when tikz graphics are present. --- lisp/org.el | 2 -- lisp/ox-latex.el | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index d3506d1..4f10959 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3752,9 +3752,7 @@ header, or they will be appended." '(("AUTO" "inputenc" t) ("T1" "fontenc" t) ("" "fixltx2e" nil) - ("" "graphicx" t) ("" "float" nil) - ("" "wrapfig" nil) ("" "soul" t) ("" "textcomp" t) ("" "marvosym" t) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 8027ce7..4889911 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1829,6 +1829,11 @@ used as a communication channel." (image-code (if (equal filetype "tikz") (format "\\input{%s}" path) (format "\\includegraphics%s{%s}" options path)))) + (if (equal filetype "tikz") + (org-latex--use-package info "tikz") + (org-latex--use-package info "graphicx")) + (when (eq float 'wrap) + (org-latex--use-package info "wrapfig")) ;; Return proper string, depending on FLOAT. (case float (wrap (format "\\begin{wrapfigure}%s -- 1.8.1.4