emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Publishing using the new exporter
@ 2012-09-24  9:57 Robert Klein
  2012-09-24 10:25 ` Nicolas Goaziou
  0 siblings, 1 reply; 23+ messages in thread
From: Robert Klein @ 2012-09-24  9:57 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm trying to use the new exporter for publishing a project.

For some reason all .org files get exported to zero length .html files.

The org-e-publishh-project-alist is currently shortened to:

#+begin_example
(setq org-e-publish-project-alist
       '(("s2-org"
          :base-directory "~/Documents/org/s2"
          :base-extension "org"
          :publishing-directory "~/public_html/s2"
          :publishing-function  org-e-publish-org-to-html
          )
         ("s2-extra"
          :base-directory "~/Documents/org/s2"
          :base-extension "css\\|pdf\\|png\\|jpg\\|gif\\|ksh\\|sh\\|py"
          :publishing-directory "~/public_html/s2"
          :publishing-function org-e-publish-attachment
          :include (".htaccess")
          :recursive t)
         ("s2"
          :components ("s2-org" "s2-extra"))
         ))
#+end_example

The files in s2-extra all get published without a hitch.  Just the .org 
files turn up wrong.

I'd be very thankful for any advice or pointers in the right direction.

Thanks an best regards
Robert

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

* Re: Publishing using the new exporter
  2012-09-24  9:57 Publishing using the new exporter Robert Klein
@ 2012-09-24 10:25 ` Nicolas Goaziou
  2012-09-24 15:57   ` Nick Dokos
  2012-09-24 17:27   ` Robert Klein
  0 siblings, 2 replies; 23+ messages in thread
From: Nicolas Goaziou @ 2012-09-24 10:25 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> I'm trying to use the new exporter for publishing a project.
>
> For some reason all .org files get exported to zero length .html
> files.

