Hi Nicolas, Thank you for your comments on this patch. I appreciate your concerns about the ordering of packages – this was something I had not considered fully. I have reworked the implementation; I think it is now simpler and more robust. Instead of a new customization variable, I’ve added a field to ‘org-latex-(default-)packages-alist’, which indicates whether a package is to be loaded always, or only if needed. This is very similar to the mechanism that already exists to load only a subset of packages when compiling latex snippets. This flag is initially set to nil for all packages, which loads them unconditionally – that is, the default behavior is unchanged. Users can set this flag to t for packages for which they are sure that optional loading is appropriate.
2013ko otsailak 21an, Nicolas Goaziou-ek idatzi zuen: [...] > > My point was that they provide distinct features, so they should be > included in different sets. But that's your call, really. You are right about this – I could not see the forest for the trees. I’ll send the tikz images patch separately. >> Except that the latex exporter supports it, > > Technically, latex exporter supports every package. That doesn't mean > all of them should by included in `org-latex-default-packages-alist'. What I meant was that the code for the latex exporter specifically mentions those packages. There is a very small set of latex packages that are “blessed” in that way. > 1. it's impossible to guess every package required by an user, so he > would ultimately have to mess with even more variables to get what he > wants (I only suggest to tweak `org-latex-class' and, optionally to > stuff package GCD in `org-latex-packages-alist'). Hopefully the new version of the patch addresses this concern. > > 2. In general, it's a bad idea to hide LaTeX internals too much as > it can become very hard to fix a problem when things happen in your > back. Well, the LaTeX file which is the output of org’s exporter is always available for debugging if something goes wrong. The new patch explicitly indicates when a package is omitted because org thinks it is unnecessary, so hopefully it will be very obvious when something goes wrong. (Also, org omitting a package will only happen if the user requests it explicitly.) The patch should appear as a reply to this email. -- Aaron Ecay