emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem exporting table with images
@ 2011-02-08 11:19 Rainer M Krug
  2011-02-08 20:02 ` Sébastien Vauban
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer M Krug @ 2011-02-08 11:19 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

#+TITLE:     Export of images in table to pdf
#+AUTHOR:    Rainer M. Krug
#+DATE:      2011-02-08 Tue

Hi

I have problems exporting this table with graphs to pdf:
1) when exporting, the links are retained, and okular tells me
"malformed url"
2) I would like to have the graphs inserted instead of the links ---
according to the manual, this should be done automatically, but it does
not work.

Is there something I am missing here?
Cheers,

Rainer

* Generating the graphs
#+begin_src R :results output org :exports both
  cat("|---|---|---|\n")
  for (x in 1:3) {
      for (y in 1:3) {
        pdf(paste("img", x, y, "pdf", sep="."))
        plot(runif(100))
        dev.off()
      }
      cat("|", paste(" [[file:img.1", x, "pdf", sep="."), "]] |",
paste(" [[./img.2", x, "pdf", sep="."), "]] |", paste("[[./img.3", x,
"pdf", sep="."), "]] |\n")
    }
  cat("|---|---|---|\n")
#+end_src

#+results:
#+BEGIN_ORG
|-------------------+----------------+----------------|
| [[file:img.1.1.pdf ]] | [[./img.2.1.pdf ]] | [[./img.3.1.pdf ]] |
| [[file:img.1.2.pdf ]] | [[./img.2.2.pdf ]] | [[./img.3.2.pdf ]] |
| [[file:img.1.3.pdf ]] | [[./img.2.3.pdf ]] | [[./img.3.3.pdf ]] |
|-------------------+----------------+----------------|
#+END_ORG


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1RJtAACgkQoYgNqgF2egrBaACfQiORHUc3itvK3rXv9Z2JtFlm
F2cAnigBCCqt2XoUpGe0iGkyF1VRIwYj
=YifL
-----END PGP SIGNATURE-----

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

* Re: Problem exporting table with images
  2011-02-08 11:19 Problem exporting table with images Rainer M Krug
@ 2011-02-08 20:02 ` Sébastien Vauban
  2011-02-09 10:09   ` Rainer M Krug
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Vauban @ 2011-02-08 20:02 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Rainer,

Rainer M Krug wrote:
> #+TITLE:     Export of images in table to pdf
> #+AUTHOR:    Rainer M. Krug
> #+DATE:      2011-02-08 Tue
>
> Hi
>
> I have problems exporting this table with graphs to pdf:
> 1) when exporting, the links are retained, and okular tells me
> "malformed url"
> 2) I would like to have the graphs inserted instead of the links ---
> according to the manual, this should be done automatically, but it does
> not work.
>
> Is there something I am missing here?
> Cheers,
>
> Rainer
>
> * Generating the graphs
> #+begin_src R :results output org :exports both
>   cat("|---|---|---|\n")
>   for (x in 1:3) {
>       for (y in 1:3) {
>         pdf(paste("img", x, y, "pdf", sep="."))
>         plot(runif(100))
>         dev.off()
>       }
>       cat("|", paste(" [[file:img.1", x, "pdf", sep="."), "]] |",
> paste(" [[./img.2", x, "pdf", sep="."), "]] |", paste("[[./img.3", x,
> "pdf", sep="."), "]] |\n")
>     }
>   cat("|---|---|---|\n")
> #+end_src
>
> #+results:
> #+BEGIN_ORG
> |-------------------+----------------+----------------|
> | [[file:img.1.1.pdf ]] | [[./img.2.1.pdf ]] | [[./img.3.1.pdf ]] |
> | [[file:img.1.2.pdf ]] | [[./img.2.2.pdf ]] | [[./img.3.2.pdf ]] |
> | [[file:img.1.3.pdf ]] | [[./img.2.3.pdf ]] | [[./img.3.3.pdf ]] |
> |-------------------+----------------+----------------|
> #+END_ORG

Don't know if that can be the source of the problem, but it appears you have
spaces after the filename, in your links.

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Problem exporting table with images
  2011-02-08 20:02 ` Sébastien Vauban
