emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* weird ox-odt, links and images
@ 2015-02-25 15:54 Rasmus
  2015-02-25 23:42 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Rasmus @ 2015-02-25 15:54 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

For a document which I have to export as odt, I have a sublet issue.  In a
document I have something like this

*  head
  para [[cite:@smith88]] para

#+NAME: name
#+CAPTION: cap
[[file:img/g_one_ahead.png]]

Where cite takes a bibtex key and format in a sensible way as plaintext
using reftex.

I get the following error

    formatting cite for @smith88
    Embedding /tmp/odt/img/g_one_ahead.png as Images/0001.png...
    OpenDocument export failed: Don't know how to format label for link: (link (:type "file" :path "img/g_one_ahead.png" :raw-link "file:img/g_one_ahead.png" :application nil :search-option nil :begin 75 :end 103 :contents-begin nil :contents-end nil :post-blank 0 :parent (paragraph (:begin 41 :end 104 :contents-begin 75 :contents-end 104 :post-blank 0 :post-affiliated 75 :name "forecast1" :caption (((#("test" 0 4 (:parent #6))))) :parent (section (:begin 10 :end 104 :contents-begin 10 :contents-end 104 :post-blank 0 :post-affiliated 10 :parent (headline (:raw-value "title" :begin 1 :end 104 :pre-blank 0 :contents-begin 10 :contents-end 104 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#("title" 0 5 (:parent #6))) :parent (org-data nil #6)) #4)) (paragraph (:begin 10 :end 41 :contents-begin 10 :contents-end 40 :post-blank 1 :post-affiliated 10 :parent #4) #("para " 0 5 (:parent #5)) (link (:type "cite" :path "@smith88" :raw-link "cite:@smith88" :application nil :search-option nil :begin 17 :end 35 :contents-begin nil :contents-end nil :post-blank 1 :parent #5)) #("para
    " 0 5 (:parent #5))) #2)) #0 #("
    " 0 1 (:parent #2)))))


Edebugging org-odt-format-label, when I include the cite-link,
(org-odt--enumerable-image-p element info) returns nil rather than t, as
it's supposed to...

—Rasmus

-- 
What will be next?

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

* Re: weird ox-odt, links and images
  2015-02-25 15:54 weird ox-odt, links and images Rasmus
@ 2015-02-25 23:42 ` Nicolas Goaziou
  2015-02-26  1:01   ` Rasmus
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2015-02-25 23:42 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> For a document which I have to export as odt, I have a sublet issue.  In a
> document I have something like this
>
> *  head
>   para [[cite:@smith88]] para
>
> #+NAME: name
> #+CAPTION: cap
> [[file:img/g_one_ahead.png]]
>
> Where cite takes a bibtex key and format in a sensible way as plaintext
> using reftex.
>
> I get the following error
>
>     formatting cite for @smith88
>     Embedding /tmp/odt/img/g_one_ahead.png as Images/0001.png...
>     OpenDocument export failed: Don't know how to format label for
> link: (link (:type "file" :path "img/g_one_ahead.png" :raw-link
> "file:img/g_one_ahead.png" :application nil :search-option nil :begin

I cannot reproduce the error. However, I don't have your "cite" handler,
if that matters.

Regards,

-- 
Nicolas Goaziou

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

* Re: weird ox-odt, links and images
  2015-02-25 23:42 ` Nicolas Goaziou
@ 2015-02-26  1:01   ` Rasmus
  2015-02-26 14:25     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Rasmus @ 2015-02-26  1:01 UTC (permalink / raw)
  To: emacs-orgmode

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

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> I cannot reproduce the error. However, I don't have your "cite" handler,
> if that matters.

I think it does. . . .  I was hoping that the error output would be
insightful in itself.

I cut down my setup to a small example, but it's still pretty big...  I
works fine with html.  Obviously it works fine with latex as well, but
there I also don't touch formatting myself.

I test from emacs -q with Org
Org-mode version 8.3beta (release_8.3beta-862-gc76f25 @ /usr/share/emacs/site-lisp/org/)

Instructions to ecm.org.

- Install aux. files to /tmp via the first source block.
- Load cite link via the second source block.
- Export.  On my system it exports with either elm 1 or elm 2 turned on,
  but not with both.
  - It works with ox-html.

Thanks,
Rasmus

-- 
May contains speling mistake

[-- Attachment #2: ecm.org --]
[-- Type: application/vnd.lotus-organizer, Size: 3179 bytes --]

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

* Re: weird ox-odt, links and images
  2015-02-26  1:01   ` Rasmus
@ 2015-02-26 14:25     ` Nicolas Goaziou
  2015-02-26 14:33       ` Rasmus
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2015-02-26 14:25 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> I think it does. . . .  I was hoping that the error output would be
> insightful in itself.
>
> I cut down my setup to a small example, but it's still pretty big...  I
> works fine with html.  Obviously it works fine with latex as well, but
> there I also don't touch formatting myself.
>
> I test from emacs -q with Org
> Org-mode version 8.3beta (release_8.3beta-862-gc76f25 @ /usr/share/emacs/site-lisp/org/)
>
> Instructions to ecm.org.
>
> - Install aux. files to /tmp via the first source block.
> - Load cite link via the second source block.
> - Export.  On my system it exports with either elm 1 or elm 2 turned on,
>   but not with both.
>   - It works with ox-html.

This one was fun. 

`org-string-nw-p' uses "\\S-" to check for non-white character in
a string. So it depends on syntax table used in the current buffer.
Usually, "\n" has a whitespace syntax, but not in `bibtex-mode'. Since
your functions set a Bibtex buffer as current buffer, return value from
`org-string-nw-p' is unreliable.

Anyway, it should be fixed. Thank you.


Regards,

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

* Re: weird ox-odt, links and images
  2015-02-26 14:25     ` Nicolas Goaziou
@ 2015-02-26 14:33       ` Rasmus
  0 siblings, 0 replies; 5+ messages in thread
From: Rasmus @ 2015-02-26 14:33 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> This one was fun. 
>
> `org-string-nw-p' uses "\\S-" to check for non-white character in
> a string. So it depends on syntax table used in the current buffer.
> Usually, "\n" has a whitespace syntax, but not in `bibtex-mode'. Since
> your functions set a Bibtex buffer as current buffer, return value from
> `org-string-nw-p' is unreliable.

I have *no idea* how you figure out this stuff...!  Anyway, thanks a
bunch!

Ox-odt is an awesome asset to Org, but it's so hard to debug since it
often doesn't give a proper backtraces...

Now all that remains between me and my final .doc — which will stop my
spam spree of ox-odt bugs (I also have a couple of fixes on my hdd) — is
that preserving data/layout when converting to .doc is *ridiculously*
hard!

—Rasmus

-- 
This message is brought to you by the department of redundant departments

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

end of thread, other threads:[~2015-02-26 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 15:54 weird ox-odt, links and images Rasmus
2015-02-25 23:42 ` Nicolas Goaziou
2015-02-26  1:01   ` Rasmus
2015-02-26 14:25     ` Nicolas Goaziou
2015-02-26 14:33       ` Rasmus

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