Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-17 Thread Tim
At Tue, 03 Dec 2013 21:17:06 +0530,
Jambunathan K wrote:
 
 Let me upgrade my LibreOffice and report back.
 
Jambunathan,
   was wondering if you had a chance to look at this error ?  I can confirm
it is an issue on my Ubuntu 13.10 system with :
   - emacs 24.3.1
   - org-mode 8.2.4 (org-plus-contrib elpa package 20131216)
   - libreoffice 4.1.3.2

I use the odt export to create student handouts and *really* don't want to go
back through 200+ documents to add captions to all of the images !

Thanks

-Tim 



Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-17 Thread Tim
At Wed, 18 Dec 2013 00:16:25 +0530,
Jambunathan K wrote:
 
 Tim wiskey5al...@gmail.com writes:
 
  Jambunathan,
 was wondering if you had a chance to look at this error ?  I can confirm
  it is an issue on my Ubuntu 13.10 system with :
 - emacs 24.3.1
 - org-mode 8.2.4 (org-plus-contrib elpa package 20131216)
 - libreoffice 4.1.3.2
 
 I can see the problem on my side.
 
  I use the odt export to create student handouts and *really* don't
  want to go back through 200+ documents to add captions to all of the
  images !
 
 This issue is a bit unfortunate.  Please don't modify your Org files.  I
 will circulate a fix - if not a fix, atleast a workaround - in another
 day.

Thank you !

-Tim



Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-17 Thread Jambunathan K
Tim wiskey5al...@gmail.com writes:

 Jambunathan,
was wondering if you had a chance to look at this error ?  I can confirm
 it is an issue on my Ubuntu 13.10 system with :
- emacs 24.3.1
- org-mode 8.2.4 (org-plus-contrib elpa package 20131216)
- libreoffice 4.1.3.2

I can see the problem on my side.

 I use the odt export to create student handouts and *really* don't
 want to go back through 200+ documents to add captions to all of the
 images !

This issue is a bit unfortunate.  Please don't modify your Org files.  I
will circulate a fix - if not a fix, atleast a workaround - in another
day.

Jambunathan K.




Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-04 Thread Jambunathan K
Christian Moe m...@christianmoe.com writes:

 This problem was also reported by Tyler Smith a couple of weeks back.

I was able to open test.odt provided by Tyler just fine.  Hence I did
not follow up the post (IIRC, Christian was also indicating a no
issue.)

http://permalink.gmane.org/gmane.emacs.orgmode/78579

I am using LibreOffice 4.0.1.2.

Tyler says he is using 4.0.4.2.  OP is using LibreOffice-4.1.3.2.  Is it
a problem only with recent LibreOffices?

Let me upgrade my LibreOffice and report back.












Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-03 Thread Enrico Scholz
Jambunathan K kjambunat...@gmail.com writes:

 If problem persists with new exporter, let me know.  I will be happy to
 share a fix.

yes; reproduced with

Org-mode version 8.2.3c (8.2.3c-17-gc92606-elpa @ 
/home/ensc/.emacs.d/elpa/org-20131202/)



Enrico



Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-03 Thread Christian Moe

Hi,

This problem was also reported by Tyler Smith a couple of weeks back. I
confirmed it and did a little checking. Unfortunately I also sort of
promised a patch, which I never got around to. 

Instead, let me report what I've found about the syntax:

It seems LibreOffice 4.1 now requires that draw:frame elements wrapping
images be uniquely named with the draw:name attribute if there's more
than one of them.

Multiple uncaptioned images fail because Org currently wraps them in
frames without these attributes.

e.g. a simple document containing

  [[file:test1.jpg]]

  [[file:test2.jpg]]

results in unnamed image frames, e.g. for the first image of the
example:

  draw:frame draw:style-name=OrgDisplayImage 
  svg:width=12.70cm svg:height=12.70cm text:anchor-type=paragraph

  draw:image xlink:href=Images/0001.jpg xlink:type=simple
  xlink:show=embed xlink:actuate=onLoad/ 

  /draw:frame