@ 2011-02-09 10:09   ` Rainer M Krug
  2011-02-09 10:36     ` Sébastien Vauban
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer M Krug @ 2011-02-09 10:09 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/08/2011 09:02 PM, Sébastien Vauban wrote:
> Hi Rainer,
> 
> Rainer M Krug wrote:
>> #+TITLE:     Export of images in table to pdf
>> #+AUTHOR:    Rainer M. Krug
>> #+DATE:      2011-02-08 Tue
>>
>> Hi
>>
>> I have problems exporting this table with graphs to pdf:
>> 1) when exporting, the links are retained, and okular tells me
>> "malformed url"
>> 2) I would like to have the graphs inserted instead of the links ---
>> according to the manual, this should be done automatically, but it does
>> not work.
>>
>> Is there something I am missing here?
>> Cheers,
>>
>> Rainer
>>
>> * Generating the graphs
>> #+begin_src R :results output org :exports both
>>   cat("|---|---|---|\n")
>>   for (x in 1:3) {
>>       for (y in 1:3) {
>>         pdf(paste("img", x, y, "pdf", sep="."))
>>         plot(runif(100))
>>         dev.off()
>>       }
>>       cat("|", paste(" [[file:img.1", x, "pdf", sep="."), "]] |",
>> paste(" [[./img.2", x, "pdf", sep="."), "]] |", paste("[[./img.3", x,
>> "pdf", sep="."), "]] |\n")
>>     }
>>   cat("|---|---|---|\n")
>> #+end_src
>>
>> #+results:
>> #+BEGIN_ORG
>> |-------------------+----------------+----------------|
>> | [[file:img.1.1.pdf ]] | [[./img.2.1.pdf ]] | [[./img.3.1.pdf ]] |
>> | [[file:img.1.2.pdf ]] | [[./img.2.2.pdf ]] | [[./img.3.2.pdf ]] |
>> | [[file:img.1.3.pdf ]] | [[./img.2.3.pdf ]] | [[./img.3.3.pdf ]] |
>> |-------------------+----------------+----------------|
>> #+END_ORG
> 
> Don't know if that can be the source of the problem, but it appears you have
> spaces after the filename, in your links.

Partly - now I have:

* Generating the graphs
#+begin_src R :results output org :exports both
  cat("|---|---|---|\n")
  for (x in 1:3) {
      for (y in 1:3) {
        pdf(paste("img", x, y, "pdf", sep="."))
        plot(runif(100))
        dev.off()
      }
      cat("|", " [[file:img_1_", x, ".pdf", "]] |", " [[./img_2_", x,
".pdf", "]] |", "[[./img_3_", x, ".pdf", "]] |\n", sep="")
    }
  cat("|---|---|---|\n")
#+end_src

#+results:
#+BEGIN_ORG
|---|---|---|
| [[file:img_1_1.pdf]] | [[./img_2_1.pdf]] |[[./img_3_1.pdf]] |
| [[file:img_1_2.pdf]] | [[./img_2_2.pdf]] |[[./img_3_2.pdf]] |
| [[file:img_1_3.pdf]] | [[./img_2_3.pdf]] |[[./img_3_3.pdf]] |
|---|---|---|
#+END_ORG

The table is translated to LaTeX as:
\begin{tabular}{lll}
\hline
 \includegraphics[width=10em]{./img_1_1.pdf}  &
\includegraphics[width=10em]{./img_2_1.pdf}  &
\includegraphics[width=10em]{./img_3_1.pdf}  \\
 \includegraphics[width=10em]{./img_1_2.pdf}  &
\includegraphics[width=10em]{./img_2_2.pdf}  &
\includegraphics[width=10em]{./img_3_2.pdf}  \\
 \includegraphics[width=10em]{./img_1_3.pdf}  &
