emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results
@ 2012-03-07 12:38 A. Major
  2012-03-07 16:10 ` Myles English
  0 siblings, 1 reply; 6+ messages in thread
From: A. Major @ 2012-03-07 12:38 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm trying to set up my .org file such that export commands create all
results in a certain directory rather than the directory containing
the .org file.  So I've added the option

  #+BIND: org-export-publishing-directory "/tmp/export-test"

at the beginning of the file, which seems to work fine for a simple
test file with HTML export.

If I try to export the .org file as a PDF document, however, the
result still resides in the directory containing the .org file --
which isn't what I want and is also counterintuitive given the name of
the variable set in the BIND option.

Even worse, if the .org file uses Babel to create files (say, in PNG
format) as a result (via ditaa, graphviz, etc.), then these files end
up in the directory containing the .org file, not in /tmp/export-test,
where the HTML file is placed.  This leaves the HTML output completely
broken.

Is there a proper way of doing this (short of "publishing", which
isn't what I want because I find it too complex in my case), and am I
doing something very wrong here?

Thanks,

  András

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results
  2012-03-07 12:38 BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results A. Major
@ 2012-03-07 16:10 ` Myles English
  2012-03-07 17:30   ` Christian Moe
  0 siblings, 1 reply; 6+ messages in thread
From: Myles English @ 2012-03-07 16:10 UTC (permalink / raw)
  To: A. Major; +Cc: emacs-orgmode

>> On Wed, 7 Mar 2012 12:38:48 +0000 (UTC), A Major said:

  > Hi, I'm trying to set up my .org file such that export commands
  > create all results in a certain directory rather than the directory
  > containing the .org file.  So I've added the option

  >   #+BIND: org-export-publishing-directory "/tmp/export-test"

  > at the beginning of the file, which seems to work fine for a simple
  > test file with HTML export.

  > If I try to export the .org file as a PDF document, however, the
  > result still resides in the directory containing the .org file --
  > which isn't what I want and is also counterintuitive given the name
  > of the variable set in the BIND option.

Hi András,

For pdf export, I have ended up using cmake to do an out-of-source build
[1] so all the files that latex produces go in one, expendable directory
and the original directory (under git management) remains free of
clutter.  It is a little complicated though.  I dream that one day maybe
org will be able to tangle its own CMakeLists.txt on export.

  > Even worse, if the .org file uses Babel to create files (say, in PNG
  > format) as a result (via ditaa, graphviz, etc.), then these files
  > end up in the directory containing the .org file, not in
  > /tmp/export-test, where the HTML file is placed.  This leaves the
  > HTML output completely broken.

  > Is there a proper way of doing this (short of "publishing", which
  > isn't what I want because I find it too complex in my case), and am
  > I doing something very wrong here?

  > Thanks,

  >   András


Myles


Footnotes: 
[1]  http://www.cmake.org/Wiki/CMakeUserUseLATEX

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results
  2012-03-07 16:10 ` Myles English
@ 2012-03-07 17:30   ` Christian Moe
  2012-03-08  6:38     ` A. Major
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Moe @ 2012-03-07 17:30 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: A. Major, Myles English


>>> On Wed, 7 Mar 2012 12:38:48 +0000 (UTC), A Major said:
>
>    >  Even worse, if the .org file uses Babel to create files (say, in PNG
>    >  format) as a result (via ditaa, graphviz, etc.), then these files
>    >  end up in the directory containing the .org file, not in
>    >  /tmp/export-test, where the HTML file is placed.  This leaves the
>    >  HTML output completely broken.

IIUC, this part of the problem should be easy to solve with the :dir 
header argument? You can set it once for the whole file with:

#+PROPERTY: dir /tmp/export-test