Did you (require 'org-e-html) first?


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-09-24 10:25 ` Nicolas Goaziou
@ 2012-09-24 15:57   ` Nick Dokos
  2012-09-24 17:25     ` Achim Gratz
  2012-09-24 17:27   ` Robert Klein
  1 sibling, 1 reply; 23+ messages in thread
From: Nick Dokos @ 2012-09-24 15:57 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Robert Klein

Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
> 
> > I'm trying to use the new exporter for publishing a project.
> >
> > For some reason all .org files get exported to zero length .html
> > files.
> 
> Did you (require 'org-e-html) first?
> 
> 

Not that I have tried it, but I would expect error messages rather
than zero-length files in that case. Is that expectation wrong?

Nick

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

* Re: Publishing using the new exporter
  2012-09-24 15:57   ` Nick Dokos
@ 2012-09-24 17:25     ` Achim Gratz
  0 siblings, 0 replies; 23+ messages in thread
From: Achim Gratz @ 2012-09-24 17:25 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos writes:
>> Did you (require 'org-e-html) first?
>> 
>> 
>
> Not that I have tried it, but I would expect error messages rather
> than zero-length files in that case. Is that expectation wrong?

I think that if a backend hasn't registered callbacks, the defaults
(doing nothing) will take over.  I think there should be a canary
someplace that tells you if you're trying to use a backend that hasn't
been registered (or doesn't exist) to give a warning in this case.
Ideally a backend should be autoloaded when requested, but I guess we're
not there just yet.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: Publishing using the new exporter
  2012-09-24 10:25 ` Nicolas Goaziou
  2012-09-24 15:57   ` Nick Dokos
@ 2012-09-24 17:27   ` Robert Klein
  2012-09-25  7:16     ` Robert Klein
  2012-10-06 11:17     ` Nicolas Goaziou
  1 sibling, 2 replies; 23+ messages in thread
From: Robert Klein @ 2012-09-24 17:27 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 09/24/2012 12:25 PM, Nicolas Goaziou wrote:
> Hello,
>
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
>
>> I'm trying to use the new exporter for publishing a project.
>>
>> For some reason all .org files get exported to zero length .html
>> files.
>
> Did you (require 'org-e-html) first?
>
>
> Regards,
>

Thanks, this helps.

This is a bit curious for me.  I compiled org-mode with
    ORG_ADD_CONTRIB = org-e-* org-md org-export
in local.mk and simple eporting (instead of publishing) using org-e-
export-html-to-html worked with only
     (require 'org-install)
in my .emacs.

Anyway, I can export now, though the new exporter doesn't seem to honor 
the :html-preamble and :html-postamble variables in the project alist 
yet.  (I set them both to a function name, e.g.
     :html-preamble s2-preamble
with s2-preamble defined as:

#+begin_src elisp
(defun s2-preamble ()
   (org-get-file-contents "~/Documents/org/s2/html/preamble.html"))
#+end_src


So, org-get-file-contents is a function from the old exporter, but I 
didn't see any reason why it shouldn't.


Another issue I encountered, when publishing(!) to pdf, the resulting 
pdfs didn't have any images.  This is probably caused by the images 
beind created in :base-directory and the pdf being created in 
:publishing-directory (there may be more to this; I think at one time I 
already hat images in :publishing-directory). Note, images are created 
using plantuml source in the .org-files.  Works Ok with the HTML 
exporter, images are created by the PDF exporter also bbut not included 
in the resulting PDF.

Best regards
Robert

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

* Re: Publishing using the new exporter
  2012-09-24 17:27   ` Robert Klein
@ 2012-09-25  7:16     ` Robert Klein
  2012-09-25 10:58       ` Nicolas Goaziou
  2012-09-25 20:54       ` Nicolas Goaziou
  2012-10-06 11:17     ` Nicolas Goaziou
  1 sibling, 2 replies; 23+ messages in thread
From: Robert Klein @ 2012-09-25  7:16 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 09/24/2012 07:27 PM, Robert Klein wrote:
> On 09/24/2012 12:25 PM, Nicolas Goaziou wrote:
>> Hello,
>>
>> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
>>
>>> I'm trying to use the new exporter for publishing a project.
>>>
>>> For some reason all .org files get exported to zero length .html
>>> files.
>>
>> Did you (require 'org-e-html) first?
>>
>>
>> Regards,
>>
>
> Thanks, this helps.
>
> This is a bit curious for me.  I compiled org-mode with
>     ORG_ADD_CONTRIB = org-e-* org-md org-export
> in local.mk and simple eporting (instead of publishing) using org-e-
> export-html-to-html worked with only
>      (require 'org-install)
> in my .emacs.
>
> Anyway, I can export now, though the new exporter doesn't seem to honor
> the :html-preamble and :html-postamble variables in the project alist
> yet.  (I set them both to a function name, e.g.
>      :html-preamble s2-preamble
> with s2-preamble defined as:
>
> #+begin_src elisp
> (defun s2-preamble ()
>    (org-get-file-contents "~/Documents/org/s2/html/preamble.html"))
> #+end_src
>
>
> So, org-get-file-contents is a function from the old exporter, but I
> didn't see any reason why it shouldn't.
>
>
> Another issue I encountered, when publishing(!) to pdf, the resulting
> pdfs didn't have any images.  This is probably caused by the images
> beind created in :base-directory and the pdf being created in
> :publishing-directory (there may be more to this; I think at one time I
> already hat images in :publishing-directory). Note, images are created
> using plantuml source in the .org-files.  Works Ok with the HTML
> exporter, images are created by the PDF exporter also but not included
> in the resulting PDF.
>
> Best regards
> Robert
>
>

Hi,

when the :html-preamble function is just:
#+begin_src elisp
(defun s2-preamble ()
   "alpha-mark")
#+end_src

the text "alpha-mark" also doesn't get inserted, though simply setting
#+begin_src elisp
     :html-preamble "alpha-mark"
#+end_src
works.


If i set :html-preable to either s2-preamble or 's2-preamble nothing 
gets inserted.

I studied the code in org-e-html (excerpt below), but i don't see what I 
did wrong.

#+begin_src elisp :file contrib/lisp/org-e-html.el :firstline 1329
(defun org-e-html-preamble (info)
   (when (plist-get info :html-preamble)
     (let* ((title (org-export-data (plist-get info :title) info))
	   (date (org-e-html-format-date info))
	   (author (org-export-data (plist-get info :author) info))
	   (email (plist-get info :email))
	   (html-pre-real-contents
	    (cond
	     ((functionp (plist-get info :html-preamble))
	      (with-temp-buffer
		(funcall (plist-get info :html-preamble))
		(buffer-string)))
#+end_src


Thanks for any help

Robert

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

* Re: Publishing using the new exporter
  2012-09-25  7:16     ` Robert Klein
@ 2012-09-25 10:58       ` Nicolas Goaziou
  2012-09-25 20:54       ` Nicolas Goaziou
  1 sibling, 0 replies; 23+ messages in thread
From: Nicolas Goaziou @ 2012-09-25 10:58 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> If i set :html-preable to either s2-preamble or 's2-preamble nothing 
> gets inserted.
>
> I studied the code in org-e-html (excerpt below), but i don't see what I 
> did wrong.
>
> #+begin_src elisp :file contrib/lisp/org-e-html.el :firstline 1329
> (defun org-e-html-preamble (info)
>    (when (plist-get info :html-preamble)
>      (let* ((title (org-export-data (plist-get info :title) info))
> 	   (date (org-e-html-format-date info))
> 	   (author (org-export-data (plist-get info :author) info))
> 	   (email (plist-get info :email))
> 	   (html-pre-real-contents
> 	    (cond
> 	     ((functionp (plist-get info :html-preamble))
> 	      (with-temp-buffer
> 		(funcall (plist-get info :html-preamble))
> 		(buffer-string)))
> #+end_src

That's because the code expects the function to write to a buffer
instead of simply returning a string, which is wrong IMO.

The condition should simply be:

  ((functionp (plist-get info :html-preamble))
   (funcall (plist-get info :html-preamble)))

I will change this in a few hours unless someone beats me to it.


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-09-25  7:16     ` Robert Klein
  2012-09-25 10:58       ` Nicolas Goaziou
@ 2012-09-25 20:54       ` Nicolas Goaziou
  1 sibling, 0 replies; 23+ messages in thread
From: Nicolas Goaziou @ 2012-09-25 20:54 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> when the :html-preamble function is just:
> #+begin_src elisp
> (defun s2-preamble ()
>    "alpha-mark")
> #+end_src
>
> the text "alpha-mark" also doesn't get inserted, though simply setting
> #+begin_src elisp
>      :html-preamble "alpha-mark"
> #+end_src
> works.
>
>
> If i set :html-preable to either s2-preamble or 's2-preamble nothing 
> gets inserted.

It should be fixed now. Note that a preamble function require one
argument: a plist containing export options.


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-09-24 17:27   ` Robert Klein
  2012-09-25  7:16     ` Robert Klein
@ 2012-10-06 11:17     ` Nicolas Goaziou
  2012-10-06 14:52       ` Robert Klein
  1 sibling, 1 reply; 23+ messages in thread
From: Nicolas Goaziou @ 2012-10-06 11:17 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode, Eric Schulte

Hello,

> Another issue I encountered, when publishing(!) to pdf, the resulting 
> pdfs didn't have any images.  This is probably caused by the images 
> beind created in :base-directory and the pdf being created in 
> :publishing-directory

Indeed.

Eric: Is there any mechanism to force (automatically) Babel code to
generate files in a given publishing directory instead of the current
directory (notwithstanding :dir argument)?

Ideally, I would like to provide publishing-directory as an optional
argument to `org-export-blocks-preprocess', since it is the only
interface between the export engine and Babel.

Any opinion on this?


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-10-06 11:17     ` Nicolas Goaziou
@ 2012-10-06 14:52       ` Robert Klein
  2012-10-06 17:48         ` Nicolas Goaziou
  0 siblings, 1 reply; 23+ messages in thread
From: Robert Klein @ 2012-10-06 14:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

On 10/06/2012 01:17 PM, Nicolas Goaziou wrote:
> Hello,
>
>> Another issue I encountered, when publishing(!) to pdf, the resulting
>> pdfs didn't have any images.  This is probably caused by the images
>> beind created in :base-directory and the pdf being created in
>> :publishing-directory
>
> Indeed.
>
> Eric: Is there any mechanism to force (automatically) Babel code to
> generate files in a given publishing directory instead of the current
> directory (notwithstanding :dir argument)?
>
> Ideally, I would like to provide publishing-directory as an optional
> argument to `org-export-blocks-preprocess', since it is the only
> interface between the export engine and Babel.
>
> Any opinion on this?
>
>
> Regards,
>

Hello,

for pdf publishing I'd rather prefer the tex file also to be created in 
the base directory and only the pdf appearing in the 
publishing-directory, if there is a way.

My publishing-directories are often publicly accessible, where I'd 
rather not accumulate intermediate files.

As a workaround I currently use the base-directory as 
publishing-directory plus a second project using 
org-e-publish-attachment to copy the pdfs to their intended location. 
(I'm using org-e-publish-attachment for images of html files, so why 
shouldn't I use it for pdfs...

Best regards
Robert

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

* Re: Publishing using the new exporter
  2012-10-06 14:52       ` Robert Klein
@ 2012-10-06 17:48         ` Nicolas Goaziou
  2012-10-07 13:21           ` Robert Klein
  0 siblings, 1 reply; 23+ messages in thread
From: Nicolas Goaziou @ 2012-10-06 17:48 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode, Eric Schulte

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> for pdf publishing I'd rather prefer the tex file also to be created
> in the base directory and only the pdf appearing in the
> publishing-directory, if there is a way.

You're right: I'm over-engineering it.

> As a workaround I currently use the base-directory as
> publishing-directory plus a second project using
> org-e-publish-attachment to copy the pdfs to their intended location.
> (I'm using org-e-publish-attachment for images of html files, so why
> shouldn't I use it for pdfs...

This is now the default for PDF publishing. Thanks.


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-10-06 17:48         ` Nicolas Goaziou
@ 2012-10-07 13:21           ` Robert Klein
  2012-10-08 12:55             ` Nicolas Goaziou
  0 siblings, 1 reply; 23+ messages in thread
From: Robert Klein @ 2012-10-07 13:21 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

On 10/06/2012 07:48 PM, Nicolas Goaziou wrote:
> Hello,
>
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
>
>> for pdf publishing I'd rather prefer the tex file also to be created
>> in the base directory and only the pdf appearing in the
>> publishing-directory, if there is a way.
>
> You're right: I'm over-engineering it.
>
>> As a workaround I currently use the base-directory as
>> publishing-directory plus a second project using
>> org-e-publish-attachment to copy the pdfs to their intended location.
>> (I'm using org-e-publish-attachment for images of html files, so why
>> shouldn't I use it for pdfs...
>
> This is now the default for PDF publishing. Thanks.
>
>
> Regards,
>

Hello,

thanks for the patch.

There is still a small issue, though.  I tried org-e-publish to pdf with 
one small difference:

1. I'm in a buffer, the visited file is in the base-directory.  M-x 
org-e-publish... Publishing works Ok.

2. I'm in a buffer, visiting a buffer /not/ in the base-directory.  M-x 
org-e-publish... The pdf's don't have their images included.

I suspect, pdflatex is called using a working directory which is not the 
base-directory but the default-directory of the buffer from which I M-x 
org-e-publish.

Best regards
Robert

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

* Re: Publishing using the new exporter
  2012-10-07 13:21           ` Robert Klein
@ 2012-10-08 12:55             ` Nicolas Goaziou
  2012-10-08 16:05               ` Robert Klein
  0 siblings, 1 reply; 23+ messages in thread
From: Nicolas Goaziou @ 2012-10-08 12:55 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode, Eric Schulte

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> There is still a small issue, though.  I tried org-e-publish to pdf
> with one small difference:
>
> 1. I'm in a buffer, the visited file is in the base-directory.  M-x 
> org-e-publish... Publishing works Ok.
>
> 2. I'm in a buffer, visiting a buffer /not/ in the base-directory.
> M-x 
> org-e-publish... The pdf's don't have their images included.
>
> I suspect, pdflatex is called using a working directory which is not
> the base-directory but the default-directory of the buffer from which
> I M-x 
> org-e-publish.

I pushed a patch to solve this. May you confirm it is fine now?

Important note : I moved publishing functions to their respective
back-end, renaming them in the process. For example
`org-e-publish-org-to-pdf' becomes `org-e-latex-publish-to-pdf'.


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-10-08 12:55             ` Nicolas Goaziou
@ 2012-10-08 16:05               ` Robert Klein
  2012-10-08 16:49                 ` Nicolas Goaziou
  0 siblings, 1 reply; 23+ messages in thread
From: Robert Klein @ 2012-10-08 16:05 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

On 10/08/2012 02:55 PM, Nicolas Goaziou wrote:
> Hello,
>
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
>
>> There is still a small issue, though.  I tried org-e-publish to pdf
>> with one small difference:
>>
>> 1. I'm in a buffer, the visited file is in the base-directory.  M-x
>> org-e-publish... Publishing works Ok.
>>
>> 2. I'm in a buffer, visiting a buffer /not/ in the base-directory.
>> M-x
>> org-e-publish... The pdf's don't have their images included.
>>
>> I suspect, pdflatex is called using a working directory which is not
>> the base-directory but the default-directory of the buffer from which
>> I M-x
>> org-e-publish.
>
> I pushed a patch to solve this. May you confirm it is fine now?
>
> Important note : I moved publishing functions to their respective
> back-end, renaming them in the process. For example
> `org-e-publish-org-to-pdf' becomes `org-e-latex-publish-to-pdf'.
>
>
> Regards,
>

Hello,

umm, no, it doesn't work. I even have more issues now.

1. At first, when calling org-e-publish I got an error message "void 
function org-e-html-publish-to-html"

I go rid of the message by this patch (which most probably is the wrong 
thing to do):
diff -ur org-mode/lisp/org-e-html.el org-mode-b/lisp/org-e-html.el
--- org-mode/lisp/org-e-html.el	2012-10-08 15:43:34.723502697 +0200
+++ org-mode-b/lisp/org-e-html.el	2012-10-08 17:24:26.147115603 +0200
@@ -36,7 +36,6 @@
  ;;; Dependencies

  (require 'org-export)
-(require 'org-e-publish)
  (require 'format-spec)
  (eval-when-compile (require 'cl) (require 'table))

diff -ur org-mode/lisp/org-e-publish.el org-mode-b/lisp/org-e-publish.el
--- org-mode/lisp/org-e-publish.el	2012-10-08 15:43:34.727502681 +0200
+++ org-mode-b/lisp/org-e-publish.el	2012-10-08 17:24:48.848019275 +0200
@@ -41,6 +41,7 @@
  (eval-when-compile (require 'cl))
  (require 'format-spec)
  (require 'org-export)
+(require 'org-e-html)

  (declare-function org-e-latex-compile "org-e-latex" (texfile))


2. When calling org-e-publish from a buffer visiting a file outside of 
the base-directory i still get empty images.

3. When calling org-e-pblish from a buffer visiting a file in the 
base-directory the intermediate tex file doesn't even have the 
"includegraphics" commands.  (I checked this twice, as I didn't believe 
it at first).  Do the my changes in 1. above bork the exporter totally?

Best regards
Robert

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

* Re: Publishing using the new exporter
  2012-10-08 16:05               ` Robert Klein
@ 2012-10-08 16:49                 ` Nicolas Goaziou
  2012-10-08 17:36                   ` Robert Klein
  0 siblings, 1 reply; 23+ messages in thread
From: Nicolas Goaziou @ 2012-10-08 16:49 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode, Eric Schulte

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> umm, no, it doesn't work. I even have more issues now.
>
> 1. At first, when calling org-e-publish I got an error message "void
> function org-e-html-publish-to-html"
>
> I go rid of the message by this patch (which most probably is the
> wrong thing to do):

Just (require 'org-e-html) instead.

> 2. When calling org-e-publish from a buffer visiting a file outside of
> the base-directory i still get empty images.
>
> 3. When calling org-e-pblish from a buffer visiting a file in the
> base-directory the intermediate tex file doesn't even have the
> "includegraphics" commands.  (I checked this twice, as I didn't
> believe it at first).  Do the my changes in 1. above bork the exporter
> totally?

I don't think so, but I cannot reproduce your problem. Could you try
again in a fresh emacs, once back-ends you need have been required?


Thanks,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-10-08 16:49                 ` Nicolas Goaziou
@ 2012-10-08 17:36                   ` Robert Klein
  2012-10-08 17:46                     ` Suvayu Ali
  2012-10-09 10:07                     ` Robert Klein
  0 siblings, 2 replies; 23+ messages in thread
From: Robert Klein @ 2012-10-08 17:36 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

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

Hallo,

On 10/08/2012 06:49 PM, Nicolas Goaziou wrote:
> Hello,
>
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
>
>> umm, no, it doesn't work. I even have more issues now.
>>
>> 1. At first, when calling org-e-publish I got an error message "void
>> function org-e-html-publish-to-html"
>>
>> I go rid of the message by this patch (which most probably is the
>> wrong thing to do):
>
> Just (require 'org-e-html) instead.
>
>> 2. When calling org-e-publish from a buffer visiting a file outside of
>> the base-directory i still get empty images.
>>
>> 3. When calling org-e-pblish from a buffer visiting a file in the
>> base-directory the intermediate tex file doesn't even have the
>> "includegraphics" commands.  (I checked this twice, as I didn't
>> believe it at first).  Do the my changes in 1. above bork the exporter
>> totally?
>
> I don't think so, but I cannot reproduce your problem. Could you try
> again in a fresh emacs, once back-ends you need have been required?
>

I re-installed the git-version of org-mode, required 'org-e-html and 
'org-e-latex and exported from a fresh emacs.  Issue 1 and 3 above are 
gone, but I still get empty images when calling org-e-publish from a 
buffer visiting a file outside the base-directory.

I appended both a minimal .emacs and org file I used for the tests.

Best regards
Robert


[-- Attachment #2: .emacs --]
[-- Type: text/plain, Size: 1417 bytes --]

(setq load-path (cons "~/.emacs.d/org-mode/lisp" load-path))
(require 'org)
(require 'org-e-html)
(require 'org-e-latex)

;; org-babel
(setq org-plantuml-jar-path "~/.emacs.d/plantuml.jar")
(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)
   (sql . t)
   (sh . t)
   (dot . t)
   (plantuml . t)
   (latex . t)
   (ditaa . t)))

(setq org-e-publish-project-alist nil)
(add-to-list 'org-e-publish-project-alist
	     '("example-org"
	       :base-directory "~/Documents/org/example"
	       :base-extension "org"
	       :publishing-directory "~/public_html/example.com"
	       :publishing-function  org-e-html-publish-to-html
	       ))
(add-to-list 'org-e-publish-project-alist
	     '("example-pdf"
	       :base-directory "~/Documents/org/example"
	       :base-extension "org"
	       :publishing-directory "~/puglic_html/example.com"
	       :publishing-function  org-e-latex-publish-to-pdf
	       ))
(add-to-list 'org-e-publish-project-alist
	     '("example-extra"
	       :base-directory "~/Documents/org/example"
	       :base-extension "css\\|pdf\\|png\\|jpg\\|gif\\|ksh\\|sh\\|py"
	       :publishing-directory "~/public_html/example.com"
	       :publishing-function org-e-publish-attachment
	       :recursive t
	       ))
(add-to-list 'org-e-publish-project-alist
	     '("example"
	       :components ("example-org" "example-pdf" "example-extra")
	       ))

[-- Attachment #3: index.org --]
[-- Type: text/plain, Size: 722 bytes --]

# -*- fill-column:75; coding: utf-8-unix; -*-
#+TITLE: example.com

* Introduction
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor
incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi
consequat. Quis aute iure reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

* plantuml diagram
#+begin_src plantuml :file example.png :exports results
@startuml
title Todo for something

(*) --> "Count slowly to ten"
--> "Count slowly backwards to zero"
--> "Relax"
--> (*)
#+end_src

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

* Re: Publishing using the new exporter
  2012-10-08 17:36                   ` Robert Klein
@ 2012-10-08 17:46                     ` Suvayu Ali
  2012-10-09  5:06                       ` Robert Klein
  2012-10-09 10:07                     ` Robert Klein
  1 sibling, 1 reply; 23+ messages in thread
From: Suvayu Ali @ 2012-10-08 17:46 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Oct 08, 2012 at 07:36:43PM +0200, Robert Klein wrote:

[...]

> 
> I appended both a minimal .emacs and org file I used for the tests.
> 

[...]

> (add-to-list 'org-e-publish-project-alist
> 	     '("example-pdf"
> 	       :base-directory "~/Documents/org/example"
> 	       :base-extension "org"
> 	       :publishing-directory "~/puglic_html/example.com"
> 	       :publishing-function  org-e-latex-publish-to-pdf
> 	       ))

Is the typo above (puglic -> public) present in the original test file?

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Publishing using the new exporter
  2012-10-08 17:46                     ` Suvayu Ali
@ 2012-10-09  5:06                       ` Robert Klein
  0 siblings, 0 replies; 23+ messages in thread
From: Robert Klein @ 2012-10-09  5:06 UTC (permalink / raw)
  To: emacs-orgmode

On 10/08/2012 07:46 PM, Suvayu Ali wrote:
> On Mon, Oct 08, 2012 at 07:36:43PM +0200, Robert Klein wrote:
>
> [...]
>
>>
>> I appended both a minimal .emacs and org file I used for the tests.
>>
>
> [...]
>
>> (add-to-list 'org-e-publish-project-alist
>> 	     '("example-pdf"
>> 	       :base-directory "~/Documents/org/example"
>> 	       :base-extension "org"
>> 	       :publishing-directory "~/puglic_html/example.com"
>> 	       :publishing-function  org-e-latex-publish-to-pdf
>> 	       ))
>
> Is the typo above (puglic -> public) present in the original test file?
>

Currently this /is/ my original test file. Yes, the typpo is present, 
but it doesn't change the results.  I just get two sets of pdfs, one 
from the example-latex project in puplic_html and one from the 
example-extra project via org-e-publish-attachment in public_html...

I know about it and used it to watch both directories during publishing 
yesterday.  Just forgot to change it :(

Thanks for catching it.

Best regards
Robert

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

* Re: Publishing using the new exporter
  2012-10-08 17:36                   ` Robert Klein
  2012-10-08 17:46                     ` Suvayu Ali
@ 2012-10-09 10:07                     ` Robert Klein
  2012-10-10 16:59                       ` Nicolas Goaziou
  1 sibling, 1 reply; 23+ messages in thread
From: Robert Klein @ 2012-10-09 10:07 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

Hello,

On 10/08/2012 07:36 PM, Robert Klein wrote:
> Hallo,
>
> On 10/08/2012 06:49 PM, Nicolas Goaziou wrote:
>> Hello,
>>

>>
>> I don't think so, but I cannot reproduce your problem. Could you try
>> again in a fresh emacs, once back-ends you need have been required?
>>
>
> I re-installed the git-version of org-mode, required 'org-e-html and
> 'org-e-latex and exported from a fresh emacs.  Issue 1 and 3 above are
> gone, but I still get empty images when calling org-e-publish from a
> buffer visiting a file outside the base-directory.
>
> I appended both a minimal .emacs and org file I used for the tests.
>
> Best regards
> Robert
>

I got i working with this patch:

diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el
index 80b8ddb..2d4ad35 100644
--- a/contrib/lisp/org-e-latex.el
+++ b/contrib/lisp/org-e-latex.el
@@ -2670,6 +2670,7 @@ Return PDF file name or an error if it couldn't be 
produced."
    (let* ((wconfig (current-window-configuration))
          (texfile (file-truename texfile))
          (base (file-name-sans-extension texfile))
+        (default-directory base)
          errors)
      (message (format "Processing LaTeX file %s ..." texfile))
      (unwind-protect


After reading a bit in the emacs lisp reference manual I knew the issue 
is something with default-directory.  Then I examined the code of the 
old exporter and looked for a "similar" place in the new exporter, 
happily finding a 'let*( ...'.   Not sure, this is Ok or even the right 
place.  Just happy at the moment it does work.

Both cases (buffer visited in base-directory and not in base-directory) 
work with the change.

Best regards
Robert

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

* Re: Publishing using the new exporter
  2012-10-09 10:07                     ` Robert Klein
@ 2012-10-10 16:59                       ` Nicolas Goaziou
  2012-10-10 19:15                         ` Robert Klein
  0 siblings, 1 reply; 23+ messages in thread
From: Nicolas Goaziou @ 2012-10-10 16:59 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode, Eric Schulte

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> I got i working with this patch:
>
> diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el
> index 80b8ddb..2d4ad35 100644
> --- a/contrib/lisp/org-e-latex.el
> +++ b/contrib/lisp/org-e-latex.el
> @@ -2670,6 +2670,7 @@ Return PDF file name or an error if it couldn't
> be produced."
>    (let* ((wconfig (current-window-configuration))
>          (texfile (file-truename texfile))
>          (base (file-name-sans-extension texfile))
> +        (default-directory base)
>          errors)
>      (message (format "Processing LaTeX file %s ..." texfile))
>      (unwind-protect
>
>
> After reading a bit in the emacs lisp reference manual I knew the
> issue is something with default-directory.  Then I examined the code
> of the old exporter and looked for a "similar" place in the new
> exporter, happily finding a 'let*( ...'.   Not sure, this is Ok or
> even the right place.  Just happy at the moment it does work.
>
> Both cases (buffer visited in base-directory and not in
> base-directory) work with the change.

I still cannot reproduce the problem, even with your recipe. Could you
double-check it?

Also, there's nothing in `org-e-latex-compile' that should depend on
default-directory anyway.


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-10-10 16:59                       ` Nicolas Goaziou
@ 2012-10-10 19:15                         ` Robert Klein
  2012-10-11 21:55                           ` Nicolas Goaziou
  0 siblings, 1 reply; 23+ messages in thread
From: Robert Klein @ 2012-10-10 19:15 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

Hello,

On 10/10/2012 06:59 PM, Nicolas Goaziou wrote:
> Hello,
>
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
>
>> I got i working with this patch:
>>
>> diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el
>> index 80b8ddb..2d4ad35 100644
>> --- a/contrib/lisp/org-e-latex.el
>> +++ b/contrib/lisp/org-e-latex.el
>> @@ -2670,6 +2670,7 @@ Return PDF file name or an error if it couldn't
>> be produced."
>>     (let* ((wconfig (current-window-configuration))
>>           (texfile (file-truename texfile))
>>           (base (file-name-sans-extension texfile))
>> +        (default-directory base)
>>           errors)
>>       (message (format "Processing LaTeX file %s ..." texfile))
>>       (unwind-protect
>>
>>
>> After reading a bit in the emacs lisp reference manual I knew the
>> issue is something with default-directory.  Then I examined the code
>> of the old exporter and looked for a "similar" place in the new
>> exporter, happily finding a 'let*( ...'.   Not sure, this is Ok or
>> even the right place.  Just happy at the moment it does work.
>>
>> Both cases (buffer visited in base-directory and not in
>> base-directory) work with the change.
>
> I still cannot reproduce the problem, even with your recipe. Could you
> double-check it?
>
> Also, there's nothing in `org-e-latex-compile' that should depend on
> default-directory anyway.
>
>
> Regards,
>

I did some more tests and it seems the issue happens when Emacs is just 
started and nothing (much) done in it.

Test description below.

Best regards
Robert



* Setting up emacs and org-mode

** cleaning up emacs configuration
#+begin_src sh
# clean out .emacs.d
rm -rf ~/.emacs.d
# re-create and copy plantuml.jar
mkdir ~/.emacs.d
cp ~roklein/.emacs.d/plantuml.jar ~/.emacs.d/
#+end_src

** fetching org-mode git master
#+begin_src sh
mkdir $HOME/elisp && cd $HOME/elisp
git clone git://orgmode.org/org-mode.git
#+end_src

** local org configuration (local.mk)
#+begin_example :file ~/org-mode/local.mk
# Installation prefix
prefix  = /home/roklein/.emacs.d

# Where local lisp files go.
lispdir = $(prefix)/org-mode/lisp

# Where local data files go.
datadir = $(prefix)/org-mode/etc

# Where info files go.
infodir = $(prefix)/org-mode/info

# include files from contrib/lisp
ORG_ADD_CONTRIB = org-e-* org-md org-export org-contacts
#+end_example

** compile and install org-mode
#+begin_src sh
cd org-mode
vi local.mk  # see above
make
make install
#+end_src

This results in "Org-mode version 7.9.2 (release_7.9.2-432-g545166 @
   /home/emacs/.emacs.d/org-mode/lisp/)" from emacs M-x org-version.

* preparing the tests

Here I create ~/.emacs and ~/Documents/org/example/index.org as in the
former mail.

Further I create an image ~/example.png, simply containing the text
"FAIL!".

Touch  ~/Documents/org/other.org  (not ...txt)

* Test  preparation for each test

** cleaning up
    - closing emacs if open
    - executing the following commands
#+begin_src sh
cd
rm -rf public_html
rm Documents/org/example/index.tex*
rm Documents/org/example/index.pdf
rm Documents/org/example/example.png
rm .org-timestamps/*
#+end_src

* Test 1
   - Do test preparation as above
   - Start emacs from the command line.
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 1
   - html export is Ok
   - pdf export has the "FAIL!" image I created in the home directory.

* Test 2
   - Do test preparation as above
   - Start emacs from the command line.
   - C-x C-f ~/Documents/org/example/index.org
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 2
   - html export is Ok
   - pdf export is Ok

* Test 3
   - Do test preparation as above
   - Start emacs from the command line.
   - C-x C-f ~/Documents/org/example/index.org
   - C-x b *Gnu Emacs*
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 3
   - html export is Ok
   - pdf export is Ok

* Test 4
   - Do test preparation as above
   - Start emacs from the command line.
   - C-x C-f ~/Documents/org/example/index.org
   - C-x C-f ~/Documents/org/other.txt
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 4
   - html export is Ok
   - pdf export is Ok

* Test 5
   - Do test preparation as above
   - Start emacs from the command line.
   - C-x C-f ~/Documents/org/example/index.org
   - C-x C-f ~/Documents/org/other.txt
   - C-x C-s
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 5
   - html export is Ok
   - pdf export is Ok

* Test 6
   - Change ~/.emacs to autoload a file ~/Documents/org/other.org
   - Start emacs from the command line.
   - (It has *Gnu Emacs* as front buffer)
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 6
   - html export is Ok
   - pdf export has the "FAIL!" image I created in the home directory.

* Test 7
   - .emacs as in Test 6
   - Start emacs from the command line.
   - C-x C-f ~/Documents/org/example/index.org
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 7
   - html export is Ok
   - pdf export is Ok

* Test 8
   - Change ~/.emacs to autoload a file ~/Documents/org/other.org
   - Start emacs from the command line.
   - C-x C-f ~/Documents/org/example/index.org
   - change buffer to other.org: C-f b other.org
   - M-x org-e-publish example
   - Have to type "yes" twice for executing plantuml.

* Result of Test 8
   - html export is Ok
   - pdf export is Ok

* Conclusion
   In these tests the issue only happens, when I start Emacs and
   publish without doing anything(much?)  else before publishing.

   Perhaps there is an issue with the setup and some stuff doesn't get
   initialized.

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

* Re: Publishing using the new exporter
  2012-10-10 19:15                         ` Robert Klein
@ 2012-10-11 21:55                           ` Nicolas Goaziou
  2012-10-15  9:35                             ` Robert Klein
  0 siblings, 1 reply; 23+ messages in thread
From: Nicolas Goaziou @ 2012-10-11 21:55 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode, Eric Schulte

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:

> I did some more tests and it seems the issue happens when Emacs is just 
> started and nothing (much) done in it.
>
> Test description below.

Thank you for the thorough testing. I was able to reproduce the bug and
you're right: setting default-directory is the only way out. I've
committed a patch doing this.

If you confirm that the problem is solved, I'll also apply the same
changes to e-texinfo, e-man and e-groff back-ends.


Regards,

-- 
Nicolas Goaziou

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

* Re: Publishing using the new exporter
  2012-10-11 21:55                           ` Nicolas Goaziou
@ 2012-10-15  9:35                             ` Robert Klein
  0 siblings, 0 replies; 23+ messages in thread
From: Robert Klein @ 2012-10-15  9:35 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Eric Schulte

Hallo,

On 10/11/2012 11:55 PM, Nicolas Goaziou wrote:
> Hello,
> 
> Robert Klein <kleinrob@mpip-mainz.mpg.de> writes:
> 
>> I did some more tests and it seems the issue happens when Emacs is just 
>> started and nothing (much) done in it.
>>
>> Test description below.
> 
> Thank you for the thorough testing. I was able to reproduce the bug and
> you're right: setting default-directory is the only way out. I've
> committed a patch doing this.
> 
> If you confirm that the problem is solved, I'll also apply the same
> changes to e-texinfo, e-man and e-groff back-ends.
> 

sorry for the late answer.

I run all tests again plus a couple additional ones using a bigger
project: The image exports work as expected.

(I ran into another "no image" issue and had to verify it isn't related
to this issue.  It isn't.)

Thanks a lot for the help.

Best regards
Robert

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

end of thread, other threads:[~2012-10-15  9:35 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24  9:57 Publishing using the new exporter Robert Klein
2012-09-24 10:25 ` Nicolas Goaziou
2012-09-24 15:57   ` Nick Dokos
2012-09-24 17:25     ` Achim Gratz
2012-09-24 17:27   ` Robert Klein
2012-09-25  7:16     ` Robert Klein
2012-09-25 10:58       ` Nicolas Goaziou
2012-09-25 20:54       ` Nicolas Goaziou
2012-10-06 11:17     ` Nicolas Goaziou
2012-10-06 14:52       ` Robert Klein
2012-10-06 17:48         ` Nicolas Goaziou
2012-10-07 13:21           ` Robert Klein
2012-10-08 12:55             ` Nicolas Goaziou
2012-10-08 16:05               ` Robert Klein
2012-10-08 16:49                 ` Nicolas Goaziou
2012-10-08 17:36                   ` Robert Klein
2012-10-08 17:46                     ` Suvayu Ali
2012-10-09  5:06                       ` Robert Klein
2012-10-09 10:07                     ` Robert Klein
2012-10-10 16:59                       ` Nicolas Goaziou
2012-10-10 19:15                         ` Robert Klein
2012-10-11 21:55                           ` Nicolas Goaziou
2012-10-15  9:35                             ` Robert Klein

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).