\includegraphics[width=10em]{./img_2_3.pdf}  &
\includegraphics[width=10em]{./img_3_3.pdf}  \\
\hline
\end{tabular}

Which gives the following error:

####
LaTeX Warning: File `./img_1_1.pdf' not found on input line 68.

!pdfTeX error: pdflatex (file ./img_1_1.pdf): cannot find image file
 ==> Fatal error occurred, no output PDF file produced!
####

So do I have to provide absolute paths to the graphs?


Cheers,

Rainer



> Best regards,
>   Seb
> 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1SZ9MACgkQoYgNqgF2egqNCACcDoJzyUk02hEWWOHsnM9RkKw9
52EAnjB3HuJlNzUo6PrAdWQlqTbBaV8H
=x8b/
-----END PGP SIGNATURE-----

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

* Re: Problem exporting table with images
  2011-02-09 10:09   ` Rainer M Krug
@ 2011-02-09 10:36     ` Sébastien Vauban
  2011-02-09 11:21       ` Rainer M Krug
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Vauban @ 2011-02-09 10:36 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Rainer,

Rainer M Krug wrote:
> Which gives the following error:
>
> ####
> LaTeX Warning: File `./img_1_1.pdf' not found on input line 68.
>
> !pdfTeX error: pdflatex (file ./img_1_1.pdf): cannot find image file
>  ==> Fatal error occurred, no output PDF file produced!
> ####
>
> So do I have to provide absolute paths to the graphs?

Why prefixing with `.', which is the current directory?  If you correctly set
the search path for the images (so that it includes the current directory --
that setting is certainly there by default), it should be OK.

So, I'd try opting out the `./' prefix in front of your links, if that's
acceptable for you.

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Problem exporting table with images
  2011-02-09 10:36     ` Sébastien Vauban
@ 2011-02-09 11:21       ` Rainer M Krug
  0 siblings, 0 replies; 5+ messages in thread
From: Rainer M Krug @ 2011-02-09 11:21 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/09/2011 11:36 AM, Sébastien Vauban wrote:
> Hi Rainer,
> 
> Rainer M Krug wrote:
>> Which gives the following error:
>>
>> ####
>> LaTeX Warning: File `./img_1_1.pdf' not found on input line 68.
>>
>> !pdfTeX error: pdflatex (file ./img_1_1.pdf): cannot find image file
>>  ==> Fatal error occurred, no output PDF file produced!
>> ####
>>
>> So do I have to provide absolute paths to the graphs?
> 
> Why prefixing with `.', which is the current directory?  If you correctly set
> the search path for the images (so that it includes the current directory --
> that setting is certainly there by default), it should be OK.
> 
> So, I'd try opting out the `./' prefix in front of your links, if that's
> acceptable for you.

Fixed it - the problem was the "." in the filename of the image. If I
use "_" instead, it works. LaTeX seems to split the filemane and the
extension after the *first* "." and tries to identify the image type by
using everything right of the first "." - so it wont work if the file
name is "img.2.3.pdf", but with "img_2_3.pdf" it does.

Pitty - I like the "." in the filenames (and I don't like the "_").

I guess it is a LaTeX question, but is there a way of telling LaTeX to
split after the *last* "." or to specify the image type?

Thanks,

Rainer


> 
> Best regards,
>   Seb
> 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1SeMoACgkQoYgNqgF2egrMfwCfQefWwyHzCrFYxJTCQTNHxbb2
8YAAniGIABHy6oYkylXIrgYaI7Cs+dUf
=UL3F
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2011-02-09 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-08 11:19 Problem exporting table with images Rainer M Krug
2011-02-08 20:02 ` Sébastien Vauban
2011-02-09 10:09   ` Rainer M Krug
2011-02-09 10:36     ` Sébastien Vauban
2011-02-09 11:21       ` Rainer M Krug

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