emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration


From: Francesco Pizzolante
Subject: Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration
Date: Mon, 07 Dec 2009 13:48:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)

Eric,

> Would it be possible to switch from using org-exp-blocks to using
> org-babel?  If so then you could use org-babel's caching which does
> *not* affect the exported file name, but rather saves a sha1 key as
> (mostly) hidden text in the org-mode buffer.
>
> so for example
>
> #+BEGIN_ditaa procedure.png
>      +-----------------+
>      |     Example     |
>      |                 |
>      |   +---------+   |
>      |   |         |   |
>      |   |         |   |
>      |   +---------+   |
>      +-----------------+
> #+END_ditaa
>
> would be written as
>
> #+begin_src ditaa :file procedure.png :cache :exports results
>      +-----------------+
>      |     Example     |
>      |                 |
>      |   +---------+   |
>      |   |         |   |
>      |   |         |   |
>      |   +---------+   |
>      +-----------------+
> #+end_src
>
> and pressing C-cC-c on the block (or exporting) would result in the
> insertion of a link to the resulting image into the org-mode buffer
> behind a results line as follows -- only in org most of the hash is
> hidden.
>
> #+results[bdffac60833c9f925a52bd6617dace39832b7dda]:
> [[file:procedure.png]]

I don't see any problem in using org-babel. The only issues I see with this
solution are the following:

- when you export, no #+results line is added to the org-mode buffer;

- you, thus, have to do the C-cC-c at least once in your block to generate
  the #+results line;

- when you export (to LaTeX or PDF), the image is always re-computed (no
  caching mechanism is used), while doing C-cC-c, the caching is used.

Can you confirm these points?


> My problem with your proposed solution is that it entails storing
> information *outside* of the org-mode buffer -- which granted we are
> already doing although in a less dramatic way.  The creation of external
> files whose sole purpose is to save a hash in their filename strikes me
> as wasteful/messy.

I agree with your point. I was "simply" trying to reuse what has been done for
the caching of images in org. The org-babel solution is more elegant.

Thanks,
F.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]