This now results in a read error in LibreOffice 4.1. LibreOffice uses
draw:name=graphics1, graphics2 etc. for the draw:frame element when
a picture is inserted, but I think any unique value will do.

The problem does not occur if you add captions to the images. Then the
draw:frame gets a draw:name attribute containing the caption text.

e.g. 

  #+caption: A picture
  [[file:test1.jpg]]

  #+caption: Another picture
  [[file:test2.jpg]]

exports without a problem, because it results in draw:frame elements
like (for the first picture of the example):

  draw:frame draw:style-name=OrgCaptionedImage (...)
  draw:name=A picture text:anchor-type=paragraph
  ^
  
However, this only works as long as each caption is unique. If you have
more than one image with identical #+captions, even if they have different
#+names, you get the read error. 

So we may need a fix for the corner case of identical captions as well.

I haven't checked what other elements may be affected by similar new
requirements besides images.

Yours,
Christian






Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-03 Thread Enrico Scholz
Christian Moe m...@christianmoe.com writes:

 It seems LibreOffice 4.1 now requires that draw:frame elements wrapping
 images be uniquely named with the draw:name attribute if there's more
 than one of them.
 ...
 So we may need a fix for the corner case of identical captions as
 well.

Why do we need meaningful 'draw:name' values at all?  And why use the
caption for it?  Just adding 'draw:name=Image%u' and incrementing the
index after each use seems to be enough.

Alternatively, '#+NAME:' seems to be a much better choice than
#+CAPTION.


Enrico



Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-03 Thread Christian Moe

Enrico Scholz writes:

 It seems LibreOffice 4.1 now requires that draw:frame elements wrapping
 images be uniquely named with the draw:name attribute if there's more
 than one of them.
 ...
 So we may need a fix for the corner case of identical captions as
 well.

 Why do we need meaningful 'draw:name' values at all?  And why use the
 caption for it?  Just adding 'draw:name=Image%u' and incrementing the
 index after each use seems to be enough.

Indeed, that sounds like a simple all-round fix, and better than one
solution for uncaptioned images and a fragile one for captioned
ones. Did a quick test replacing the draw:name attributes for captioned
images with such generic names, and it didn't seem to cause any
problems.

 Alternatively, '#+NAME:' seems to be a much better choice than
 #+CAPTION.

But not a good one, since users do not necessarily name images.

Yours,
Christian






Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-02 Thread Jambunathan K

 7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

The exporter(s) are re-written.  You should be using Org-8.*.

Use Elpa

   M-x list-packages

and install the org package.

or install from tar file or git.


orgmode.org/worg has instructions on how to use the new exporters.

If problem persists with new exporter, let me know.  I will be happy to
share a fix.

Enrico Scholz enrico.sch...@sigma-chemnitz.de writes:

 Hi,

 org-mode generates ODT files which can not be opened by libreoffice-4.1.3.2
 when more than one image is included. E.g. running (org-export-as-odt) on

  test.org ---
 * Test

 [[file:s01.png]]

 [[file:s01.png]]
 -

 and trying to open it with 'oowrite test.odt' gives a Read-Error/Error
 reading file message.  ODT created after removing one of the images is
 ok.

 It seems that libreoffice requires an unique 'draw:name' attribute for
 'draw:frame' tags.  This can be set by '#+CAPTION' (and the resulting
 ODT is working) but this option is not suitable for inline images.



 Enrico


 Emacs  : GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.19)
  of 2013-08-19 on koji-builder0.intern.sigma-chemnitz.de
 Package: Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @
 /usr/share/emacs/24.3/lisp/org/)




Re: [O] Bug: Bad ODT files when including multiple images [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2013-12-02 Thread Enrico Scholz
Jambunathan K kjambunat...@gmail.com writes:

M-x list-packages

 and install the org package.

this seems to be completely broken: export by C-c C-e o o fails with

| OpenDocument export failed: Invalid function: org-with-silent-modifications


 If problem persists with new exporter, let me know.  I will be happy to
 share a fix.

From reading ox-odt.el, it is very likely that it still exists.  There
is no place except with short-caption where 'draw:name' will be set.



Enrico