emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] [PATCH] conditional use of latex packages
Date: Thu, 21 Feb 2013 12:33:24 -0500	[thread overview]
Message-ID: <87r4k9shaz.fsf@gmail.com> (raw)
In-Reply-To: <87y5eh1yq4.fsf@gmail.com>

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.

> 
> 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 “know” 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
‘org-latex-classes’ or ‘-packages-alist’.  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’s 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’s true.  I don’t think that this will replace ‘org-latex-classes’ –
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’t 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
‘org-latex-optional-packages-options-alist’ variable to specify the
ordering).

> 
> 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 ‘org-latex-default-packages-alist’ to
disappear (or be shrunk to only a couple of entries), and all packages
not explicitly requested by the user (in ‘org-latex-packages-alist’ or
in an ‘org-latex-classes’ entry) to be loaded only if actually 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.)

-- 
Aaron Ecay

  reply	other threads:[~2013-02-21 17:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21  4:02 [RFC] [PATCH] conditional use of latex packages Aaron Ecay
2013-02-21  4:02 ` [PATCH 1/5] ox-latex: add optional-packages machinery Aaron Ecay
2013-02-21  4:02 ` [PATCH 2/5] ox-latex: convert source code and table export to use optional packages Aaron Ecay
2013-02-21  4:02 ` [PATCH 3/5] ob-R: change the file extension for tikz figures Aaron Ecay
2013-02-21  4:02 ` [PATCH 4/5] ox-latex: Treat tikz files as images Aaron Ecay
2013-02-21  4:02 ` [PATCH 5/5] ox-latex: Convert the image inclusion code to use optional packages Aaron Ecay
2013-02-21  9:51 ` [RFC] [PATCH] conditional use of latex packages Suvayu Ali
2013-02-21 15:19 ` Nicolas Goaziou
2013-02-21 17:33   ` Aaron Ecay [this message]
2013-02-21 18:39     ` Nicolas Goaziou
2013-02-24 18:47       ` Aaron Ecay
2013-02-24 18:50         ` [PATCH] ox-latex: add optional-packages machinery Aaron Ecay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4k9shaz.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).