Yours,
Christian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results
  2012-03-07 17:30   ` Christian Moe
@ 2012-03-08  6:38     ` A. Major
  2012-03-08 20:09       ` Christian Moe
  0 siblings, 1 reply; 6+ messages in thread
From: A. Major @ 2012-03-08  6:38 UTC (permalink / raw)
  To: emacs-orgmode

Christian Moe <mail <at> christianmoe.com> writes:

> 
> 
> >>> On Wed, 7 Mar 2012 12:38:48 +0000 (UTC), A Major said:
> >
> >    >  Even worse, if the .org file uses Babel to create files (say, in PNG
> >    >  format) as a result (via ditaa, graphviz, etc.), then these files
> >    >  end up in the directory containing the .org file, not in
> >    >  /tmp/export-test, where the HTML file is placed.  This leaves the
> >    >  HTML output completely broken.
> 
> IIUC, this part of the problem should be easy to solve with the :dir 
> header argument? You can set it once for the whole file with:
> 
> #+PROPERTY: dir /tmp/export-test
> 
> Yours,
> Christian
> 
> 

Thanks, but the "dir" PROPERTY appears to affect the target directory for
babel's results, neither the HTML nor the PDF output are influenced that way.

Combining BIND and the "dir" PROPERTY, I can get HTML and babel files in the
right place, but not the PDF.

Any other suggestions? :)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results
  2012-03-08  6:38     ` A. Major
@ 2012-03-08 20:09       ` Christian Moe
  2012-03-23 13:00         ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Moe @ 2012-03-08 20:09 UTC (permalink / raw)
  To: A. Major; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

On 3/8/12 7:38 AM, A. Major wrote:
> Thanks, but the "dir" PROPERTY appears to affect the target directory for
> babel's results, neither the HTML nor the PDF output are influenced that way.

Yes, that's why I said "this part of the problem".

> Combining BIND and the "dir" PROPERTY, I can get HTML and babel files in the
> right place, but not the PDF.
>
> Any other suggestions? :)

Yep. Change three characters in org-latex.el. Problem solved. Maybe. :)

The attached patch addresses a difference between the latex and html 
exporters, enabling the user to choose a different output directory 
for latex/PDF export by binding org-export-publishing directory, just 
as was already possible for html export.

If there's a latex user following this thread who understands the ways 
of the latex exporter, could you have a look to see that it doesn't 
screw up anything else before I submit a properly formatted patch?

Yours,
Christian


diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 03664b4..759fad4 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -870,7 +870,7 @@ when PUB-DIR is set, use this as the publishing 
directory."
  	       (concat
  		(file-name-as-directory
  		 (or pub-dir
-		     (org-export-directory :LaTeX ext-plist)))
+		     (org-export-directory :LaTeX opt-plist)))
  		(file-name-sans-extension
  		 (or (and subtree-p
  			  (org-entry-get rbeg "EXPORT_FILE_NAME" t))


[-- Attachment #2: org-latex.el.diff --]
[-- Type: text/plain, Size: 470 bytes --]

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 03664b4..759fad4 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -870,7 +870,7 @@ when PUB-DIR is set, use this as the publishing directory."
 	       (concat
 		(file-name-as-directory
 		 (or pub-dir
-		     (org-export-directory :LaTeX ext-plist)))
+		     (org-export-directory :LaTeX opt-plist)))
 		(file-name-sans-extension
 		 (or (and subtree-p
 			  (org-entry-get rbeg "EXPORT_FILE_NAME" t))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results
  2012-03-08 20:09       ` Christian Moe
@ 2012-03-23 13:00         ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2012-03-23 13:00 UTC (permalink / raw)
  To: mail; +Cc: A. Major, emacs-orgmode

Hi,

I fixed this bug.

Christian Moe <mail@christianmoe.com> writes:

> On 3/8/12 7:38 AM, A. Major wrote:
>> Thanks, but the "dir" PROPERTY appears to affect the target directory for
>> babel's results, neither the HTML nor the PDF output are influenced that way.
>
> Yes, that's why I said "this part of the problem".
>
>> Combining BIND and the "dir" PROPERTY, I can get HTML and babel files in the
>> right place, but not the PDF.
>>
>> Any other suggestions? :)
>
> Yep. Change three characters in org-latex.el. Problem
> solved. Maybe. :)

You showed the direction -- thanks!  The right fix is to use
org-export-latex-options-plist, which is initialized by combining
opt-plist (general options for publishing) and ext-plist (local LaTeX
options for publishing.)

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-23 12:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-07 12:38 BUG(?): #+BINDing org-export-publishing-directory only affects HTML output, not PDF or Babel results A. Major
2012-03-07 16:10 ` Myles English
2012-03-07 17:30   ` Christian Moe
2012-03-08  6:38     ` A. Major
2012-03-08 20:09       ` Christian Moe
2012-03-23 13:00         ` Bastien

Code repositories for project(s) associated with this 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).