emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [RFC] [PATCH] conditional use of latex packages
Date: Wed, 20 Feb 2013 23:02:21 -0500	[thread overview]
Message-ID: <1361419346-23146-1-git-send-email-aaronecay@gmail.com> (raw)

Hello,

The current way that org handles LaTeX packages for export isn’t
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.

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’s preamble if the package is
used.

The other patches in the series (3, 4) fix the latex exporter’s handling
of tikz image files, as generated by R’s 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 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.)

With luck, the patches will be sent as replies to this message with git
send-email.

Thanks,
Aaron

PS I’ve sent away for the copyright assignment forms from the FSF...

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21  4:02 Aaron Ecay [this message]
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
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=1361419346-23146-1-git-send-email-aaronecay@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).