From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [RFC] [PATCH] conditional use of latex packages Date: Thu, 21 Feb 2013 12:33:24 -0500 Message-ID: <87r4k9shaz.fsf@gmail.com> References: <1361419346-23146-1-git-send-email-aaronecay@gmail.com> <87y5eh1yq4.fsf@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]:43271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8a1Y-0003G5-7V for emacs-orgmode@gnu.org; Thu, 21 Feb 2013 12:33:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8a1Q-0000BQ-KG for emacs-orgmode@gnu.org; Thu, 21 Feb 2013 12:33:35 -0500 Received: from mail-ve0-f182.google.com ([209.85.128.182]:42394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8a1P-0000Aj-OZ for emacs-orgmode@gnu.org; Thu, 21 Feb 2013 12:33:28 -0500 Received: by mail-ve0-f182.google.com with SMTP id ox1so8212382veb.13 for ; Thu, 21 Feb 2013 09:33:26 -0800 (PST) In-Reply-To: <87y5eh1yq4.fsf@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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org 2013ko otsailak 21an, Nicolas Goaziou-ek idatzi zuen: > Obviously, if you need a package in every document you write, it > should go into `org-latex-packages-alist'. I agree with this. >=20 > 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. But not with this. It leads to combinatorial explosion: you need article-with-tikz, article-with-biblatex, article-with-tikz-and-biblatex, article-with-tikz-and-booktabs, .... Apart from that, I think that the latex exporter should =E2=80=9Cknow=E2=80= =9D that you need the booktabs package to export a table with the booktabs option. So, if I send someone an org document with a booktabs table, it will export correctly without the recipient needing to fiddle with =E2=80=98org-latex-classes=E2=80=99 or =E2=80=98-packages-alist=E2=80=99. = And the same reasoning applies to longtables, tikz graphics, etc. Obviously this is not true of arbitrarily complex LaTeX constructs, but longtables, booktabs and tikz are all supported natively by org=E2=80=99s syntax. > 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. That=E2=80=99s true. I don=E2=80=99t think that this will replace =E2=80= =98org-latex-classes=E2=80=99 =E2=80=93 for certain kinds of setup it will be necessary to explicitly spell out the latex code. But the hope is that the kind of packages that this is targeted at (which implement formatting options, but don=E2=80=99t generally muck with lower-level things like hyperref) ordering will not be an issue. That might be an optimistic assumption about the state of LaTeX packages, though... The patch currently does not insert the optional packages in a specific order, but it would be possible to do so (using the =E2=80=98org-latex-optional-packages-options-alist=E2=80=99 variable to spe= cify the ordering). >=20 > I don't mind that change. Would you mind providing it as a separate > set of patches? If the consensus is that the optional package functionality is not wanted, I can do so. > I don't mind removing "longtable" from > `org-latex-default-packages-alist'. I think there's no reason for it > to be there. Except that the latex exporter supports it, which is also why wrapfig is in there, and several packages providing symbols for org-entities. I think that a logical goal is for =E2=80=98org-latex-default-packages-alist= =E2=80=99 to disappear (or be shrunk to only a couple of entries), and all packages not explicitly requested by the user (in =E2=80=98org-latex-packages-alist= =E2=80=99 or in an =E2=80=98org-latex-classes=E2=80=99 entry) to be loaded only if actua= lly needed by the exporter. (Whether or not this endpoint is reached depends, as you point out, on whether the problem of package load order can be solved in a satisfactory way.) --=20 Aaron Ecay