From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] [PATCH] conditional use of latex packages Date: Thu, 21 Feb 2013 16:19:15 +0100 Message-ID: <87y5eh1yq4.fsf@gmail.com> References: <1361419346-23146-1-git-send-email-aaronecay@gmail.com> 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]:58296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Y1s-0007i1-8g for emacs-orgmode@gnu.org; Thu, 21 Feb 2013 10:25:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8Y1l-00033d-FL for emacs-orgmode@gnu.org; Thu, 21 Feb 2013 10:25:48 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:41611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Y1l-00033J-9B for emacs-orgmode@gnu.org; Thu, 21 Feb 2013 10:25:41 -0500 Received: by mail-wi0-f176.google.com with SMTP id hm14so7656866wib.3 for ; Thu, 21 Feb 2013 07:25:40 -0800 (PST) In-Reply-To: <1361419346-23146-1-git-send-email-aaronecay@gmail.com> (Aaron Ecay's message of "Wed, 20 Feb 2013 23:02:21 -0500") 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: Aaron Ecay Cc: emacs-orgmode@gnu.org Hello, Aaron Ecay writes: > The current way that org handles LaTeX packages for export isn=E2=80=99t > optimal. The org-latex-(default-)packages-alist variables define a set > of packages that are loaded always. If a user wants to use advanced > functionality (booktabs for nicer table export, listings or minted for > nicer source code), s/he has to add the packages to these variables > manually.And a package like longtables is imported into every > document, slowing down compilation even when it is not used. I think you are misusing latex back-end configuration. Obviously, if you need a package in every document you write, it should go into `org-latex-packages-alist'. If you need occasional packages, they should go into `org-latex-classes'. Adding a new class is cheap. For example you can create a class "article-with-tikz". It also allows to include arbitrary code within the header. > The attached patches (specifically 1, 2, and 5) introduce a mechanism to > load certain packages only when needed. It is possible to customize > these packages by specifying options to be passed to their \usepackage > (only inserted if needed to properly export the document), as well as > arbitrary code to place in the document=E2=80=99s preamble if the package= is > used. I don't want to take that route. Bad things can happen if you load packages in the wrong order, or with wrong options. This is a can of worms. That's why no package is ever loaded automatically. Notwithstanding conditional package insertion, `org-latex-classes' provides the same set of features. > The other patches in the series (3, 4) fix the latex exporter=E2=80=99s h= andling > of tikz image files, as generated by R=E2=80=99s tikzDevice function. > Currently, a link to the file containing the graphics code is inserted. > The proper behavior is to \input the file; the source code therein is > compiled into a graph by LaTeX as it compiles the document. (Tikz is a > very expensive latex package to load; the ability to load tikz only when > necessary motivated the optional packages mechanism.) I don't mind that change. Would you mind providing it as a separate set of patches? Anyway, nothing can be applied before FSF registration is complete. > I think these patches need more testing, but I wanted to send them along > for feedback. If it is not desired to change the status quo > wrt. packages like booktabs and minted (must be manually added), and > wrapfig and longtable (will always be used even if not needed), it would > be possible to accept only patches 1, 3, and 4. (But obviously I think > the other patches are a marked improvement.) I don't mind removing "longtable" from `org-latex-default-packages-alist'. I think there's no reason for it to be there. Regards, --=20 Nicolas Goaziou